Creating a functional design document for ZATCA-compliant e-invoicing in Saudi Arabia involves detailing the system's capabilities to meet the requirements set by the Zakat, Tax, and Customs Authority (ZATCA). Below is a structured outline to guide you in developing this document:
1. Introduction
Purpose: Define the objective of the document, focusing on ensuring compliance with ZATCA's e-invoicing regulations.
Scope: Specify the boundaries of the system, including the types of invoices (e.g., tax invoices, simplified tax invoices, credit notes, debit notes) and the business processes affected.
2. System Overview
System Description: Provide a high-level description of the e-invoicing system, including its integration with existing ERP or POS systems.
User Roles and Responsibilities: Outline the different user roles (e.g., system administrators, finance personnel) and their responsibilities within the system.
3. Functional Requirements
Invoice Generation:
Ensure the system can generate e-invoices in XML or PDF/A-3 format with embedded XML, as mandated by ZATCA.
Include all required fields as specified in ZATCA's Electronic Invoice Data Dictionary.
Invoice Validation and Compliance:
Implement 150+ smart data validations to ensure invoice data aligns with ZATCA regulations, thereby generating error-free invoices.
Generate UUIDs, invoice hashes, invoice counter values, and QR codes as per ZATCA's specifications.
Integration with ZATCA Systems:
Establish seamless integration with ZATCA's FATOORA platform for real-time clearance of tax invoices and reporting of simplified tax invoices within 24 hours.
Utilize ZATCA's APIs for data exchange, ensuring secure and efficient communication.
User Interface:
Design an intuitive interface for users to create, view, and manage e-invoices.
Provide dashboards and reports to monitor e-invoicing activities and compliance status.
Error Handling:
Implement automated error handling with periodic alerts and notifications.
Offer smart correction suggestions and guidance for bulk resubmission of invoices.
4. Non-Functional Requirements
Performance:
Ensure the system can handle high volumes of e-invoice generation, with a capacity of up to 15,000 e-invoices per minute.
Security:
Implement robust data security measures, including cryptographic stamps and secure data storage, to protect sensitive information.
Scalability:
Design the system to be scalable, accommodating future growth and increased transaction volumes.
Compliance:
Stay updated with the latest ZATCA regulations and ensure the system adheres to all compliance requirements.
5. System Architecture
High-Level Architecture Diagram: Provide a visual representation of the system's architecture, illustrating components such as the e-invoicing application, integration middleware, and connections to ZATCA's systems.
Component Descriptions: Detail each component's function and how they interact within the system.
6. Integration Details
ERP/POS Integration:
Describe the process for integrating the e-invoicing system with existing ERP or POS systems, including data flow and synchronization mechanisms.
API Specifications:
Provide details on the APIs used for integration, including endpoints, request/response formats, and authentication methods.
7. Data Management
Data Storage:
Outline the data storage solutions, ensuring compliance with ZATCA's requirement for e-invoice data archival for up to six years.
Data Validation:
Implement data validation rules to ensure accuracy and completeness of invoice data before submission.
8. Security Considerations
Access Control:
Define user authentication and authorization mechanisms to control access to the system.
Data Encryption:
Ensure data is encrypted during transmission and storage to protect against unauthorized access.
9. Compliance and Regulatory Requirements
ZATCA Guidelines:
Adhere to ZATCA's technical requirements for e-invoicing solutions, including prohibited functionalities such as the generation of more than one invoice sequence at the same time and time changes.
Audit and Reporting:
Implement features to generate detailed and complete reporting audit trails that are reconciled to accounting records.
10. Appendices
Glossary: Define technical terms and acronyms used in the document.
References: List all documents, guidelines, and resources referenced, including ZATCA's official documentation and relevant standards.
By following this outline, you can create a comprehensive functional design document that ensures your e-invoicing system is compliant with ZATCA's regulations and meets your business needs.
User
Project Galaxy
Integration Functional Specification
RICE Name: LMG Galaxy - FDD - Integration - Payroll to ZATCA Clear Tax
Document Control Information
Document Identification Functional Specification document
Document Name LMG Galaxy - FDD - Integration - Payroll to ZATCA Clear Tax
Creation Date 14-04-2025
Intended Audience LMG
Document Author Ankit
Document Status
Document Version 1.00
Last Updated 14-04-2025
Revision and Signoff Sheet
Change Record
Date Author Version Change Reference
14-04-2025 Ankit Mishra 1.00 Initial Draft
Requirements overview 4
2.1. Dependencies and prerequisites 4
2.2. Setup requirements 4
2.3. Access Requirement: 5
2.4. Business Validations required: 5
2.5. File format, data mapping and transformation. 5
2.6. Data flow diagram 6
2.7. User procedure overview 7
2.8. Error handling and reporting 7
Additional Information 8
2.1. Acronyms, abbreviations, and definitions 8
2.2. Open items, risks, issues, dependencies, and future considerations 8
Introduction
1.1. Project Overview
LMG intends to migrate its existing application & processes (Oracle EBS R12) to Oracle Fusion Payroll Cloud ERP to establish standard, simple and scalable system landscape to achieve sustainable business growth.
1.2. Document Purpose and Scope
The Purpose of this Document is to detail the Integration process of generating the QR Code generation from ZATCA Clear Tax and generate the report in Cloud Payroll. Also, it provides the functional specification details and Mappings required for of generating the BI Extracts, transforming in the OIC and generation of QR code.
The Document scope is limited to Cloud Payroll Applications and OIC, and it is outbound mechanism.
2. Requirements overview
2.1. Dependencies and prerequisites
Below is the sequence of action which would be performed every month during payroll process. This is the approach would be applicable only for Saudi wherein VAT invoice is being generated based on QR code generation from ZATCA.
S.No Action performed Owner Source path Destination path Remarks
1 Payroll process to be completed for each of the payroll for the specific period Payroll Team Fusion Payroll Fusion Payroll
2 Prepayments process to be completed for each of the payroll for the specific period Payroll Team Fusion Payroll Fusion Payroll
3 Salary Payment Transfer Payroll Team Fusion Payroll Bank Portal Manual Process
2.2. Setup requirements
This integration will require configuration for the VAT invoice generation process.
Elements Configuration
Element entries need to be attached to the employees.
BI Extracts to be created to generate the payroll run results specific to VAT related payroll elements.
Assistant
To ensure compliance with the Zakat, Tax, and Customs Authority (ZATCA) e-invoicing regulations in Saudi Arabia, it's essential to integrate your payroll system with ZATCA's Clear Tax platform. Below is a refined functional design document (FDD) outlining the integration process between your payroll system and ZATCA Clear Tax.
Introduction
1.1. Project Overview
1.2. Document Purpose and Scope
Requirements Overview
2.1. Dependencies and Prerequisites
2.2. Setup Requirements
2.3. Access Requirements
2.4. Business Validations Required
2.5. File Format, Data Mapping, and Transformation
2.6. Data Flow Diagram
2.7. User Procedure Overview
2.8. Error Handling and Reporting
Additional Information
3.1. Acronyms, Abbreviations, and Definitions
3.2. Open Items, Risks, Issues, Dependencies, and Future Considerations
1. Introduction
1.1. Project Overview
LMG intends to migrate its existing application and processes from Oracle EBS R12 to Oracle Fusion Payroll Cloud ERP. This migration aims to establish a standardized, simple, and scalable system landscape to achieve sustainable business growth.
Create QR code by using Mirco Service and send VAT employees details to Clear Tax Portal.
LMG Payroll to ZATCA Clear Tax Process needs to be creates as below given process to complete the Payroll ZATCA Solution.
Program Name Interface Type
LMG Saudi ZATCA Cleare Tax Program Integration (Outbound)
LMG Saudi ZATCA DOR Load Integration (Inboud)
LMG ZATCA VAT Invoice Report Integration (Generating the VAT Report)
2.3. Access Requirement:
Integration User should have access to following Roles and privileges with Data Access Set.
Payroll Administrator role
2.4. Business Validations required:
Regular payroll process should be completed successfully.
Consider only the employees whoever is attached with VAT deduction element.
Only Payroll action with “R” & “Q” should be picked up
Don’t consider the entries which is processed with zero value.
Element with classification as “'Involuntary Deductions” & “'Voluntary Deductions'” should be considered
Invoice number needs to be generated using sequence object to maintain the uniqueness. Below is the As-is logic used for invoice number generation. It needs to be replicated.
• If Payroll type is “Regular” then sequencing format will be 'PAY' || “lmhr_pay_saudi_vat_seq.”
• If Payroll type is “FNF: then sequencing format will be 'FNF' || lmhr_ff_saudi_vat_seq.NEXTVAL
Create a lookup to maintain the “VAT Deduction rate” which is 15% as per As-Is logic and use it to derive the VAT amount from the element value.
2.5. File format, data mapping and transformation.
The file below provides details of fields that would form the basis of the format for creating VAT invoice through BI extracts.
Payroll to BI Extract Mapping
BI Columns TO BE Mapping
PERSON_ID Get the Person ID From Person Secured View
ASSIGNMENT_ID Get the Assignment ID From Person Secured View
EMPLOYEE_NUMBER Get the employee number form Person Secured View
EMPLOYEE_NAME From Person Names table
ASSIGNMENT_NUMBER From Assignment Table
EMAIL_ADDRESS From Email Address Table
LEGAL_ENTITY_NAME From Organization tables
PAYROLL_ACTON_ID From Payroll Actions tables
PAYROLL_NAME From Payroll Name Tables
PAYROLL_TYPE From Payroll Actions tables
ELEMENT NAME Payroll Results tables
Amount Payroll Results tables
Currency Payroll Results tables
VAT Percentage From Common Lookups tables
VAT Amount From Common Lookups tables
Total Amount & VAT From Common Lookups tables
Effective Date Zatca Run date
Period Name Payroll Period Tables
Tax Currency Code Payroll Tables(Same as Payroll Currency)
Party Reg. Name LE Name
Party Company ID LE ORG Code
BUILD_NAME From Legal Address Table (Only for KSA)
Flat name From Legal Address Table (Only for KSA)
Street name From Legal Address Table (Only for KSA)
City From Legal Address Table (Only for KSA)
Sub-City From Legal Address Table (Only for KSA)
Postal Code From Legal Address Table (Only for KSA)
Postal Country From Legal Address Table (Only for KSA)
OIC to Microservice Mapping
OIC to DOR Mapping
DOR to VAT Report
Refer Attached FDD for ZATCA VAT report.
Below are the points considered during transformation: -
In case of lines details If deduction element name is Like 'International%Courier%' THEN this should be displayed ‘The international transport of Goods' under tax exemption reason code.
In case of lines details If deduction element name is Like ‘'International%Ticket%'’ THEN this should be displayed ‘international transport of passengers' as tax exemption reason code.
Once BI Extracts is completed then details will be processed/transformed in the OIC and it will be captured in some ATP tables where the QR code response will be updated with reference to each invoices as per ZATCA Clear Tax.
Arabic Versions of element are captured in the following lookup LM_HR_FINAL_SET_REPORT at EBS so, similar kind of lookup to be created in Fusion or it can be fetched from standard Translation tables
Invoice Tax category should be captured based on the VAT Percentage like below
• If its zero then transform as Z
• If its 15 then transform as S
• Else default S
If element name is like “International” then don’t apply the 15% VAT amount and consider only the base value. For any other elements, display sum of element base value and VAT amount.
Below are the static values used in the AS-IS context which needs to be considered accordingly
table column Display Name Static- Column Value
INV_TAX_SCHEME_ID Tax Scheme ID VAT
INV_ITEM_QTY Item Quantity 1
INV_ITME_QTY_CODE Item Quantity Code EA
INV_LINE_AMT_CUR Invoice Line Amount Currency SAR
INV_LINE_VAT_CUR Invoice Line VAT currency SAR
INV_LINE_INC_VAT_CUR Invoice Line with VAT Currency SAR
INV_LINE_AMT_SUM_CUR Invoice Line Amount Sum Currency SAR
2.6. Data flow diagram
Stage 1 - Oracle Cloud Payroll to OIC
Employee’s payroll processed details with respect to VAT process gets generated through BI Extracts and its will be placed in some SFTP folder.
BI report will be used to check the status of QR code and VAT invoice generation program submitted accordingly as per the status.
Stage 2 – OIC to ZATCA by Using Microservices.
BI Extracts file gets consumed from SFTP folder and transformation gets done as per the given transformation logic and captures in the ATP custom tables which will be used to pass inputs to ZATCA clear Tax and gets responses from ZATCA through Microservices and it will be inserted into same ATP custom tables to capture the QR code response and Invoice Status.
Stage 3 – OIC to Document of Record
After generating the QR code successfully load the QR code into Employee wise DOR – ZATCA QR CODE.
In Oracle HCM Cloud.
Stage 4 – DOR to VAT Report Generation
Once QR code loaded in QR code DOR then User will submit the ESS process to generate the report.
2.7. User procedure overview
This integration will be submitted by Payroll team to run after payroll process is finalized.
When the integration fails in any stage, business team & IT support team will get error/warning email.
In case of errors in OIC from source which get errors in Oracle payroll application, IT support will do the following to correct the errors
Standard procedures for invoice creation is validated from source.
Error records will be notified to Business users / IT Support through email and Integration Dashboard available to check status of Integration processing
Business users / IT Support team can download the errors and sent to Payroll team if in case of any data corrections required
Payroll team rectifies the data errors and rerun the program.
2.8. Error handling and reporting
Following are some errors and Resolutions to perform to clear journal lines errors in GL Interface tables:
Error Scenario Resolution
1 VAT details not generated for the employee Check whether VAT deduction element was attached to the employee. Check for error message under ZATCA report.
2 VAT details are generated but QR code not generated Check in ZATCA portal whether QR code generation process is completed which should be taken care by business.
Reporting:
Integration Dashboard access will be available to business users and IT users to review the data processing status and find error records.
Email will be sent to distribution list for Integration errors with predefined format (Format will be decided in build phase with consultation of business)
Integration status report can be built to list error records with details of errors.
1.1. Testing Scenarios:
S. No Test Scenarios Result
1 Run the LMHR Saudi ZATCA Cleare Tax Program – HCM Extracts The data should be populated properly as per the defined format without any issues
2 Check the QR code generation status in the report The QR code status should reflect as generated.
Additional Information
2.1. Acronyms, abbreviations, and definitions
Term Definition
ERPM Enterprise Resource Planning and Performance Management
SFTP Secure File Transfer Protocol
OIC Oracle Integration Cloud
2.2. Open items, risks, issues, dependencies, and future considerations
Category Description
validate and correct the english and mapping according to Payroll to OIC to ZATCA Clear Tax
1.2. Document Purpose and Scope
This document details the integration process for generating QR codes from ZATCA Clear Tax and producing reports in Cloud Payroll. It provides functional specifications and mappings required for generating BI Extracts, transforming data in the Oracle Integration Cloud (OIC), and generating QR codes. The scope is limited to Cloud Payroll Applications and OIC, focusing on outbound mechanisms.
2. Requirements Overview
2.1. Dependencies and Prerequisites
The following sequence of actions will be performed monthly during the payroll process, applicable only for Saudi Arabia, where VAT invoices are generated based on QR code generation from ZATCA:
Payroll Processing: Complete payroll processing for each payroll period.
Prepayments Processing: Complete prepayments processing for each payroll period.
Salary Payment Transfer: Transfer salary payments to the bank portal (manual process).
2.2. Setup Requirements
This integration requires configuration for the VAT invoice generation process:
Elements Configuration: Configure payroll elements related to VAT deductions.
Element Entries: Attach relevant element entries to employees.
BI Extracts: Create BI Extracts to generate payroll run results specific to VAT-related payroll elements.
QR Code Generation: Utilize a microservice to create QR codes and send VAT employee details to the Clear Tax Portal.
The following programs need to be created to complete the Payroll ZATCA Solution:
LMG Saudi ZATCA Clear Tax Program: Integration (Outbound)
LMG Saudi ZATCA DOR Load: Integration (Inbound)
LMG ZATCA VAT Invoice Report: Integration (Generating the VAT Report)
2.3. Access Requirements
The integration user should have access to the following roles and privileges with Data Access Set:
Payroll Administrator Role
2.4. Business Validations Required
Payroll Completion: Ensure regular payroll processing is successfully completed.
Employee Eligibility: Consider only employees with attached VAT deduction elements.
Payroll Actions: Include only payroll actions with statuses "R" (Run) and "Q" (QuickPay).
Non-Zero Entries: Exclude entries processed with zero value.
Element Classification: Consider elements classified as "Involuntary Deductions" and "Voluntary Deductions."
Invoice Number Generation: Generate unique invoice numbers using sequence objects:
Regular Payroll: Format as 'PAY' || "lmhr_pay_saudi_vat_seq."
Final Settlement (FNF): Format as 'FNF' || lmhr_ff_saudi_vat_seq.NEXTVAL
VAT Deduction Rate: Maintain a lookup for the VAT deduction rate (15%) and use it to derive the VAT amount from the element value.
2.5. File Format, Data Mapping, and Transformation
The following details outline the fields required for creating VAT invoices through BI Extracts: