How can I add a QR-Code to my invoices?

I would like to add a QR-Code to my invoices. Do we have any wiki entry or other source where I can find an example?
(I’m actually on v3.6.2)

If anyone else is looking for such a possibility, there are many code examples at
http://www.tcpdf.org/examples.php for a QR Code especially at
http://www.tcpdf.org/examples/example_050.pdf (PDF Example Overview)
an
http://www.tcpdf.org/examples/example_050.phps (PHP Code examples)

I solved it with this code in my own
…www\dolibarr\htdocs\core\modules\facture\doc\pdf_MyCompanyName.modules.php

[code]
// new style
$style = array(
‘border’ => false,
‘padding’ => 0,
‘fgcolor’ => array(128,0,0),
‘bgcolor’ => false
);

// QRCODE,H : QR-CODE Best error correction
$pdf->write2DBarcode(‘www.tcpdf.org’, ‘QRCODE,H’, 140, 210, 50, 50, $style, ‘N’);
$pdf->Text(140, 205, ‘QRCODE H - NO PADDING’);[/code]

Hi
Could you please elaborate how to do it?
Thanks

If you are looking for a barcode that follows the ZATCA specifications (for Saudi Arabia for example), with Dolibarr v16, just add the option INVOICE_ADD_ZATCA_QR_CODE into home - setup - other and the QR code should appears in new PDF (when using the template “crabe” or “sponge”).

Also, you can add INVOICE_ADD_SWISS_QR_CODE to add the Swiss QR code.

the 2 options are also available in v16 form menu setup - PDF - Other.

v16 is also able to generate PDF/a instead of PDF 1.7 but inclusion of the xml file is not yet implemented (bu you may find external modules that do this i think, not sure).

3 Likes

Excellent what about the pdf/a to include the xml invoice information ?

Thanks a lot for the barcode feature for Swiss invoices. This is a really useful improvement. Normally though the barcode on Swiss invoices is larger and appears towards the bottom (near where the banking details are given (IBAN, etc.)) and not at the top of invoices.

If you want that your invoice can be payed at every postoffice in Switzerland, you have to follow EXACTLY the standards in the 76-pages guideline given from SIX in the currently valid “Schweizer Implementation Guidelines für Überweisungen SPS 2021 (Version 1.11 vom Februar 2021)”

or in english:

Otherwise, the invoice will not be accepted and declined, frustrating your customers.

Guide as PDF (german):

Guide as PDF (english):

Style Guide (german):

Style Guide (english):

In addition: If you print your invoice on paper, this paper has to be perforated mandatory!

This is all true, and detailed. Thanks for that. My point was more that it would be more natural to find the QR code near where the payment details are given on the invoice, even if the intention is not necessarily to make a payment at a Swiss Post Office.

I know what you mean, but you can’t place it where it would be “more natural”. The QR-Code has to be placed at the exactly specified coordinates at the bottom of the invoice with the precise dimensions: :innocent:

You may find a module a dolistore that generate the part of swiss qr code at bottom of pdf.

vieux peut tu nous assister

Thank you for providing this service
I have a question
Do dolibarr Supports these requirements
-Cryptographic Stamp
-UUID
-Hash

required by the ZATCA Saudi Zakat Authority in the PHASE 2 REQUIREMENTS

No,
only ZATCA phase 1 is supported.

ok thank you for reply