X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pay_pkg.pm;h=24ca7973ab0c7283bef8e3a138ddae205967051a;hb=01c2f31cf80bc89cc28d0ac7b99e3ab731431ff2;hp=639960f7d7c9a7894c86a47deed31e237514f11c;hpb=1d9f6cca76b3581cbbaf2fab8d906bc578aaea90;p=freeside.git diff --git a/FS/FS/cust_bill_pay_pkg.pm b/FS/FS/cust_bill_pay_pkg.pm index 639960f7d..24ca7973a 100644 --- a/FS/FS/cust_bill_pay_pkg.pm +++ b/FS/FS/cust_bill_pay_pkg.pm @@ -1,14 +1,12 @@ package FS::cust_bill_pay_pkg; +use base qw( FS::cust_main_Mixin FS::Record ); use strict; -use vars qw( @ISA ); use FS::Conf; use FS::Record qw( qsearch qsearchs ); use FS::cust_bill_pay; use FS::cust_bill_pkg; -@ISA = qw(FS::Record); - =head1 NAME FS::cust_bill_pay_pkg - Object methods for cust_bill_pay_pkg records @@ -102,7 +100,11 @@ sub insert { #payment receipt my $conf = new FS::Conf; - my $trigger = $conf->config('payment_receipt-trigger') || 'cust_pay'; + my $trigger = + $conf->config('payment_receipt-trigger', + $self->cust_bill_pay->cust_bill->cust_main->agentnum, + ) + || 'cust_pay'; if ( $trigger eq 'cust_bill_pay_pkg' ) { my $error = $self->send_receipt( 'manual' => $options{'manual'}, @@ -149,6 +151,13 @@ sub check { $self->ut_numbern('billpaypkgnum') || $self->ut_foreign_key('billpaynum', 'cust_bill_pay', 'billpaynum' ) || $self->ut_foreign_key('billpkgnum', 'cust_bill_pkg', 'billpkgnum' ) + || $self->ut_foreign_keyn('pkgnum', 'cust_pkg', 'pkgnum') + || $self->ut_foreign_keyn('billpkgtaxlocationnum', + 'cust_bill_pkg_tax_location', + 'billpkgtaxlocationnum') + || $self->ut_foreign_keyn('billpkgtaxratelocationnum', + 'cust_bill_pkg_tax_rate_location', + 'billpkgtaxratelocationnum') || $self->ut_money('amount') || $self->ut_enum('setuprecur', [ 'setup', 'recur' ] ) || $self->ut_numbern('sdate')