From: Steven Schubiger Date: Thu, 13 Jan 2022 13:34:44 +0000 (+0100) Subject: Swiss QR-Bill: QrBill.pm: Füge Variante IBAN ohne Referenz hinzu X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~239 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=13aed1fc2af8e71108872823e9a782f0d18e8017;p=kivitendo-erp.git Swiss QR-Bill: QrBill.pm: Füge Variante IBAN ohne Referenz hinzu --- diff --git a/SL/Helper/QrBill.pm b/SL/Helper/QrBill.pm index 3628056bb..7df8ff0bc 100644 --- a/SL/Helper/QrBill.pm +++ b/SL/Helper/QrBill.pm @@ -93,8 +93,12 @@ sub _init_check { $check_re->($invoice_recipient_data, 'address_row2', qr{^.{0,70}$}); $check_re->($invoice_recipient_data, 'countrycode', qr{^[A-Z]{2}$}); + my %ref_nr_regexes = ( + QRR => qr{^\d{27}$}, + NON => qr{^$}, + ); $check_re->($ref_nr_data, 'type', qr{^(?:QRR|SCOR|NON)$}); - $check_re->($ref_nr_data, 'ref_number', qr{^\d{27}$}); + $check_re->($ref_nr_data, 'ref_number', $ref_nr_regexes{$ref_nr_data->{type}}); } sub generate { @@ -311,7 +315,7 @@ Maximum of 4 characters, alphanumerical. QRR/SCOR/NON. =item C -27 characters, numerical. QR-Reference. +QR-Reference: 27 characters, numerical; without Reference: empty. =back