projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36a0eb2
)
slightly more efficient cust_bill->previous
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 12 Jun 2012 08:13:09 +0000
(
01:13
-0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 12 Jun 2012 08:13:09 +0000
(
01:13
-0700)
FS/FS/cust_bill.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
7d7d363
..
a70f975
100644
(file)
--- 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;