From: Ivan Kohler Date: Sun, 26 Aug 2012 20:27:49 +0000 (-0700) Subject: fix listing of previous balances when two customer invoices are generated in the... X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=1b6a5f4347ffe0213e3642f5fb741b8b32cfa456;p=freeside.git fix listing of previous balances when two customer invoices are generated in the same second, RT#18928 --- diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 96dce2c35..0823d480e 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -388,8 +388,11 @@ 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 }, + 'invnum' => { op=>'<', value=>$self->invnum }, + } ) ; foreach ( @cust_bill ) { $total += $_->owed; } $total, @cust_bill;