summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2007-01-30 19:40:09 +0000
committerjeff <jeff>2007-01-30 19:40:09 +0000
commitb201bef650fd5818943fcb7ecd123767b1fbcbc3 (patch)
tree2e11dd31ba6aee785325ef01c9a172e1f1fb9c8d /FS
parent5b30406d72c3f723582af30708352f2e671dc07d (diff)
only add first user to invoicing_list (ticket 1424)
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/cust_main.pm8
-rw-r--r--FS/FS/svc_acct.pm5
3 files changed, 17 insertions, 3 deletions
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);