X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_tax.cgi;h=1a94163b43270add473070bff132173840239803;hb=aeae062630d148cad199305dd601ce33e37714f1;hp=ed5ebef030442baf31e630bd5afebcc4d8b4cf6c;hpb=332cff350f042ba6f4aa6ca42043d03eb18105fb;p=freeside.git diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi index ed5ebef03..1a94163b4 100755 --- a/httemplate/search/report_tax.cgi +++ b/httemplate/search/report_tax.cgi @@ -285,6 +285,9 @@ foreach my $r ( qsearch({ 'table' => 'cust_main_county', my $label = getlabel($r); $regions{$label}->{'label'} = $label; + + $regions{$label}->{$_} = $r->$_() for (qw( county state country )); #taxname? + $regions{$label}->{'url_param'} = join(';', map "$_=".uri_escape($r->$_()), qw( county state country taxname ) @@ -532,6 +535,9 @@ my @regions = keys %regions; my( $total, $tot_taxable, $tot_owed ) = ( 0, 0, 0 ); my( $exempt_cust, $exempt_pkg, $exempt_monthly ) = ( 0, 0, 0 ); my %taxclasses = (); +my %county = (); +my %state = (); +my %country = (); foreach (@regions) { $total += $regions{$_}->{'total'}; $tot_taxable += $regions{$_}->{'taxable'}; @@ -541,13 +547,32 @@ foreach (@regions) { $exempt_monthly += $regions{$_}->{'exempt_monthly'}; $taxclasses{$regions{$_}->{'taxclass'}} = 1 if $regions{$_}->{'taxclass'}; + $county{$regions{$_}->{'county'}} = 1; + $state{$regions{$_}->{'state'}} = 1; + $country{$regions{$_}->{'country'}} = 1; } my $total_url_param = ''; if ( $group_op ) { + + my @country = keys %country; + warn "WARNING: multiple countries on this grouped report; total links broken" + if scalar(@country) > 1; + my $country = $country[0]; + + my @state = keys %state; + warn "WARNING: multiple countries on this grouped report; total links broken" + if scalar(@state) > 1; + my $state = $state[0]; + $total_url_param = 'report_group='.uri_escape("$group_op $group_value").';'. - join(';', map 'taxclass='.dbh->quote($_), keys %taxclasses ); + join(';', map 'taxclass='.uri_escape($_), keys %taxclasses ).';'. + "country=$country;state=".uri_escape($state).';'. + join(';', map 'county='.uri_escape($_), keys %county ) + ; + + } #ordering