fix tax reports for taxclass+non-taxclass cases, RT#13160
[freeside.git] / httemplate / search / report_tax.cgi
index 93e5b51..0cd652d 100755 (executable)
@@ -366,12 +366,13 @@ foreach my $r ( qsearch({ 'table'     => 'cust_main_county',
 
   } else {
 
-    $regions{$label}->{'url_param'} .= ';taxclassNULL=1'
-      if $cgi->param('show_taxclasses');
-
     my $same_sql = $r->sql_taxclass_sameregion;
     $mywhere .= " AND $same_sql" if $same_sql;
 
+    $regions{$label}->{'url_param'} .= ';taxclassNULL=1'
+      if $cgi->param('show_taxclasses')
+      || $same_sql;
+
   }
 
   my $fromwhere = "$from_join_cust_pkg $mywhere"; # AND payby != 'COMP' ";