diff options
| author | ivan <ivan> | 2008-07-08 02:19:57 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2008-07-08 02:19:57 +0000 | 
| commit | 97125ce8d07d65942eb83669832c9b94f1883eb3 (patch) | |
| tree | 5251bd95530a39115957b08a6e424c8f69b86c3c /httemplate | |
| parent | 4a621a8ef69cb404a419bab97bc17f18ca5f959b (diff) | |
fix line-item reports on taxclass-less regions
Diffstat (limited to 'httemplate')
| -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 306bb3340..ce063839f 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -127,8 +127,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; +    }  } | 
