[freeside-commits] freeside/FS/FS cust_bill.pm,1.199,1.200

Ivan,,, ivan at wavetail.420.am
Thu May 29 20:55:51 PDT 2008


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

Modified Files:
	cust_bill.pm 
Log Message:
1.7 sucks.  add a "balance over" option to the 1.7 style agent-specific invoice send event

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.199
retrieving revision 1.200
diff -u -d -r1.199 -r1.200
--- cust_bill.pm	16 May 2008 19:26:37 -0000	1.199
+++ cust_bill.pm	30 May 2008 03:55:49 -0000	1.200
@@ -798,6 +798,9 @@
 
 INVOICE_FROM, if specified, overrides the default email invoice From: address.
 
+AMOUNT, if specified, only sends the invoice if the total amount owed on this
+invoice and all older invoices is greater than the specified amount.
+
 =cut
 
 sub queueable_send {
@@ -828,6 +831,11 @@
       ? shift
       : ( $self->_agent_invoice_from || $conf->config('invoice_from') );
 
+  my $balance_over = ( scalar(@_) && $_[0] !~ /^\s*$/ ) ? shift : 0;
+
+  return ''
+    unless $self->cust_main->total_owed_date($self->_date) > $balance_over;
+
   my @invoicing_list = $self->cust_main->invoicing_list;
 
   $self->email($template, $invoice_from)



More information about the freeside-commits mailing list