X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=62ab87f0fae5f8ab33c53abb9e34fac224b4cb05;hp=6581578f5df11b14cbc9707d3cefb2c7183bba22;hb=0f7643c1af2d909e0c3172e5bec0c01855fca1b9;hpb=3abef78632d45098064258023dc487e8317d8124 diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 6581578f5..62ab87f0f 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -1241,8 +1241,14 @@ sub email { my @invoicing_list = grep { $_ !~ /^(POST|FAX)$/ } $self->cust_main->invoicing_list; - #better to notify this person than silence - @invoicing_list = ($invoice_from) unless @invoicing_list; + if ( ! @invoicing_list ) { #no recipients + if ( $conf->exists('cust_bill-no_recipients-error') ) { + die 'No recipients for customer #'. $self->custnum; + } else { + #default: better to notify this person than silence + @invoicing_list = ($invoice_from); + } + } my $subject = $self->email_subject($template); @@ -1952,7 +1958,8 @@ sub realtime_lec { } sub realtime_bop { - my( $self, $method ) = @_; + my( $self, $method ) = (shift,shift); + my %opt = @_; my $cust_main = $self->cust_main; my $balance = $cust_main->balance; @@ -1981,6 +1988,7 @@ sub realtime_bop { #this didn't do what we want, it just calls apply_payments_and_credits # 'apply' => 1, 'apply_to_invoice' => 1, + %opt, #what we want: #this changes application behavior: auto payments #triggered against a specific invoice are now applied