From f042650d973fa1729824ecfec0b71e10c084d646 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Thu, 16 Apr 2020 12:00:49 +0200 Subject: [PATCH] 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 --- bin/mozilla/oe.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 22784d9fa..65277ed4a 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -2171,18 +2171,18 @@ sub edit_periodic_invoices_config { $config = SL::YAML::Load($::form->{periodic_invoices_config}) if $::form->{periodic_invoices_config}; if ('HASH' ne ref $config) { - my $lang_id = $::form->{language_id}; $config = { periodicity => 'm', order_value_periodicity => 'p', # = same as periodicity start_date_as_date => $::form->{transdate} || $::form->current_date, extend_automatically_by => 12, active => 1, - email_subject => GenericTranslations->get(language_id => $lang_id, - translation_type =>"preset_text_periodic_invoices_email_subject"), - email_body => GenericTranslations->get(language_id => $lang_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->{lanuage_id}, + translation_type =>"preset_text_periodic_invoices_email_subject"); + $config->{email_body} ||= GenericTranslations->get(language_id => $::form->{lanuage_id}, + translation_type =>"preset_text_periodic_invoices_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