From: ivan Date: Sun, 2 Nov 2008 20:27:19 +0000 (+0000) Subject: (and REALLY fix the line-item links too, whew) fix overreporting of tax invoiced... X-Git-Tag: freeside_1_7_4rc1~149 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=0dd14cb683e858f490cbd3379e7cafbd78183b83;p=freeside.git (and REALLY fix the line-item links too, whew) fix overreporting of tax invoiced when using & reporting with taxclasses, RT#4131 --- diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 74efe4f7e..27819b716 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -119,6 +119,13 @@ if ( $cgi->param('out') ) { " ( state = $state OR $state = '' ) ", " country = $country " ; + if ( $cgi->param('taxname') ) { + push @where, 'itemdesc = '. dbh->quote( $cgi->param('taxname') ); + #} elsif ( $cgi->param('taxnameNULL') { + } else { + push @where, "( itemdesc IS NULL OR itemdesc = '' OR itemdesc = 'Tax' )"; + } + push @where, ' taxclass = '. dbh->quote( $cgi->param('taxclass') ) if $cgi->param('taxclass'); diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi index 43dedc834..c3462afbc 100755 --- a/httemplate/search/report_tax.cgi +++ b/httemplate/search/report_tax.cgi @@ -301,7 +301,10 @@ foreach my $r ( qsearch({ 'table' => 'cust_main_county', my $label = getlabel($r); $regions{$label}->{'label'} = $label; - $regions{$label}->{'url_param'} = join(';', map "$_=".$r->$_(), qw( county state country ) ); + $regions{$label}->{'url_param'} = + join(';', map "$_=".uri_escape($r->$_()), + qw( county state country taxname ) + ); my @param = @base_param; my $mywhere = $where; @@ -310,7 +313,7 @@ foreach my $r ( qsearch({ 'table' => 'cust_main_county', $mywhere .= " AND taxclass = ? "; push @param, 'taxclass'; - $regions{$label}->{'url_param'} .= ';taxclass='. $r->taxclass + $regions{$label}->{'url_param'} .= ';taxclass='. uri_escape($r->taxclass) if $cgi->param('show_taxclasses'); } else { @@ -494,13 +497,9 @@ if ( $cgi->param('show_taxclasses') ) { $base_regions{$base_label}->{'label'} = $base_label; $base_regions{$base_label}->{'url_param'} = - join(';', map "$_=".$r->$_(), qw( county state country ) ); #taxname??? - - if ( $r->taxclass ) { - $base_regions{$base_label}->{'url_param'} .= ';taxclass='. $r->taxclass; - } else { - $base_regions{$base_label}->{'url_param'} .= ';taxclassNULL=1' - } + join(';', map "$_=". uri_escape($r->$_()), + qw( county state country taxname ) + ); $base_regions{$base_label}->{'tax'} += $x; $tax += $x;