X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_credit_bill_pkg.pm;h=080a83aaab94681c5e89fae783a2e220e181b87e;hb=5f7c4a6025b9e3a49bee72dbc06cac37a45e6f10;hp=be9cd70bdb4acc5167e156a1bbcc724f2b5db63f;hpb=32072dbf59a054529f5304574c0f56f9567d14d0;p=freeside.git diff --git a/FS/FS/cust_credit_bill_pkg.pm b/FS/FS/cust_credit_bill_pkg.pm index be9cd70bd..080a83aaa 100644 --- a/FS/FS/cust_credit_bill_pkg.pm +++ b/FS/FS/cust_credit_bill_pkg.pm @@ -112,7 +112,7 @@ sub insert { if ($taxable_per_month >= 0) { #panic if its subzero? my $groupby = join(',', - qw(taxnum year month exempt_monthly exempt_cust + qw(taxnum taxtype year month exempt_monthly exempt_cust exempt_cust_taxname exempt_setup exempt_recur)); my $sum = 'SUM(amount)'; my @exemptions = qsearch( @@ -166,11 +166,16 @@ sub insert { 'amount' => sprintf('%.2f', 0-$amount), }; - my $error = $cust_tax_exempt_pkg->insert; - if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return "error inserting cust_tax_exempt_pkg: $error"; + if ( $cust_tax_exempt_pkg->cust_main_county ) { + + my $error = $cust_tax_exempt_pkg->insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return "error inserting cust_tax_exempt_pkg: $error"; + } + } + } #foreach $exemption }