1 <% include('elements/process.html',
2 'table' => 'cust_main',
3 'error_redirect' => popurl(3). 'edit/cust_main-contacts.html?',
5 'skip_process' => 1, #we don't want to make any changes to cust_main
6 'precheck_callback' => $precheck_callback,
9 'fields' => FS::contact->cgi_contact_fields,
11 'redirect' => popurl(3). 'view/cust_main.cgi?',
15 my $precheck_callback = sub {
17 my $conf = FS::Conf->new;
18 if ( $conf->exists('cust_main-require_invoicing_list_email') ) {
20 foreach my $prefix (grep /^contactnum\d+$/, $cgi->param) {
21 if ( length($cgi->param($prefix . '_emailaddress'))
22 and $cgi->param($prefix . '_invoice_dest') ) {
27 return "At least one contact must receive email invoices"