QR Code Generation for Invoice

Now in the Saudi Arabia, the electronic billing system will be implemented starting from the date of December 04, 2021. Among the requirements of the General Authority for Zakat and Income Tax is to add a QR code to the invoice that includes the following:

Supplier name
Supplier tax code
Invoice date and time
Total invoice amount inclusive of VAT
VAT amount

The question is, is there a possibility to add a QR code to the invoice in the next updates?

الأن في المملكة العربية السعودية سيتم تطبيق نظام الفوترة الإلكترونية بداية من تاريخ 04 ديسمبر 2021 ومن متطلبات الهيئة العامة للزكاة والدخل إضافة رمز الاستجابة السريع إلى الفاتورة يتضمن ما يلي :

إسم المورد
الرمز الضريبي للمورد
تاريخ ووقت الفاتورة
إجمالي مبلغ الفاتورة شامل ضريبة القيمة المضافة
مبلغ ضريبة القيمة المضافة

والسؤال هل هناك إمكانية لإضافة رمز الإستجابة السريعة إلى الفاتورة في التحديثات القادمة ؟

5 Likes

@lubos

This is already achievable.

Example

I wouldn’t vote against getting a native QR generator or a QR custom field type but it has to be dynamic since every country, or even possibly every business, is going to use different texts, links or even standards.

So, more likely than not, the QR Code text string will have to be entered or coded by the user in any case.

1 Like

Automation of this process was discussed here "Report tranformation" which writes to data entry screen - #2 by lubos and linked threads

Dear Mr.Aboselim

Did you fiend a solution for this case ?

Dear friends
I found a temprary solution for QR and work fine with me and here the code that you should add to your theme to have the QR code on your invoices
you should do the following to get it work:
1- go to the Sitting> Themes
2- choose the theme you want to add the QR code to it. and click View
3- then click Copy To New Theme
4- now add the following code to your theme at your prreferd place (I inserted it in the end of the body section):

 <tr>
           {% for total in table.totals %}
             {% if total.label == "VAT 15%" %}
                {% assign t1 = total.text %}
             {% endif %}
             {% if total.label == "الإجمالي" or total.label == "Total"  %}
                {% assign t2 = total.text %}
             {% endif %}
           {% endfor %}
           {% for field in fields %}
                 {% if   field.label == "تاريخ الفاتورة" or field.label == "Invoice date"  %}
                    {% assign d1= field.text %}
                 {%endif%}
                 {% if   field.label == "رقم الفاتورة"  or field.label == "Invoice number" %}
                    {% assign d3= field.text %}
                 {%endif%}
             {% endfor %}
             {%capture inv_vat %}
                 Supplier-Name:{{ business.name }};
                 VAT-ID://123456789// ;
                 Inv-No:{{d3}}; 
                 Inv-Date:{{d1}};
                 Inv-Time:{{"Today"|date: "%H:%m:%s"}};
                 VAT-Amount:{{t1}};
                 Inv-Amount:{{t2}};
            {%endcapture%}
             <td colspan="99" style="padding-top: 30px">
             <img src="https://api.qrserver.com/v1/create-qr-code/?size=140x140&data= {{inv_vat|newline_to_br}}"  style=" border: 2px solid #e4ba4e ;" >
            
             </td>
          
           </tr>

5- you have to change the //Insert Your VAT ID Here// with your VAT Number.
6- One note here since the Date in the program does not give the time with date I added the Time from Liquid code so every time you will click View for the invoice it will update but with the Email link and Pdf the time will captured at the moment you generate them.
7- Now change the name of the Theme to whatever you want and click Create
8- When you create the Invoice in the Edit Screen choose Custom Theme and choose the created theme above.
9- Create the Invoice and the invoice should be as in the Photo


and the result when you scan the QR code as in the photo
I hope this would help you till the developer solves it and add it to the program

3 Likes

Hi Nabil
Could you give me an idea about this code what’s meaning (https://api.qrserver.com/v1/create-qr-code)

Regards,

1 Like

Dear banderyk this is Api server create for you the QR code And return it as image And Thanks for Ealfardan how intrduces it in the same post
And Here the link to there site And how it work
https://goqr.me/api/
They explain how to use it
I hope it is clear now
Thanks again

3 Likes

Thanks Nabil

One more think after apply your code and when scan the QR code it give me like


Although i changed the name.

Do you have any idea ?

What you are using to scan the QR code
Use any QR code scanning app it will return it as text
One more thing is change th //123456789// With your Vat Id provided by Zakat

What Do you mean by ’ I changed the name’?

I’m using mobile phone Camera and also Qr code App.

I add it Zakat No

My issue is with:-

Supplier-Name:;

It’s not change and i think because it’s more than 32 words

Sorry for that.

Could you check my code is it correct ?

{% for total in table.totals %} {% if total.label == "VAT 15%" %} {% assign t1 = total.text %} {% endif %} {% if total.label == "الإجمالي" or total.label == "Total" %} {% assign t2 = total.text %} {% endif %} {% endfor %} {% for field in fields %} {% if field.label == "تاريخ الفاتورة" or field.label == "Invoice date" %} {% assign d1= field.text %} {%endif%} {% if field.label == "رقم الفاتورة" or field.label == "Invoice number" %} {% assign d3= field.text %} {%endif%} {% endfor %} {%capture inv_vat %} Supplier-Name:{{م،خمسةوثلاثين للدعايةوالاعلان}}; VAT-ID://123456789// ; Inv-No:{{d3}}; Inv-Date:{{d1}}; Inv-Time:{{"Today"|date: "%H:%m:%s"}}; VAT-Amount:{{t1}}; Inv-Amount:{{t2}}; {%endcapture%} ![](upload://gbpGGyqtjWWZZnNxojrVujl2NVh.png)
         </td>
      
       </tr>

Did you insert your company name under sitting > Business Details

Or did you changed any thing in the code
Supplier-Name : {{bussiness. name}}

The code get the name from the porgram
And is your company name too long 32 word?

You changed this just return it to
Supplier-Name : {{bussiness. name}}

And put your company name in sitting>>Business Details

:+1: Thanks Bro

I add more than 32 words and working well


Supplier-Name:35studio | مؤسسة خمسة وثلاثين للدعاية والاعلان;
VAT-ID://123456789// ;
Inv-No:5;
Inv-Date:2021-02-10;
Inv-Time:2:59:51;
VAT-Amount:;
Inv-Amount:‎3,750.00;

Dear Nabil

How can i contact you ?

Thats great
One more thing
What is your vat subtotal
Did you use the localizaion from Manager or you created it to have vat -amount appears you should put the correct label in the following phrase

Replace the “VAT 15%” with the subtotal label in your invoice

At this time i didn’t register in VAT and i didn’t ad VAT record in manger till now

I will see the code how is working

Thanks

You are welcom :handshake:

@nabilb, your post was edited to remove your email address. If you want to make personal contact with another forum member, use the personal message feature of the forum.