projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix cch tax report for more than one cust_bill_pkg_tax_rate_location per line item...
[freeside.git]
/
httemplate
/
search
/
report_newtax.cgi
diff --git
a/httemplate/search/report_newtax.cgi
b/httemplate/search/report_newtax.cgi
index
6a2cbb0
..
7851462
100755
(executable)
--- a/
httemplate/search/report_newtax.cgi
+++ b/
httemplate/search/report_newtax.cgi
@@
-123,7
+123,7
@@
foreach my $t (qsearch({ table => 'cust_bill_pkg',
my $taxwhere = "FROM cust_bill_pkg $addl_from $where AND payby != 'COMP' ".
"AND ". join( ' AND ', map { "( $_ = ? OR ? = '' AND $_ IS NULL)" } @taxparam );
my $taxwhere = "FROM cust_bill_pkg $addl_from $where AND payby != 'COMP' ".
"AND ". join( ' AND ', map { "( $_ = ? OR ? = '' AND $_ IS NULL)" } @taxparam );
- my $sql = "SELECT SUM(
cust_bill_pkg.setup+cust_bill_pkg.recur
) ".
+ my $sql = "SELECT SUM(
COALESCE(amount, cust_bill_pkg.setup+cust_bill_pkg.recur)
) ".
" $taxwhere AND cust_bill_pkg.pkgnum = 0";
my $x = scalar_sql($t, [ map { $_, $_ } @params ], $sql );
" $taxwhere AND cust_bill_pkg.pkgnum = 0";
my $x = scalar_sql($t, [ map { $_, $_ } @params ], $sql );