#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'},
$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')
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,
);
}