From ed0754c2f82cab2e24100107b534692d5455b02d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 17 Apr 2020 13:03:52 +0200 Subject: [PATCH] Mahnungskonfiguration Ausdruck der Originalrechnung konfigurierbar --- SL/DN.pm | 13 ++++++++----- bin/mozilla/dn.pl | 1 + templates/webpages/dunning/edit_config.html | 3 +++ templates/webpages/dunning/show_invoices.html | 3 ++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/SL/DN.pm b/SL/DN.pm index dd4d61a00..bc1ff8401 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -111,7 +111,8 @@ sub _save_config { $form->{"template_$i"}, $form->{"fee_$i"}, $form->{"interest_rate_$i"}, $form->{"active_$i"} ? 't' : 'f', $form->{"auto_$i"} ? 't' : 'f', $form->{"email_$i"} ? 't' : 'f', $form->{"email_attachment_$i"} ? 't' : 'f', conv_i($form->{"payment_terms_$i"}), conv_i($form->{"terms_$i"}), - $form->{"create_invoices_for_fees_$i"} ? 't' : 'f'); + $form->{"create_invoices_for_fees_$i"} ? 't' : 'f', + $form->{"print_original_invoice_$i"} ? 't' : 'f'); if ($form->{"id_$i"}) { $query = qq|UPDATE dunning_config SET @@ -120,7 +121,8 @@ sub _save_config { template = ?, fee = ?, interest_rate = ?, active = ?, auto = ?, email = ?, email_attachment = ?, payment_terms = ?, terms = ?, - create_invoices_for_fees = ? + create_invoices_for_fees = ?, + print_original_invoice = ? WHERE id = ?|; push(@values, conv_i($form->{"id_$i"})); } else { @@ -128,8 +130,9 @@ sub _save_config { qq|INSERT INTO dunning_config (dunning_level, dunning_description, email_subject, email_body, template, fee, interest_rate, active, auto, email, - email_attachment, payment_terms, terms, create_invoices_for_fees) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|; + email_attachment, payment_terms, terms, create_invoices_for_fees, + print_original_invoice) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|; } do_query($form, $dbh, $query, @values); } @@ -597,7 +600,7 @@ sub get_invoices { nextcfg.dunning_description AS next_dunning_description, nextcfg.id AS next_dunning_config_id, - nextcfg.terms, nextcfg.active, nextcfg.email + nextcfg.terms, nextcfg.active, nextcfg.email, nextcfg.print_original_invoice FROM ar a diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index 5cb23000d..3bc7029f5 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -249,6 +249,7 @@ sub save_dunning { "customer_id" => $form->{"customer_id_$i"}, "language_id" => $form->{"language_id_$i"}, "next_dunning_config_id" => $form->{"next_dunning_config_id_$i"}, + "print_invoice" => $form->{"include_invoice_$i"}, "email" => $form->{"email_$i"}, } ]; if (!$form->{force_lang}) { $form->{language_id} = @{$level}[0]->{language_id}; diff --git a/templates/webpages/dunning/edit_config.html b/templates/webpages/dunning/edit_config.html index 1cef95f7e..19686f03c 100644 --- a/templates/webpages/dunning/edit_config.html +++ b/templates/webpages/dunning/edit_config.html @@ -16,6 +16,7 @@ [% 'eMail Send?' | $T8 %] [% 'Create invoice?' | $T8 %] + [% 'Include original Invoices?' | $T8 %] [% 'Fristsetzung' | $T8 %] [% 'Duedate +Days' | $T8 %] [% 'Fee' | $T8 %] @@ -45,6 +46,7 @@ + @@ -76,6 +78,7 @@ + diff --git a/templates/webpages/dunning/show_invoices.html b/templates/webpages/dunning/show_invoices.html index b4128efb3..75c7703b3 100644 --- a/templates/webpages/dunning/show_invoices.html +++ b/templates/webpages/dunning/show_invoices.html @@ -5,6 +5,7 @@ [% SET all_active = 1 %][% FOREACH row = DUNNINGS %][% IF !row.active %][% SET all_active = 0 %][% LAST %][% END %][% END %] [% SET all_email = 1 %][% FOREACH row = DUNNINGS %][% IF !row.email %][% SET all_email = 0 %][% LAST %][% END %][% END %] +[% SET all_include_invoices = 1 %][% FOREACH row = DUNNINGS %][% IF !row.print_original_invoice %][% SET all_include_invoices = 0 %][% LAST %][% END %][% END %]

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

@@ -67,7 +68,7 @@ - + [% HTML.escape(row.customername) %] [% HTML.escape(row.departmentname) %] [% HTML.escape(row.language) %] -- 2.20.1