diff options
| author | jeff <jeff> | 2009-05-13 22:27:42 +0000 |
|---|---|---|
| committer | jeff <jeff> | 2009-05-13 22:27:42 +0000 |
| commit | 794a4505360fec404e2b9d5c6daf79f750186bfe (patch) | |
| tree | c5cc70b4ab4077241ef6827f92c57e31248b9aa3 /httemplate/search/cust_bill_pkg.cgi | |
| parent | 1b357798e052668efe0be9000a79e921e30141d2 (diff) | |
improved taxproduct tax report RT#4783
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
| -rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 89901ac40..9d4843281 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -189,6 +189,26 @@ if ( $cgi->param('out') ) { } + } elsif ( scalar( grep( /locationtaxid/, $cgi->param ) ) ) { + + # this should really be shoved out to FS::cust_pkg->location_sql or something + # along with the code in report_newtax.cgi + + my %pn = ( + 'county' => 'tax_rate_location.county', + 'state' => 'tax_rate_location.state', + 'city' => 'tax_rate_location.city', + 'locationtaxid' => 'cust_bill_pkg_tax_rate_location.locationtaxid', + ); + + my %ph = map { ( $pn{$_} => dbh->quote( $cgi->param($_) || '' ) ) } + qw( county state city locationtaxid ); + + push @where, + join( ' AND ', map { "( $_ = $ph{$_} OR $ph{$_} = '' AND $_ IS NULL)" } + keys %ph + ); + } if ($cgi->param('itemdesc')) { @@ -295,6 +315,10 @@ if ( $cgi->param('nottax') ) { #quelle kludge, false laziness w/report_tax.cgi $where =~ s/cust_pkg\.locationnum/cust_bill_pkg_tax_location.locationnum/g; + } elsif ( scalar( grep( /locationtaxid/, $cgi->param ) ) ) { + $join_pkg .= + ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ) '. + ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) '; } } else { |
