From: jeff Date: Tue, 30 Jan 2007 19:40:09 +0000 (+0000) Subject: only add first user to invoicing_list (ticket 1424) X-Git-Tag: TRIXBOX_2_6~709 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=b201bef650fd5818943fcb7ecd123767b1fbcbc3 only add first user to invoicing_list (ticket 1424) --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 3d1289d45..156aed3e5 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -559,6 +559,13 @@ httemplate/docs/config.html }, { + 'key' => 'emailinvoiceautoalways', + 'section' => 'billing', + 'description' => 'Automatically adds new accounts to the email invoice list even when the list contains email addresses', + 'type' => 'checkbox', + }, + + { 'key' => 'exclude_ip_addr', 'section' => '', 'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)', diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index a0ad0de71..e1fe4c6da 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2531,8 +2531,10 @@ sub realtime_bop { $payname = "$payfirst $paylast"; } + # invoicing_list_emailonly instead? push one? which one? my @invoicing_list = grep { $_ ne 'POST' } $self->invoicing_list; - if ( $conf->exists('emailinvoiceauto') + if ( $conf->exists('emailinvoiceautoalways') + || $conf->exists('emailinvoiceauto') && ! @invoicing_list || ( $conf->exists('emailinvoiceonly') && ! @invoicing_list ) ) { push @invoicing_list, $self->all_emails; } @@ -3017,8 +3019,10 @@ sub realtime_refund_bop { $payname = "$payfirst $paylast"; } + # invoicing_list_emailonly instead? push one? which one? my @invoicing_list = grep { $_ ne 'POST' } $self->invoicing_list; - if ( $conf->exists('emailinvoiceauto') + if ( $conf->exists('emailinvoiceautoalways') + || $conf->exists('emailinvoiceauto') && ! @invoicing_list || ( $conf->exists('emailinvoiceonly') && ! @invoicing_list ) ) { push @invoicing_list, $self->all_emails; } diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index ba9577864..402d729d0 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -453,7 +453,10 @@ sub insert { if ( $cust_pkg ) { my $cust_main = $cust_pkg->cust_main; - if ( $conf->exists('emailinvoiceauto') ) { + if ( $conf->exists('emailinvoiceautoalways') + || $conf->exists('emailinvoiceauto') + && $cust_main->invoicing_list_emailonly + ) { my @invoicing_list = $cust_main->invoicing_list; push @invoicing_list, $self->email; $cust_main->invoicing_list(\@invoicing_list);