grep { $_ }
map { trim($_) }
(split(m{,}, $data->{config}->email_recipient_address),
- $data->{config}->email_recipient_contact ? ($data->{config}->email_recipient_contact->cp_email) : ());
+ $data->{config}->email_recipient_contact ? ($data->{config}->email_recipient_contact->cp_email) : (),
+ $data->{invoice}->{customer}->invoice_mail ? ($data->{invoice}->{customer}->invoice_mail) : ()
+ );
return unless @recipients;
if ($::form->{customer_id}) {
$::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(where => [ cp_cv_id => $::form->{customer_id} ]);
+ $::form->{email_recipient_invoice_address} = SL::DB::Manager::Customer->find_by(id => $::form->{customer_id})->invoice_mail;
}
$self->render('oe/edit_periodic_invoices_config', { layout => 0 },