From 71c23cdf2826595579b8e62fc964393875ef070f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 13 Jan 2017 11:09:54 +0100 Subject: [PATCH] =?utf8?q?Mahnungen:=20Funktion=20=C2=BBDiese=20Sprache=20?= =?utf8?q?verwenden=C2=AB=20gefixt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Wenn die Checkbox angehakt ist, so soll die Benutzer*in die Möglichkeit haben, über die Druckoptionen einen Sprache für alle zu erzeugenden Mahnungen auszuwählen. Ist die Checkbox aus, so wird die Sprache des Kunden der jeweiligen Mahnung genommen, und dann muss die Sprachauswahl deaktiviert werden. --- bin/mozilla/dn.pl | 1 + js/kivi.Dunning.js | 18 +++++++++++++ locale/de/all | 1 + templates/webpages/dunning/show_invoices.html | 25 +++++++------------ 4 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 js/kivi.Dunning.js diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index ca08da498..a4d46b5c3 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -153,6 +153,7 @@ sub show_invoices { 'no_html' => 1, 'no_opendocument' => 1,); + $::request->layout->add_javascripts("kivi.Dunning.js"); $form->header(); print $form->parse_html_template("dunning/show_invoices"); diff --git a/js/kivi.Dunning.js b/js/kivi.Dunning.js new file mode 100644 index 000000000..6467ce463 --- /dev/null +++ b/js/kivi.Dunning.js @@ -0,0 +1,18 @@ +namespace('kivi.Dunning', function(ns) { + ns.check_invoice_selection = function() { + if ($('[name^=active_]:checked').length > 0) + return true; + + alert(kivi.t8('No invoices have been selected.')); + return false; + }; + + ns.enable_disable_language_id = function() { + $('select[name="language_id"]').prop('disabled', !$('#force_lang').prop('checked')); + }; + + $(function() { + $('#force_lang').click(kivi.Dunning.enable_disable_language_id); + kivi.Dunning.enable_disable_language_id(); + }); +}); diff --git a/locale/de/all b/locale/de/all index 1f0243606..820ed2d66 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1998,6 +1998,7 @@ $self->{texts} = { 'Out of balance transaction!' => 'Buchung ist nicht ausgeglichen!', 'Out of balance!' => 'Summen stimmen nicht überein!', 'Output Number Format' => 'Zahlenformat (Ausgabe)', + 'Overdue invoices' => 'Überfällige Rechnungen', 'Overdue sales quotations and requests for quotations' => 'Überfällige Angebote und Preisanfragen', 'Override' => 'Override', 'Override invoice language' => 'Diese Sprache verwenden', diff --git a/templates/webpages/dunning/show_invoices.html b/templates/webpages/dunning/show_invoices.html index 15acab346..f0932ca5f 100644 --- a/templates/webpages/dunning/show_invoices.html +++ b/templates/webpages/dunning/show_invoices.html @@ -8,9 +8,16 @@ -

[% 'The columns "Dunning Duedate", "Total Fees" and "Interest" show data for the previous dunning created for this invoice.' | $T8 %]

+
- +

[% LxERP.t8("Print options") %]

+ + [% L.checkbox_tag("force_lang", label=LxERP.t8('Override invoice language'), checked=force_lang) %] + [% PRINT_OPTIONS %] + +

[% LxERP.t8("Overdue invoices") %]

+ +

[% 'The columns "Dunning Duedate", "Total Fees" and "Interest" show data for the previous dunning created for this invoice.' | $T8 %]

@@ -80,14 +87,6 @@ [% END %]
[% 'Current / Next Level' | $T8 %]
-
- - - [% 'Override invoice language' | $T8 %] - [% PRINT_OPTIONS %] - -
- @@ -100,9 +99,3 @@ [% UNLESS DEBUG_DUNNING %]onclick="this.disabled=true; this.value='[% 'The dunning process started' | $T8 %]'; document.Form.submit()"[% END %]>
- -- 2.20.1