- my $msgnum = $conf->config('payment_receipt_msgnum', $cust_main->agentnum);
- if ( $msgnum ) {
-
- my %substitutions = ();
- $substitutions{invnum} = $opt->{cust_bill}->invnum if $opt->{cust_bill};
-
- my $msg_template = qsearchs('msg_template',{ msgnum => $msgnum});
- unless ($msg_template) {
- warn "send_receipt could not load msg_template";
- return;
- }
-
- my $cust_msg = $msg_template->prepare(
- 'cust_main' => $cust_main,
- 'object' => $self,
- 'from_config' => 'payment_receipt_from',
- 'substitutions' => \%substitutions,
- 'msgtype' => 'receipt',
+ $error = $self->send_message_receipt(
+ 'cust_main' => $cust_main,
+ 'cust_bill' => $opt->{cust_bill},
+ 'msgnum' => $conf->config('payment_receipt_msgnum', $cust_main->agentnum)