summaryrefslogtreecommitdiff
path: root/httemplate/search/cust_tax_exempt_pkg.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-09-26 00:53:05 -0700
committerMark Wells <mark@freeside.biz>2012-09-26 00:53:05 -0700
commit82d8565fbeaebd69177a3a14d833685ecb86a545 (patch)
tree2b5313e05aaa0cdbc1be393f10263010db2d62d8 /httemplate/search/cust_tax_exempt_pkg.cgi
parenteb9148f0ab9aac5e4f89824b7fab6bb9d648e688 (diff)
tax calculation and reporting for new customer locations, #940
Diffstat (limited to 'httemplate/search/cust_tax_exempt_pkg.cgi')
-rw-r--r--httemplate/search/cust_tax_exempt_pkg.cgi8
1 files changed, 7 insertions, 1 deletions
diff --git a/httemplate/search/cust_tax_exempt_pkg.cgi b/httemplate/search/cust_tax_exempt_pkg.cgi
index 3a5155ae8..1b767f846 100644
--- a/httemplate/search/cust_tax_exempt_pkg.cgi
+++ b/httemplate/search/cust_tax_exempt_pkg.cgi
@@ -103,7 +103,7 @@ my $join = "
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('View customer tax exemptions');
-my @where = ();
+my @where = ("exempt_monthly = 'Y'");
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
if ( $beginning || $ending ) {
@@ -121,6 +121,7 @@ if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
}
if ( $cgi->param('out') ) {
+ # wtf? how would you ever get exemptions on a non-taxable package location?
push @where, "
0 = (
@@ -151,6 +152,11 @@ if ( $cgi->param('out') ) {
push @where, 'taxclass = '. dbh->quote( $cgi->param('taxclass') )
if $cgi->param('taxclass');
+} elsif ( $cgi->param('taxnum') ) {
+
+ my $taxnum_in = join(',', grep /^\d+$/, $cgi->param('taxnum') );
+ push @where, "taxnum IN ($taxnum_in)" if $taxnum_in;
+
}
my $where = scalar(@where) ? 'WHERE '.join(' AND ', @where) : '';