X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_tax.cgi;h=aec91c415b09db92dabf36a8d018d2d810fc1116;hp=bb376214ff8de5388bfc5afcaf5c03960e6f26ef;hb=29a82b24b37fee37588efb96928574ac1a452d88;hpb=ee3760985fc43588e7eab5033b704cb7528f049d diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi index bb376214f..aec91c415 100755 --- a/httemplate/search/report_tax.cgi +++ b/httemplate/search/report_tax.cgi @@ -64,18 +64,7 @@ foreach my $r ( my @taxparam = my @param = qw( county county state state country ); - my $num_others = - scalar_sql( $r, [qw( country state state county county taxname taxname )], - "SELECT COUNT(*) FROM cust_main_county - WHERE country = ? - AND ( state = ? OR ( state IS NULL AND ? = '' ) ) - AND ( county = ? OR ( county IS NULL AND ? = '' ) ) - AND ( taxname = ? OR ( taxname IS NULL AND ? = '' ) ) " - ); - - die "didn't even find self?" unless $num_others; - - if ( $num_others > 1 ) { + if ( $r->taxclass ) { $fromwhere .= " AND ( taxclass = ? ) "; push @param, 'taxclass'; }