fix problems with tax detail searches, #27698
[freeside.git] / httemplate / search / cust_tax_exempt_pkg.cgi
index 7e1a239..267c938 100644 (file)
@@ -1,4 +1,4 @@
-<% include( 'elements/search.html',
+<& elements/search.html,
                  'title'       => 'Tax exemptions',
                  'name'        => 'tax exemptions',
                  'query'       => $query,
@@ -77,8 +77,7 @@
                               '',
                               FS::UI::Web::cust_styles(),
                             ],
-           )
-%>
+&>
 <%once>
 
 my $join_cust = "
@@ -119,6 +118,12 @@ if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
   push @where,  "cust_main.custnum = $1";
 }
 
+if ( $cgi->param('classnum') eq '0' ) {
+  push @where,  "part_pkg.classnum IS NULL";
+} elsif ( $cgi->param('classnum') =~ /^(\d+)$/ ) {
+  push @where,  "part_pkg.classnum = $1";
+}
+
 if ( $cgi->param('out') ) {
   # wtf? how would you ever get exemptions on a non-taxable package location?