Remove all non numeric character form invoice ref and set reference to 0 for PROV invoice

This commit is contained in:
Benoit Vianin 2023-03-12 10:51:48 +01:00
parent 8918230c1a
commit 298de15213
1 changed files with 3 additions and 5 deletions

View File

@ -928,15 +928,13 @@ class pdf_swissqr extends ModelePDFFactures
$ref = $object->ref; $ref = $object->ref;
if (str_contains($ref, 'FA')) if (str_contains($ref, 'PROV'))
{ {
// Remove FA and - from the invoice reference
$ref = str_replace('FA', '', $ref);
$ref = str_replace('-', '', $ref);
} else {
$ref = 0; $ref = 0;
} }
$ref = preg_replace('/[^0-9]/', '', $ref);
// Add payment reference for QR-IBAN // Add payment reference for QR-IBAN
// This is what you will need to identify incoming payments. // This is what you will need to identify incoming payments.
$referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate( $referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(