From 13aed1fc2af8e71108872823e9a782f0d18e8017 Mon Sep 17 00:00:00 2001 From: Steven Schubiger Date: Thu, 13 Jan 2022 14:34:44 +0100 Subject: [PATCH] =?utf8?q?Swiss=20QR-Bill:=20QrBill.pm:=20F=C3=BCge=20Vari?= =?utf8?q?ante=20IBAN=20ohne=20Referenz=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Helper/QrBill.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.20.1