Forum

Ask, reply and learn. Join the community of Akaunting.

New Discussion

ZATCA QR Code

Abdul Rahman   ( User )

Commented 8 months ago

Hi,
I enjoy using Akaunting and I can't thank you enough for it.

Regarding the new law starting from today in Saudi Arabia, the invoice should include a QR code for fast reading, the ZATCA authority of the govt. published the guide line for it here:
https://zatca.gov.sa/en/E-Invoicing/Documents/Einvoicing_FAQ_EN.pdf

I have managed to include it manually and I would like to share it here:

I made the QR code using Javascript, and I made a separate file generate it, so each invoice will call the file in html iframe tag.

the following are the steps:

1- after installing the akaunting application in my local host, I have modified the following file:
resources\views\components\documents\template\default.blade.php

after the line: @stack('notes_input_end')
paste the following code:

@foreach ($document->totals_sorted as $taxes)
@if ($taxes->code == 'tax')
@php
$tax_amount = $taxes->amount;
@endphp
@endif
@endforeach






2- As you can see the file URL which creates the QR code is the value of $qr_base_url
the following is the file qrcode.php content

---------------------------------------------------------------------------------------







#qrcode {
width:260px;
height:260px;
margin-top:0px;
}


var vtext = '';






var qrcode = new QRCode(document.getElementById("qrcode"), {
text: vtext,
width: 250,
height: 250,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});



---------------------------------------------------------------------------------------

Denis Duliçi   ( Admin )

Commented 8 months ago

Hello,

The code is not clear so can you please create a Gist and share the link here?

https://gist.github.com

Best regards

Abdul Rahman   ( User )

Commented 8 months ago

Yes, it seems posting here doesn't enable code script for security purpose... Ive never uploaded to github, I was a programmer 20 years ago, just fascinated with laravel lately... I will try to upload it in my free time :)

Leonardo Gomes   ( User )

Commented 8 months ago

Hello Abdul Rahman,

I have worked on a solution similar to that.
Where the QR CODE shoud redirect to?

Please login or register to leave a response.

Showing 1 to 4 of 4 discussions