diff options
author | ivan <ivan> | 2010-11-05 18:16:22 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-11-05 18:16:22 +0000 |
commit | 34ca0c7b49bb6411155a4b8023598d3dd7d11a56 (patch) | |
tree | 280359dc6742ad3ee1a1806e87d228e3f50e3a8a /httemplate/search | |
parent | 042d37f557e3ad0cf2f02753d20e70dfbd1f73a9 (diff) |
fix line item report when linked from CCH tax report... credits may still be off w/pkg locations? RT#10472
Diffstat (limited to 'httemplate/search')
-rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 98a1da9d9..f2a5ccd4f 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -502,26 +502,29 @@ if ( $cgi->param('nottax') ) { } elsif ( $cgi->param('istax') ) { #false laziness w/report_tax.cgi $taxfromwhere - if ( $conf->exists('tax-pkg_address') ) { + if ( scalar( grep( /locationtaxid/, $cgi->param ) ) || + $cgi->param('iscredit') eq 'rate') { + + $join_pkg .= + ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ) '. + ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) '; + + } elsif ( $conf->exists('tax-pkg_address') ) { + $join_pkg .= ' LEFT JOIN cust_bill_pkg_tax_location USING ( billpkgnum ) LEFT JOIN cust_location USING ( locationnum ) '; #quelle kludge, somewhat false laziness w/report_tax.cgi s/cust_pkg\.locationnum/cust_bill_pkg_tax_location.locationnum/g for @where; - } elsif ( scalar( grep( /locationtaxid/, $cgi->param ) ) || - $cgi->param('iscredit') eq 'rate') { - $join_pkg .= - ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ) '. - ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) '; } if ( $cgi->param('iscredit') ) { $join_pkg .= ' JOIN cust_credit_bill_pkg USING ( billpkgnum'; - if ( $conf->exists('tax-pkg_address') ) { + if ( $cgi->param('iscredit') eq 'rate' ) { + $join_pkg .= ', billpkgtaxratelocationnum )'; + } elsif ( $conf->exists('tax-pkg_address') ) { $join_pkg .= ', billpkgtaxlocationnum )'; push @where, "billpkgtaxratelocationnum IS NULL"; - } elsif ( $cgi->param('iscredit') eq 'rate' ) { - $join_pkg .= ', billpkgtaxratelocationnum )'; } else { $join_pkg .= ' )'; push @where, "billpkgtaxratelocationnum IS NULL"; |