$swiss_qr not rendering

Hi,

Did Anyone get the Swiss QR feature running?
I’m trying to get the swiss qr payment info rendered on my invoices. I followed the steps here:

However no QR code is rendering in the PDF.

Currently using: v5.5.16-C91 self-hosted on Docker with SnapPDF

IBAN and BESR info are included, and address information is available for both company and client.

Cheers

@filo87

The most command cause for this is an incorrect IBAN or BESR ID, ensure there are no spaces in either of these.

Also, your clients full address is required. If the code generator does not have all fields, it will not render at all.

Hi I have the same problem and as far as I can tell i have all fields filled out. Where is the source code for the swiss_qr implementation, so I could have a look at what I’m missing.

Here the fields I think are important:

but still the qr bill is missing

whups I found my problem, the library as used by invoice ninja only supports QR-IBAN and not the usage with a normal IBAN as described here (IS not ISR): Checklist: switching to the QR-bill for invoice issuers | PostFinance

I’ll probably write a hacky patch to allow normal IBANs without reference, like described here: No reference, normal IBAN · Issue #100 · sprain/php-swiss-qr-bill · GitHub

I’m using the Google QR Code API.

@SwissConsult

I don’t quite understand the issue here, and the fix they used in that thread?

@david
afaik, Swiss banks offer dedicated QR Code IBAN accounts with unique payment reference numbers so that it’s easier to match payments with invoices.
But it’s possible to generate a QR code for each IBAN, then without a unique reference number.

Ok,

So in the code we have this:

    // Add payment reference
    // This is what you will need to identify incoming payments.
    $referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(
        $this->company->present()->besr_id() ?: '',  // You receive this number from your bank (BESR-ID). Unless your bank is PostFinance, in that case use NULL.
        $this->invoice->number// A number to match the payment with your internal data, e.g. an invoice number
    );

    $qrBill->setPaymentReference(
        QrBill\DataGroup\Element\PaymentReference::create(
            QrBill\DataGroup\Element\PaymentReference::TYPE_QR,
            $referenceNumber
        ));

I am assuming in these cases if we do not have a BESR_ID number then, we’ll want to pass in the NON version? If yes, I can add this change in .

Hey @david
According to this document, you can use every IBAN to generate a QR code:

  • you need a dedicated QR-IBAN, if you want to submit a unique reference number
  • no payment reference number is allowed when using any other IBAN
    See chapter 3.2.

As far as I can see you don’t need the BESR number anymore.

@lucaw

In the latest release I have put a fix in for this, so if you don’t have the BESR, it should generate the QR, let us know if this is not functioning as you expect.

Hey @david
Do you mean v5.5.21-W92, or an unpublished release?
At least in v5.5.21-W92 it’s not rendering for me without BESR.

@lucaw

This will be available in 5.5.22

Please note, if the IBAN requires the BESR id and the besr ID is not provided the QR code will fail to generate. However if the IBAN is a regular one that doesn’t require the BESR, the QR code will generate from my tests.

1 Like

Thanks for all the improvements, I got it working. The issue was I just have a normal IBAN. With the new version it renders correctly.

I still spotted a minor issue…

image

in the payable by address line, the [postal code] is repeated twice, instead of listing [postal code] [city]

Thanks for the PR for this filo