Vorbelegte E-Mail-Texte um Vorbelegung periodic invoices ergänzt
authorJan Büren <jan@kivitendo-premium.de>
Thu, 5 Oct 2017 13:09:03 +0000 (15:09 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Thu, 5 Oct 2017 13:09:03 +0000 (15:09 +0200)
bin/mozilla/generictranslations.pl
bin/mozilla/oe.pl
js/edit_periodic_invoices_config.js
locale/de/all
templates/webpages/generictranslations/edit_email_strings.html

index d3341f2..0261ef1 100644 (file)
@@ -10,16 +10,18 @@ use strict;
 # and will be preset in $form email dialog if the form name matches
 
 my %mail_strings = (
-  salutation_male                     => t8('Salutation male'),
-  salutation_female                   => t8('Salutation female'),
-  salutation_general                  => t8('Salutation general'),
-  salutation_punctuation_mark         => t8('Salutation punctuation mark'),
-  preset_text_sales_quotation         => t8('Preset email text for sales quotations'),
-  preset_text_sales_order             => t8('Preset email text for sales orders'),
-  preset_text_sales_delivery_order    => t8('Preset email text for sales delivery orders'),
-  preset_text_invoice                 => t8('Preset email text for sales invoices'),
-  preset_text_request_quotation       => t8('Preset email text for requests (rfq)'),
-  preset_text_purchase_order          => t8('Preset email text for purchase orders'),
+  salutation_male                             => t8('Salutation male'),
+  salutation_female                           => t8('Salutation female'),
+  salutation_general                          => t8('Salutation general'),
+  salutation_punctuation_mark                 => t8('Salutation punctuation mark'),
+  preset_text_sales_quotation                 => t8('Preset email text for sales quotations'),
+  preset_text_sales_order                     => t8('Preset email text for sales orders'),
+  preset_text_sales_delivery_order            => t8('Preset email text for sales delivery orders'),
+  preset_text_invoice                         => t8('Preset email text for sales invoices'),
+  preset_text_request_quotation               => t8('Preset email text for requests (rfq)'),
+  preset_text_purchase_order                  => t8('Preset email text for purchase orders'),
+  preset_text_periodic_invoices_email_body    => t8('Preset email body for periodic invoices'),
+  preset_text_periodic_invoices_email_subject => t8('Preset email subject for periodic invoices'),
 );
 
 sub edit_greetings {
index 3b5bcd0..ce18a32 100644 (file)
@@ -2117,11 +2117,16 @@ sub edit_periodic_invoices_config {
   $config = 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"),
                };
   }
 
index 775f584..263b2fa 100644 (file)
@@ -6,11 +6,13 @@ function edit_periodic_invoices_config() {
   var config    = $('#periodic_invoices_config').val();
   var cus_id    = $('[name=customer_id]').val();
   var transdate = $('#transdate').val();
+  var lang_id   = $('#language_id').val();
 
   var url       = "oe.pl?" +
     "action=edit_periodic_invoices_config&" +
-    "customer_id="              + encodeURIComponent(cus_id) + "&" +
-    "periodic_invoices_config=" + encodeURIComponent(config) + "&" +
+    "customer_id="              + encodeURIComponent(cus_id)  + "&" +
+    "language_id="              + encodeURIComponent(lang_id) + "&" +
+    "periodic_invoices_config=" + encodeURIComponent(config)  + "&" +
     "transdate="                + encodeURIComponent(transdate || '');
 
   // alert(url);
index c9482c2..8471353 100755 (executable)
@@ -2277,7 +2277,9 @@ $self->{texts} = {
   'Prepare bank collection via SEPA XML' => 'Einzug via SEPA XML vorbereiten',
   'Prepare bank transfer via SEPA XML' => 'Überweisung via SEPA XML vorbereiten',
   'Prepayment'                  => 'Vorauszahlung',
+  'Preset email body for periodic invoices' => 'Vorbelegter E-Mail-Text für wiederkehrende Rechnungen',
   'Preset email strings'        => 'Vorbelegte E-Mail-Texte',
+  'Preset email subject for periodic invoices' => 'Vorbelegter E-Mail-Betreff für wiederkehrende Rechnungen',
   'Preset email text for purchase orders' => 'Vorbelegter E-Mail-Text für Einkaufsaufträge',
   'Preset email text for requests (rfq)' => 'Vorbelegter E-Mail-Text für Anfragen',
   'Preset email text for sales delivery orders' => 'Vorbelegter E-Mail-Text für Verkaufs-Lieferscheine',
index c24a8c8..2db858d 100644 (file)
        [%- ELSE %]
        [%- HTML.escape(language.description) %]
        [%- END %]
+       [%- IF mail_string.search('preset_text_periodic_invoices') %]
+        <br />
+        <a href="doc/html/ch03.html#features.periodic-invoices.variables" target="_blank">?</a>
+       [%- END %]
       </td>
       <td>
        [%- IF mail_string.search('preset') %]