Announcing the launch of the Saudi Zatca-2 E-Invoicing app on FrappeCloud

I am getting following error for item line.when I checked XML I found out difference
<cbc:BaseAmount currencyID=“SAR”>0.0</cbc:BaseAmount> instead of 0 this must be item price.
What changes I need to make to avoid such error

{“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD_ZATCA_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“type”:“WARNING”,“code”:“BR-KSA-37”,“category”:“KSA”,“message”:“The seller address building number must contain 4 digits.”,“status”:“WARNING”}],“errorMessages”:[{“type”:“ERROR”,“code”:“BR-KSA-EN16931-07”,“category”:“KSA”,“message”:“[BR-KSA-EN16931-07]-Item net price (BT-146) must equal (Item Gross price (BT-148) - Allowance amount (BT-147)) when gross price is provided.”,“status”:“ERROR”}],“status”:“ERROR”},“clearanceStatus”:“NOT_CLEARED”,“clearedInvoice”:null}

1- he seller address building number must contain 4 digits. - On your company address. On address line-2 , you give 4 digit building number. this warning will go.
2-You can not give discount on gross-total. You can give discount on net-total only. The reason is gross-amount calculated after tax.

There is no discount in the invoice.we just entered the rate and tax.following are the excerpts from the XML file.

cac:Delivery

cbc:ActualDeliveryDate2024-10-20</cbc:ActualDeliveryDate>

</cac:Delivery>

cac:PaymentMeans

cbc:PaymentMeansCode30</cbc:PaymentMeansCode>

</cac:PaymentMeans>

cac:AllowanceCharge

cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>

cbc:AllowanceChargeReasonDiscount</cbc:AllowanceChargeReason>

<cbc:Amount currencyID=“SAR”>0.00</cbc:Amount>

cac:TaxCategory

cbc:IDS</cbc:ID>

cbc:Percent15.00</cbc:Percent>

cac:TaxScheme

cbc:IDVAT</cbc:ID>

</cac:TaxScheme>

</cac:TaxCategory>

</cac:AllowanceCharge>

cac:TaxTotal

<cbc:TaxAmount currencyID=“SAR”>0.15</cbc:TaxAmount>

</cac:TaxTotal>

cac:TaxTotal

<cbc:TaxAmount currencyID=“SAR”>0.15</cbc:TaxAmount>

cac:TaxSubtotal

<cbc:TaxableAmount currencyID=“SAR”>1.0</cbc:TaxableAmount>

<cbc:TaxAmount currencyID=“SAR”>0.15</cbc:TaxAmount>

cac:TaxCategory

cbc:IDS</cbc:ID>

cbc:Percent15.00</cbc:Percent>

cac:TaxScheme

cbc:IDVAT</cbc:ID>

</cac:TaxScheme>

</cac:TaxCategory>

</cac:TaxSubtotal>

</cac:TaxTotal>

cac:LegalMonetaryTotal

<cbc:LineExtensionAmount currencyID=“SAR”>1.0</cbc:LineExtensionAmount>

<cbc:TaxExclusiveAmount currencyID=“SAR”>1.0</cbc:TaxExclusiveAmount>

<cbc:TaxInclusiveAmount currencyID=“SAR”>1.15</cbc:TaxInclusiveAmount>

<cbc:AllowanceTotalAmount currencyID=“SAR”>0.0</cbc:AllowanceTotalAmount>

<cbc:PayableAmount currencyID=“SAR”>1.15</cbc:PayableAmount>

</cac:LegalMonetaryTotal>

cac:InvoiceLine

cbc:ID1</cbc:ID>

<cbc:InvoicedQuantity unitCode=“PCS”>1.0</cbc:InvoicedQuantity>

<cbc:LineExtensionAmount currencyID=“SAR”>1.0</cbc:LineExtensionAmount>

cac:TaxTotal

<cbc:TaxAmount currencyID=“SAR”>0.15</cbc:TaxAmount>

