summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-08-26 13:27:49 -0700
committerIvan Kohler <ivan@freeside.biz>2012-08-26 13:27:49 -0700
commit1b6a5f4347ffe0213e3642f5fb741b8b32cfa456 (patch)
treeb9dbcd7251887d781fdd158be95c1d03f54300d3
parent583b3d28d3b999aba3c68c3bcdd3aeaaae9e0f9c (diff)
fix listing of previous balances when two customer invoices are generated in the same second, RT#18928
-rw-r--r--FS/FS/cust_bill.pm7
1 files changed, 5 insertions, 2 deletions
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;