diff options
author | ivan <ivan> | 2008-11-02 20:28:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-11-02 20:28:09 +0000 |
commit | af0bf34fadc9bb398e54560657dce51987c975a9 (patch) | |
tree | d7a959fc7b19e3898c71171bc3833930a7175ba5 /httemplate | |
parent | 54e6a299668387fd2b0256e8ec0ed10f5caea871 (diff) |
(and REALLY fix the line-item links too, whew) fix overreporting of tax invoiced when using & reporting with taxclasses, RT#4131
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 7 | ||||
-rwxr-xr-x | httemplate/search/report_tax.cgi | 17 |
2 files changed, 15 insertions, 9 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 61d9a7505..1a95d010d 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 21b42e370..0bec85d70 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; |