[freeside-commits] branch master updated. 6f2740efafc72c4a13d0670a76201eaa22784abe

Ivan ivan at 420.am
Tue Jun 12 01:13:18 PDT 2012


The branch, master has been updated
       via  6f2740efafc72c4a13d0670a76201eaa22784abe (commit)
      from  36a0eb23dee284237243225883f9e086376b05e8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6f2740efafc72c4a13d0670a76201eaa22784abe
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Jun 12 01:13:09 2012 -0700

    slightly more efficient cust_bill->previous

diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 7d7d363..a70f975 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -388,8 +388,10 @@ sub previous {
   my $self = shift;
   my $total = 0;
   my @cust_bill = sort { $a->_date <=> $b->_date }
-    grep { $_->owed != 0 && $_->_date < $self->_date }
-      qsearch( 'cust_bill', { 'custnum' => $self->custnum } ) 
+    grep { $_->owed != 0 }
+      qsearch( 'cust_bill', { 'custnum' => $self->custnum,
+                              '_date'   => { op=>'<', value=>$self->_date },
+                            } ) 
   ;
   foreach ( @cust_bill ) { $total += $_->owed; }
   $total, @cust_bill;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_bill.pm |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list