X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Ftax_rate.pm;h=54b388ce3f3863f24941a5773ac01dc296e78f5d;hb=83053569b3d965924e2e1d4f5b199609ec7c29af;hp=43f8bbbf5ad230d3e94570dd96084a6a0a4d74e8;hpb=d1eb981dfbf03363513be788e9166e50794b6e1e;p=freeside.git diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm index 43f8bbbf5..54b388ce3 100644 --- a/FS/FS/tax_rate.pm +++ b/FS/FS/tax_rate.pm @@ -1894,7 +1894,7 @@ sub generate_liability_report { my $payby_itemdesc_loc = " payby != 'COMP' ". - "AND itemdesc = ? OR ? = '' AND itemdesc IS NULL ". + "AND ( itemdesc = ? OR ? = '' AND itemdesc IS NULL ) ". "AND ". FS::tax_rate_location->location_sql( map { $_ => $t->$_ } @taxparams ); @@ -1904,19 +1904,19 @@ sub generate_liability_report { my $sql = "SELECT SUM(amount) $taxwhere AND cust_bill_pkg.pkgnum = 0"; - my $x = &{$scalar_sql}($t, [ $itemdesc, $itemdesc ], $sql ); + my $x = &{$scalar_sql}($t, [ 'itemdesc', 'itemdesc' ], $sql ); $tax += $x; $taxes{$label}->{'tax'} += $x; my $creditfrom = "JOIN cust_credit_bill_pkg USING (billpkgnum,billpkgtaxratelocationnum)"; my $creditwhere = - "FROM cust_bill_pkg $addl_from $creditfrom $where $payby_itemdesc_loc"; + "FROM cust_bill_pkg $addl_from $creditfrom $where AND $payby_itemdesc_loc"; $sql = "SELECT SUM(cust_credit_bill_pkg.amount) ". " $creditwhere AND cust_bill_pkg.pkgnum = 0"; - my $y = &{$scalar_sql}($t, [ $Itemdesc, $itemdesc ], $sql ); + my $y = &{$scalar_sql}($t, [ 'itemdesc', 'itemdesc' ], $sql ); $credit += $y; $taxes{$label}->{'credit'} += $y;