summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2003-07-16 16:01:33 +0000
committerivan <ivan>2003-07-16 16:01:33 +0000
commitbbf1007026670f3f83813b1a349488a773ea41a0 (patch)
treebc5e65aa517adb5ece918310a6718bf7401f4c01
parentbc78fff57f36e24b87df3202e9529c498e4a0389 (diff)
show totals in payment report
-rwxr-xr-xhttemplate/search/cust_pay.cgi8
1 files changed, 7 insertions, 1 deletions
diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi
index 7a983703f..0f7b7b791 100755
--- a/httemplate/search/cust_pay.cgi
+++ b/httemplate/search/cust_pay.cgi
@@ -72,6 +72,7 @@ if (0) {
END
my(%saw, $cust_pay);
+ my $tot_amount = 0;
foreach my $cust_pay (
sort $sortby grep(!$saw{$_->paynum}++, @cust_pay)
) {
@@ -83,6 +84,7 @@ END
sprintf("%.2f", $cust_pay->paid),
$cust_pay->_date,
);
+ $tot_amount += $amount;
my $pdate = time2str("%b&nbsp;%d&nbsp;%Y", $date);
my $rowspan = 1;
@@ -127,7 +129,11 @@ END
print "</TR>";
}
- print <<END;
+
+ $tot_amount = sprintf("%.2f", $tot_amount);
+ print '</TABLE><BR>'. table(). <<END;
+ <TR><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD><TH>Total<BR>Amount</TH></TR>
+ <TR><TD><TD ALIGN="right">\$$tot_amount</TD></TR>
</TABLE>
</BODY>
</HTML>