From 66869d3f51d7a9711fd7402a9ad89a21c894f6a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 1 Feb 2022 13:44:04 +0100 Subject: [PATCH] OrderController: Wiederkehrende Rechnungen: vorbelegte E-Mail-Texte setzen falls leer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Vorher wurde nur geprüft, ob die Konfiguration schon gesetzt wurde. Sollte ein Kunde im Nachhinein auf E-Mail-Versand umstelle ist das Verhalten jetzt komfortabler --- SL/Controller/Order.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 5b49c4d15..f24f5cf54 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -566,6 +566,23 @@ sub action_show_periodic_invoices_config_dialog { language_id => $::form->{language_id}, translation_type =>"preset_text_periodic_invoices_email_body"), ); + # for older configs, replace email preset text if not yet set. + $config->email_subject(GenericTranslations->get( + language_id => $::form->{language_id}, + translation_type =>"preset_text_periodic_invoices_email_subject") + ) unless $config->email_subject; + + $config->email_body(GenericTranslations->get( + language_id => $::form->{language_id}, + translation_type => "salutation_general") + . GenericTranslations->get( + language_id => $::form->{language_id}, + translation_type => "salutation_punctuation_mark") . "\n\n" + . GenericTranslations->get( + language_id => $::form->{language_id}, + translation_type =>"preset_text_periodic_invoices_email_body") + ) unless $config->email_body; + $config->periodicity('m') if none { $_ eq $config->periodicity } @SL::DB::PeriodicInvoicesConfig::PERIODICITIES; $config->order_value_periodicity('p') if none { $_ eq $config->order_value_periodicity } ('p', @SL::DB::PeriodicInvoicesConfig::ORDER_VALUE_PERIODICITIES); -- 2.20.1