axenda / zatca

An unofficial package to help developers implement ZATCA (Fatoora) QR code easily which is required for e-invoicing in Saudi Arabia.
MIT License
54 stars 13 forks source link

Question about phase1 #10

Closed sudo-sand closed 2 years ago

sudo-sand commented 2 years ago

Hi, I was wondering, if this is compatible with ZATCA phase 1?

Is this the invoice data I need to save in a DB?

{
    sellerName: 'Axenda',
    vatRegistrationNumber: '1234567891',
    invoiceTimestamp: '2021-12-04T00:00:00Z',
    invoiceTotal: '100.00',
    invoiceVatTotal: '15.00',
}

Or do I save the qrCode base64?

xBiei commented 2 years ago

this is compatible with phase 1 it has all the requirements required by ZATCA. and you don't have to store it in your db cuz it'll always be the same data if u didn't modify the receipt info anyway the final qrcode value is in base64, so if you want to save it for some reason just save the base64 so u can generate the qrcode directly using the stored base64.

xBiei commented 2 years ago

also the invoice total must be VAT included so in your case if it's a 100SR excluding VAT, it would be like this:

{
    sellerName: 'Axenda',
    vatRegistrationNumber: '1234567891',
    invoiceTimestamp: '2021-12-04T00:00:00Z',
    invoiceTotal: '115.00',
    invoiceVatTotal: '15.00',
}
sudo-sand commented 2 years ago

Thanks for your reply @xBiei