Swiss QR-Bill: Option Rechnung ohne Betrag
authorCem Aydin <cem.aydin@gmx.ch>
Thu, 3 Feb 2022 20:43:32 +0000 (21:43 +0100)
committerCem Aydin <cem.aydin@gmx.ch>
Thu, 17 Feb 2022 20:55:55 +0000 (21:55 +0100)
- Checkbox bei Rechnung hinzugefügt (eingeblendet wenn Feature aktiv,
sonst hidden)
- Integration in Odt Print Ablauf
- Übersetzung + locales lauf

SL/IS.pm
SL/Template/OpenDocument.pm
locale/de/all
templates/webpages/is/form_footer.html

index 11db135..2ebf9aa 100644 (file)
--- 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
index d8823b4..66d8f83 100644 (file)
@@ -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'},
   );
 
index 42f9db4..7114e97 100755 (executable)
@@ -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',
index 856c7f4..7c749cf 100644 (file)
                  [%- L.checkbox_tag('direct_debit', 'checked', direct_debit) %]
                </td>
              </tr>
+[%- IF INSTANCE_CONF.get_create_qrbill_invoices > 0 %]
+             <tr>
+               <th align="right">[% 'QR bill without amount' | $T8 %]</th>
+               <td>
+                 [%- L.checkbox_tag('qrbill_without_amount', 'checked', qrbill_without_amount) %]
+               </td>
+             </tr>
+[%- END %]
            </table>
          </td>
         </tr>
 <input type="hidden" name="customer_discount" value="[% customer_discount %]">
 <input type="hidden" name="gldate" value="[% gldate %]">
 
+[%- IF INSTANCE_CONF.get_create_qrbill_invoices <= 0 %]
+ <input type="hidden" name="qrbill_without_amount" value="[% qrbill_without_amount %]">
+[%- END %]
+
 <div id="shipto_inputs" class="hidden">
  [%- PROCESS 'common/_ship_to_dialog.html' cvars=shipto_cvars %]
 </div>