diff options
author | jeff <jeff> | 2002-04-05 23:37:13 +0000 |
---|---|---|
committer | jeff <jeff> | 2002-04-05 23:37:13 +0000 |
commit | ee037398ef051cca986f799c52e52c0114f897c9 (patch) | |
tree | e910e516605977168154552be6391636616e1700 | |
parent | 0bd54ce52909122fa729e12709f6f155dd39c09c (diff) |
credit/refund display correction
-rwxr-xr-x | httemplate/view/cust_main.cgi | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 1a04ff61c..d960468a0 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -489,7 +489,28 @@ foreach my $bill (@bills) { } } -my @credits = grep { $_->credited > 0 } +my @credits = grep { scalar(my @array = $_->cust_credit_refund) } + qsearch('cust_credit',{'custnum'=>$custnum}); +foreach my $credit (@credits) { + my($cref)=$credit->hashref; + my(@cust_credit_refund)= + qsearch('cust_credit_refund', { 'crednum'=> $cref->{crednum} } ); + foreach my $cust_credit_refund (@cust_credit_refund) { + my $cust_refund = $cust_credit_refund->cust_credit; + my($date, $crednum, $amount, $reason, $app_date ) = ( + $credit->_date, + $credit->crednum, + $cust_credit_refund->amount, + $credit->reason, + time2str("%D", $cust_credit_refund->_date), + ); + push @history, + "$date\tCredit #$crednum: $reason<BR>". + "(applied to refund on $app_date)\t\t\t$amount\t"; + } +} + +@credits = grep { $_->credited > 0 } qsearch('cust_credit',{'custnum'=>$custnum}); foreach my $credit (@credits) { my($cref)=$credit->hashref; |