<cbc:RoundingAmount currencyID=“SAR”>1.15</cbc:RoundingAmount>

</cac:TaxTotal>

cac:Item

cbc:NamePS5 CONSOLE SLIM DIGITAL</cbc:Name>

cac:ClassifiedTaxCategory

cbc:IDS</cbc:ID>

cbc:Percent15.00</cbc:Percent>

cac:TaxScheme

cbc:IDVAT</cbc:ID>

</cac:TaxScheme>

</cac:ClassifiedTaxCategory>

</cac:Item>

cac:Price

<cbc:PriceAmount currencyID=“SAR”>1.000000</cbc:PriceAmount>

<cbc:BaseQuantity unitCode=“PCS”>1</cbc:BaseQuantity>

cac:AllowanceCharge

cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>

cbc:AllowanceChargeReasondiscount</cbc:AllowanceChargeReason>

<cbc:Amount currencyID=“SAR”>0.0</cbc:Amount>

<cbc:BaseAmount currencyID=“SAR”>0.0</cbc:BaseAmount>

</cac:AllowanceCharge>

</cac:Price>

</cac:InvoiceLine>

Share the xml and invoice print-out to our email support@erpgulf.com

1 Like

Please help me getting warning every time.

after pulling the latest updates the issues resolved.Thanks

Today we made an update . Pull the latest , if still shows the error , send xml and inv

Suadi phase-2 e-invoicing update

for Heathcare and education -
Zero rated invoices for saudi citizens,
Catetory -zero rated Reason code - VATEX-SA-HEA
they have to provide National ID number of the patient.

Pls pull & migrate - added fields for that in customer dt.

same applicable for education.
Zero rated - Z
reason code - VATEX-SA-EDU

Use the same fields above while making invoices.

I pulled latest update but can not submit to ZATCA.I tried sending it again through "ZATACA Phase-2 " button but no response.

Please make sure that you ticked "Zatca invoice enabled " and select "phase-2 " . Screenshot attachd.

yes it is enabled as per the screenshot provided.received error “Error in clearance API: (1054, “Unknown column ‘custom_ksa_einvoicing_xml’ in ‘field list’”)”

Some fields not created in your instance
Please do bench migrate , it will solve this issue.

New dashboard

I bench migrate but error remains still same.even after that I have pulled latest update as well.

what is the error ? send details.

We were missing this filed ( custom_ksa_einvoicing_xml ) on fixture. Now pushed . You can pull and migragte

Thank you very much. Now invoices are submitted.

New features added for inclusive tax. Now you can post invoices with tax included on the line

Added new feature of print PDF-A3 .
Please pull and update from our github repo.

How to use video Watch it here

1 Like

Hi @Support-at-ERPgulf

First and foremost, I want to extend my gratitude for the incredible app you’ve built. I do have a few concerns.

  1. In the Customer DocType, there are two fields:
    'Customer ID Type for Zatca ’ and 'Buyer ID type for Zatca '.
    Could you please provide guidance on configuring a regular customer in B2C scenarios?
    Should these fields be populated, and if so, what values should be used?
    Also for the B2B , Should i put the customer Vat Registeration number and CRN Number in customer doctype ?

  2. When I try to simulate on Fatoora Portal using the OTP I received, I encounter an Error in creating CSID: Error: OTP is not valid. {“errors”:[{“code”:“Invalid-OTP”,“message”:“The provided OTP is invalid”}]}.

Could you please advise on what might be going wrong? Additionally, here’s some more information about the CSR:
csr.common.name=TST-886431145-30110-----003
csr.serial.number=1-TST|2-TST|3-e4291a9a-6a13-9726-0b3f-9df5fad7
csr.organization.identifier=30110------003
csr.organization.unit.name=30110000----003
csr.organization.name=مؤسسة----قاولات
csr.country.name=SA
csr.invoice.type=1100
csr.location.address=حفر الباطن
csr.industry.business.category=Retail Services

Thank you