}
my @pkgs = $cust_main->_discount_pkgs_and_bill;
my $cust_bill = shift(@pkgs);
- @pkgs = &FS::cust_main::Billing::_discountable_pkgs_at_term($months, @pkgs);
+ @pkgs = &FS::cust_main::Billing_Discount::_discountable_pkgs_at_term($months, @pkgs);
$_->bill($_->last_bill) foreach @pkgs;
$error = $cust_main->bill(
'recurring_only' => 1,
my $error = '';
if ( ( exists($opt->{'manual'}) && $opt->{'manual'} )
- || ! $conf->exists('invoice_html_statement')
+ #|| ! $conf->exists('invoice_html_statement')
|| ! $cust_bill
)
{
my $msgnum = $conf->config('payment_receipt_msgnum', $cust_main->agentnum);
if ( $msgnum ) {
my $msg_template = FS::msg_template->by_key($msgnum);
- $error = $msg_template->send('cust_main'=> $cust_main, 'object'=> $self);
+ $error = $msg_template->send(
+ 'cust_main' => $cust_main,
+ 'object' => $self,
+ 'from_config' => 'payment_receipt_from',
+ );
} elsif ( $conf->exists('payment_receipt_email') ) {
} else {
- warn "payment_receipt is on, but no payment_receipt_msgnum or invoice_html_statement is configured\n";
+ warn "payment_receipt is on, but no payment_receipt_msgnum\n";
}
};
$error = $queue->insert(
- 'invnum' => $cust_bill->invnum,
- 'template' => 'statement',
+ 'invnum' => $cust_bill->invnum,
+ 'template' => 'statement',
+ 'notice_name' => 'Statement',
+ 'no_coupon' => 1,
);
}