Issue with ZATCA Integration in Manager.io

For @Arslan786 , and everyone who experiences something similar

Update Zatca Reference Error
image

ZATCA Invoice Fix Guide - Manual Form Modification

Make sure to back up your Business Data before trying it.

Overview

This guide helps you manually modify invoice forms when automatic processing fails, by temporarily disabling form validation scripts and updating ZATCA-related fields.

Step 1: Disable Form Validation Scripts

Modify CustomField Descriptions

You need to modify the following CustomFields:

  • Approval Status
  • Base64 QRCode
  • Zatca UUID
  • Zatca Certificate Info

For each CustomField:

  1. Go to SettingsCustom Fields
  2. Find and Edit the CustomField
  3. Locate the Description field
  4. Find the script tag that starts with:
    <script> document.addEventListener('DOMContentLoaded', () =>
    
  5. Add “xxx” at the beginning to disable it:
    <script>xxx document.addEventListener('DOMContentLoaded', () =>
    
  6. Save the changes

Purpose: This prevents the form locking script from running, allowing you to modify and save the form manually.

Step 2: Extract Values from Success Report

  1. Download the ZIP file generated after successful reporting/clearance
  2. Open the TXT file inside the ZIP archive
  3. Copy the following values from the TXT file:
    • ApprovalStatus
    • ZatcaUUID
    • Base64QrCode
    • ICV value (for Last ICV)
    • InvoiceHash value (for Last PIH)

Step 3: Update Business Details

  1. Go to SettingsBusiness Details
  2. Edit the business details
  3. Update the following fields:
    • Last ICV: Enter the ICV: value from the TXT file
    • Last PIH: Enter the InvoiceHash: value from the TXT file
  4. Save the changes

Step 4: Update Failed Invoice

  1. Open/Edit the invoice that failed processing
  2. Manually fill the following fields with values from the TXT file:
    • Approval Status: Enter the ApprovalStatus value
    • Zatca UUID: Enter the ZatcaUUID value
    • Base64 QRCode: Enter the Base64QrCode value
  3. Save the invoice

Step 5: Re-enable Form Validation Scripts

Restore CustomField Descriptions

  1. Go back to SettingsCustom Fields
  2. Edit each of the four CustomFields again:
    • Approval Status
    • Base64 QRCode
    • Zatca UUID
    • Zatca Certificate Info
  3. Remove the “xxx” from the script tags:
    <script>xxx document.addEventListener('DOMContentLoaded', () =>
    
    Should become:
    <script> document.addEventListener('DOMContentLoaded', () =>
    
  4. Save all changes

Important Notes

  • This process temporarily disables form validation to allow manual data entry
  • Always re-enable the scripts after completing the manual updates
  • Keep the TXT file from successful reports as reference for future manual fixes
  • This method should only be used when automatic ZATCA processing fails

Troubleshooting

  • If you can’t save the form, ensure all validation scripts are properly disabled (step 1)
  • Double-check that values copied from TXT file are complete and accurate
  • Verify that Last ICV and Last PIH are updated in Business Details before processing new invoices