commit 17c2f7bdbd65623ae67d66b770dbf0cc14ad8770
Author: Bernd Bleßmann <bernd@kivitendo-premium.de>
Date:   Thu Jul 2 13:12:39 2020 +0200

    E-Mail Betreff auch mit Kundenbestellnummer vorbelegen.

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'              => '',
