fix listing of previous balances when two customer invoices are generated in the...
authorIvan Kohler <ivan@freeside.biz>
Sun, 26 Aug 2012 20:27:14 +0000 (13:27 -0700)
committerIvan Kohler <ivan@freeside.biz>
Sun, 26 Aug 2012 20:27:14 +0000 (13:27 -0700)
FS/FS/cust_bill.pm

index c5b707b..c48c806 100644 (file)
@@ -433,7 +433,8 @@ sub previous {
   my @cust_bill = sort { $a->_date <=> $b->_date }
     grep { $_->owed != 0 }
       qsearch( 'cust_bill', { 'custnum' => $self->custnum,
-                              '_date'   => { op=>'<', value=>$self->_date },
+                              #'_date'   => { op=>'<', value=>$self->_date },
+                              'invnum'   => { op=>'<', value=>$self->invnum },
                             } ) 
   ;
   foreach ( @cust_bill ) { $total += $_->owed; }