From 17c2f7bdbd65623ae67d66b770dbf0cc14ad8770 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 2 Jul 2020 13:12:39 +0200 Subject: [PATCH] E-Mail Betreff auch mit Kundenbestellnummer vorbelegen. --- SL/Controller/Order.pm | 2 +- SL/Form.pm | 18 ++++++++++++++++++ js/kivi.SalesPurchase.js | 1 + locale/de/all | 1 + locale/en/all | 1 + 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index bf0915b7e..bef36317e 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -376,11 +376,11 @@ sub action_save_and_show_email_dialog { my $form = Form->new; $form->{$self->nr_key()} = $self->order->number; + $form->{cusordnumber} = $self->order->cusordnumber; $form->{formname} = $self->type; $form->{type} = $self->type; $form->{language} = '_' . $self->order->language->template_code if $self->order->language; $form->{language_id} = $self->order->language->id if $self->order->language; - $form->{cusordnumber} = $self->order->cusordnumber; $form->{format} = 'pdf'; $email_form->{subject} = $form->generate_email_subject(); diff --git a/SL/Form.pm b/SL/Form.pm index f57163178..636eacd98 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1270,6 +1270,20 @@ sub get_formname_translation { return $formname_translations{$formname}; } +sub get_cusordnumber_translation { + $main::lxdebug->enter_sub(); + my ($self, $formname) = @_; + + $formname ||= $self->{formname}; + + $self->{recipient_locale} ||= Locale->lang_to_locale($self->{language}); + local $::locale = Locale->new($self->{recipient_locale}); + + + $main::lxdebug->leave_sub(); + return $main::locale->text('Your Order'); +} + sub get_number_prefix_for_type { $main::lxdebug->enter_sub(); my ($self) = @_; @@ -1345,6 +1359,10 @@ sub generate_email_subject { $subject .= " " . $self->{"${prefix}number"} } + if ($self->{cusordnumber}) { + $subject = $self->get_cusordnumber_translation() . ' ' . $self->{cusordnumber} . ' / ' . $subject; + } + $main::lxdebug->leave_sub(); return $subject; } diff --git a/js/kivi.SalesPurchase.js b/js/kivi.SalesPurchase.js index 3a623ebbd..571d154c7 100644 --- a/js/kivi.SalesPurchase.js +++ b/js/kivi.SalesPurchase.js @@ -280,6 +280,7 @@ namespace('kivi.SalesPurchase', function(ns) { language_id: $('#language_id').val(), media: 'email', ordnumber: $('#ordnumber').val(), + cusordnumber: $('#cusordnumber').val(), rowcount: $('#rowcount').val(), quonumber: $('#quonumber').val(), type: $('#type').val(), diff --git a/locale/de/all b/locale/de/all index 86213cb59..bec30d1db 100755 --- a/locale/de/all +++ b/locale/de/all @@ -4045,6 +4045,7 @@ $self->{texts} = { 'You should create a backup of the database before proceeding because the backup might not be reversible.' => 'Sie sollten eine Sicherungskopie der Datenbank erstellen, bevor Sie fortfahren, da die Aktualisierung unter Umständen nicht umkehrbar ist.', 'You\'re not editing a file.' => 'Sie bearbeiten momentan keine Datei.', 'You\'ve already chosen the following limitations:' => 'Sie haben bereits die folgenden Einschränkungen vorgenommen:', + 'Your Order' => 'Ihre Bestellung', 'Your PostgreSQL installationen does not use Unicode as its encoding. This is not supported anymore.' => 'Ihre PostgreSQL-Installation benutzt ein anderes Encoding als Unicode. Dies wird nicht mehr unterstützt.', 'Your Reference' => 'Ihr Zeichen', 'Your TODO list' => 'Ihre Aufgabenliste', diff --git a/locale/en/all b/locale/en/all index 649901a20..ea121506c 100644 --- a/locale/en/all +++ b/locale/en/all @@ -4044,6 +4044,7 @@ $self->{texts} = { 'You should create a backup of the database before proceeding because the backup might not be reversible.' => '', 'You\'re not editing a file.' => '', 'You\'ve already chosen the following limitations:' => '', + 'Your Order' => '', 'Your PostgreSQL installationen does not use Unicode as its encoding. This is not supported anymore.' => '', 'Your Reference' => '', 'Your TODO list' => '', -- 2.20.1