From bcc996e65643a7bd5766e5d633fff572be4a464c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 20 Sep 2018 16:07:05 +0200 Subject: [PATCH] Rechnungsadresse aus den Stammdaten bei periodischen Rechnungen verwenden (Anzeige beim Editieren) --- SL/BackgroundJob/CreatePeriodicInvoices.pm | 4 +++- SL/Controller/Order.pm | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/BackgroundJob/CreatePeriodicInvoices.pm b/SL/BackgroundJob/CreatePeriodicInvoices.pm index 48f41b48c..03cbdf51c 100644 --- a/SL/BackgroundJob/CreatePeriodicInvoices.pm +++ b/SL/BackgroundJob/CreatePeriodicInvoices.pm @@ -376,7 +376,9 @@ sub _email_invoice { 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; diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index b57d772c0..10c7dd484 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -509,6 +509,7 @@ sub action_show_periodic_invoices_config_dialog { 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 }, -- 2.20.1