3 This form works indirectly with the tables contact_email and
4 contact_phone. The columns are updated against an FS::contact
5 object. The insert/update methods of FS::contact will make the
6 necessary inserts/updates to contact_email and contact_phone.
9 <% include('elements/process.html',
10 'table' => 'cust_main',
11 'error_redirect' => popurl(3). 'edit/cust_main-contacts.html?',
13 'skip_process' => 1, #we don't want to make any changes to cust_main
14 'precheck_callback' => $precheck_callback,
17 'fields' => FS::contact->cgi_contact_fields,
19 'redirect' => popurl(3). 'view/cust_main.cgi?',
23 my $precheck_callback = sub {
25 my $conf = FS::Conf->new;
26 if ( $conf->exists('cust_main-require_invoicing_list_email') ) {
28 foreach my $prefix (grep /^contactnum\d+$/, $cgi->param) {
29 if ( length($cgi->param($prefix . '_emailaddress'))
30 and $cgi->param($prefix . '_invoice_dest') ) {
35 return "At least one contact must receive email invoices"