From: Ivan Kohler Date: Thu, 27 Feb 2014 03:16:16 +0000 (-0800) Subject: fix applying a credit against an invoice which has had its tax config removed, RT... X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=e64b3d81da1d0a7026631e893f708c675a0cfa83;p=freeside.git fix applying a credit against an invoice which has had its tax config removed, RT#23949 --- diff --git a/FS/FS/cust_credit_bill_pkg.pm b/FS/FS/cust_credit_bill_pkg.pm index be9cd70bd..1f741b289 100644 --- a/FS/FS/cust_credit_bill_pkg.pm +++ b/FS/FS/cust_credit_bill_pkg.pm @@ -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 }