projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
428faf8
)
fix cch tax report for more than one cust_bill_pkg_tax_rate_location per line item...
author
ivan
<ivan>
Thu, 10 Feb 2011 01:20:06 +0000
(
01:20
+0000)
committer
ivan
<ivan>
Thu, 10 Feb 2011 01:20:06 +0000
(
01:20
+0000)
FS/FS/tax_rate.pm
patch
|
blob
|
history
httemplate/search/report_newtax.cgi
patch
|
blob
|
history
diff --git
a/FS/FS/tax_rate.pm
b/FS/FS/tax_rate.pm
index
d8ee875
..
334c31e
100644
(file)
--- a/
FS/FS/tax_rate.pm
+++ b/
FS/FS/tax_rate.pm
@@
-1806,6
+1806,7
@@
agentnum, beginning, and ending
=cut
=cut
+#shit, all sorts of false laxiness w/report_newtax.cgi
sub generate_liability_report {
my %args = @_;
sub generate_liability_report {
my %args = @_;
@@
-1897,8
+1898,7
@@
sub generate_liability_report {
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) ".
- " $taxwhere AND cust_bill_pkg.pkgnum = 0";
+ my $sql = "SELECT SUM(amount) $taxwhere AND cust_bill_pkg.pkgnum = 0";
my $x = &{$scalar_sql}($t, [ map { $_, $_ } @params ], $sql );
$tax += $x;
my $x = &{$scalar_sql}($t, [ map { $_, $_ } @params ], $sql );
$tax += $x;
diff --git
a/httemplate/search/report_newtax.cgi
b/httemplate/search/report_newtax.cgi
index
7851462
..
559d89d
100755
(executable)
--- a/
httemplate/search/report_newtax.cgi
+++ b/
httemplate/search/report_newtax.cgi
@@
-123,8
+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(COALESCE(amount, cust_bill_pkg.setup+cust_bill_pkg.recur)) ".
- " $taxwhere AND cust_bill_pkg.pkgnum = 0";
+ my $sql = "SELECT SUM(amount) $taxwhere AND cust_bill_pkg.pkgnum = 0";
my $x = scalar_sql($t, [ map { $_, $_ } @params ], $sql );
$tax += $x;
my $x = scalar_sql($t, [ map { $_, $_ } @params ], $sql );
$tax += $x;