[Saudi Arabia] E-Invoice

General Authority of Zakat and Tax (GAZT) announced that its Board of Directors approved e-invoicing regulations.
Businesses operating in Saudi Arabia have to be ready by 4-Dec-2021 to prepare for issuing and processing e-invoices.

Goal
Following implementation of e-invoicing, businesses will provide transactional data to GAZT on a real-time basis.

AFG records to be automated with instant data access with Security control for review, in case of any discrepancies will likely trigger GAZT enquiry and audit activity.

Key Objectives:

The primary objective of GAZT introducing an e-invoicing framework in KSA are

  1. Reducing Shadow economy/Commercial Concealment
  2. Increase compliance with Tax obligations
  3. Adopting Global best practices
  4. Enabling fair competition and improving consumer protection

Compliance

Phase1 - Dead line Generation of Electronic Invoices and Electronic Notes, including provisions related to its processing, and record keeping, effective 4-Dec-2021

Phase2 - Dead line iintegration phase, transmission of Electronic Invoices and Electronic Notes, and sharing them with the Authority 1-Jun-2022

5 Pillars of E-Invoicing of Compliance Requirements

  • Electronic storage-Generation and storing of tax invoices and electronic notes in structured electronic format.|

  • Data Protection- Solution used is tamper-proof and includes a mechanism that allows detection of any data intervention or manipulation.|

  • Cyber Security- Compatibility with all the requirements and controls applied in Saudi Arabia in relation to data or information security or cybersecurity.|

  • Connectivity- Ability to connect with the Internet or with an external systems using an|

  • Integration of e-invoice solution with GAZT system for data sharing and collaboration.|

Scope of the application

Phase1
Generation of Electronic Invoices and Electronic Notes, including provisions related to its processing, and record keeping, effective 4th December 2021 .

Phase2
Integration phase, transmission of Electronic Invoices and Electronic Notes, and sharing them with the Authority, which shall be implemented through phases starting from 1st June 2022.

Technical Requirement details for E-invoicing

E-invoice generation & storage requirements covering types of invoices, invoice formats and invoice structure as per Annexure 1 & 2.
Security and stamps requirements covering cryptographic stamping, hashing, etc.

– Cryptographic Stamp

  • With regards to Electronic Tax Invoices and their associated Electronic Notes, the Authority shall create the Cryptographic Stamp after receiving.|

  • With regards to Simplified Tax Invoices and their associated Electronic Notes, the Cryptographic Stamp shall be generated by a Compliant E-Invoice Generation Solution|

– Universally Unique Identifier (UUID)

  • The Compliant E-Invoice Generation Solution must be able to generate a Universally Unique Identifier (UUID) for Tax Invoice, Simplified Tax Invoice, and their associated notes.|

  • UUID is a 128-bit number, generated by an algorithm chosen to make it unlikely that the same identifier will be generated by anyone else.

– Hash Tagging

  • The Compliant Solution must be able to generate a hash for each generated Electronic Invoice or Electronic Note.|

  • The hash of the invoice is then embedded in the next invoice in the sequence.|

  • QR Code
    The Compliant Solution must be able to generate a QR code.

– Invoice Counter
The Compliant Solution must have a tamper-resistant invoice counter that cannot be reset.

– Data Protection

  • Tamper-resistant and include a mechanism which prevents tampering.|

  • Prevent Manipulation and Alteration.

  • Archiving the database without Internet

– Connectivity requirement

  • Able to establish an encrypted and authenticated connection (such as TLS) over the internet|
  • Protect usability, reliability, integrity, and safety of data over communication channels|
  • Ability to periodically upload e-invoices and their associated notes in batch to external API (Simplified Tax Invoice only and the associated notes)|
  • Ability to submit invoices and their associated notes in real-time and receive a response (Electronic Tax Invoice only and the associated notes)|
  • In case the solution is offline, e-invoices and any associated notes are queued, and the solution remains operational, invoices and notes are reported after connection re-established|

– Integration

  • The Compliant Solution must be able to connect to an internet connection and integrate with external systems by using the Application Programming Interface (API).
  • Format Electronic for Integration.
  • XML format or PDF/A-3 format (with embedded XML).

Prohibited functions

