Fix UI issues in accountcode billing implementation, RT12181
[freeside.git] / FS / FS / cust_pay.pm
index 71bc707..c80729a 100644 (file)
@@ -544,14 +544,18 @@ sub send_receipt {
   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') ) {
 
@@ -599,7 +603,7 @@ sub send_receipt {
 
     } 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";
 
     }
 
@@ -611,8 +615,10 @@ sub send_receipt {
     };
 
     $error = $queue->insert(
-      'invnum'   => $cust_bill->invnum,
-      'template' => 'statement',
+      'invnum'      => $cust_bill->invnum,
+      'template'    => 'statement',
+      'notice_name' => 'Statement',
+      'no_coupon'   => 1,
     );
 
   }