projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update upgrade docs for bind exports
[freeside.git]
/
httemplate
/
search
/
cust_pay.cgi
diff --git
a/httemplate/search/cust_pay.cgi
b/httemplate/search/cust_pay.cgi
index
d601617
..
e4dba01
100755
(executable)
--- a/
httemplate/search/cust_pay.cgi
+++ b/
httemplate/search/cust_pay.cgi
@@
-23,8
+23,9
@@
if ( $cgi->param('magic') && $cgi->param('magic') eq '_date' ) {
my $ending = str2time($1) + 86400;
$range .= ( $range ? ' AND ' : ' WHERE ' ). " _date <= $ending ";
}
my $ending = str2time($1) + 86400;
$range .= ( $range ? ' AND ' : ' WHERE ' ). " _date <= $ending ";
}
+ $range =~ s/^\s*WHERE/ AND/ if scalar(keys %search) ;
- @cust_pay = qsearch('cust_pay', \%search, '',
" $range"
);
+ @cust_pay = qsearch('cust_pay', \%search, '',
$range
);
$sortby = \*date_sort;
$sortby = \*date_sort;
@@
-71,6
+72,7
@@
if (0) {
END
my(%saw, $cust_pay);
END
my(%saw, $cust_pay);
+ my $tot_amount = 0;
foreach my $cust_pay (
sort $sortby grep(!$saw{$_->paynum}++, @cust_pay)
) {
foreach my $cust_pay (
sort $sortby grep(!$saw{$_->paynum}++, @cust_pay)
) {
@@
-82,6
+84,7
@@
END
sprintf("%.2f", $cust_pay->paid),
$cust_pay->_date,
);
sprintf("%.2f", $cust_pay->paid),
$cust_pay->_date,
);
+ $tot_amount += $amount;
my $pdate = time2str("%b %d %Y", $date);
my $rowspan = 1;
my $pdate = time2str("%b %d %Y", $date);
my $rowspan = 1;
@@
-126,7
+129,13
@@
END
print "</TR>";
}
print "</TR>";
}
- print <<END;
+
+ $tot_amount = sprintf("%.2f", $tot_amount);
+ print '</TABLE><BR>'. table(). <<END;
+ <TR>
+ <TH>Total Amount</TH>
+ <TD ALIGN="right">\$$tot_amount</TD>
+ </TR>
</TABLE>
</BODY>
</HTML>
</TABLE>
</BODY>
</HTML>