– Access Controls

  • Anonymous access
  • Ability to operate with the default password
  • Absence of user session management

– Tampering

  • Allow alteration or deletion of generated e-invoices or their associated notes
  • Allows for log modification/deletion
  • Generated with inaccurate timestamps
  • Non-sequential log generation
  • Invoice counter reset
  • Ability to generate more than one invoice sequence at any given time
  • Provide an option to export cryptographic stamp stamping key
  • Allow software time changes
  • Allow modification of timestamp value during invoice or note-issuing

Verification /Certification of E-Invoice Solution

The E-Invoice Solution shall be considered as compliant after verifying its conformity to all specifications and requirements by the Authority, third party, or self-certified by the person subject to E-Invoicing Regulation.

Scope of the Project

Electronic Invoices shall include Tax Invoices, Simplified Tax Invoices & Notes
Transactions subject to E-Invoicing Regulation and in the scope.

  • Supplies of goods and services, either they are subject to the standard VAT rate or Zero rate;
  • Export of goods and services from the Kingdom;
  • Intra-GCC supplies in accordance with the Agreement, VAT law and its Implementing Regulation;
  • Nominal supplies by the taxpayer in accordance with the Agreement, VAT, and Implementing Regulation;
  • Any payments related to supply of goods or services and received by the taxpayer (Advances Payments)

Electronic Notes must be issued shall include the following:

  • Cancellation or suspension of the supplies after its occurrence either wholly or partially
  • In case of essential change or amendment in the supply, which leads to the change of the VAT due
  • Amendment of the supply value which is pre-agreed upon between the supplier and consumer
  • In case of goods or services refund.

For More technical details :

Electronic_Invoice_XML_Implementation
Electronic Invoice Data Dictionary.Excel
Electronic Invoice Security Implementation Standards
Electronic Invoice Data Dictionary

16 Likes

Same thing in Serbia. An xml format file will have to be provided. And it has to be ready by 2022.

1 Like

@Mohammed_Redha thanks for the detailed scoping. Are you working on it’s implementation as well?

Here is some of the regional features already developed for e-invoice feature.

Both of above are open-source

As indicated earlier, please let us know if you are working on the specifics, so that we can collaborate to make a generic design, merged in core and have it maintained by Frappe in the long term.

Cc: @nabinhait @Saqib_Ansari @Deepesh_Garg @saifi0102

4 Likes

Hello @Mohammed_Redha

Whats been your progress on this requirement?

I have to do something similar and could benefit from your progress. Please let me know

2 Likes

Hi Adam, Did you get any solution?

Any update on this? When e-invoicing for Saudi Arabia will be ready for ERPNext Ver 13

Development has been done. It’s under review. You can expect it in later October may be.

3 Likes

The development is done with collaboration with @Mohammad_Ahmad_Zulfi

You can find the PR here:

https://github.com/frappe/erpnext/pull/27369

Or you find it in this custom App:

5 Likes

Great work, we had GCC VAT Reports too.

There are total of 3 reports with different fetch method.

E-Invoice using a QR Code is Interesting. As ERPNext have Invoice link public it can be used.

2 Likes

Hello Umair, is there any update on e-invoicing module? Has it been completed? when will the authorization be completed with Gazt? Only few more days to go for the 4-Dec deadline.

1 Like

Yes. 04 Dec Deadline is almost near. Anyone did E-invoicing successfully?

Hi brother, I can’t get this app (Authentication faild) and [Errno2]
can you help please
V 13.13

Dear friends
how can i use this qr code in our invoice i have erpnext v12

@Shiraz_KI
This App is working fine with V12 :

1 Like

bro pls help me how can i integrate this app with my system

You have to install KSA_VAT app in your bench :

bench get-app ksa_vat https://github.com/ahmadpak/ksa_vat.git

Then install it in your site:

bench --site site_name install-app ksa_vat

Hi @Mohammed_Redha is this an official app from ERPnext or is a custom app you are made?

@Alaa_Badri No, This is a custom App

so why i saw issues about it in the release note like this GitHub - frappe/erpnext at v13.16.0

Hi,

Thanks a lot for your efforts in the first phase. Do you have any update on the second phase implementation in ERPNext?