X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_pay_pkg.pm;h=5d154d0b77e049d338742890f75b688afa5fbaa2;hb=69bdaccf38c8f1b7471ff13354ccbcbb6aa20096;hp=48c436483d74d2649edc59bad2aa55b33203e286;hpb=87ddf7284561e5c912aefe2ecc3f348649b78183;p=freeside.git diff --git a/FS/FS/cust_bill_pay_pkg.pm b/FS/FS/cust_bill_pay_pkg.pm index 48c436483..5d154d0b7 100644 --- a/FS/FS/cust_bill_pay_pkg.pm +++ b/FS/FS/cust_bill_pay_pkg.pm @@ -102,7 +102,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 +153,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') @@ -194,7 +205,7 @@ sub send_receipt { my $self = shift; my $opt = ref($_[0]) ? shift : { @_ }; $self->cust_bill_pay->send_receipt( - 'cust_pkg' => $self->cust_bill_pkg->cust_pkg, + 'cust_pkg' => scalar($self->cust_bill_pkg->cust_pkg), %$opt, ); }