summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeff <jeff>2002-04-05 23:37:13 +0000
committerjeff <jeff>2002-04-05 23:37:13 +0000
commitee037398ef051cca986f799c52e52c0114f897c9 (patch)
treee910e516605977168154552be6391636616e1700
parent0bd54ce52909122fa729e12709f6f155dd39c09c (diff)
credit/refund display correction
-rwxr-xr-xhttemplate/view/cust_main.cgi23
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;