X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_credit_bill_pkg.pm;h=a54471db3609fe5fb3cf5e7513130638d9017c5a;hb=f479f1a024a2749279c82a4e2a54e5ca00755e7b;hp=657a88904a2dfb55c25e16a8c05b8e4e5861b514;hpb=34c3b60c76f0ade9d4f7507732666ac8b9f81b67;p=freeside.git diff --git a/FS/FS/cust_credit_bill_pkg.pm b/FS/FS/cust_credit_bill_pkg.pm index 657a88904..a54471db3 100644 --- a/FS/FS/cust_credit_bill_pkg.pm +++ b/FS/FS/cust_credit_bill_pkg.pm @@ -42,7 +42,7 @@ The following fields are currently supported: =item creditbillpkgnum - primary key -=item creditbillnum - Credit application to the overall invoice (see L) +=item creditbillnum - Credit application to the overall invoice (see L) =item billpkgnum - Line item to which credit is applied (see L) @@ -117,7 +117,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( @@ -171,11 +171,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 }