[freeside-commits] freeside/FS/FS cust_bill.pm, 1.304, 1.305 Conf.pm, 1.420, 1.421

Ivan,,, ivan at wavetail.420.am
Wed Jan 19 11:12:27 PST 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv25279

Modified Files:
	cust_bill.pm Conf.pm 
Log Message:
add cust_bill-no_recipients-error config, RT#11276

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.420
retrieving revision 1.421
diff -u -w -d -r1.420 -r1.421
--- Conf.pm	18 Jan 2011 08:42:15 -0000	1.420
+++ Conf.pm	19 Jan 2011 19:12:25 -0000	1.421
@@ -4263,6 +4263,13 @@
     'agentonly'   => 1,
   },
 
+  {
+    'key'         => 'cust_bill-no_recipients-error',
+    'section'     => 'invoicing',
+    'description' => 'For customers with no invoice recipients, throw a job queue error rather than the default behavior of emailing the invoice to the invoice_from address.'.
+    'type'        => 'checkbox',
+  },
+
   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.304
retrieving revision 1.305
diff -u -w -d -r1.304 -r1.305
--- cust_bill.pm	18 Jan 2011 08:42:15 -0000	1.304
+++ cust_bill.pm	19 Jan 2011 19:12:24 -0000	1.305
@@ -1241,8 +1241,14 @@
   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);
 



More information about the freeside-commits mailing list