summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2011-04-15 22:12:57 +0000
committerivan <ivan>2011-04-15 22:12:57 +0000
commitc424ac3ca53d56107b7e713fb024e987e86558e1 (patch)
tree8279ed1e06548886205bf5382c1daf18f715ddf5 /httemplate
parent973a62e72bf2c9f60bb4ca8f7f8f5cbfa328b7db (diff)
link new tax report to cust_credit_bill_pkg for credits, RT#12332
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/search/cust_credit_bill_pkg.html25
1 files changed, 13 insertions, 12 deletions
diff --git a/httemplate/search/cust_credit_bill_pkg.html b/httemplate/search/cust_credit_bill_pkg.html
index c6995470d..19a9869dd 100644
--- a/httemplate/search/cust_credit_bill_pkg.html
+++ b/httemplate/search/cust_credit_bill_pkg.html
@@ -345,16 +345,7 @@ my $join_cust =
my $join_pkg;
-my $join_cust_bill_pkg = 'LEFT JOIN cust_bill_pkg USING ( billpkgnum';
-if ( $cgi->param('iscredit') eq 'rate' ) {
- $join_cust_bill_pkg .= ', billpkgtaxratelocationnum )';
-} elsif ( $conf->exists('tax-pkg_address') ) {
- $join_cust_bill_pkg .= ', billpkgtaxlocationnum )';
- push @where, "billpkgtaxratelocationnum IS NULL";
-} else {
- $join_cust_bill_pkg .= ' )';
- push @where, "billpkgtaxratelocationnum IS NULL";
-}
+my $join_cust_bill_pkg = 'LEFT JOIN cust_bill_pkg USING ( billpkgnum )';
if ( $cgi->param('nottax') ) {
@@ -372,8 +363,18 @@ if ( $cgi->param('nottax') ) {
$cgi->param('iscredit') eq 'rate') {
$join_pkg .=
- ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ) '.
- ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) ';
+ ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ';
+ if ( $cgi->param('iscredit') eq 'rate' ) {
+ $join_pkg .= ', billpkgtaxratelocationnum )';
+ } elsif ( $conf->exists('tax-pkg_address') ) {
+ $join_pkg .= ', billpkgtaxlocationnum )';
+ push @where, "billpkgtaxratelocationnum IS NULL";
+ } else {
+ $join_pkg .= ' )';
+ push @where, "billpkgtaxratelocationnum IS NULL";
+ }
+
+ $join_pkg .= ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) ';
} elsif ( $conf->exists('tax-pkg_address') ) {