From 94976940f8eba1a83eef65bfd4ae09e65eea9030 Mon Sep 17 00:00:00 2001 From: Cem Aydin Date: Thu, 3 Feb 2022 21:43:32 +0100 Subject: [PATCH] Swiss QR-Bill: Option Rechnung ohne Betrag MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Checkbox bei Rechnung hinzugefügt (eingeblendet wenn Feature aktiv, sonst hidden) - Integration in Odt Print Ablauf - Übersetzung + locales lauf --- SL/IS.pm | 6 +++--- SL/Template/OpenDocument.pm | 9 ++++++++- locale/de/all | 1 + templates/webpages/is/form_footer.html | 12 ++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/SL/IS.pm b/SL/IS.pm index 11db135be..2ebf9aa26 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1481,7 +1481,7 @@ SQL cp_id = ?, marge_total = ?, marge_percent = ?, globalproject_id = ?, delivery_customer_id = ?, transaction_description = ?, delivery_vendor_id = ?, - donumber = ?, invnumber_for_credit_note = ?, direct_debit = ?, + donumber = ?, invnumber_for_credit_note = ?, direct_debit = ?, qrbill_without_amount = ?, delivery_term_id = ? WHERE id = ?|; @values = ( $form->{"invnumber"}, $form->{"ordnumber"}, $form->{"quonumber"}, $form->{"cusordnumber"}, @@ -1495,7 +1495,7 @@ SQL conv_i($form->{"cp_id"}), 1 * $form->{marge_total} , 1 * $form->{marge_percent}, conv_i($form->{"globalproject_id"}), conv_i($form->{"delivery_customer_id"}), $form->{transaction_description}, conv_i($form->{"delivery_vendor_id"}), - $form->{"donumber"}, $form->{"invnumber_for_credit_note"}, $form->{direct_debit} ? 't' : 'f', + $form->{"donumber"}, $form->{"invnumber_for_credit_note"}, $form->{direct_debit} ? 't' : 'f', $form->{qrbill_without_amount} ? 't' : 'f', conv_i($form->{delivery_term_id}), conv_i($form->{"id"})); do_query($form, $dbh, $query, @values); @@ -2249,7 +2249,7 @@ sub _retrieve_invoice { a.mtime, a.itime, a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type, a.transaction_description, a.donumber, a.invnumber_for_credit_note, - a.marge_total, a.marge_percent, a.direct_debit, a.delivery_term_id, + a.marge_total, a.marge_percent, a.direct_debit, a.qrbill_without_amount, a.delivery_term_id, dc.dunning_description, e.name AS employee FROM ar a diff --git a/SL/Template/OpenDocument.pm b/SL/Template/OpenDocument.pm index d8823b4ab..66d8f83ac 100644 --- a/SL/Template/OpenDocument.pm +++ b/SL/Template/OpenDocument.pm @@ -653,8 +653,15 @@ sub generate_qr_code { 'countrycode' => $biller_countrycode, ); + my $amount; + if ($form->{'qrbill_without_amount'}) { + $amount = ''; + } else { + $amount = sprintf("%.2f", $form->parse_amount(\%::myconfig, $form->{'total'})); + } + my %payment_information = ( - 'amount' => sprintf("%.2f", $form->parse_amount(\%::myconfig, $form->{'total'})), + 'amount' => $amount, 'currency' => $form->{'currency'}, ); diff --git a/locale/de/all b/locale/de/all index 42f9db400..7114e972e 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2753,6 +2753,7 @@ $self->{texts} = { 'Purpose' => 'Verwendungszweck', 'Purpose (if field names purpose, purpose1, purpose2 ... exist they will all combined into the field "purpose")' => 'Verwendungszweck (wenn die Spalten purpose, purpose1, purpose2 ... existieren werden diese zum Feld "purpose" zusammengefügt)', 'Purpose/Reference' => 'Verwendungszweck und Referenz', + 'QR bill without amount' => 'QR-Rechnung ohne Betrag', 'QR-Code placeholder image: QRCodePlaceholder not found in template.' => 'QR-Code Platzhalter Bild: QRCodePlaceholder nicht gefunden.', 'QR-Image generation failed: ' => 'QR-Code Erzeugung fehlgeschlagen: ', 'QUEUED' => 'In Warteschlange', diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 856c7f488..7c749cf5a 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -40,6 +40,14 @@ [%- L.checkbox_tag('direct_debit', 'checked', direct_debit) %] +[%- IF INSTANCE_CONF.get_create_qrbill_invoices > 0 %] + + [% 'QR bill without amount' | $T8 %] + + [%- L.checkbox_tag('qrbill_without_amount', 'checked', qrbill_without_amount) %] + + +[%- END %] @@ -152,6 +160,10 @@ +[%- IF INSTANCE_CONF.get_create_qrbill_invoices <= 0 %] + +[%- END %] + -- 2.20.1