package FS::cust_credit_bill_pkg;
+use base qw( FS::cust_main_Mixin FS::Record );
use strict;
-use vars qw( @ISA );
use FS::Record qw( qsearch qsearchs dbh );
-use FS::cust_main_Mixin;
-use FS::cust_credit_bill;
-use FS::cust_bill_pkg;
use FS::cust_bill_pkg_tax_location;
use FS::cust_bill_pkg_tax_rate_location;
use FS::cust_tax_exempt_pkg;
-@ISA = qw( FS::cust_main_Mixin FS::Record );
-
=head1 NAME
FS::cust_credit_bill_pkg - Object methods for cust_credit_bill_pkg records
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(
'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
}
$self->SUPER::check;
}
-sub cust_credit_bill {
- my $self = shift;
- qsearchs('cust_credit_bill', { 'creditbillnum' => $self->creditbillnum } );
-}
-
-sub cust_bill_pkg {
- my $self = shift;
- qsearchs('cust_bill_pkg', { 'billpkgnum' => $self->billpkgnum } );
-}
-
sub cust_bill_pkg_tax_Xlocation {
my $self = shift;
if ($self->billpkgtaxlocationnum) {