RT 82999 - fixed issue where payment receipt only sent when one email present.
authorChristopher Burger <burgerc@freeside.biz>
Tue, 26 Mar 2019 19:08:37 +0000 (15:08 -0400)
committerChristopher Burger <burgerc@freeside.biz>
Tue, 26 Mar 2019 19:08:37 +0000 (15:08 -0400)
FS/FS/cust_pay.pm

index 61e5ea3..3e368f6 100644 (file)
@@ -673,7 +673,7 @@ sub send_receipt {
         'cust_main'      => $cust_main,
         'cust_bill'      => $opt->{cust_bill},
         'cust_pkg'       => $opt->{cust_pkg},
         'cust_main'      => $cust_main,
         'cust_bill'      => $opt->{cust_bill},
         'cust_pkg'       => $opt->{cust_pkg},
-        'invoicing_list' => @invoicing_list,
+        'invoicing_list' => \@invoicing_list,
         'msgnum'         => $conf->config('payment_receipt_msgnum', $cust_main->agentnum)
     );
 
         'msgnum'         => $conf->config('payment_receipt_msgnum', $cust_main->agentnum)
     );
 
@@ -710,9 +710,6 @@ sub send_receipt {
 
       $error = $queue->insert(%opt);
     }
 
       $error = $queue->insert(%opt);
     }
-
-
-
   }
 
   warn "send_receipt: $error\n" if $error;
   }
 
   warn "send_receipt: $error\n" if $error;
@@ -725,7 +722,7 @@ $error = $self->send_message_receipt(
         'cust_main'      => $cust_main,
         'cust_bill'      => $opt->{cust_bill},
         'cust_pkg'       => $opt->{cust_pkg},
         'cust_main'      => $cust_main,
         'cust_bill'      => $opt->{cust_bill},
         'cust_pkg'       => $opt->{cust_pkg},
-        'invoicing_list' => @invoicing_list,
+        'invoicing_list' => \@invoicing_list,
         'msgnum'         => $conf->config('payment_receipt_msgnum', $cust_main->agentnum)
       );
 
         'msgnum'         => $conf->config('payment_receipt_msgnum', $cust_main->agentnum)
       );
 
@@ -736,7 +733,7 @@ sub send_message_receipt {
   my $cust_main      = $opt{'cust_main'};
   my $cust_bill      = $opt{'cust_bill'};
   my $cust_pkg       = $opt{'cust_pkg'};
   my $cust_main      = $opt{'cust_main'};
   my $cust_bill      = $opt{'cust_bill'};
   my $cust_pkg       = $opt{'cust_pkg'};
-  my @invoicing_list = $opt{'invoicing_list'};
+  my @invoicing_list = ref($opt{'invoicing_list'}) ? @{ $opt{'invoicing_list'} } : ( $opt{'invoicing_list'} );
   my $msgnum         = $opt{'msgnum'};
   my $error = '';
 
   my $msgnum         = $opt{'msgnum'};
   my $error = '';