diff options
| author | ivan <ivan> | 2008-07-08 02:19:56 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2008-07-08 02:19:56 +0000 | 
| commit | 64e7037dd42a240f095e76ea7cba007dd1340bc5 (patch) | |
| tree | 3bbaa621252a55eed21e9731afb03d6f86374408 | |
| parent | 36f08ea69b42f3b998a98feb04a5edb1ec81b82b (diff) | |
fix line-item reports on taxclass-less regions
| -rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 11 | 
1 files changed, 10 insertions, 1 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 4ac9d9f3f..74efe4f7e 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -123,8 +123,17 @@ if ( $cgi->param('out') ) {      if $cgi->param('taxclass');    if ( $cgi->param('taxclassNULL') ) { -    my $same_sql = $r->sql_taxclass_sameregion; + +    my %hash = ( 'country' => scalar($cgi->param('country')) ); +    foreach (qw( state county )) { +      $hash{$_} = scalar($cgi->param($_)) if $cgi->param($_); +    } +    my $cust_main_county = qsearchs('cust_main_county', \%hash); +    die "unknown base region for empty taxclass" unless $cust_main_county; + +    my $same_sql = $cust_main_county->sql_taxclass_sameregion;      push @where, $same_sql if $same_sql; +    }  }  | 
