Download rules.json from nagieeb/zatca-rules: direct link, hf CLI and curl.
- Browser
- Download file 390 kB
-
https://huggingface.co/datasets/nagieeb/zatca-rules/resolve/main/rules.json
- Command line
-
hf download hf://datasets/nagieeb/zatca-rules/rules.json
-
curl -L -o rules.json https://huggingface.co/datasets/nagieeb/zatca-rules/resolve/main/rules.json
390 kB
[
{
"id": "BR-02",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-02]-An Invoice shall have an Invoice number (BT-1).",
"fails_when": "not(exists(cbc:ID) and (cbc:ID) !='')",
"en_title": "Every invoice needs an invoice number (BT-1)",
"ar_title": "يجب أن تحمل كل فاتورة رقم فاتورة (BT-1)",
"en_meaning": "Checks that the document root (ubl:Invoice or cn:CreditNote) has a cbc:ID element and that it is not empty.",
"en_fix": "Add a non-empty invoice number directly under the root element, e.g. `<cbc:ID>INV-0001</cbc:ID>`.",
"ar_meaning": "تتحقق القاعدة من أن العنصر الجذر للمستند (ubl:Invoice أو cn:CreditNote) يحتوي على العنصر cbc:ID وأنه غير فارغ.",
"ar_fix": "أضف رقم فاتورة غير فارغ مباشرة تحت العنصر الجذر، مثل `<cbc:ID>INV-0001</cbc:ID>`.",
"applies_to": "all",
"fields": [
"BT-1"
],
"url_en": "https://matheel.app/en/zatca-errors/br-02",
"url_ar": "https://matheel.app/akhta/br-02"
},
{
"id": "BR-03",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-03]-An Invoice shall have an Invoice issue date (BT-2).",
"fails_when": "not(exists(cbc:IssueDate) and (cbc:IssueDate) !='')",
"en_title": "Every invoice needs an issue date (BT-2)",
"ar_title": "يجب أن تحمل كل فاتورة تاريخ إصدار (BT-2)",
"en_meaning": "Checks that the document root has a cbc:IssueDate element and that it is not empty.",
"en_fix": "Add the issue date directly under the root element in the UBL date format YYYY-MM-DD, e.g. `<cbc:IssueDate>2026-10-24</cbc:IssueDate>`.",
"ar_meaning": "تتحقق القاعدة من أن العنصر الجذر للمستند يحتوي على العنصر cbc:IssueDate وأنه غير فارغ.",
"ar_fix": "أضف تاريخ الإصدار مباشرة تحت العنصر الجذر بصيغة التاريخ في UBL (YYYY-MM-DD)، مثل `<cbc:IssueDate>2026-10-24</cbc:IssueDate>`.",
"applies_to": "all",
"fields": [
"BT-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-03",
"url_ar": "https://matheel.app/akhta/br-03"
},
{
"id": "BR-04",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-04]-An Invoice shall have an Invoice type code (BT-3).",
"fails_when": "not((exists(cbc:InvoiceTypeCode) and (cbc:InvoiceTypeCode) !='') or (exists(cbc:CreditNoteTypeCode) and (cbc:CreditNoteTypeCode) !=''))",
"en_title": "Every invoice needs an invoice type code (BT-3)",
"ar_title": "يجب أن تحمل كل فاتورة رمز نوع الفاتورة (BT-3)",
"en_meaning": "Checks that the document has a non-empty cbc:InvoiceTypeCode (or, in a cn:CreditNote document, a non-empty cbc:CreditNoteTypeCode).",
"en_fix": "Add a type code under the root element, e.g. `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>` as in the official samples; the value must also be in the BR-CL-01 code list.",
"ar_meaning": "تتحقق القاعدة من وجود العنصر cbc:InvoiceTypeCode غير فارغ (أو العنصر cbc:CreditNoteTypeCode غير فارغ في مستند من نوع cn:CreditNote).",
"ar_fix": "أضف رمز النوع تحت العنصر الجذر، مثل `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>` كما في النماذج الرسمية، ويجب أن تكون القيمة ضمن قائمة الرموز في القاعدة BR-CL-01.",
"applies_to": "all",
"fields": [
"BT-3"
],
"url_en": "https://matheel.app/en/zatca-errors/br-04",
"url_ar": "https://matheel.app/akhta/br-04"
},
{
"id": "BR-05",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-05]-An Invoice shall have an Invoice currency code (BT-5).",
"fails_when": "not(exists(cbc:DocumentCurrencyCode) and (cbc:DocumentCurrencyCode) !='')",
"en_title": "Every invoice needs a currency code (BT-5)",
"ar_title": "يجب أن تحمل كل فاتورة رمز عملة الفاتورة (BT-5)",
"en_meaning": "Checks that the document root has a cbc:DocumentCurrencyCode element and that it is not empty.",
"en_fix": "Add the invoice currency under the root element, e.g. `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`; the value must be an ISO 4217 code (see BR-CL-04).",
"ar_meaning": "تتحقق القاعدة من أن العنصر الجذر يحتوي على العنصر cbc:DocumentCurrencyCode وأنه غير فارغ.",
"ar_fix": "أضف عملة الفاتورة تحت العنصر الجذر، مثل `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`، ويجب أن تكون القيمة رمزًا من ISO 4217 (انظر BR-CL-04).",
"applies_to": "all",
"fields": [
"BT-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-05",
"url_ar": "https://matheel.app/akhta/br-05"
},
{
"id": "BR-06",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-06]-An Invoice shall contain the Seller name (BT-27).",
"fails_when": "not(exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) and (cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) !='')",
"en_title": "The seller's legal name (BT-27) must be present",
"ar_title": "يجب ذكر الاسم القانوني للبائع (BT-27)",
"en_meaning": "Checks that cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName exists and is not empty.",
"en_fix": "Add the seller name: `<cac:AccountingSupplierParty><cac:Party><cac:PartyLegalEntity><cbc:RegistrationName>Seller name</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty>`.",
"ar_meaning": "تتحقق القاعدة من وجود العنصر cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName وأنه غير فارغ.",
"ar_fix": "أضف اسم البائع: `<cac:AccountingSupplierParty><cac:Party><cac:PartyLegalEntity><cbc:RegistrationName>Seller name</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty>`.",
"applies_to": "all",
"fields": [
"BT-27"
],
"url_en": "https://matheel.app/en/zatca-errors/br-06",
"url_ar": "https://matheel.app/akhta/br-06"
},
{
"id": "BR-08",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-08]-An Invoice shall contain the Seller postal address (BG-5)",
"fails_when": "not(exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) and count(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress) >0)",
"en_title": "The seller's postal address (BG-5) must be present",
"ar_title": "يجب ذكر العنوان البريدي للبائع (BG-5)",
"en_meaning": "Checks that the seller party has at least one cac:AccountingSupplierParty/cac:Party/cac:PostalAddress element. This rule only checks that the element exists, not what it contains.",
"en_fix": "Add a cac:PostalAddress inside cac:AccountingSupplierParty/cac:Party; its contents (such as the country code) are checked by other rules like BR-09.",
"ar_meaning": "تتحقق القاعدة من وجود عنصر cac:PostalAddress واحد على الأقل ضمن cac:AccountingSupplierParty/cac:Party. القاعدة تتحقق من وجود العنصر فقط، لا من محتواه.",
"ar_fix": "أضف العنصر cac:PostalAddress داخل cac:AccountingSupplierParty/cac:Party؛ أما محتواه (مثل رمز الدولة) فتتحقق منه قواعد أخرى مثل BR-09.",
"applies_to": "all",
"fields": [
"BG-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-08",
"url_ar": "https://matheel.app/akhta/br-08"
},
{
"id": "BR-09",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-09]-The Seller postal address (BG-5) shall contain a Seller country code (BT-40).",
"fails_when": "not((cac:Country/cbc:IdentificationCode) != '')",
"en_title": "The seller address must include a country code (BT-40)",
"ar_title": "يجب أن يتضمن عنوان البائع رمز الدولة (BT-40)",
"en_meaning": "Checks that the seller's cac:PostalAddress contains cac:Country/cbc:IdentificationCode with a non-empty value.",
"en_fix": "Inside the seller's cac:PostalAddress add `<cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country>` (or the seller's ISO 3166-1 country code, see BR-CL-14).",
"ar_meaning": "تتحقق القاعدة من أن العنصر cac:PostalAddress الخاص بالبائع يحتوي على cac:Country/cbc:IdentificationCode بقيمة غير فارغة.",
"ar_fix": "داخل العنصر cac:PostalAddress الخاص بالبائع أضف `<cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country>` (أو رمز دولة البائع وفق ISO 3166-1، انظر BR-CL-14).",
"applies_to": "all",
"fields": [
"BG-5",
"BT-40"
],
"url_en": "https://matheel.app/en/zatca-errors/br-09",
"url_ar": "https://matheel.app/akhta/br-09"
},
{
"id": "BR-13",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-13]-An Invoice shall have the Invoice total amount without VAT (BT-109).",
"fails_when": "not(exists(cbc:TaxExclusiveAmount))",
"en_title": "The invoice total without VAT (BT-109) must be present",
"ar_title": "يجب ذكر إجمالي الفاتورة دون ضريبة القيمة المضافة (BT-109)",
"en_meaning": "Checks that cac:LegalMonetaryTotal contains a cbc:TaxExclusiveAmount element.",
"en_fix": "Add the total without VAT inside cac:LegalMonetaryTotal, e.g. `<cbc:TaxExclusiveAmount currencyID=\"SAR\">100.00</cbc:TaxExclusiveAmount>`.",
"ar_meaning": "تتحقق القاعدة من أن العنصر cac:LegalMonetaryTotal يحتوي على العنصر cbc:TaxExclusiveAmount.",
"ar_fix": "أضف الإجمالي دون الضريبة داخل cac:LegalMonetaryTotal، مثل `<cbc:TaxExclusiveAmount currencyID=\"SAR\">100.00</cbc:TaxExclusiveAmount>`.",
"applies_to": "all",
"fields": [
"BT-109"
],
"url_en": "https://matheel.app/en/zatca-errors/br-13",
"url_ar": "https://matheel.app/akhta/br-13"
},
{
"id": "BR-14",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-14]-An Invoice shall have the Invoice total amount with VAT (BT-112).",
"fails_when": "not(exists(cbc:TaxInclusiveAmount))",
"en_title": "The invoice total with VAT (BT-112) must be present",
"ar_title": "يجب ذكر إجمالي الفاتورة شاملًا ضريبة القيمة المضافة (BT-112)",
"en_meaning": "Checks that cac:LegalMonetaryTotal contains a cbc:TaxInclusiveAmount element.",
"en_fix": "Add the total with VAT inside cac:LegalMonetaryTotal, e.g. `<cbc:TaxInclusiveAmount currencyID=\"SAR\">115.00</cbc:TaxInclusiveAmount>`.",
"ar_meaning": "تتحقق القاعدة من أن العنصر cac:LegalMonetaryTotal يحتوي على العنصر cbc:TaxInclusiveAmount.",
"ar_fix": "أضف الإجمالي شاملًا الضريبة داخل cac:LegalMonetaryTotal، مثل `<cbc:TaxInclusiveAmount currencyID=\"SAR\">115.00</cbc:TaxInclusiveAmount>`.",
"applies_to": "all",
"fields": [
"BT-112"
],
"url_en": "https://matheel.app/en/zatca-errors/br-14",
"url_ar": "https://matheel.app/akhta/br-14"
},
{
"id": "BR-15",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-15]-An Invoice shall have the Amount due for payment (BT-115).",
"fails_when": "not(exists(cbc:PayableAmount))",
"en_title": "The amount due for payment (BT-115) must be present",
"ar_title": "يجب ذكر المبلغ المستحق الدفع (BT-115)",
"en_meaning": "Checks that cac:LegalMonetaryTotal contains a cbc:PayableAmount element.",
"en_fix": "Add the amount due inside cac:LegalMonetaryTotal, e.g. `<cbc:PayableAmount currencyID=\"SAR\">115.00</cbc:PayableAmount>`.",
"ar_meaning": "تتحقق القاعدة من أن العنصر cac:LegalMonetaryTotal يحتوي على العنصر cbc:PayableAmount.",
"ar_fix": "أضف المبلغ المستحق داخل cac:LegalMonetaryTotal، مثل `<cbc:PayableAmount currencyID=\"SAR\">115.00</cbc:PayableAmount>`.",
"applies_to": "all",
"fields": [
"BT-115"
],
"url_en": "https://matheel.app/en/zatca-errors/br-15",
"url_ar": "https://matheel.app/akhta/br-15"
},
{
"id": "BR-16",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-16]-An Invoice shall have at least one Invoice line (BG-25)",
"fails_when": "not(exists(cac:InvoiceLine) or exists(cac:CreditNoteLine))",
"en_title": "Every invoice needs at least one invoice line (BG-25)",
"ar_title": "يجب أن تحتوي كل فاتورة على بند واحد على الأقل (BG-25)",
"en_meaning": "Checks that the document root contains at least one cac:InvoiceLine (or cac:CreditNoteLine in a cn:CreditNote document).",
"en_fix": "Add at least one cac:InvoiceLine under the root element, with its line ID, quantity, net amount, item and price.",
"ar_meaning": "تتحقق القاعدة من أن العنصر الجذر يحتوي على عنصر cac:InvoiceLine واحد على الأقل (أو cac:CreditNoteLine في مستند من نوع cn:CreditNote).",
"ar_fix": "أضف عنصر cac:InvoiceLine واحدًا على الأقل تحت العنصر الجذر، يتضمن معرّف البند والكمية وصافي المبلغ والصنف والسعر.",
"applies_to": "all",
"fields": [
"BG-25"
],
"url_en": "https://matheel.app/en/zatca-errors/br-16",
"url_ar": "https://matheel.app/akhta/br-16"
},
{
"id": "BR-21",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-21]-Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).",
"fails_when": "not((cbc:ID) != '')",
"en_title": "Each invoice line needs a line identifier (BT-126)",
"ar_title": "يجب أن يحمل كل بند في الفاتورة معرّفًا (BT-126)",
"en_meaning": "Checks that every cac:InvoiceLine (or cac:CreditNoteLine) has a non-empty cbc:ID.",
"en_fix": "Give each line a non-empty identifier as its first child, e.g. `<cbc:ID>1</cbc:ID>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:InvoiceLine (أو cac:CreditNoteLine) يحتوي على cbc:ID غير فارغ.",
"ar_fix": "أعطِ كل بند معرّفًا غير فارغ، مثل `<cbc:ID>1</cbc:ID>`.",
"applies_to": "all",
"fields": [
"BG-25",
"BT-126"
],
"url_en": "https://matheel.app/en/zatca-errors/br-21",
"url_ar": "https://matheel.app/akhta/br-21"
},
{
"id": "BR-22",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-22]-Each Invoice line (BG-25) shall have an Invoiced quantity (BT-129).",
"fails_when": "(not(exists(cbc:InvoicedQuantity)) or cbc:InvoicedQuantity/text() = '0')",
"en_title": "Each invoice line needs an invoiced quantity (BT-129)",
"ar_title": "يجب أن يحمل كل بند في الفاتورة الكمية المفوترة (BT-129)",
"en_meaning": "Checks each cac:InvoiceLine / cac:CreditNoteLine for cbc:InvoicedQuantity. The check the validator actually executes is stricter than the displayed test: it fails when cbc:InvoicedQuantity is missing or its text is exactly '0', and it does not accept cbc:CreditedQuantity as a substitute (the displayed test accepts either element).",
"en_fix": "Add `<cbc:InvoicedQuantity>1.00</cbc:InvoicedQuantity>` to every line, and do not write the quantity as the bare value 0.",
"ar_meaning": "تتحقق القاعدة من وجود cbc:InvoicedQuantity في كل عنصر cac:InvoiceLine أو cac:CreditNoteLine. الفحص الذي ينفّذه المدقق فعليًا أشد من الاختبار المعروض: يفشل عند غياب cbc:InvoicedQuantity أو إذا كانت قيمته النصية '0' تمامًا، ولا يقبل cbc:CreditedQuantity بديلًا (بينما يقبل الاختبار المعروض أيًّا منهما).",
"ar_fix": "أضف `<cbc:InvoicedQuantity>1.00</cbc:InvoicedQuantity>` إلى كل بند، ولا تكتب الكمية بالقيمة 0 المجردة.",
"applies_to": "all",
"fields": [
"BG-25",
"BT-129"
],
"url_en": "https://matheel.app/en/zatca-errors/br-22",
"url_ar": "https://matheel.app/akhta/br-22"
},
{
"id": "BR-24",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-24]-Each Invoice line (BG-25) shall have an Invoice line net amount (BT-131).",
"fails_when": "not(exists(cbc:LineExtensionAmount))",
"en_title": "Each invoice line needs a line net amount (BT-131)",
"ar_title": "يجب أن يحمل كل بند صافي مبلغ البند (BT-131)",
"en_meaning": "Checks that every cac:InvoiceLine (or cac:CreditNoteLine) contains a cbc:LineExtensionAmount element.",
"en_fix": "Add the line net amount to every line, e.g. `<cbc:LineExtensionAmount currencyID=\"SAR\">100.00</cbc:LineExtensionAmount>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:InvoiceLine (أو cac:CreditNoteLine) يحتوي على العنصر cbc:LineExtensionAmount.",
"ar_fix": "أضف صافي مبلغ البند إلى كل بند، مثل `<cbc:LineExtensionAmount currencyID=\"SAR\">100.00</cbc:LineExtensionAmount>`.",
"applies_to": "all",
"fields": [
"BG-25",
"BT-131"
],
"url_en": "https://matheel.app/en/zatca-errors/br-24",
"url_ar": "https://matheel.app/akhta/br-24"
},
{
"id": "BR-25",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-25]-Each Invoice line (BG-25) shall contain the Item name (BT-153).",
"fails_when": "not((cac:Item/cbc:Name) != '')",
"en_title": "Each invoice line needs an item name (BT-153)",
"ar_title": "يجب أن يحمل كل بند اسم الصنف (BT-153)",
"en_meaning": "Checks that every cac:InvoiceLine (or cac:CreditNoteLine) has cac:Item/cbc:Name with a non-empty value.",
"en_fix": "Inside each line's cac:Item add a non-empty name, e.g. `<cac:Item><cbc:Name>Item name</cbc:Name></cac:Item>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:InvoiceLine (أو cac:CreditNoteLine) يحتوي على cac:Item/cbc:Name بقيمة غير فارغة.",
"ar_fix": "داخل العنصر cac:Item في كل بند أضف اسمًا غير فارغ، مثل `<cac:Item><cbc:Name>Item name</cbc:Name></cac:Item>`.",
"applies_to": "all",
"fields": [
"BG-25",
"BT-153"
],
"url_en": "https://matheel.app/en/zatca-errors/br-25",
"url_ar": "https://matheel.app/akhta/br-25"
},
{
"id": "BR-26",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-26]-Each Invoice line (BG-25) shall contain the Item net price (BT-146).",
"fails_when": "not(exists(cac:Price/cbc:PriceAmount))",
"en_title": "Each invoice line needs an item net price (BT-146)",
"ar_title": "يجب أن يحمل كل بند صافي سعر الصنف (BT-146)",
"en_meaning": "Checks that every cac:InvoiceLine (or cac:CreditNoteLine) contains cac:Price/cbc:PriceAmount.",
"en_fix": "Add the net price to every line, e.g. `<cac:Price><cbc:PriceAmount currencyID=\"SAR\">100.00</cbc:PriceAmount></cac:Price>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:InvoiceLine (أو cac:CreditNoteLine) يحتوي على cac:Price/cbc:PriceAmount.",
"ar_fix": "أضف صافي السعر إلى كل بند، مثل `<cac:Price><cbc:PriceAmount currencyID=\"SAR\">100.00</cbc:PriceAmount></cac:Price>`.",
"applies_to": "all",
"fields": [
"BG-25",
"BT-146"
],
"url_en": "https://matheel.app/en/zatca-errors/br-26",
"url_ar": "https://matheel.app/akhta/br-26"
},
{
"id": "BR-31",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-31]-Each Document level allowance (BG-20) shall have a Document level allowance amount (BT-92).",
"fails_when": "not(exists(cbc:Amount))",
"en_title": "Each document-level allowance needs an amount (BT-92)",
"ar_title": "يجب أن يحمل كل خصم على مستوى المستند مبلغًا (BT-92)",
"en_meaning": "Applies only when the document has a document-level cac:AllowanceCharge with cbc:ChargeIndicator = false (an allowance); each such element must contain cbc:Amount.",
"en_fix": "Add the allowance amount inside each document-level allowance, e.g. `<cbc:Amount currencyID=\"SAR\">10.00</cbc:Amount>`.",
"ar_meaning": "تنطبق القاعدة فقط عند وجود عنصر cac:AllowanceCharge على مستوى المستند وقيمة cbc:ChargeIndicator فيه false (أي خصم)؛ ويجب أن يحتوي كل عنصر منها على cbc:Amount.",
"ar_fix": "أضف مبلغ الخصم داخل كل خصم على مستوى المستند، مثل `<cbc:Amount currencyID=\"SAR\">10.00</cbc:Amount>`.",
"applies_to": "conditional",
"fields": [
"BG-20",
"BT-92"
],
"url_en": "https://matheel.app/en/zatca-errors/br-31",
"url_ar": "https://matheel.app/akhta/br-31"
},
{
"id": "BR-32",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-32]-Each Document level allowance (BG-20) shall have a Document level allowance VAT category code (BT-95).",
"fails_when": "not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID) and (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID) !='')",
"en_title": "Each document-level allowance needs a VAT category code (BT-95)",
"ar_title": "يجب أن يحمل كل خصم على مستوى المستند رمز فئة الضريبة (BT-95)",
"en_meaning": "Applies only to document-level cac:AllowanceCharge elements with cbc:ChargeIndicator = false; each must contain a cac:TaxCategory whose cac:TaxScheme/cbc:ID is 'VAT' and whose own cbc:ID is not empty.",
"en_fix": "Inside each document-level allowance add a VAT category, e.g. `<cac:TaxCategory><cbc:ID>S</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>`.",
"ar_meaning": "تنطبق القاعدة فقط على عناصر cac:AllowanceCharge على مستوى المستند التي تكون فيها cbc:ChargeIndicator بقيمة false؛ ويجب أن يحتوي كل منها على cac:TaxCategory تكون فيه قيمة cac:TaxScheme/cbc:ID هي 'VAT' وقيمة cbc:ID الخاص به غير فارغة.",
"ar_fix": "داخل كل خصم على مستوى المستند أضف فئة الضريبة، مثل `<cac:TaxCategory><cbc:ID>S</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>`.",
"applies_to": "conditional",
"fields": [
"BG-20",
"BT-95"
],
"url_en": "https://matheel.app/en/zatca-errors/br-32",
"url_ar": "https://matheel.app/akhta/br-32"
},
{
"id": "BR-36",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-36]-Each Document level charge (BG-21) shall have a Document level charge amount (BT-99).",
"fails_when": "(not (exists(./cbc:Amount)))",
"en_title": "Each document-level charge needs an amount (BT-99)",
"ar_title": "يجب أن تحمل كل رسوم إضافية على مستوى المستند مبلغًا (BT-99)",
"en_meaning": "Applies only to document-level cac:AllowanceCharge elements with cbc:ChargeIndicator = true (a charge); the validator checks that each contains cbc:Amount. The test text published with the rule is malformed (it looks for lower-case cbc:amount via an absolute path), but the condition actually executed is the presence of cbc:Amount, matching the official message.",
"en_fix": "Add the charge amount inside each document-level charge, e.g. `<cbc:Amount currencyID=\"SAR\">10.00</cbc:Amount>`.",
"ar_meaning": "تنطبق القاعدة فقط على عناصر cac:AllowanceCharge على مستوى المستند التي تكون فيها cbc:ChargeIndicator بقيمة true (أي رسوم إضافية)؛ ويتحقق المدقق من أن كلًّا منها يحتوي على cbc:Amount. نص الاختبار المنشور مع القاعدة معيب (يبحث عن cbc:amount بحرف صغير عبر مسار مطلق)، لكن الشرط المنفَّذ فعليًا هو وجود cbc:Amount، بما يطابق الرسالة الرسمية.",
"ar_fix": "أضف مبلغ الرسوم داخل كل رسوم إضافية على مستوى المستند، مثل `<cbc:Amount currencyID=\"SAR\">10.00</cbc:Amount>`.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-99"
],
"url_en": "https://matheel.app/en/zatca-errors/br-36",
"url_ar": "https://matheel.app/akhta/br-36"
},
{
"id": "BR-37",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-37]-Each Document level charge (BG-21) shall have a Document level charge VAT category code (BT-102).",
"fails_when": "not(exists(cac:TaxCategory/cbc:ID))",
"en_title": "Each document-level charge needs a VAT category code (BT-102)",
"ar_title": "رمز فئة الضريبة (BT-102) إلزامي لكل رسوم على مستوى المستند",
"en_meaning": "Applies only to document-level cac:AllowanceCharge elements with cbc:ChargeIndicator = true; the validator checks that each contains cac:TaxCategory/cbc:ID. The published test text is malformed (it uses an undeclared cvc: prefix and an absolute path); the executed check is the presence of cac:TaxCategory/cbc:ID, matching the official message.",
"en_fix": "Inside each document-level charge add a tax category with an ID, e.g. `<cac:TaxCategory><cbc:ID>S</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>`.",
"ar_meaning": "تنطبق القاعدة فقط على عناصر cac:AllowanceCharge على مستوى المستند التي تكون فيها cbc:ChargeIndicator بقيمة true؛ ويتحقق المدقق من أن كلًّا منها يحتوي على cac:TaxCategory/cbc:ID. نص الاختبار المنشور معيب (يستخدم البادئة cvc: غير المعرّفة ومسارًا مطلقًا)، والفحص المنفَّذ فعليًا هو وجود cac:TaxCategory/cbc:ID، بما يطابق الرسالة الرسمية.",
"ar_fix": "داخل كل رسوم إضافية على مستوى المستند أضف فئة ضريبة تحمل معرّفًا، مثل `<cac:TaxCategory><cbc:ID>S</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>`.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-102"
],
"url_en": "https://matheel.app/en/zatca-errors/br-37",
"url_ar": "https://matheel.app/akhta/br-37"
},
{
"id": "BR-41",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-41]-Each Invoice line allowance (BG-27) shall have an Invoice line allowance amount (BT-136).",
"fails_when": "not(exists(cbc:Amount))",
"en_title": "Each line-level allowance needs an amount (BT-136)",
"ar_title": "يجب أن يحمل كل خصم على مستوى البند مبلغًا (BT-136)",
"en_meaning": "Applies only when an invoice line has a cac:AllowanceCharge with cbc:ChargeIndicator = false (a line allowance); each such element must contain cbc:Amount.",
"en_fix": "Add the amount inside each line-level allowance, e.g. `<cbc:Amount currencyID=\"SAR\">5.00</cbc:Amount>`.",
"ar_meaning": "تنطبق القاعدة فقط عند وجود عنصر cac:AllowanceCharge داخل بند الفاتورة وقيمة cbc:ChargeIndicator فيه false (أي خصم على البند)؛ ويجب أن يحتوي كل عنصر منها على cbc:Amount.",
"ar_fix": "أضف المبلغ داخل كل خصم على مستوى البند، مثل `<cbc:Amount currencyID=\"SAR\">5.00</cbc:Amount>`.",
"applies_to": "conditional",
"fields": [
"BG-27",
"BT-136"
],
"url_en": "https://matheel.app/en/zatca-errors/br-41",
"url_ar": "https://matheel.app/akhta/br-41"
},
{
"id": "BR-43",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-43]-Each Invoice line charge (BG-28) shall have an Invoice line charge amount (BT-141).",
"fails_when": "(not (exists(./cbc:Amount)))",
"en_title": "Each line-level charge needs an amount (BT-141)",
"ar_title": "يجب أن تحمل كل رسوم إضافية على مستوى البند مبلغًا (BT-141)",
"en_meaning": "Applies only to cac:InvoiceLine/cac:AllowanceCharge elements with cbc:ChargeIndicator = true (a line charge); the validator checks that each contains cbc:Amount. The published test text is malformed (lower-case cbc:amount via an absolute path), but the executed condition is the presence of cbc:Amount, matching the official message.",
"en_fix": "Add the amount inside each line-level charge, e.g. `<cbc:Amount currencyID=\"SAR\">5.00</cbc:Amount>`.",
"ar_meaning": "تنطبق القاعدة فقط على عناصر cac:InvoiceLine/cac:AllowanceCharge التي تكون فيها cbc:ChargeIndicator بقيمة true (أي رسوم على البند)؛ ويتحقق المدقق من أن كلًّا منها يحتوي على cbc:Amount. نص الاختبار المنشور معيب (يبحث عن cbc:amount بحرف صغير عبر مسار مطلق)، لكن الشرط المنفَّذ فعليًا هو وجود cbc:Amount، بما يطابق الرسالة الرسمية.",
"ar_fix": "أضف المبلغ داخل كل رسوم إضافية على مستوى البند، مثل `<cbc:Amount currencyID=\"SAR\">5.00</cbc:Amount>`.",
"applies_to": "conditional",
"fields": [
"BG-28",
"BT-141"
],
"url_en": "https://matheel.app/en/zatca-errors/br-43",
"url_ar": "https://matheel.app/akhta/br-43"
},
{
"id": "BR-45",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-45]-Each VAT breakdown (BG-23) shall have a VAT category taxable amount (BT-116).",
"fails_when": "not(exists(cbc:TaxableAmount))",
"en_title": "Each VAT breakdown needs a taxable amount (BT-116)",
"ar_title": "يجب أن يحمل كل تفصيل ضريبي المبلغ الخاضع للضريبة (BT-116)",
"en_meaning": "Checks that every cac:TaxTotal/cac:TaxSubtotal under ubl:Invoice contains cbc:TaxableAmount.",
"en_fix": "Add the taxable amount inside each cac:TaxSubtotal, e.g. `<cbc:TaxableAmount currencyID=\"SAR\">100.00</cbc:TaxableAmount>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:TaxTotal/cac:TaxSubtotal تحت ubl:Invoice يحتوي على cbc:TaxableAmount.",
"ar_fix": "أضف المبلغ الخاضع للضريبة داخل كل cac:TaxSubtotal، مثل `<cbc:TaxableAmount currencyID=\"SAR\">100.00</cbc:TaxableAmount>`.",
"applies_to": "all",
"fields": [
"BG-23",
"BT-116"
],
"url_en": "https://matheel.app/en/zatca-errors/br-45",
"url_ar": "https://matheel.app/akhta/br-45"
},
{
"id": "BR-46",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-46]-Each VAT breakdown (BG-23) shall have a VAT category tax amount (BT-117).",
"fails_when": "not(exists(cbc:TaxAmount))",
"en_title": "Each VAT breakdown needs a VAT amount (BT-117)",
"ar_title": "يجب أن يحمل كل تفصيل ضريبي مبلغ الضريبة (BT-117)",
"en_meaning": "Checks that every cac:TaxTotal/cac:TaxSubtotal under ubl:Invoice contains cbc:TaxAmount.",
"en_fix": "Add the VAT amount inside each cac:TaxSubtotal, e.g. `<cbc:TaxAmount currencyID=\"SAR\">15.00</cbc:TaxAmount>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:TaxTotal/cac:TaxSubtotal تحت ubl:Invoice يحتوي على cbc:TaxAmount.",
"ar_fix": "أضف مبلغ الضريبة داخل كل cac:TaxSubtotal، مثل `<cbc:TaxAmount currencyID=\"SAR\">15.00</cbc:TaxAmount>`.",
"applies_to": "all",
"fields": [
"BG-23",
"BT-117"
],
"url_en": "https://matheel.app/en/zatca-errors/br-46",
"url_ar": "https://matheel.app/akhta/br-46"
},
{
"id": "BR-47",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-47]-Each VAT breakdown (BG-23) shall be defined through a VAT category code (BT-118).",
"fails_when": "not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID))",
"en_title": "Each VAT breakdown needs a VAT category code (BT-118)",
"ar_title": "يجب أن يحمل كل تفصيل ضريبي رمز فئة الضريبة (BT-118)",
"en_meaning": "Checks that every cac:TaxTotal/cac:TaxSubtotal under ubl:Invoice contains a cac:TaxCategory whose cac:TaxScheme/cbc:ID is 'VAT' and which has a cbc:ID.",
"en_fix": "Inside each cac:TaxSubtotal add `<cac:TaxCategory><cbc:ID>S</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` with the category code that applies.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:TaxTotal/cac:TaxSubtotal تحت ubl:Invoice يحتوي على cac:TaxCategory تكون فيه قيمة cac:TaxScheme/cbc:ID هي 'VAT' ويحمل العنصر cbc:ID.",
"ar_fix": "داخل كل cac:TaxSubtotal أضف `<cac:TaxCategory><cbc:ID>S</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` مع رمز الفئة المنطبق.",
"applies_to": "all",
"fields": [
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-47",
"url_ar": "https://matheel.app/akhta/br-47"
},
{
"id": "BR-48",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-48]-Each VAT breakdown (BG-23) shall have a VAT category rate (BT-119), except if the Invoice is not subject to VAT.",
"fails_when": "not(exists(cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:Percent) or (cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/normalize-space(cbc:ID)='O'))",
"en_title": "Each VAT breakdown needs a VAT rate (BT-119) unless category is O",
"ar_title": "نسبة الضريبة (BT-119) إلزامية في كل تفصيل ضريبي إلا للفئة O",
"en_meaning": "Checks that the VAT cac:TaxCategory in every cac:TaxTotal/cac:TaxSubtotal under ubl:Invoice contains cbc:Percent; the only exception is when that category's cbc:ID is 'O' (not subject to VAT).",
"en_fix": "Add the rate inside the subtotal's cac:TaxCategory, e.g. `<cbc:Percent>15.00</cbc:Percent>`; it may be omitted only when the category cbc:ID is O.",
"ar_meaning": "تتحقق القاعدة من أن فئة الضريبة cac:TaxCategory في كل عنصر cac:TaxTotal/cac:TaxSubtotal تحت ubl:Invoice تحتوي على cbc:Percent؛ والاستثناء الوحيد عندما تكون قيمة cbc:ID للفئة 'O' (غير خاضع للضريبة).",
"ar_fix": "أضف النسبة داخل cac:TaxCategory في التفصيل الضريبي، مثل `<cbc:Percent>15.00</cbc:Percent>`؛ ويجوز حذفها فقط عندما تكون قيمة cbc:ID للفئة O.",
"applies_to": "all",
"fields": [
"BG-23",
"BT-119"
],
"url_en": "https://matheel.app/en/zatca-errors/br-48",
"url_ar": "https://matheel.app/akhta/br-48"
},
{
"id": "BR-49",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-49]-A Payment instruction (BG-16) shall specify the Payment means type code (BT-81).",
"fails_when": "boolean(//*[matches(@name, '01\\d{5}')]) and not(exists(cbc:PaymentMeansCode))",
"en_title": "Payment means must state a payment means code (BT-81)",
"ar_title": "يجب أن تتضمن وسيلة الدفع رمز وسيلة الدفع (BT-81)",
"en_meaning": "Checks that each cac:PaymentMeans contains cbc:PaymentMeansCode. As executed, the check only runs when the document contains a @name attribute matching '01' followed by five digits, i.e. a standard tax invoice subtype on cbc:InvoiceTypeCode (e.g. name=\"0100000\"); the official text and displayed test do not mention this condition.",
"en_fix": "Add a UNCL4461 code (see BR-CL-16) inside each cac:PaymentMeans, e.g. `<cac:PaymentMeans><cbc:PaymentMeansCode>10</cbc:PaymentMeansCode></cac:PaymentMeans>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:PaymentMeans يحتوي على cbc:PaymentMeansCode. وفق التنفيذ الفعلي، لا يجري الفحص إلا إذا احتوى المستند على سمة @name تطابق '01' متبوعة بخمسة أرقام، أي نوع فرعي لفاتورة ضريبية قياسية في cbc:InvoiceTypeCode (مثل name=\"0100000\")؛ ولا يذكر النص الرسمي ولا الاختبار المعروض هذا الشرط.",
"ar_fix": "أضف رمزًا من قائمة UNCL4461 (انظر BR-CL-16) داخل كل cac:PaymentMeans، مثل `<cac:PaymentMeans><cbc:PaymentMeansCode>10</cbc:PaymentMeansCode></cac:PaymentMeans>`.",
"applies_to": "standard",
"fields": [
"BG-16",
"BT-81"
],
"url_en": "https://matheel.app/en/zatca-errors/br-49",
"url_ar": "https://matheel.app/akhta/br-49"
},
{
"id": "BR-52",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-52]-Each Additional supporting document (BG-24) shall contain a Supporting document reference (BT-122).",
"fails_when": "not((cbc:ID) != '')",
"en_title": "Each additional document reference needs an ID (BT-122)",
"ar_title": "يجب أن يحمل كل مرجع لمستند إضافي معرّفًا (BT-122)",
"en_meaning": "Checks that every cac:AdditionalDocumentReference has a non-empty cbc:ID.",
"en_fix": "Give each cac:AdditionalDocumentReference a non-empty cbc:ID; in the official samples these are values such as `<cbc:ID>ICV</cbc:ID>`, `<cbc:ID>PIH</cbc:ID>` and `<cbc:ID>QR</cbc:ID>`.",
"ar_meaning": "تتحقق القاعدة من أن كل عنصر cac:AdditionalDocumentReference يحتوي على cbc:ID غير فارغ.",
"ar_fix": "أعطِ كل عنصر cac:AdditionalDocumentReference قيمة cbc:ID غير فارغة؛ وفي النماذج الرسمية تكون قيمًا مثل `<cbc:ID>ICV</cbc:ID>` و`<cbc:ID>PIH</cbc:ID>` و`<cbc:ID>QR</cbc:ID>`.",
"applies_to": "all",
"fields": [
"BG-24",
"BT-122"
],
"url_en": "https://matheel.app/en/zatca-errors/br-52",
"url_ar": "https://matheel.app/akhta/br-52"
},
{
"id": "BR-53",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-53]-If the VAT accounting currency code (BT-6) is present, then the Invoice total VAT amount in accounting currency (BT-111) shall be provided.",
"fails_when": "(exists(cbc:TaxCurrencyCode) and not(every $taxcurrency in ./cac:TaxTotal[not(cac:TaxSubtotal)]/cbc:TaxAmount/@currencyID satisfies $taxcurrency = cbc:TaxCurrencyCode)) or (exists(cbc:TaxCurrencyCode) and not(every $taxamount in ./cac:TaxTotal[not(cac:TaxSubtotal)] satisfies exists($taxamount/cbc:TaxAmount)))",
"en_title": "With a tax currency (BT-6), give the VAT total in it (BT-111)",
"ar_title": "مع عملة الضريبة (BT-6) يُذكر إجمالي الضريبة بها (BT-111)",
"en_meaning": "Applies only when cbc:TaxCurrencyCode is present. As executed, it fails if any cac:TaxTotal that has no cac:TaxSubtotal lacks cbc:TaxAmount, or has a cbc:TaxAmount whose @currencyID differs from cbc:TaxCurrencyCode. The displayed test is the failure condition (not a pass condition) and considers every cac:TaxTotal; the executed check looks only at cac:TaxTotal elements without subtotals and does not fail when none exists.",
"en_fix": "When you set cbc:TaxCurrencyCode, add a cac:TaxTotal without subtotals whose amount uses that currency, e.g. with SAR: `<cac:TaxTotal><cbc:TaxAmount currencyID=\"SAR\">15.00</cbc:TaxAmount></cac:TaxTotal>`.",
"ar_meaning": "تنطبق القاعدة فقط عند وجود cbc:TaxCurrencyCode. وفق التنفيذ الفعلي، تفشل إذا وُجد عنصر cac:TaxTotal لا يحتوي على cac:TaxSubtotal وكان خاليًا من cbc:TaxAmount، أو كانت قيمة @currencyID في cbc:TaxAmount مختلفة عن cbc:TaxCurrencyCode. الاختبار المعروض هو شرط الفشل (لا شرط النجاح) ويشمل كل عناصر cac:TaxTotal، بينما يقتصر الفحص المنفَّذ على عناصر cac:TaxTotal التي لا تحتوي تفاصيل ضريبية، ولا يفشل إذا لم يوجد أي منها.",
"ar_fix": "عند تحديد cbc:TaxCurrencyCode أضف عنصر cac:TaxTotal دون تفاصيل ضريبية يكون مبلغه بتلك العملة، مثلًا مع SAR: `<cac:TaxTotal><cbc:TaxAmount currencyID=\"SAR\">15.00</cbc:TaxAmount></cac:TaxTotal>`.",
"applies_to": "conditional",
"fields": [
"BT-6",
"BT-111"
],
"url_en": "https://matheel.app/en/zatca-errors/br-53",
"url_ar": "https://matheel.app/akhta/br-53"
},
{
"id": "BR-54",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-54]-Each Item attribute (BG-32) shall contain an Item attribute name (BT-160) and an Item attribute value (BT-161).",
"fails_when": "not(exists(cbc:Name) and exists(cbc:Value))",
"en_title": "Each item attribute needs a name (BT-160) and a value (BT-161)",
"ar_title": "يجب أن تحمل كل خاصية صنف اسمًا (BT-160) وقيمة (BT-161)",
"en_meaning": "Applies only when cac:AdditionalItemProperty is used; every such element must contain both cbc:Name and cbc:Value.",
"en_fix": "Give each item property both children, e.g. `<cac:AdditionalItemProperty><cbc:Name>Colour</cbc:Name><cbc:Value>Black</cbc:Value></cac:AdditionalItemProperty>`.",
"ar_meaning": "تنطبق القاعدة فقط عند استخدام cac:AdditionalItemProperty؛ ويجب أن يحتوي كل عنصر منها على cbc:Name وcbc:Value معًا.",
"ar_fix": "أعطِ كل خاصية صنف العنصرين معًا، مثل `<cac:AdditionalItemProperty><cbc:Name>Colour</cbc:Name><cbc:Value>Black</cbc:Value></cac:AdditionalItemProperty>`.",
"applies_to": "conditional",
"fields": [
"BG-32",
"BT-160",
"BT-161"
],
"url_en": "https://matheel.app/en/zatca-errors/br-54",
"url_ar": "https://matheel.app/akhta/br-54"
},
{
"id": "BR-55",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-55]-Each Preceding Invoice reference (BG-3) shall contain a Preceding Invoice reference (BT-25).",
"fails_when": "not(exists(cac:InvoiceDocumentReference/cbc:ID) and (cac:InvoiceDocumentReference/cbc:ID) !='')",
"en_title": "A billing reference must give the preceding invoice number (BT-25)",
"ar_title": "يجب أن يتضمن مرجع الفوترة رقم الفاتورة السابقة (BT-25)",
"en_meaning": "Applies only when cac:BillingReference is present; each must contain cac:InvoiceDocumentReference/cbc:ID with a non-empty value.",
"en_fix": "Inside each billing reference put the referenced invoice number: `<cac:BillingReference><cac:InvoiceDocumentReference><cbc:ID>INV-0001</cbc:ID></cac:InvoiceDocumentReference></cac:BillingReference>`.",
"ar_meaning": "تنطبق القاعدة فقط عند وجود cac:BillingReference؛ ويجب أن يحتوي كل منها على cac:InvoiceDocumentReference/cbc:ID بقيمة غير فارغة.",
"ar_fix": "داخل كل مرجع فوترة ضع رقم الفاتورة المشار إليها: `<cac:BillingReference><cac:InvoiceDocumentReference><cbc:ID>INV-0001</cbc:ID></cac:InvoiceDocumentReference></cac:BillingReference>`.",
"applies_to": "conditional",
"fields": [
"BG-3",
"BT-25"
],
"url_en": "https://matheel.app/en/zatca-errors/br-55",
"url_ar": "https://matheel.app/akhta/br-55"
},
{
"id": "BR-CL-01",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CL-01]-The document type code MUST be coded by the invoice and credit note related code lists of UNTDID 1001.",
"fails_when": "not((self::cbc:InvoiceTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 80 82 84 130 202 203 204 211 295 325 326 380 381 383 384 385 386 387 388 389 390 393 394 395 456 457 527 575 623 633 751 780 935 ', concat(' ', normalize-space(.), ' '))))) or (self::cbc:CreditNoteTypeCode and ((not(contains(normalize-space(.), ' ')) and contains(' 81 83 261 262 296 308 396 420 458 532 ', concat(' ', normalize-space(.), ' '))))))",
"en_title": "Invoice type code must be a valid UNTDID 1001 code",
"ar_title": "يجب أن يكون رمز نوع الفاتورة من قائمة UNTDID 1001",
"en_meaning": "Checks that the value of cbc:InvoiceTypeCode (or cbc:CreditNoteTypeCode) is a single code, without spaces, from the UNTDID 1001 subset listed in the rule; for cbc:InvoiceTypeCode the list includes 388, 381 and 383, which the official samples use for invoices, credit notes and debit notes.",
"en_fix": "Use one of the listed codes as the element value, e.g. `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>`, with no extra spaces or text.",
"ar_meaning": "تتحقق القاعدة من أن قيمة cbc:InvoiceTypeCode (أو cbc:CreditNoteTypeCode) رمز واحد دون مسافات من مجموعة رموز UNTDID 1001 المذكورة في القاعدة؛ وتشمل القائمة الخاصة بـ cbc:InvoiceTypeCode الرموز 388 و381 و383 التي تستخدمها النماذج الرسمية للفاتورة والإشعار الدائن والإشعار المدين.",
"ar_fix": "استخدم أحد الرموز المذكورة قيمةً للعنصر، مثل `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>`، دون مسافات أو نص إضافي.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-01",
"url_ar": "https://matheel.app/akhta/br-cl-01"
},
{
"id": "BR-CL-03",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CL-03]-currencyID MUST be coded using ISO code list 4217 alpha-3",
"fails_when": "string-length(@currencyID) > 0 and not(((not(contains(normalize-space(@currencyID), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(@currencyID), ' ')))))",
"en_title": "Amount currencyID must be an ISO 4217 alpha-3 code",
"ar_title": "يجب أن تكون سمة currencyID للمبالغ رمزًا من ISO 4217",
"en_meaning": "Checks the @currencyID attribute on amount elements (cbc:Amount, cbc:BaseAmount, cbc:PriceAmount, cbc:TaxAmount, cbc:TaxableAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, cbc:TaxInclusiveAmount, cbc:AllowanceTotalAmount, cbc:ChargeTotalAmount, cbc:PrepaidAmount, cbc:PayableRoundingAmount, cbc:PayableAmount) against the ISO 4217 alpha-3 list in the rule (which includes SAR). As executed, the check is skipped when @currencyID is empty or absent, which the displayed test does not show.",
"en_fix": "Set a valid three-letter ISO 4217 code on every amount, e.g. `<cbc:PayableAmount currencyID=\"SAR\">115.00</cbc:PayableAmount>`.",
"ar_meaning": "تتحقق القاعدة من السمة @currencyID على عناصر المبالغ (cbc:Amount وcbc:BaseAmount وcbc:PriceAmount وcbc:TaxAmount وcbc:TaxableAmount وcbc:LineExtensionAmount وcbc:TaxExclusiveAmount وcbc:TaxInclusiveAmount وcbc:AllowanceTotalAmount وcbc:ChargeTotalAmount وcbc:PrepaidAmount وcbc:PayableRoundingAmount وcbc:PayableAmount) مقابل قائمة ISO 4217 الثلاثية الواردة في القاعدة (وتشمل SAR). وفق التنفيذ الفعلي، يُتجاوز الفحص إذا كانت @currencyID فارغة أو غير موجودة، وهو ما لا يظهر في الاختبار المعروض.",
"ar_fix": "ضع رمزًا ثلاثيًا صحيحًا من ISO 4217 على كل مبلغ، مثل `<cbc:PayableAmount currencyID=\"SAR\">115.00</cbc:PayableAmount>`.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-03",
"url_ar": "https://matheel.app/akhta/br-cl-03"
},
{
"id": "BR-CL-04",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CL-04]-Invoice currency code MUST be coded using ISO code list 4217 alpha-3",
"fails_when": "not(((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' ')))))",
"en_title": "Invoice currency code must be an ISO 4217 alpha-3 code",
"ar_title": "يجب أن يكون رمز عملة الفاتورة من ISO 4217",
"en_meaning": "Checks that cbc:DocumentCurrencyCode is a single ISO 4217 alpha-3 code, without spaces, from the list in the rule (which includes SAR).",
"en_fix": "Use a valid three-letter code, e.g. `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`.",
"ar_meaning": "تتحقق القاعدة من أن cbc:DocumentCurrencyCode رمز واحد دون مسافات من قائمة ISO 4217 الثلاثية الواردة في القاعدة (وتشمل SAR).",
"ar_fix": "استخدم رمزًا ثلاثيًا صحيحًا، مثل `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-04",
"url_ar": "https://matheel.app/akhta/br-cl-04"
},
{
"id": "BR-CL-05",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CL-05]-Tax currency code MUST be coded using ISO code list 4217 alpha-3",
"fails_when": "not(((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' ')))))",
"en_title": "Tax currency code must be an ISO 4217 alpha-3 code",
"ar_title": "يجب أن يكون رمز عملة الضريبة من ISO 4217",
"en_meaning": "Applies when cbc:TaxCurrencyCode is present; its value must be a single ISO 4217 alpha-3 code, without spaces, from the list in the rule (which includes SAR).",
"en_fix": "Use a valid three-letter code, e.g. `<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>`.",
"ar_meaning": "تنطبق القاعدة عند وجود cbc:TaxCurrencyCode؛ ويجب أن تكون قيمته رمزًا واحدًا دون مسافات من قائمة ISO 4217 الثلاثية الواردة في القاعدة (وتشمل SAR).",
"ar_fix": "استخدم رمزًا ثلاثيًا صحيحًا، مثل `<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>`.",
"applies_to": "conditional",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-05",
"url_ar": "https://matheel.app/akhta/br-cl-05"
},
{
"id": "BR-CL-14",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CL-14]-Country codes in an invoice MUST be coded using ISO code list 3166-1",
"fails_when": "not(((not(contains(normalize-space(.), ' ')) and contains(' 1A AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XI YE YT ZA ZM ZW ', concat(' ', normalize-space(.), ' ')))))",
"en_title": "Country codes must be ISO 3166-1 alpha-2 codes",
"ar_title": "يجب أن تكون رموز الدول من ISO 3166-1",
"en_meaning": "Checks every cac:Country/cbc:IdentificationCode in the document (seller, buyer or any other address) against the two-character country list in the rule, which is ISO 3166-1 alpha-2 plus 1A and XI and includes SA.",
"en_fix": "Use a two-letter code from the list, without spaces, e.g. `<cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country>`.",
"ar_meaning": "تتحقق القاعدة من كل عنصر cac:Country/cbc:IdentificationCode في المستند (للبائع أو المشتري أو أي عنوان آخر) مقابل قائمة رموز الدول الثنائية الواردة في القاعدة، وهي ISO 3166-1 alpha-2 مضافًا إليها 1A وXI، وتشمل SA.",
"ar_fix": "استخدم رمزًا ثنائيًا من القائمة دون مسافات، مثل `<cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country>`.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-14",
"url_ar": "https://matheel.app/akhta/br-cl-14"
},
{
"id": "BR-CL-16",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CL-16]-Payment means in an invoice MUST be coded using UNCL4461 code list",
"fails_when": "not(( ( not(contains(normalize-space(.),' ')) and contains( ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 74 75 76 77 78 91 92 93 94 95 96 97 ZZZ ',concat(' ',normalize-space(.),' ') ) ) ))",
"en_title": "Payment means code must be from the UNCL4461 list",
"ar_title": "يجب أن يكون رمز وسيلة الدفع من قائمة UNCL4461",
"en_meaning": "Applies when cac:PaymentMeans/cbc:PaymentMeansCode is present; its value must be one code from the list in the rule: 1 to 70, 74 to 78, 91 to 97, or ZZZ.",
"en_fix": "Use one of the allowed codes with no spaces, e.g. `<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>`.",
"ar_meaning": "تنطبق القاعدة عند وجود cac:PaymentMeans/cbc:PaymentMeansCode؛ ويجب أن تكون قيمته رمزًا واحدًا من القائمة الواردة في القاعدة: من 1 إلى 70، ومن 74 إلى 78، ومن 91 إلى 97، أو ZZZ.",
"ar_fix": "استخدم أحد الرموز المسموح بها دون مسافات، مثل `<cbc:PaymentMeansCode>10</cbc:PaymentMeansCode>`.",
"applies_to": "conditional",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-16",
"url_ar": "https://matheel.app/akhta/br-cl-16"
},
{
"id": "BR-CL-18",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CL-18]-Invoice tax categories MUST be coded using UNCL5305 code list.",
"fails_when": "not(( ( not(contains(normalize-space(.),' ')) and contains( ' AE L M E S Z G O K B ',concat(' ',normalize-space(.),' ') ) ) ))",
"en_title": "Tax category codes must come from the UNCL5305 code list",
"ar_title": "رموز فئات الضريبة يجب أن تكون من قائمة UNCL5305",
"en_meaning": "Every tax category code (cbc:ID under cac:TaxCategory in cac:TaxSubtotal and cac:AllowanceCharge, and under cac:Item/cac:ClassifiedTaxCategory on lines) must be a single code from AE, L, M, E, S, Z, G, O, K, B.",
"en_fix": "Use one of AE, L, M, E, S, Z, G, O, K, B with no spaces, e.g. `<cbc:ID>S</cbc:ID>`. Note that BR-KSA-18 narrows this further to S, Z, E or O.",
"ar_meaning": "يتحقق من أن كل رمز فئة ضريبة (cbc:ID داخل cac:TaxCategory في cac:TaxSubtotal و cac:AllowanceCharge، وداخل cac:Item/cac:ClassifiedTaxCategory في البنود) رمز واحد من: AE, L, M, E, S, Z, G, O, K, B.",
"ar_fix": "استخدم أحد الرموز AE, L, M, E, S, Z, G, O, K, B دون مسافات، مثل `<cbc:ID>S</cbc:ID>`. لاحظ أن القاعدة BR-KSA-18 تحصر القيم المقبولة في S أو Z أو E أو O.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-18",
"url_ar": "https://matheel.app/akhta/br-cl-18"
},
{
"id": "BR-CL-KSA-14",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[KSA-14]Field character limit for QR Code field has been exceeded. The maximum character limit for this field is 1000 characters.",
"fails_when": "exists(cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) and (string-length(cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) > 1000 or string-length(cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) < 1)",
"en_title": "The QR code value must be 1 to 1000 characters long",
"ar_title": "قيمة رمز QR يجب أن تكون بين 1 و1000 حرف",
"en_meaning": "Applies only when the QR element exists: the content of cac:AdditionalDocumentReference with cbc:ID = 'QR' / cac:Attachment / cbc:EmbeddedDocumentBinaryObject must be at least 1 and at most 1000 characters. (The rule's test text is written as the failure condition: it fires when the length is over 1000 or under 1.)",
"en_fix": "Keep the Base64 QR value in cbc:EmbeddedDocumentBinaryObject non-empty and no longer than 1000 characters.",
"ar_meaning": "تنطبق فقط عند وجود عنصر QR: يجب أن يكون محتوى cbc:EmbeddedDocumentBinaryObject داخل cac:AdditionalDocumentReference ذي cbc:ID = 'QR' / cac:Attachment بين 1 و1000 حرف. (نص الاختبار في القاعدة مكتوب بصيغة شرط الخطأ: يُطلق الخطأ عندما يزيد الطول عن 1000 أو يقل عن 1.)",
"ar_fix": "اجعل قيمة QR بترميز Base64 في cbc:EmbeddedDocumentBinaryObject غير فارغة ولا تتجاوز 1000 حرف.",
"applies_to": "conditional",
"fields": [
"KSA-14"
],
"url_en": "https://matheel.app/en/zatca-errors/br-cl-ksa-14",
"url_ar": "https://matheel.app/akhta/br-cl-ksa-14"
},
{
"id": "BR-CO-04",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-04]-Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151).",
"fails_when": "not((cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/(normalize-space(upper-case(cbc:ID))='VAT')]/cbc:ID))",
"en_title": "Every invoice line needs a VAT category code",
"ar_title": "كل بند في الفاتورة يحتاج رمز فئة ضريبة القيمة المضافة",
"en_meaning": "Each cac:InvoiceLine (or cac:CreditNoteLine) must contain cac:Item/cac:ClassifiedTaxCategory with cac:TaxScheme/cbc:ID = 'VAT' and a cbc:ID holding the item's VAT category code (BT-151).",
"en_fix": "Inside each line's cac:Item add `<cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>15.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory>`, using the category code and rate that apply to the item.",
"ar_meaning": "يتحقق من أن كل cac:InvoiceLine (أو cac:CreditNoteLine) يحتوي على cac:Item/cac:ClassifiedTaxCategory بقيمة cac:TaxScheme/cbc:ID = 'VAT' وعلى cbc:ID يحمل رمز فئة ضريبة الصنف (BT-151).",
"ar_fix": "داخل cac:Item في كل بند أضف `<cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>15.00</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory>` مع رمز الفئة والنسبة المنطبقين على الصنف.",
"applies_to": "all",
"fields": [
"BG-25",
"BT-151"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-04",
"url_ar": "https://matheel.app/akhta/br-co-04"
},
{
"id": "BR-CO-10",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-10]-Sum of Invoice line net amount (BT-106) = Σ Invoice line net amount (BT-131).",
"fails_when": "not((xs:decimal(cbc:LineExtensionAmount) = xs:decimal(round(sum(//(cac:InvoiceLine|cac:CreditNoteLine)/xs:decimal(cbc:LineExtensionAmount)) * 10 * 10) div 100)))",
"en_title": "Total line amount must equal the sum of all line net amounts",
"ar_title": "إجمالي مبالغ البنود يجب أن يساوي مجموع صافي البنود",
"en_meaning": "cac:LegalMonetaryTotal/cbc:LineExtensionAmount (BT-106) must equal the sum of cbc:LineExtensionAmount (BT-131) across all cac:InvoiceLine / cac:CreditNoteLine elements, rounded to two decimals.",
"en_fix": "Set cac:LegalMonetaryTotal/cbc:LineExtensionAmount to the sum of every line's cbc:LineExtensionAmount, rounded to 2 decimals.",
"ar_meaning": "يتحقق من أن cac:LegalMonetaryTotal/cbc:LineExtensionAmount (BT-106) يساوي مجموع cbc:LineExtensionAmount (BT-131) لجميع عناصر cac:InvoiceLine أو cac:CreditNoteLine، مقرّباً إلى منزلتين عشريتين.",
"ar_fix": "اجعل قيمة cac:LegalMonetaryTotal/cbc:LineExtensionAmount مساوية لمجموع cbc:LineExtensionAmount في كل البنود، مقرّباً إلى منزلتين عشريتين.",
"applies_to": "all",
"fields": [
"BT-106",
"BT-131"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-10",
"url_ar": "https://matheel.app/akhta/br-co-10"
},
{
"id": "BR-CO-11",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-11]-Sum of allowances on document level (BT-107) = Σ Document level allowance amount (BT-92).",
"fails_when": "not(xs:decimal(cbc:AllowanceTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()])))",
"en_title": "Allowance total must equal the sum of document-level allowances",
"ar_title": "إجمالي الخصومات يجب أن يساوي مجموع خصومات مستوى المستند",
"en_meaning": "cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount (BT-107) must equal the sum of cbc:Amount (BT-92) of the document-level cac:AllowanceCharge elements with cbc:ChargeIndicator = false, rounded to two decimals. It also passes when there is neither an AllowanceTotalAmount nor any document-level allowance.",
"en_fix": "Set cbc:AllowanceTotalAmount to the rounded sum of all document-level allowance amounts, or omit it when the invoice has no document-level allowances.",
"ar_meaning": "يتحقق من أن cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount (BT-107) يساوي مجموع cbc:Amount (BT-92) لعناصر cac:AllowanceCharge على مستوى المستند التي فيها cbc:ChargeIndicator = false، مقرّباً إلى منزلتين عشريتين. وتنجح القاعدة أيضاً إذا لم يوجد AllowanceTotalAmount ولا أي خصم على مستوى المستند.",
"ar_fix": "اجعل cbc:AllowanceTotalAmount مساوياً لمجموع مبالغ خصومات مستوى المستند بعد التقريب، أو احذفه إذا لم تحتوِ الفاتورة على خصومات على مستوى المستند.",
"applies_to": "all",
"fields": [
"BT-107",
"BT-92"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-11",
"url_ar": "https://matheel.app/akhta/br-co-11"
},
{
"id": "BR-CO-12",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-12]-Sum of charges on document level (BT-108) = Σ Document level charge amount (BT-99).",
"fails_when": "not(xs:decimal(cbc:AllowanceTotalAmount) = (round(sum(../cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount)) * 10 * 10) div 100) or (not(cbc:AllowanceTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=false()])))",
"en_title": "Charge total must equal the sum of document-level charges",
"ar_title": "إجمالي الرسوم يجب أن يساوي مجموع رسوم مستوى المستند",
"en_meaning": "In SDK 3.4.8 the executed check compares cac:LegalMonetaryTotal/cbc:ChargeTotalAmount (BT-108) with the sum of cbc:Amount (BT-99) of document-level cac:AllowanceCharge elements with cbc:ChargeIndicator = true, rounded to two decimals; it passes if both are absent and fails if ChargeTotalAmount is present but empty. The rule's listed test text is a copy of the allowance formula (BR-CO-11) and does not match the official message.",
"en_fix": "Set cbc:ChargeTotalAmount to the rounded sum of all document-level charge amounts, or omit the element entirely when there are no document-level charges (do not leave it empty).",
"ar_meaning": "في الإصدار SDK 3.4.8 يقارن الفحص الفعلي قيمة cac:LegalMonetaryTotal/cbc:ChargeTotalAmount (BT-108) بمجموع cbc:Amount (BT-99) لعناصر cac:AllowanceCharge على مستوى المستند التي فيها cbc:ChargeIndicator = true، مقرّباً إلى منزلتين عشريتين؛ وينجح إذا غاب الاثنان، ويفشل إذا وُجد ChargeTotalAmount فارغاً. نص الاختبار المدرج في القاعدة نسخة من معادلة الخصومات (BR-CO-11) ولا يطابق الرسالة الرسمية.",
"ar_fix": "اجعل cbc:ChargeTotalAmount مساوياً لمجموع مبالغ رسوم مستوى المستند بعد التقريب، أو احذف العنصر كلياً إذا لم توجد رسوم على مستوى المستند (لا تتركه فارغاً).",
"applies_to": "all",
"fields": [
"BT-108",
"BT-99"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-12",
"url_ar": "https://matheel.app/akhta/br-co-12"
},
{
"id": "BR-CO-13",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-13]-Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).",
"fails_when": "not(xs:decimal(cbc:ChargeTotalAmount) = ( round ( sum(../cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount)) * 10 * 10)div 100 ) or ( not(cbc:ChargeTotalAmount) and not(../cac:AllowanceCharge[cbc:ChargeIndicator=true()])))",
"en_title": "Total without VAT = line amounts - allowances + charges",
"ar_title": "الإجمالي دون الضريبة = البنود - الخصومات + الرسوم",
"en_meaning": "cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount (BT-109) must equal the sum of the lines' cbc:LineExtensionAmount, plus cbc:ChargeTotalAmount, minus cbc:AllowanceTotalAmount (each only if present), rounded to two decimals. The executed check sums the line amounts directly (the listed test text uses the BT-106 total instead) and also warns if ChargeTotalAmount is present but empty.",
"en_fix": "Compute cbc:TaxExclusiveAmount as Σ line cbc:LineExtensionAmount − cbc:AllowanceTotalAmount + cbc:ChargeTotalAmount, rounded to 2 decimals.",
"ar_meaning": "يتحقق من أن cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount (BT-109) يساوي مجموع cbc:LineExtensionAmount للبنود، زائد cbc:ChargeTotalAmount، ناقص cbc:AllowanceTotalAmount (كلٌّ منهما إن وُجد)، مقرّباً إلى منزلتين عشريتين. الفحص الفعلي يجمع مبالغ البنود مباشرة (بينما نص الاختبار المدرج يستخدم الإجمالي BT-106)، ويعطي تحذيراً أيضاً إذا وُجد ChargeTotalAmount فارغاً.",
"ar_fix": "احسب cbc:TaxExclusiveAmount على أنه مجموع cbc:LineExtensionAmount للبنود − cbc:AllowanceTotalAmount + cbc:ChargeTotalAmount، مقرّباً إلى منزلتين عشريتين.",
"applies_to": "all",
"fields": [
"BT-109",
"BT-131",
"BT-107",
"BT-108"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-13",
"url_ar": "https://matheel.app/akhta/br-co-13"
},
{
"id": "BR-CO-14",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-14]-Invoice total VAT amount (BT-110) = Σ VAT category tax amount (BT-117).",
"fails_when": "not((xs:decimal(child::cbc:TaxAmount)= round((sum(cac:TaxSubtotal/xs:decimal(cbc:TaxAmount)) * 10 * 10)) div 100) or not(cac:TaxSubtotal))",
"en_title": "Total VAT must equal the sum of the VAT breakdown amounts",
"ar_title": "إجمالي الضريبة يجب أن يساوي مجموع مبالغ تفصيل الضريبة",
"en_meaning": "For each cac:TaxTotal, cbc:TaxAmount (BT-110) must equal the sum of cbc:TaxAmount (BT-117) of its cac:TaxSubtotal children, rounded to two decimals. A cac:TaxTotal with no cac:TaxSubtotal is not checked.",
"en_fix": "In the cac:TaxTotal that carries the breakdown, set cbc:TaxAmount to the sum of its cac:TaxSubtotal/cbc:TaxAmount values, rounded to 2 decimals.",
"ar_meaning": "يتحقق في كل cac:TaxTotal من أن cbc:TaxAmount (BT-110) يساوي مجموع cbc:TaxAmount (BT-117) في عناصر cac:TaxSubtotal التابعة له، مقرّباً إلى منزلتين عشريتين. ولا يُفحص cac:TaxTotal الذي لا يحتوي على cac:TaxSubtotal.",
"ar_fix": "في cac:TaxTotal الذي يحمل التفصيل، اجعل cbc:TaxAmount مساوياً لمجموع قيم cac:TaxSubtotal/cbc:TaxAmount، مقرّباً إلى منزلتين عشريتين.",
"applies_to": "all",
"fields": [
"BT-110",
"BT-117"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-14",
"url_ar": "https://matheel.app/akhta/br-co-14"
},
{
"id": "BR-CO-15",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-15]-Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).",
"fails_when": "not(every $Currency in cbc:DocumentCurrencyCode satisfies (count(cac:TaxTotal/xs:decimal(cbc:TaxAmount[@currencyID=$Currency])) >= 1) and (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxInclusiveAmount) = round( (cac:LegalMonetaryTotal/xs:decimal(cbc:TaxExclusiveAmount) + sum(cac:TaxTotal/cac:TaxSubtotal/xs:decimal(cbc:TaxAmount))) * 10 * 10) div 100))",
"en_title": "Total with VAT must equal total without VAT plus total VAT",
"ar_title": "الإجمالي مع الضريبة = الإجمالي دون الضريبة + الضريبة",
"en_meaning": "The document must have at least one cac:TaxTotal/cbc:TaxAmount whose @currencyID equals cbc:DocumentCurrencyCode, and cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount (BT-112) must equal cbc:TaxExclusiveAmount (BT-109) plus the sum of all cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount values, rounded to two decimals.",
"en_fix": "Set cbc:TaxInclusiveAmount = cbc:TaxExclusiveAmount + Σ cac:TaxSubtotal/cbc:TaxAmount (rounded to 2 decimals), and give at least one cac:TaxTotal/cbc:TaxAmount the document currency, e.g. `<cbc:TaxAmount currencyID=\"SAR\">`.",
"ar_meaning": "يتحقق من وجود cac:TaxTotal/cbc:TaxAmount واحد على الأقل تساوي فيه @currencyID قيمة cbc:DocumentCurrencyCode، ومن أن cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount (BT-112) يساوي cbc:TaxExclusiveAmount (BT-109) زائد مجموع كل قيم cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount، مقرّباً إلى منزلتين عشريتين.",
"ar_fix": "اجعل cbc:TaxInclusiveAmount = cbc:TaxExclusiveAmount + مجموع cac:TaxSubtotal/cbc:TaxAmount (مقرّباً إلى منزلتين)، واجعل عملة cac:TaxTotal/cbc:TaxAmount واحد على الأقل هي عملة المستند، مثل `<cbc:TaxAmount currencyID=\"SAR\">`.",
"applies_to": "all",
"fields": [
"BT-112",
"BT-109",
"BT-110"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-15",
"url_ar": "https://matheel.app/akhta/br-co-15"
},
{
"id": "BR-CO-16",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-16]-Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Pre-Paid amount (BT-113) + Rounding amount (BT-114).",
"fails_when": "not(( not(exists(cbc:PayableRoundingAmount)) and (xs:decimal(cbc:PayableAmount) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and not(exists(cbc:PayableRoundingAmount)) and xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)) or (exists(cbc:PrepaidAmount) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(exists(cbc:PrepaidAmount)) and exists(cbc:PayableRoundingAmount) and ((round((xs:decimal(cbc:PayableAmount) - xs:decimal(cbc:PayableRoundingAmount)) * 10 * 10) div 100) = xs:decimal(cbc:TaxInclusiveAmount))))",
"en_title": "Amount due = total with VAT - prepaid amount + rounding amount",
"ar_title": "المستحق = الإجمالي مع الضريبة - المدفوع مقدماً + التقريب",
"en_meaning": "cac:LegalMonetaryTotal/cbc:PayableAmount (BT-115) must equal cbc:TaxInclusiveAmount (BT-112) minus cbc:PrepaidAmount (BT-113) plus cbc:PayableRoundingAmount (BT-114), where the prepaid and rounding amounts count only if present; values are compared after rounding to two decimals.",
"en_fix": "Set cbc:PayableAmount = cbc:TaxInclusiveAmount − cbc:PrepaidAmount + cbc:PayableRoundingAmount (leave out any term whose element is absent).",
"ar_meaning": "يتحقق من أن cac:LegalMonetaryTotal/cbc:PayableAmount (BT-115) يساوي cbc:TaxInclusiveAmount (BT-112) ناقص cbc:PrepaidAmount (BT-113) زائد cbc:PayableRoundingAmount (BT-114)، ولا يُحتسب المبلغ المدفوع مقدماً ومبلغ التقريب إلا عند وجودهما؛ وتتم المقارنة بعد التقريب إلى منزلتين عشريتين.",
"ar_fix": "اجعل cbc:PayableAmount = cbc:TaxInclusiveAmount − cbc:PrepaidAmount + cbc:PayableRoundingAmount (مع إسقاط أي حد لا يوجد عنصره).",
"applies_to": "all",
"fields": [
"BT-115",
"BT-112",
"BT-113",
"BT-114"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-16",
"url_ar": "https://matheel.app/akhta/br-co-16"
},
{
"id": "BR-CO-17",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-17]-VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.",
"fails_when": "not(($taxAmount >= $upperLimit and $taxAmount <= $lowerLimit) or ($taxAmount = $shouldBe))",
"en_title": "VAT amount per category must equal taxable amount x rate",
"ar_title": "ضريبة كل فئة يجب أن تساوي المبلغ الخاضع × النسبة",
"en_meaning": "For each /ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal, cbc:TaxAmount (BT-117) must equal cbc:TaxableAmount (BT-116) × cac:TaxCategory/cbc:Percent (BT-119) / 100, rounded to two decimals. The executed check allows a tolerance of 0.01 per invoice line (number of lines × 0.01); the listed test text describes a ±1 tolerance instead.",
"en_fix": "Compute each subtotal's cbc:TaxAmount as round(cbc:TaxableAmount × cbc:Percent / 100, 2), using the same cbc:Percent that appears in that subtotal's cac:TaxCategory.",
"ar_meaning": "يتحقق في كل /ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal من أن cbc:TaxAmount (BT-117) يساوي cbc:TaxableAmount (BT-116) × cac:TaxCategory/cbc:Percent (BT-119) / 100، مقرّباً إلى منزلتين عشريتين. الفحص الفعلي يسمح بفارق 0.01 لكل بند في الفاتورة (عدد البنود × 0.01)، بينما يصف نص الاختبار المدرج فارقاً قدره ±1.",
"ar_fix": "احسب cbc:TaxAmount لكل تفصيل على أنه round(cbc:TaxableAmount × cbc:Percent / 100, 2)، باستخدام نفس cbc:Percent الموجود في cac:TaxCategory لذلك التفصيل.",
"applies_to": "all",
"fields": [
"BT-117",
"BT-116",
"BT-119"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-17",
"url_ar": "https://matheel.app/akhta/br-co-17"
},
{
"id": "BR-CO-18",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-CO-18]-An Invoice shall at least have one VAT breakdown group (BG-23).",
"fails_when": "not(exists(cac:TaxTotal/cac:TaxSubtotal))",
"en_title": "Every invoice needs at least one VAT breakdown",
"ar_title": "كل فاتورة تحتاج تفصيلاً واحداً على الأقل للضريبة",
"en_meaning": "The document must contain at least one cac:TaxTotal/cac:TaxSubtotal (VAT breakdown, BG-23).",
"en_fix": "Add a cac:TaxSubtotal (with cbc:TaxableAmount, cbc:TaxAmount and cac:TaxCategory) inside cac:TaxTotal for each VAT category used on the invoice.",
"ar_meaning": "يتحقق من أن المستند يحتوي على cac:TaxTotal/cac:TaxSubtotal واحد على الأقل (تفصيل ضريبة القيمة المضافة BG-23).",
"ar_fix": "أضف cac:TaxSubtotal (يحتوي على cbc:TaxableAmount و cbc:TaxAmount و cac:TaxCategory) داخل cac:TaxTotal لكل فئة ضريبية مستخدمة في الفاتورة.",
"applies_to": "all",
"fields": [
"BG-23"
],
"url_en": "https://matheel.app/en/zatca-errors/br-co-18",
"url_ar": "https://matheel.app/akhta/br-co-18"
},
{
"id": "BR-CUSTOM-VALIDATION-01",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-CUSTOM-VALIDATION-01]- The Seller VAT registration number or seller group VAT registration number (BT-31) of The invoice must not match the buyer VAT registration number (BT-48) .",
"fails_when": "(( (cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) != '' and (cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) != '' and (cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) = (cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) ))",
"en_title": "Seller and buyer VAT numbers must not be the same",
"ar_title": "الرقم الضريبي للبائع يجب ألا يطابق الرقم الضريبي للمشتري",
"en_meaning": "Applies when both cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-31) and cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) are non-empty: the two values must differ. (The rule's test text is written as the failure condition: it fires when both are filled and equal.)",
"en_fix": "Put the buyer's own VAT registration number in the buyer's cac:PartyTaxScheme/cbc:CompanyID, not the seller's.",
"ar_meaning": "تنطبق عندما تكون قيمتا cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-31) و cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) غير فارغتين: يجب أن تختلفا. (نص الاختبار في القاعدة مكتوب بصيغة شرط الخطأ: يُطلق الخطأ عندما تكون القيمتان معبأتين ومتساويتين.)",
"ar_fix": "ضع الرقم الضريبي الخاص بالمشتري في cac:PartyTaxScheme/cbc:CompanyID للمشتري، وليس رقم البائع.",
"applies_to": "conditional",
"fields": [
"BT-31",
"BT-48"
],
"url_en": "https://matheel.app/en/zatca-errors/br-custom-validation-01",
"url_ar": "https://matheel.app/akhta/br-custom-validation-01"
},
{
"id": "BR-DEC-01",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-01]-The allowed maximum number of decimals for the Document level allowance amount (BT-92) is 2.",
"fails_when": "not(string-length(substring-after(cbc:Amount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-02",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-02]-The allowed maximum number of decimals for the Document level allowance base amount (BT-93) is 2.",
"fails_when": "not(string-length(substring-after(cbc:BaseAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-05",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-05]-The allowed maximum number of decimals for the Document level charge amount (BT-99) is 2.",
"fails_when": "not(string-length(substring-after(cbc:Amount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-06",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-06]-The allowed maximum number of decimals for the Document level charge base amount (BT-100) is 2.",
"fails_when": "not(string-length(substring-after(cbc:BaseAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-09",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-09]-The allowed maximum number of decimals for the Sum of Invoice line net amount (BT-106) is 2.",
"fails_when": "string-length(substring-after(cbc:LineExtensionAmount,'.')) > 2",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-10",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-10]-The allowed maximum number of decimals for the Sum of allowanced on document level (BT-107) is 2.",
"fails_when": "not(string-length(substring-after(cbc:AllowanceTotalAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-11",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-11]-The allowed maximum number of decimals for the Sum of charges on document level (BT-108) is 2.",
"fails_when": "not(string-length(substring-after(cbc:ChargeTotalAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-12",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-12]-The allowed maximum number of decimals for the Invoice total amount without VAT (BT-109) is 2.",
"fails_when": "not(string-length(substring-after(cbc:TaxExclusiveAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-13",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-13]-The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2.",
"fails_when": "not((string-length(substring-after(.,'.'))<=2))",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-14",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-14]-The allowed maximum number of decimals for the Invoice total amount with VAT (BT-112) is 2.",
"fails_when": "not(string-length(substring-after(cbc:TaxInclusiveAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-15",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-15]-The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.",
"fails_when": "not((string-length(substring-after(.,'.'))<=2))",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-16",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-16]-The allowed maximum number of decimals for the Pre-Paid amount (BT-113) is 2.",
"fails_when": "not(string-length(substring-after(cbc:PrepaidAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-17",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-17]-The allowed maximum number of decimals for the Rounding amount (BT-114) is 2.",
"fails_when": "not(string-length(substring-after(cbc:PayableRoundingAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-18",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-18]-The allowed maximum number of decimals for the Amount due for payment (BT-115) is 2.",
"fails_when": "not(string-length(substring-after(cbc:PayableAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-19",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-19]-The allowed maximum number of decimals for the VAT category taxable amount (BT-116) is 2.",
"fails_when": "not(string-length(substring-after(cbc:TaxableAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-20",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-20]-The allowed maximum number of decimals for the VAT category tax amount (BT-117) is 2.",
"fails_when": "not(string-length(substring-after(cbc:TaxAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-23",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-23]-The allowed maximum number of decimals for the Invoice line net amount (BT-131) is 2.",
"fails_when": "not(string-length(substring-after(cbc:LineExtensionAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-24",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-24]-The allowed maximum number of decimals for the Invoice line allowance amount (BT-136) is 2.",
"fails_when": "not(string-length(substring-after(cbc:Amount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-25",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-25]-The allowed maximum number of decimals for the Invoice line allowance base amount (BT-137) is 2.",
"fails_when": "not(string-length(substring-after(cbc:BaseAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-27",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-27]-The allowed maximum number of decimals for the Invoice line charge amount (BT-141) is 2.",
"fails_when": "not(string-length(substring-after(./cbc:Amount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-DEC-28",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-DEC-28]-The allowed maximum number of decimals for the Invoice line charge base amount (BT-142) is 2.",
"fails_when": "not(string-length(substring-after(./cbc:BaseAmount,'.'))<=2)",
"url_en": "https://matheel.app/en/zatca-errors/br-dec",
"url_ar": "https://matheel.app/akhta/br-dec"
},
{
"id": "BR-E-01",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-E-01]-An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is \"Exempt from VAT\" shall contain at least one VAT breakdown (BG-23) with the VAT category code (BT-118) equal to \"Exempt from VAT\".",
"fails_when": "not(((exists(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) > 0)) or (not(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E'])))",
"en_title": "Exempt (E) items need an 'E' VAT breakdown",
"ar_title": "البنود المعفاة (E) تحتاج تفصيل ضريبة بالفئة E",
"en_meaning": "Applies when any line cac:ClassifiedTaxCategory or document-level cac:AllowanceCharge/cac:TaxCategory (with TaxScheme 'VAT') has cbc:ID = 'E': the document must then have at least one cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'E'. The executed check requires at least one; the listed test text says exactly one.",
"en_fix": "Add a cac:TaxSubtotal whose cac:TaxCategory has `<cbc:ID>E</cbc:ID>` and the VAT tax scheme, covering the exempt lines, allowances and charges.",
"ar_meaning": "تنطبق عندما يكون cbc:ID = 'E' في أي cac:ClassifiedTaxCategory لبند أو في cac:AllowanceCharge/cac:TaxCategory على مستوى المستند (بنظام ضريبي 'VAT'): عندها يجب أن يحتوي المستند على cac:TaxTotal/cac:TaxSubtotal واحد على الأقل قيمة cac:TaxCategory/cbc:ID فيه 'E'. الفحص الفعلي يشترط واحداً على الأقل، بينما يذكر نص الاختبار المدرج واحداً بالضبط.",
"ar_fix": "أضف cac:TaxSubtotal يحتوي cac:TaxCategory فيه على `<cbc:ID>E</cbc:ID>` ونظام ضريبة VAT، ليغطي البنود والخصومات والرسوم المعفاة.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BG-20",
"BG-21",
"BT-151",
"BT-95",
"BT-102",
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-e-01",
"url_ar": "https://matheel.app/akhta/br-e-01"
},
{
"id": "BR-E-05",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-E-05]-In an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is \"Exempt from VAT\", the Invoiced item VAT rate (BT-152) shall be 0 (zero).",
"fails_when": "not((xs:decimal(cbc:Percent) = 0))",
"en_title": "Exempt (E) invoice lines must have a VAT rate of 0",
"ar_title": "بنود الفاتورة المعفاة (E) يجب أن تكون نسبة ضريبتها 0",
"en_meaning": "Applies to each line cac:Item/cac:ClassifiedTaxCategory with cbc:ID = 'E' and TaxScheme 'VAT': its cbc:Percent (BT-152) must equal 0.",
"en_fix": "For exempt lines use `<cbc:ID>E</cbc:ID><cbc:Percent>0</cbc:Percent>` inside cac:ClassifiedTaxCategory.",
"ar_meaning": "تنطبق على كل cac:Item/cac:ClassifiedTaxCategory لبند فيه cbc:ID = 'E' ونظام ضريبي 'VAT': يجب أن تساوي قيمة cbc:Percent (BT-152) صفراً.",
"ar_fix": "في البنود المعفاة استخدم `<cbc:ID>E</cbc:ID><cbc:Percent>0</cbc:Percent>` داخل cac:ClassifiedTaxCategory.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BT-151",
"BT-152"
],
"url_en": "https://matheel.app/en/zatca-errors/br-e-05",
"url_ar": "https://matheel.app/akhta/br-e-05"
},
{
"id": "BR-E-06",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-E-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is \"Exempt from VAT\", the Document level allowance VAT rate (BT-96) shall be 0 (zero).",
"fails_when": "not((xs:decimal(cbc:Percent) = 0))",
"en_title": "Exempt (E) document allowances must have a VAT rate of 0",
"ar_title": "خصومات المستند المعفاة (E) يجب أن تكون نسبة ضريبتها 0",
"en_meaning": "Applies to each document-level cac:AllowanceCharge with cbc:ChargeIndicator = false whose cac:TaxCategory has cbc:ID = 'E' and TaxScheme 'VAT': that cac:TaxCategory/cbc:Percent (BT-96) must equal 0.",
"en_fix": "In the allowance's cac:TaxCategory use `<cbc:ID>E</cbc:ID><cbc:Percent>0</cbc:Percent>`.",
"ar_meaning": "تنطبق على كل cac:AllowanceCharge على مستوى المستند فيه cbc:ChargeIndicator = false وقيمة cbc:ID في cac:TaxCategory هي 'E' بنظام ضريبي 'VAT': يجب أن تساوي cac:TaxCategory/cbc:Percent (BT-96) صفراً.",
"ar_fix": "في cac:TaxCategory الخاص بالخصم استخدم `<cbc:ID>E</cbc:ID><cbc:Percent>0</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-20",
"BT-95",
"BT-96"
],
"url_en": "https://matheel.app/en/zatca-errors/br-e-06",
"url_ar": "https://matheel.app/akhta/br-e-06"
},
{
"id": "BR-E-07",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-E-07]-In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is \"Exempt from VAT\", the Document level charge VAT rate (BT-103) shall be 0 (zero).",
"fails_when": "cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and not(((/ubl:Invoice/cac:AllowanceCharge/cac:TaxCategory /cbc:Percent)=0))",
"en_title": "Exempt (E) document charges must have a VAT rate of 0",
"ar_title": "رسوم المستند المعفاة (E) يجب أن تكون نسبة ضريبتها 0",
"en_meaning": "Applies when the document has a document-level cac:AllowanceCharge with cbc:ChargeIndicator = true whose cac:TaxCategory has cbc:ID = 'E' (VAT): the charge rate cbc:Percent (BT-103) should be 0. In SDK 3.4.8 the executed check is looser: it passes as long as any document-level cac:AllowanceCharge/cac:TaxCategory/cbc:Percent equals 0.",
"en_fix": "In the charge's cac:TaxCategory use `<cbc:ID>E</cbc:ID><cbc:Percent>0</cbc:Percent>`.",
"ar_meaning": "تنطبق عندما يحتوي المستند على cac:AllowanceCharge على مستوى المستند فيه cbc:ChargeIndicator = true وقيمة cbc:ID في cac:TaxCategory هي 'E' (VAT): يجب أن تكون نسبة الرسم cbc:Percent (BT-103) صفراً. في الإصدار SDK 3.4.8 الفحص الفعلي أخف من ذلك: ينجح ما دامت أي قيمة cac:AllowanceCharge/cac:TaxCategory/cbc:Percent على مستوى المستند تساوي 0.",
"ar_fix": "في cac:TaxCategory الخاص بالرسم استخدم `<cbc:ID>E</cbc:ID><cbc:Percent>0</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-102",
"BT-103"
],
"url_en": "https://matheel.app/en/zatca-errors/br-e-07",
"url_ar": "https://matheel.app/akhta/br-e-07"
},
{
"id": "BR-E-08",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-E-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is \" Exempt from VAT\" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are \"Exempt from VAT\".",
"fails_when": "count(/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'])> 0 and not(exists(../../../cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']) or exists(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'E']])) or not( (xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='E']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='E']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='E']/xs:decimal(cbc:Amount)) )))",
"en_title": "Exempt (E) taxable amount must match the exempt lines and adjustments",
"ar_title": "المبلغ الخاضع للفئة E يجب أن يطابق البنود والتعديلات المعفاة",
"en_meaning": "Applies to each cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'E': its cbc:TaxableAmount (BT-116) must equal the sum of cbc:LineExtensionAmount of lines with category 'E' plus 'E' document-level charges minus 'E' document-level allowances. The executed check also warns when an 'E' breakdown exists but no line, allowance or charge uses 'E'; the listed test text mistakenly sums 'S' amounts.",
"en_fix": "Set the 'E' subtotal's cbc:TaxableAmount to Σ exempt line amounts + Σ exempt document charges − Σ exempt document allowances, and include an 'E' breakdown only when something on the invoice is exempt.",
"ar_meaning": "تنطبق على كل cac:TaxSubtotal قيمة cac:TaxCategory/cbc:ID فيه 'E': يجب أن يساوي cbc:TaxableAmount (BT-116) مجموع cbc:LineExtensionAmount للبنود ذات الفئة 'E' زائد رسوم مستوى المستند بالفئة 'E' ناقص خصومات مستوى المستند بالفئة 'E'. الفحص الفعلي يعطي تحذيراً أيضاً عند وجود تفصيل 'E' دون أي بند أو خصم أو رسم بالفئة 'E'؛ ونص الاختبار المدرج يجمع مبالغ الفئة 'S' خطأً.",
"ar_fix": "اجعل cbc:TaxableAmount لتفصيل 'E' مساوياً لمجموع مبالغ البنود المعفاة + رسوم المستند المعفاة − خصومات المستند المعفاة، ولا تضف تفصيل 'E' إلا إذا كان في الفاتورة شيء معفى.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-116",
"BT-131",
"BT-92",
"BT-99",
"BT-151",
"BT-95",
"BT-102"
],
"url_en": "https://matheel.app/en/zatca-errors/br-e-08",
"url_ar": "https://matheel.app/akhta/br-e-08"
},
{
"id": "BR-E-09",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-E-09]-The VAT category tax amount (BT-117) In a VAT breakdown (BG-23) where the VAT category code (BT-118) equals \"Exempt from VAT\" shall equal 0 (zero).",
"fails_when": "not(xs:decimal(../cbc:TaxAmount) = 0)",
"en_title": "VAT amount in an exempt (E) breakdown must be 0",
"ar_title": "مبلغ الضريبة في تفصيل الفئة المعفاة (E) يجب أن يكون 0",
"en_meaning": "Applies to each cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'E' (VAT): that subtotal's cbc:TaxAmount (BT-117) must equal 0.",
"en_fix": "In the 'E' subtotal use `<cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>` (with your document currency).",
"ar_meaning": "تنطبق على كل cac:TaxTotal/cac:TaxSubtotal قيمة cac:TaxCategory/cbc:ID فيه 'E' (VAT): يجب أن يساوي cbc:TaxAmount (BT-117) لذلك التفصيل صفراً.",
"ar_fix": "في تفصيل 'E' استخدم `<cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>` (بعملة المستند الخاصة بك).",
"applies_to": "conditional",
"fields": [
"BT-117",
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-e-09",
"url_ar": "https://matheel.app/akhta/br-e-09"
},
{
"id": "BR-KSA-03",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-03]-The invoice must contain a unique identifier (\"UUID\") (KSA-1) given by the unit that issued the document (unique message identifier for interchange process). This value must contain only letters, digits, and dashes.",
"fails_when": "not(exists(cbc:UUID) and (cbc:UUID) != '' and matches(cbc:UUID, '^[\\w.-]+'))",
"en_title": "Every invoice needs a UUID",
"ar_title": "كل فاتورة تحتاج معرّفاً فريداً UUID",
"en_meaning": "The document must have a non-empty cbc:UUID (KSA-1). The executed regex '^[\\w.-]+' only checks that the value starts with a letter, digit, underscore, dot or dash, so it is looser than the official text's 'only letters, digits and dashes'.",
"en_fix": "Generate a standard UUID and add it near the top of the document, e.g. `<cbc:UUID>3cf5ee18-ee25-44ea-a444-2c37ba7f28be</cbc:UUID>`.",
"ar_meaning": "يتحقق من وجود cbc:UUID (KSA-1) غير فارغ في المستند. التعبير النمطي المنفّذ '^[\\w.-]+' يتحقق فقط من أن القيمة تبدأ بحرف أو رقم أو شرطة سفلية أو نقطة أو شرطة، فهو أخف من النص الرسمي الذي يشترط أحرفاً وأرقاماً وشرطات فقط.",
"ar_fix": "أنشئ UUID قياسياً وأضفه في أعلى المستند، مثل `<cbc:UUID>3cf5ee18-ee25-44ea-a444-2c37ba7f28be</cbc:UUID>`.",
"applies_to": "all",
"fields": [
"KSA-1"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-03",
"url_ar": "https://matheel.app/akhta/br-ksa-03"
},
{
"id": "BR-KSA-04",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-04]-The document issue date (BT-2) must be less or equal to the current date.",
"fails_when": "((. castable as xs:date ) and normalize-space(.)!='') and xs:date(.) > current-date()",
"en_title": "Issue date must not be in the future",
"ar_title": "تاريخ الإصدار يجب ألا يكون في المستقبل",
"en_meaning": "cbc:IssueDate (BT-2), when it is a valid date, must be on or before the current date at the time of validation.",
"en_fix": "Set cbc:IssueDate to the actual issue date in YYYY-MM-DD format, e.g. `<cbc:IssueDate>2022-09-07</cbc:IssueDate>`, never a later date.",
"ar_meaning": "يتحقق من أن cbc:IssueDate (BT-2)، عندما يكون تاريخاً صالحاً، يساوي التاريخ الحالي وقت التحقق أو يسبقه.",
"ar_fix": "اجعل cbc:IssueDate تاريخ الإصدار الفعلي بصيغة YYYY-MM-DD، مثل `<cbc:IssueDate>2022-09-07</cbc:IssueDate>`، ولا تضع تاريخاً لاحقاً.",
"applies_to": "all",
"fields": [
"BT-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-04",
"url_ar": "https://matheel.app/akhta/br-ksa-04"
},
{
"id": "BR-KSA-05",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-05]-The invoice type code (BT-3) must be equal to one of value from the subset of UN/CEFACT code list 1001, D.16B agreed for KSA electronic invoices. Please refer paragraph 11.2.1 of XML implementation Standards.",
"fails_when": "not(not(contains(normalize-space(.), ' ')) and contains(' 388 383 381 386 ', concat(' ', normalize-space(.), ' ')))",
"en_title": "Invoice type code must be 388, 383, 381 or 386",
"ar_title": "رمز نوع الفاتورة يجب أن يكون 388 أو 383 أو 381 أو 386",
"en_meaning": "cbc:InvoiceTypeCode (BT-3) must be a single value from the KSA subset of UN/CEFACT 1001. The executed check accepts 388 (tax invoice), 383 (debit note), 381 (credit note) and 386 (prepayment invoice); the listed test text omits 386.",
"en_fix": "Use one of these values with no spaces, e.g. `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>`.",
"ar_meaning": "يتحقق من أن cbc:InvoiceTypeCode (BT-3) قيمة واحدة من المجموعة الفرعية السعودية لقائمة UN/CEFACT 1001. الفحص الفعلي يقبل 388 (فاتورة ضريبية) و383 (إشعار مدين) و381 (إشعار دائن) و386 (فاتورة دفعة مقدمة)؛ ونص الاختبار المدرج لا يذكر 386.",
"ar_fix": "استخدم إحدى هذه القيم دون مسافات، مثل `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>`.",
"applies_to": "all",
"fields": [
"BT-3"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-05",
"url_ar": "https://matheel.app/akhta/br-ksa-05"
},
{
"id": "BR-KSA-06",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-06]-The invoice transaction code (KSA-2) must exist and respect the following structure: NNPNESBCG where NN (positions 1 and 2) = invoice subtype: - 01 for tax invoice - 02 for simplified tax invoice P (position 3) = 3rd Party invoice transaction, 0 for false, 1 for true; N (position 4) = Nominal invoice transaction, 0 for false, 1 for true; E (position 5) = Exports invoice transaction, 0 for false, 1 for true; S (position 6) = Summary invoice transaction, 0 for false, 1 for true; B (position 7) = Self billed invoice transaction, 0 for false, 1 for true; C (position 8) = Continuous Supply invoice transaction, 0 for false, 1 for true; G (position 9) = B2G invoice transaction, 0 for false, 1 for true",
"fails_when": "not( ( ( (string-length(@name) = 7 and (substring(@name,1,2) = '01' or substring(@name,1,2) = '02') and (substring(@name,3,1) = '0' or substring(@name,3,1) = '1') and (substring(@name,4,1) = '0' or substring(@name,4,1) = '1') and (substring(@name,5,1) = '0' or substring(@name,5,1) = '1') and (substring(@name,6,1) = '0' or substring(@name,6,1) = '1') and (substring(@name,7,1) = '0' or substring(@name,7,1) = '1') ) or (string-length(@name) = 9 and (substring(@name,1,2) = '01' or substring(@name,1,2) = '02') and (substring(@name,3,1) = '0' or substring(@name,3,1) = '1') and (substring(@name,4,1) = '0' or substring(@name,4,1) = '1') and (substring(@name,5,1) = '0' or substring(@name,5,1) = '1') and (substring(@name,6,1) = '0' or substring(@name,6,1) = '1') and (substring(@name,7,1) = '0' or substring(@name,7,1) = '1') and (substring(@name,8,1) = '0' or substring(@name,8,1) = '1') and (substring(@name,9,1) = '0' or substring(@name,9,1) = '1') ) or (string-length(@name) = 8 and (substring(@name,1,2) = '01' or substring(@name,1,2) = '02') and (substring(@name,3,1) = '0' or substring(@name,3,1) = '1') and (substring(@name,4,1) = '0' or substring(@name,4,1) = '1') and (substring(@name,5,1) = '0' or substring(@name,5,1) = '1') and (substring(@name,6,1) = '0' or substring(@name,6,1) = '1') and (substring(@name,7,1) = '0' or substring(@name,7,1) = '1') and (substring(@name,8,1) = '0' or substring(@name,8,1) = '1') ) ) ) )",
"en_title": "Invoice transaction code (name attribute) must follow NNPNESB",
"ar_title": "رمز معاملة الفاتورة (السمة name) يجب أن يتبع الصيغة NNPNESB",
"en_meaning": "The @name attribute of cbc:InvoiceTypeCode (KSA-2) must start with '01' (tax invoice) or '02' (simplified), followed by 0/1 flags: 3rd-party, nominal, export, summary, self-billed (positions 3–7). The executed check accepts 7, 8 or 9 characters (positions 8–9, continuous supply and B2G, also 0/1); the listed test text allows only 7.",
"en_fix": "Set the name attribute, e.g. `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>` for a plain standard invoice or name=\"0200000\" for a simplified one.",
"ar_meaning": "يتحقق من أن السمة @name في cbc:InvoiceTypeCode (KSA-2) تبدأ بـ '01' (فاتورة ضريبية) أو '02' (مبسطة)، تليها علامات 0/1: طرف ثالث، اسمية، تصدير، ملخصة، فوترة ذاتية (المواضع 3–7). الفحص الفعلي يقبل 7 أو 8 أو 9 خانات (الموضعان 8–9: توريد مستمر وB2G، وقيمتهما 0/1 أيضاً)؛ ونص الاختبار المدرج يسمح بـ 7 خانات فقط.",
"ar_fix": "اضبط السمة name، مثل `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>` للفاتورة الضريبية العادية، أو name=\"0200000\" للفاتورة المبسطة.",
"applies_to": "all",
"fields": [
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-06",
"url_ar": "https://matheel.app/akhta/br-ksa-06"
},
{
"id": "BR-KSA-07",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-07]-Self billing is not allowed (KSA-2, position 7 cannot be \"1\") for export invoices (KSA-2, position 5 = 1).",
"fails_when": "not(substring(./@name,7,1) != '1')",
"en_title": "Export invoices cannot be self-billed",
"ar_title": "فواتير التصدير لا يجوز أن تكون فوترة ذاتية",
"en_meaning": "Applies when position 5 (export) of cbc:InvoiceTypeCode/@name (KSA-2) is '1': position 7 (self-billed) must then not be '1'.",
"en_fix": "For an export invoice set position 7 of the name attribute to 0, e.g. name=\"0100100\".",
"ar_meaning": "تنطبق عندما يكون الموضع 5 (تصدير) في cbc:InvoiceTypeCode/@name (KSA-2) مساوياً '1': عندها يجب ألا يكون الموضع 7 (فوترة ذاتية) '1'.",
"ar_fix": "في فاتورة التصدير اجعل الموضع 7 في السمة name صفراً، مثل name=\"0100100\".",
"applies_to": "conditional",
"fields": [
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-07",
"url_ar": "https://matheel.app/akhta/br-ksa-07"
},
{
"id": "BR-KSA-08",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-08]-The seller identification (BT-29) must exist only once with one of the scheme ID (BT-29-1) (CRN, MOM, MLS, SAG, OTH, 700) and must contain only alphanumeric characters. Commercial Registration number with \"CRN\" as schemeID. MOMRAH license with \"MOM\" as schemeID. MHRSD license with \"MLS\" as schemeID. 700 Number with \"700\" as schemeID. MISA license with \"SAG\" as schemeID. Other OD with \"OTH\" as schemeID. In case of multiple commercial registrations, the seller should fill the commercial registration of the branch in respect of which the Tax Invoice is being issued. In case multiple IDs exist then one of the above must be entered following the sequence specified above.",
"fails_when": "not( exists(cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID) and string-length(cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID/normalize-space(@schemeID)) > 2 and contains('CRN MOM MLS SAG OTH 700', normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID/@schemeID)))",
"en_title": "Seller ID needs a valid scheme (CRN, MOM, MLS, SAG, OTH, 700)",
"ar_title": "معرّف البائع بنوع صالح (CRN, MOM, MLS, SAG, OTH, 700)",
"en_meaning": "cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID (BT-29) must exist with a @schemeID (BT-29-1) of CRN, MOM, MLS, SAG, OTH or 700. The executed check only verifies the ID exists and the scheme; it does not check the 'alphanumeric only' or 'only once' parts of the official text.",
"en_fix": "Add the seller identifier with its scheme, e.g. `<cac:PartyIdentification><cbc:ID schemeID=\"CRN\">1010010000</cbc:ID></cac:PartyIdentification>`, using letters and digits only and the first applicable scheme in the order CRN, MOM, MLS, SAG, OTH, 700 per the official text.",
"ar_meaning": "يتحقق من وجود cac:AccountingSupplierParty/cac:Party/cac:PartyIdentification/cbc:ID (BT-29) مع @schemeID (BT-29-1) بإحدى القيم CRN أو MOM أو MLS أو SAG أو OTH أو 700. الفحص الفعلي يتحقق فقط من وجود المعرّف ونوعه، ولا يفحص شرطي 'أحرف وأرقام فقط' و'مرة واحدة فقط' الواردين في النص الرسمي.",
"ar_fix": "أضف معرّف البائع مع نوعه، مثل `<cac:PartyIdentification><cbc:ID schemeID=\"CRN\">1010010000</cbc:ID></cac:PartyIdentification>`، بأحرف وأرقام فقط، واختر أول نوع منطبق حسب الترتيب CRN, MOM, MLS, SAG, OTH, 700 كما في النص الرسمي.",
"applies_to": "all",
"fields": [
"BT-29",
"BT-29-1"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-08",
"url_ar": "https://matheel.app/akhta/br-ksa-08"
},
{
"id": "BR-KSA-09",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-09]-Seller address must contain street name (BT-35), building number (KSA-17), postal code (BT-38), city (BT-37), district (KSA-3), country code (BT-40). For more information please access this link: https://splonline.com.sa/en/national-address-1/",
"fails_when": "not(exists(cbc:StreetName) and exists(cbc:BuildingNumber) and exists(cbc:CityName) and exists(cbc:PostalZone) and exists(cbc:CitySubdivisionName) and exists(cac:Country/cbc:IdentificationCode))",
"en_title": "Seller address: street, building, postcode, city, district, country",
"ar_title": "عنوان البائع: الشارع والمبنى والرمز والمدينة والحي والدولة",
"en_meaning": "cac:AccountingSupplierParty/cac:Party/cac:PostalAddress must contain cbc:StreetName, cbc:BuildingNumber, cbc:CityName, cbc:PostalZone, cbc:CitySubdivisionName and cac:Country/cbc:IdentificationCode. The listed test text also requires cbc:PlotIdentification, but the executed check and the official text do not.",
"en_fix": "Fill all six elements in the seller's cac:PostalAddress, e.g. `<cbc:StreetName>…</cbc:StreetName><cbc:BuildingNumber>…</cbc:BuildingNumber><cbc:CitySubdivisionName>…</cbc:CitySubdivisionName><cbc:CityName>…</cbc:CityName><cbc:PostalZone>…</cbc:PostalZone><cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country>`.",
"ar_meaning": "يتحقق من أن cac:AccountingSupplierParty/cac:Party/cac:PostalAddress يحتوي على cbc:StreetName و cbc:BuildingNumber و cbc:CityName و cbc:PostalZone و cbc:CitySubdivisionName و cac:Country/cbc:IdentificationCode. نص الاختبار المدرج يشترط أيضاً cbc:PlotIdentification، لكن الفحص الفعلي والنص الرسمي لا يشترطانه.",
"ar_fix": "عبّئ العناصر الستة في cac:PostalAddress للبائع، مثل `<cbc:StreetName>…</cbc:StreetName><cbc:BuildingNumber>…</cbc:BuildingNumber><cbc:CitySubdivisionName>…</cbc:CitySubdivisionName><cbc:CityName>…</cbc:CityName><cbc:PostalZone>…</cbc:PostalZone><cac:Country><cbc:IdentificationCode>SA</cbc:IdentificationCode></cac:Country>`.",
"applies_to": "all",
"fields": [
"BT-35",
"KSA-17",
"BT-38",
"BT-37",
"KSA-3",
"BT-40"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-09",
"url_ar": "https://matheel.app/akhta/br-ksa-09"
},
{
"id": "BR-KSA-10",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-10]-Where the Buyer Country Code (BT-55) is other than 'SA' Buyer address must contain a street (BT-50), city (BT-52), country code (BT-55). This rule does not apply on the simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02).",
"fails_when": "not (string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) > 0 and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) > 0 and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) > 0 and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode))",
"en_title": "Standard invoices need buyer street, city and country code",
"ar_title": "الفواتير الضريبية تحتاج شارع المشتري ومدينته ورمز دولته",
"en_meaning": "On standard invoices (cbc:InvoiceTypeCode/@name starting '01'), cac:AccountingCustomerParty/cac:Party/cac:PostalAddress must have non-empty cbc:StreetName, cbc:CityName and cac:Country/cbc:IdentificationCode. The executed check does not look at the country value, so it applies to Saudi buyers too, unlike the official text; it also does not require cbc:PostalZone or cbc:CitySubdivisionName, which the listed test text adds.",
"en_fix": "Fill the buyer's address with at least `<cbc:StreetName>…</cbc:StreetName><cbc:CityName>…</cbc:CityName><cac:Country><cbc:IdentificationCode>…</cbc:IdentificationCode></cac:Country>`.",
"ar_meaning": "في الفواتير الضريبية (التي تبدأ فيها cbc:InvoiceTypeCode/@name بـ '01') يجب أن يحتوي cac:AccountingCustomerParty/cac:Party/cac:PostalAddress على cbc:StreetName و cbc:CityName و cac:Country/cbc:IdentificationCode غير فارغة. الفحص الفعلي لا ينظر إلى قيمة الدولة، فينطبق على المشترين السعوديين أيضاً خلافاً للنص الرسمي؛ ولا يشترط cbc:PostalZone ولا cbc:CitySubdivisionName اللذين يضيفهما نص الاختبار المدرج.",
"ar_fix": "عبّئ عنوان المشتري على الأقل بـ `<cbc:StreetName>…</cbc:StreetName><cbc:CityName>…</cbc:CityName><cac:Country><cbc:IdentificationCode>…</cbc:IdentificationCode></cac:Country>`.",
"applies_to": "standard",
"fields": [
"BT-55",
"BT-50",
"BT-52",
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-10",
"url_ar": "https://matheel.app/akhta/br-ksa-10"
},
{
"id": "BR-KSA-11",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-11]-An Invoice line (BG-25) where the VAT category code (BT-151) is \"Not subject to VAT\", an invoiced item VAT rate (BT-152) shall be 0 (zero), if exist.",
"fails_when": "(cbc:Percent >0 or cbc:Percent <0 )",
"en_title": "'Not subject to VAT' (O) lines must have a VAT rate of 0 if given",
"ar_title": "البنود غير الخاضعة للضريبة (O) نسبتها 0 إن وُجدت",
"en_meaning": "Applies to each line cac:Item/cac:ClassifiedTaxCategory with cbc:ID = 'O': if cbc:Percent (BT-152) is present it must be 0. The executed check fails only on a non-zero Percent, while the listed test text (not(cbc:Percent)) implies Percent must be absent.",
"en_fix": "For 'O' lines either omit cbc:Percent or set `<cbc:Percent>0</cbc:Percent>`.",
"ar_meaning": "تنطبق على كل cac:Item/cac:ClassifiedTaxCategory لبند فيه cbc:ID = 'O': إذا وُجد cbc:Percent (BT-152) فيجب أن يساوي 0. الفحص الفعلي يفشل فقط عند وجود نسبة غير صفرية، بينما يوحي نص الاختبار المدرج (not(cbc:Percent)) بأن النسبة يجب أن تغيب.",
"ar_fix": "في بنود 'O' إما أن تحذف cbc:Percent أو تضع `<cbc:Percent>0</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BT-151",
"BT-152"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-11",
"url_ar": "https://matheel.app/akhta/br-ksa-11"
},
{
"id": "BR-KSA-12",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-12]-A Document level allowance (BG-20) where VAT category code (BT-95) is \"Not subject to VAT\", a Document level allowance VAT rate (BT-96) shall be 0 (Zero), if exist.",
"fails_when": "(cbc:Percent >0 or cbc:Percent <0 )",
"en_title": "'Not subject to VAT' (O) allowances must have a VAT rate of 0 if given",
"ar_title": "الخصومات غير الخاضعة للضريبة (O) نسبتها 0 إن وُجدت",
"en_meaning": "Applies to each document-level cac:AllowanceCharge with cbc:ChargeIndicator = false whose cac:TaxCategory/cbc:ID is 'O': if cbc:Percent (BT-96) is present it must be 0. The executed check fails only on a non-zero Percent, while the listed test text implies Percent must be absent.",
"en_fix": "In the allowance's 'O' cac:TaxCategory either omit cbc:Percent or set `<cbc:Percent>0</cbc:Percent>`.",
"ar_meaning": "تنطبق على كل cac:AllowanceCharge على مستوى المستند فيه cbc:ChargeIndicator = false وقيمة cac:TaxCategory/cbc:ID فيه 'O': إذا وُجد cbc:Percent (BT-96) فيجب أن يساوي 0. الفحص الفعلي يفشل فقط عند وجود نسبة غير صفرية، بينما يوحي نص الاختبار المدرج بأن النسبة يجب أن تغيب.",
"ar_fix": "في cac:TaxCategory بالفئة 'O' للخصم إما أن تحذف cbc:Percent أو تضع `<cbc:Percent>0</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-20",
"BT-95",
"BT-96"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-12",
"url_ar": "https://matheel.app/akhta/br-ksa-12"
},
{
"id": "BR-KSA-13",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-13]-A Document level charge (BG-21) where the VAT category code (BT-102) is \"Not subject to VAT\", a Document level charge VAT rate (BT-103) shall be 0 (zero), if exist.",
"fails_when": "(cbc:Percent >0 or cbc:Percent <0 )",
"en_title": "'Not subject to VAT' (O) charges must have a VAT rate of 0 if given",
"ar_title": "الرسوم غير الخاضعة للضريبة (O) نسبتها 0 إن وُجدت",
"en_meaning": "Applies to each document-level cac:AllowanceCharge with cbc:ChargeIndicator = true whose cac:TaxCategory/cbc:ID is 'O': if cbc:Percent (BT-103) is present it must be 0. The executed check fails only on a non-zero Percent, while the listed test text implies Percent must be absent.",
"en_fix": "In the charge's 'O' cac:TaxCategory either omit cbc:Percent or set `<cbc:Percent>0</cbc:Percent>`.",
"ar_meaning": "تنطبق على كل cac:AllowanceCharge على مستوى المستند فيه cbc:ChargeIndicator = true وقيمة cac:TaxCategory/cbc:ID فيه 'O': إذا وُجد cbc:Percent (BT-103) فيجب أن يساوي 0. الفحص الفعلي يفشل فقط عند وجود نسبة غير صفرية، بينما يوحي نص الاختبار المدرج بأن النسبة يجب أن تغيب.",
"ar_fix": "في cac:TaxCategory بالفئة 'O' للرسم إما أن تحذف cbc:Percent أو تضع `<cbc:Percent>0</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-102",
"BT-103"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-13",
"url_ar": "https://matheel.app/akhta/br-ksa-13"
},
{
"id": "BR-KSA-14",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-14]-The buyer identification (BT-46), required only if buyer is not VAT registered, then the buyer identification (BT-46) must be provided with one of the scheme IDs (BT-46-1) (TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, PAS, OTH) and must contain only alphanumeric characters. Tax Identification Number \"TIN\" as schemeID ;Commercial registration number with \"CRN\" as schemeID ;MOMRAH license with \"MOM\" as schemeID ;MHRSD license with \"MLS\" as schemeID ;700 Number with \"700\" as schemeID ;MISA license with \"SAG\" as schemeID ;National ID with \"NAT\" as schemeID ;GCC ID with \"GCC\" as schemeID ;Iqama Number with \"IQA\" as schemeID ;Passport ID with \"PAS\" as schemeID ;Other ID with \"OTH\" as schemeID. ;In case of multiple commercial registrations, the seller should fill the commercial registration of the branch in respect of which the Tax Invoice is being issued. In case multiple IDs exist then one of the above must be entered following the sequence specified above",
"fails_when": "not( string-length(normalize-space( ./@schemeID)) > 2 and contains('TIN NAT IQA PAS CRN MOM MLS 700 SAG GCC OTH', normalize-space(./@schemeID)))",
"en_title": "Buyer ID must use an allowed scheme ID",
"ar_title": "معرّف المشتري يجب أن يستخدم نوعاً مسموحاً",
"en_meaning": "Applies to each cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID (BT-46): its @schemeID (BT-46-1) must be one of TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, PAS, OTH. The executed check verifies only the scheme; the 'alphanumeric only' part appears in the listed test text but is not enforced.",
"en_fix": "Give the buyer ID a valid scheme, e.g. `<cac:PartyIdentification><cbc:ID schemeID=\"NAT\">1234567890</cbc:ID></cac:PartyIdentification>`, using letters and digits only as the official text requires.",
"ar_meaning": "تنطبق على كل cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID (BT-46): يجب أن تكون قيمة @schemeID (BT-46-1) إحدى القيم TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, PAS, OTH. الفحص الفعلي يتحقق من النوع فقط؛ أما شرط 'أحرف وأرقام فقط' فيظهر في نص الاختبار المدرج لكنه غير مطبّق.",
"ar_fix": "أعطِ معرّف المشتري نوعاً صالحاً، مثل `<cac:PartyIdentification><cbc:ID schemeID=\"NAT\">1234567890</cbc:ID></cac:PartyIdentification>`، بأحرف وأرقام فقط كما يشترط النص الرسمي.",
"applies_to": "conditional",
"fields": [
"BT-46",
"BT-46-1"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-14",
"url_ar": "https://matheel.app/akhta/br-ksa-14"
},
{
"id": "BR-KSA-15",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-15]-The tax invoice ((invoice type code (BT-30) = 388) and (invoice transaction code (KSA-2) has \"01\" as first 2 digits)) must contain the supply date (KSA-5).",
"fails_when": "not(exists(//cac:Delivery/cbc:ActualDeliveryDate) and normalize-space(//cac:Delivery/cbc:ActualDeliveryDate) != '')",
"en_title": "Standard tax invoices (388) need a supply date",
"ar_title": "الفاتورة الضريبية (388) تحتاج تاريخ التوريد",
"en_meaning": "Applies when cbc:InvoiceTypeCode is 388 and its @name starts with '01': the document must contain a non-empty cac:Delivery/cbc:ActualDeliveryDate (KSA-5). The official text labels the type code BT-30; the type code field is BT-3.",
"en_fix": "Add the supply date, e.g. `<cac:Delivery><cbc:ActualDeliveryDate>2022-09-07</cbc:ActualDeliveryDate></cac:Delivery>`.",
"ar_meaning": "تنطبق عندما تكون قيمة cbc:InvoiceTypeCode هي 388 وتبدأ السمة @name بـ '01': يجب أن يحتوي المستند على cac:Delivery/cbc:ActualDeliveryDate (KSA-5) غير فارغ. النص الرسمي يسمّي رمز النوع BT-30، بينما حقل رمز النوع هو BT-3.",
"ar_fix": "أضف تاريخ التوريد، مثل `<cac:Delivery><cbc:ActualDeliveryDate>2022-09-07</cbc:ActualDeliveryDate></cac:Delivery>`.",
"applies_to": "standard",
"fields": [
"BT-30",
"KSA-2",
"KSA-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-15",
"url_ar": "https://matheel.app/akhta/br-ksa-15"
},
{
"id": "BR-KSA-16",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-16]-Payment means code (BT-81) in an invoice exist, then it must contain one of the values from subset of UNTDID 4461 code list",
"fails_when": "not(( ( not(contains(normalize-space(.),' ')) and contains( ' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 74 75 76 77 78 91 92 93 94 95 96 97 ZZZ ',concat(' ',normalize-space(.),' ') ) ) ))",
"en_title": "Payment means code must be a valid UNTDID 4461 code",
"ar_title": "رمز وسيلة الدفع يجب أن يكون رمزاً صالحاً من UNTDID 4461",
"en_meaning": "Applies to each cac:PaymentMeans/cbc:PaymentMeansCode (BT-81) that exists: the executed check accepts 1–68, 70, 74–78, 91–97 or ZZZ. The listed test text instead requires a PaymentMeans and only the codes 10, 30, 42, 48, 1.",
"en_fix": "Use a single code from the list, e.g. `<cac:PaymentMeans><cbc:PaymentMeansCode>10</cbc:PaymentMeansCode></cac:PaymentMeans>`.",
"ar_meaning": "تنطبق على كل cac:PaymentMeans/cbc:PaymentMeansCode (BT-81) موجود: الفحص الفعلي يقبل 1–68 و70 و74–78 و91–97 و ZZZ. أما نص الاختبار المدرج فيشترط وجود PaymentMeans ويقصر الرموز على 10 و30 و42 و48 و1.",
"ar_fix": "استخدم رمزاً واحداً من القائمة، مثل `<cac:PaymentMeans><cbc:PaymentMeansCode>10</cbc:PaymentMeansCode></cac:PaymentMeans>`.",
"applies_to": "conditional",
"fields": [
"BT-81"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-16",
"url_ar": "https://matheel.app/akhta/br-ksa-16"
},
{
"id": "BR-KSA-17",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-17]-Debit and credit note (invoice type code (BT-3) is equal to 383 or 381) must contain the reason (KSA-10) for this invoice type issuing.",
"fails_when": "not(exists(./cbc:InstructionNote))",
"en_title": "Credit and debit notes need a reason for issuing",
"ar_title": "الإشعارات الدائنة والمدينة تحتاج سبب الإصدار",
"en_meaning": "When cbc:InvoiceTypeCode is 381 or 383, every cac:PaymentMeans must contain cbc:InstructionNote (KSA-10); a note with no cac:PaymentMeans at all also fails.",
"en_fix": "Add the reason inside cac:PaymentMeans, e.g. `<cac:PaymentMeans><cbc:PaymentMeansCode>10</cbc:PaymentMeansCode><cbc:InstructionNote>Goods returned</cbc:InstructionNote></cac:PaymentMeans>`.",
"ar_meaning": "عندما تكون قيمة cbc:InvoiceTypeCode هي 381 أو 383 يجب أن يحتوي كل cac:PaymentMeans على cbc:InstructionNote (KSA-10)؛ ويفشل الإشعار أيضاً إذا لم يحتوِ على أي cac:PaymentMeans.",
"ar_fix": "أضف السبب داخل cac:PaymentMeans، مثل `<cac:PaymentMeans><cbc:PaymentMeansCode>10</cbc:PaymentMeansCode><cbc:InstructionNote>Goods returned</cbc:InstructionNote></cac:PaymentMeans>`.",
"applies_to": "credit_debit_notes",
"fields": [
"BT-3",
"KSA-10"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-17",
"url_ar": "https://matheel.app/akhta/br-ksa-17"
},
{
"id": "BR-KSA-18",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-18]-VAT category code must contain one of the values (S, Z, E, O).",
"fails_when": "not( contains( ' S Z E O ',(.)) )",
"en_title": "VAT category code must be S, Z, E or O",
"ar_title": "رمز فئة الضريبة يجب أن يكون S أو Z أو E أو O",
"en_meaning": "Each tax category cbc:ID (in cac:TaxSubtotal/cac:TaxCategory, line cac:TaxSubtotal, document-level cac:AllowanceCharge/cac:TaxCategory and line cac:Item/cac:ClassifiedTaxCategory) must be S, Z, E or O. The executed check tests each code; the listed test text is malformed and does not express this.",
"en_fix": "Use S (standard), Z (zero-rated), E (exempt) or O (not subject to VAT), e.g. `<cbc:ID>S</cbc:ID>`.",
"ar_meaning": "يتحقق من أن كل cbc:ID لفئة ضريبية (في cac:TaxSubtotal/cac:TaxCategory، وفي cac:TaxSubtotal للبنود، وفي cac:AllowanceCharge/cac:TaxCategory على مستوى المستند، وفي cac:Item/cac:ClassifiedTaxCategory للبنود) هو S أو Z أو E أو O. الفحص الفعلي يختبر كل رمز، أما نص الاختبار المدرج فمعيب ولا يعبّر عن ذلك.",
"ar_fix": "استخدم S (أساسية) أو Z (نسبة صفرية) أو E (معفاة) أو O (غير خاضعة للضريبة)، مثل `<cbc:ID>S</cbc:ID>`.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-18",
"url_ar": "https://matheel.app/akhta/br-ksa-18"
},
{
"id": "BR-KSA-19",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-19]-Each Document level charge (BG-21) shall have a code for the reason for document level charge (BT-105).",
"fails_when": "not (exists(cbc:AllowanceChargeReasonCode) and normalize-space(cbc:AllowanceChargeReasonCode )!='' )",
"en_title": "Each document-level charge needs a reason code",
"ar_title": "كل رسم على مستوى المستند يحتاج رمز سبب",
"en_meaning": "Applies to each document-level cac:AllowanceCharge with cbc:ChargeIndicator = true: it must have a non-empty cbc:AllowanceChargeReasonCode (BT-105). A text cbc:AllowanceChargeReason alone does not satisfy the executed check; the listed test text expresses this differently.",
"en_fix": "Add a reason code to each document-level charge, e.g. `<cbc:AllowanceChargeReasonCode>…</cbc:AllowanceChargeReasonCode>`.",
"ar_meaning": "تنطبق على كل cac:AllowanceCharge على مستوى المستند فيه cbc:ChargeIndicator = true: يجب أن يحتوي على cbc:AllowanceChargeReasonCode (BT-105) غير فارغ. وجود السبب النصي cbc:AllowanceChargeReason وحده لا يكفي في الفحص الفعلي؛ ونص الاختبار المدرج يعبّر عن ذلك بشكل مختلف.",
"ar_fix": "أضف رمز سبب لكل رسم على مستوى المستند، مثل `<cbc:AllowanceChargeReasonCode>…</cbc:AllowanceChargeReasonCode>`.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-105"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-19",
"url_ar": "https://matheel.app/akhta/br-ksa-19"
},
{
"id": "BR-KSA-20",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-20]-Each Invoice line charge (BG-28) shall have a code for the reason for invoice line charge (BT-145).",
"fails_when": "not(exists(cbc:AllowanceChargeReasonCode) and normalize-space(cbc:AllowanceChargeReasonCode )!='' )",
"en_title": "Each invoice line charge needs a reason code",
"ar_title": "كل رسم على مستوى البند يحتاج رمز سبب",
"en_meaning": "Applies to each cac:InvoiceLine/cac:AllowanceCharge with cbc:ChargeIndicator = true: it must have a non-empty cbc:AllowanceChargeReasonCode (BT-145). A text cbc:AllowanceChargeReason alone does not satisfy the executed check; the listed test text expresses this differently.",
"en_fix": "Add a reason code to each line-level charge, e.g. `<cbc:AllowanceChargeReasonCode>…</cbc:AllowanceChargeReasonCode>`.",
"ar_meaning": "تنطبق على كل cac:InvoiceLine/cac:AllowanceCharge فيه cbc:ChargeIndicator = true: يجب أن يحتوي على cbc:AllowanceChargeReasonCode (BT-145) غير فارغ. وجود السبب النصي cbc:AllowanceChargeReason وحده لا يكفي في الفحص الفعلي؛ ونص الاختبار المدرج يعبّر عن ذلك بشكل مختلف.",
"ar_fix": "أضف رمز سبب لكل رسم على مستوى البند، مثل `<cbc:AllowanceChargeReasonCode>…</cbc:AllowanceChargeReasonCode>`.",
"applies_to": "conditional",
"fields": [
"BG-28",
"BT-145"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-20",
"url_ar": "https://matheel.app/akhta/br-ksa-20"
},
{
"id": "BR-KSA-21",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-21]-Each Document level charge (BG-21) shall have a Reason for document level charge (BT-104).",
"fails_when": "not (exists(cbc:AllowanceChargeReason) and normalize-space(cbc:AllowanceChargeReason )!='' )",
"en_title": "Each document-level charge needs a charge reason text (BT-104)",
"ar_title": "كل رسم على مستوى المستند يحتاج نص سبب الرسم (BT-104)",
"en_meaning": "Applies only when the invoice has a document-level charge (BG-21): every cac:AllowanceCharge directly under the invoice with cbc:ChargeIndicator = true must contain a non-blank cbc:AllowanceChargeReason (BT-104).",
"en_fix": "Add a reason text to every document-level charge, for example `<cbc:AllowanceChargeReason>Delivery charge</cbc:AllowanceChargeReason>` inside the cac:AllowanceCharge whose cbc:ChargeIndicator is true.",
"ar_meaning": "تنطبق فقط عند وجود رسم على مستوى المستند (BG-21): كل عنصر cac:AllowanceCharge مباشرة تحت الفاتورة وقيمة cbc:ChargeIndicator فيه true يجب أن يحتوي على cbc:AllowanceChargeReason (BT-104) غير فارغ.",
"ar_fix": "أضف نص سبب لكل رسم على مستوى المستند، مثل `<cbc:AllowanceChargeReason>Delivery charge</cbc:AllowanceChargeReason>` داخل cac:AllowanceCharge الذي قيمة cbc:ChargeIndicator فيه true.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-104"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-21",
"url_ar": "https://matheel.app/akhta/br-ksa-21"
},
{
"id": "BR-KSA-22",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-22]- Each Invoice line charge (BG-28) shall have a Reason for invoice line charge (BT-144).",
"fails_when": "not( exists(cbc:AllowanceChargeReason)and normalize-space(cbc:AllowanceChargeReason )!='' )",
"en_title": "Each invoice line charge needs a charge reason text (BT-144)",
"ar_title": "كل رسم على مستوى البند يحتاج نص سبب الرسم (BT-144)",
"en_meaning": "Applies only when a line has a charge (BG-28): every cac:InvoiceLine/cac:AllowanceCharge with cbc:ChargeIndicator = true must contain a non-blank cbc:AllowanceChargeReason (BT-144).",
"en_fix": "Add a reason text to every line-level charge, for example `<cbc:AllowanceChargeReason>Installation</cbc:AllowanceChargeReason>` inside the line's cac:AllowanceCharge whose cbc:ChargeIndicator is true.",
"ar_meaning": "تنطبق فقط عند وجود رسم على أحد البنود (BG-28): كل عنصر cac:InvoiceLine/cac:AllowanceCharge قيمة cbc:ChargeIndicator فيه true يجب أن يحتوي على cbc:AllowanceChargeReason (BT-144) غير فارغ.",
"ar_fix": "أضف نص سبب لكل رسم على مستوى البند، مثل `<cbc:AllowanceChargeReason>Installation</cbc:AllowanceChargeReason>` داخل cac:AllowanceCharge الخاص بالبند والذي قيمة cbc:ChargeIndicator فيه true.",
"applies_to": "conditional",
"fields": [
"BG-28",
"BT-144"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-22",
"url_ar": "https://matheel.app/akhta/br-ksa-22"
},
{
"id": "BR-KSA-23",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-23]-A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Exempt from VAT' shall have a VAT exemption reason code (BT-121).",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and normalize-space(cbc:TaxExemptionReasonCode )!='' )",
"en_title": "VAT-exempt (E) breakdown needs an exemption reason code (BT-121)",
"ar_title": "تفصيل الضريبة المعفى (E) يحتاج رمز سبب الإعفاء (BT-121)",
"en_meaning": "Applies to each document-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory whose cbc:ID is 'E' (exempt): it must contain a non-blank cbc:TaxExemptionReasonCode (BT-121). This rule checks only that a code is present, not which code it is.",
"en_fix": "Inside every TaxCategory with cbc:ID 'E', add `<cbc:TaxExemptionReasonCode>` with the exemption code that applies; the exempt codes named in the rule's text are VATEX-SA-29, VATEX-SA-29-7 and VATEX-SA-30.",
"ar_meaning": "تنطبق على كل عنصر cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى المستند قيمة cbc:ID فيه 'E' (معفى): يجب أن يحتوي على cbc:TaxExemptionReasonCode (BT-121) غير فارغ. القاعدة تتحقق من وجود الرمز فقط، لا من قيمته.",
"ar_fix": "داخل كل TaxCategory قيمة cbc:ID فيه 'E' أضف `<cbc:TaxExemptionReasonCode>` برمز الإعفاء المناسب؛ رموز الإعفاء المذكورة في نص القاعدة هي VATEX-SA-29 و VATEX-SA-29-7 و VATEX-SA-30.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-121"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-23",
"url_ar": "https://matheel.app/akhta/br-ksa-23"
},
{
"id": "BR-KSA-24",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-24]-A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Not subject to VAT' shall have a VAT exception reason code (BT-121)",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and normalize-space(cbc:TaxExemptionReasonCode )!='' )",
"en_title": "Not-subject-to-VAT (O) breakdown needs a reason code (BT-121)",
"ar_title": "تفصيل الضريبة غير الخاضع (O) يحتاج رمز السبب (BT-121)",
"en_meaning": "Applies to each document-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory whose cbc:ID is 'O' (not subject to VAT): it must contain a non-blank cbc:TaxExemptionReasonCode (BT-121). This rule checks only that a code is present, not which code it is.",
"en_fix": "Inside every TaxCategory with cbc:ID 'O', add `<cbc:TaxExemptionReasonCode>` with the out-of-scope reason code (the same rules file uses VATEX-SA-OOS for this category).",
"ar_meaning": "تنطبق على كل عنصر cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى المستند قيمة cbc:ID فيه 'O' (غير خاضع للضريبة): يجب أن يحتوي على cbc:TaxExemptionReasonCode (BT-121) غير فارغ. القاعدة تتحقق من وجود الرمز فقط، لا من قيمته.",
"ar_fix": "داخل كل TaxCategory قيمة cbc:ID فيه 'O' أضف `<cbc:TaxExemptionReasonCode>` برمز سبب عدم الخضوع (ملف القواعد نفسه يستخدم VATEX-SA-OOS لهذه الفئة).",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-121"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-24",
"url_ar": "https://matheel.app/akhta/br-ksa-24"
},
{
"id": "BR-KSA-25",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-25]-If it is a simplified tax invoice or an associated credit note or a debit note (KSA-2, position 1 and 2 = 02) and the tax exemption reason code (BT-121) is equal with VATEX-SA-EDU or VATEX-SA-HEA, then buyer name (BT-44) is mandatory.",
"fails_when": "not((every $taxreasoncode in //cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:TaxExemptionReasonCode satisfies contains(' VATEX-SA-HEA VATEX-SA-EDU ', $taxreasoncode) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) and (//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) != '') or not(every $taxreasoncode in //cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:TaxExemptionReasonCode satisfies contains(' VATEX-SA-HEA VATEX-SA-EDU ', $taxreasoncode)))",
"en_title": "Simplified invoice with EDU/HEA exemption needs the buyer name",
"ar_title": "الفاتورة المبسطة بإعفاء EDU/HEA تتطلب اسم المشتري",
"en_meaning": "For simplified invoices and their notes (cbc:InvoiceTypeCode @name starting '02'): if the invoice has VAT exemption reason codes (BT-121) and every one of them is VATEX-SA-EDU or VATEX-SA-HEA, the buyer name cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName (BT-44) must be present and non-empty. If any other exemption code also appears, the check does not trigger.",
"en_fix": "Add the buyer's name: `<cac:PartyLegalEntity><cbc:RegistrationName>…</cbc:RegistrationName></cac:PartyLegalEntity>` under cac:AccountingCustomerParty/cac:Party.",
"ar_meaning": "للفواتير المبسطة وإشعاراتها (قيمة @name في cbc:InvoiceTypeCode تبدأ بـ '02'): إذا احتوت الفاتورة على رموز سبب إعفاء (BT-121) وكانت كلها VATEX-SA-EDU أو VATEX-SA-HEA، فيجب أن يكون اسم المشتري cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName (BT-44) موجودًا وغير فارغ. إذا ظهر رمز إعفاء آخر معها فلا ينطبق الفحص.",
"ar_fix": "أضف اسم المشتري: `<cac:PartyLegalEntity><cbc:RegistrationName>…</cbc:RegistrationName></cac:PartyLegalEntity>` تحت cac:AccountingCustomerParty/cac:Party.",
"applies_to": "simplified",
"fields": [
"KSA-2",
"BT-121",
"BT-44"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-25",
"url_ar": "https://matheel.app/akhta/br-ksa-25"
},
{
"id": "BR-KSA-26",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-26]-If the invoice contains the previous invoice hash (KSA-13), this hash must be base64 encoded SHA256. The hash shall be computed using the following method as described in the ds:transforms block in the XML Invoice Specifications: 1. Remove the <Invoice><ext:UBLExtensions/> block 2. Remove the <Invoice><cac:AdditionalDocumentReference/> block where <cbc:ID/> = QR 3. Remove the <Invoice><cac:Signature/> block 4. Canonicalize the Invoice using the C14N11 standard 5. Hash the resulting string using SHA256 to a binary object 6. Base64 encode the binary object to generate the digest value For the first invoice, the previous invoice hash is \"NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==\", the equivalent for base64 encoded SHA256 of \"0\" (zero) character.",
"fails_when": "not(exists(cbc:EmbeddedDocumentBinaryObject) and (cbc:EmbeddedDocumentBinaryObject) != '' and (cbc:EmbeddedDocumentBinaryObject[normalize-space(@mimeCode) = 'text/plain']))",
"en_title": "Previous invoice hash (PIH) attachment must be filled, text/plain",
"ar_title": "مرفق تجزئة الفاتورة السابقة (PIH) غير فارغ وبنوع text/plain",
"en_meaning": "Runs on the cac:Attachment of the cac:AdditionalDocumentReference whose cbc:ID is 'PIH' (KSA-13): it must contain a non-empty cbc:EmbeddedDocumentBinaryObject with mimeCode='text/plain'. The official text describes how the SHA-256 hash is computed, but this check does not recompute or verify the hash value itself.",
"en_fix": "Put the base64 SHA-256 hash of the previous invoice in `<cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">…</cbc:EmbeddedDocumentBinaryObject>` inside the PIH attachment. For the first invoice, the official text gives the value NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==.",
"ar_meaning": "تُطبَّق على عنصر cac:Attachment داخل cac:AdditionalDocumentReference الذي قيمة cbc:ID فيه 'PIH' (KSA-13): يجب أن يحتوي على cbc:EmbeddedDocumentBinaryObject غير فارغ مع mimeCode='text/plain'. النص الرسمي يشرح طريقة حساب تجزئة SHA-256، لكن هذا الفحص لا يعيد حساب قيمة التجزئة ولا يتحقق منها.",
"ar_fix": "ضع تجزئة SHA-256 للفاتورة السابقة بترميز base64 في `<cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">…</cbc:EmbeddedDocumentBinaryObject>` داخل مرفق PIH. للفاتورة الأولى، القيمة المحددة في النص الرسمي هي NWZlY2ViNjZmZmM4NmYzOGQ5NTI3ODZjNmQ2OTZjNzljMmRiYzIzOWRkNGU5MWI0NjcyOWQ3M2EyN2ZiNTdlOQ==.",
"applies_to": "conditional",
"fields": [
"KSA-13"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-26",
"url_ar": "https://matheel.app/akhta/br-ksa-26"
},
{
"id": "BR-KSA-27",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-27]-The document must contain a QR code (KSA-14), and this code must be base64Binary.",
"fails_when": "not((cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'QR'] and exists(cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) and (normalize-space(cac:AdditionalDocumentReference[cbc:ID = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) != '') and (cac:AdditionalDocumentReference[cbc:ID = 'QR']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject[normalize-space(@mimeCode) = 'text/plain'])) )",
"en_title": "Simplified invoices must carry a QR code (KSA-14)",
"ar_title": "الفاتورة المبسطة يجب أن تحتوي على رمز QR (KSA-14)",
"en_meaning": "Requires a cac:AdditionalDocumentReference with cbc:ID 'QR' whose cac:Attachment has a non-empty cbc:EmbeddedDocumentBinaryObject with mimeCode='text/plain'. Although the official text says every document, the check only runs for simplified invoices and their notes (InvoiceTypeCode @name starting '02').",
"en_fix": "Add `<cac:AdditionalDocumentReference><cbc:ID>QR</cbc:ID><cac:Attachment><cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">…</cbc:EmbeddedDocumentBinaryObject></cac:Attachment></cac:AdditionalDocumentReference>` with the base64 QR content.",
"ar_meaning": "تتطلب وجود cac:AdditionalDocumentReference قيمة cbc:ID فيه 'QR' ويحتوي cac:Attachment فيه على cbc:EmbeddedDocumentBinaryObject غير فارغ مع mimeCode='text/plain'. رغم أن النص الرسمي يذكر كل مستند، فإن الفحص يُطبَّق فقط على الفواتير المبسطة وإشعاراتها (قيمة @name في InvoiceTypeCode تبدأ بـ '02').",
"ar_fix": "أضف `<cac:AdditionalDocumentReference><cbc:ID>QR</cbc:ID><cac:Attachment><cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">…</cbc:EmbeddedDocumentBinaryObject></cac:Attachment></cac:AdditionalDocumentReference>` مع محتوى رمز QR بترميز base64.",
"applies_to": "simplified",
"fields": [
"KSA-14"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-27",
"url_ar": "https://matheel.app/akhta/br-ksa-27"
},
{
"id": "BR-KSA-28",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-28]-If the cryptographic stamp (KSA-15) exists in the invoice, this cryptographic stamp (KSA-15) must contain the exact \"urn:oasis:names:specification:ubl:signature:1\" value for signature information ID.",
"fails_when": "not(exists(cbc:EmbeddedDocumentBinaryObject) and (cbc:EmbeddedDocumentBinaryObject) != '' and (//ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/sig:UBLDocumentSignatures/sac:SignatureInformation/cbc:ID) = 'urn:oasis:names:specification:ubl:signature:1')",
"en_title": "Signature information ID must be ...ubl:signature:1",
"ar_title": "معرّف معلومات التوقيع يجب أن يكون ...ubl:signature:1",
"en_meaning": "For simplified invoices and their notes (@name starting '02'), on every document attachment other than the PIH one (in practice the QR attachment): the attachment's cbc:EmbeddedDocumentBinaryObject must be non-empty and sac:SignatureInformation/cbc:ID in ext:UBLExtensions must equal 'urn:oasis:names:specification:ubl:signature:1'. It is not checked on standard invoices.",
"en_fix": "In ext:UBLExtensions/…/sig:UBLDocumentSignatures/sac:SignatureInformation set `<cbc:ID>urn:oasis:names:specification:ubl:signature:1</cbc:ID>`, and make sure the QR attachment is not empty.",
"ar_meaning": "للفواتير المبسطة وإشعاراتها (@name يبدأ بـ '02')، على كل مرفق في المستند عدا مرفق PIH (عمليًا مرفق QR): يجب أن يكون cbc:EmbeddedDocumentBinaryObject في المرفق غير فارغ، وأن تساوي قيمة sac:SignatureInformation/cbc:ID داخل ext:UBLExtensions القيمة 'urn:oasis:names:specification:ubl:signature:1'. لا يُطبَّق على الفواتير الضريبية القياسية.",
"ar_fix": "داخل ext:UBLExtensions/…/sig:UBLDocumentSignatures/sac:SignatureInformation ضع `<cbc:ID>urn:oasis:names:specification:ubl:signature:1</cbc:ID>`، وتأكد أن مرفق QR غير فارغ.",
"applies_to": "simplified",
"fields": [
"KSA-15"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-28",
"url_ar": "https://matheel.app/akhta/br-ksa-28"
},
{
"id": "BR-KSA-29",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-29]-If the cryptographic stamp (KSA-15) exists in the invoice, this cryptographic stamp (KSA-15) must contain the exact \"urn:oasis:names:specification:ubl:signature:Invoice\" value for referenced signature ID and signature ID.",
"fails_when": "not((//cac:Signature/cbc:ID) = 'urn:oasis:names:specification:ubl:signature:Invoice' and (normalize-space(//ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/sig:UBLDocumentSignatures/sac:SignatureInformation/sbc:ReferencedSignatureID)) = 'urn:oasis:names:specification:ubl:signature:Invoice' )",
"en_title": "Signature ID and referenced signature ID must be ...signature:Invoice",
"ar_title": "معرّف التوقيع ومرجعه يجب أن يكونا ...signature:Invoice",
"en_meaning": "For simplified invoices and their notes (@name starting '02'), checked once per non-PIH attachment: cac:Signature/cbc:ID and sac:SignatureInformation/sbc:ReferencedSignatureID (in ext:UBLExtensions) must both equal 'urn:oasis:names:specification:ubl:signature:Invoice'. It is not checked on standard invoices.",
"en_fix": "Set `<cbc:ID>urn:oasis:names:specification:ubl:signature:Invoice</cbc:ID>` in cac:Signature and `<sbc:ReferencedSignatureID>urn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>` in sac:SignatureInformation.",
"ar_meaning": "للفواتير المبسطة وإشعاراتها (@name يبدأ بـ '02')، ويُفحص مع كل مرفق عدا مرفق PIH: يجب أن تساوي كلٌّ من cac:Signature/cbc:ID و sac:SignatureInformation/sbc:ReferencedSignatureID (داخل ext:UBLExtensions) القيمة 'urn:oasis:names:specification:ubl:signature:Invoice'. لا يُطبَّق على الفواتير الضريبية القياسية.",
"ar_fix": "ضع `<cbc:ID>urn:oasis:names:specification:ubl:signature:Invoice</cbc:ID>` في cac:Signature و `<sbc:ReferencedSignatureID>urn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>` في sac:SignatureInformation.",
"applies_to": "simplified",
"fields": [
"KSA-15"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-29",
"url_ar": "https://matheel.app/akhta/br-ksa-29"
},
{
"id": "BR-KSA-30",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-30]-The document cryptographic stamp (KSA-15) must contain the exact \"urn:oasis:names:specification:ubl:dsig:enveloped:xades\" value for signature method.",
"fails_when": "not(exists(cbc:EmbeddedDocumentBinaryObject) and (cbc:EmbeddedDocumentBinaryObject) != '' and (//cac:Signature/cbc:SignatureMethod) = 'urn:oasis:names:specification:ubl:dsig:enveloped:xades')",
"en_title": "Signature method must be the enveloped XAdES URN",
"ar_title": "طريقة التوقيع يجب أن تكون معرّف XAdES المغلّف",
"en_meaning": "For simplified invoices and their notes (@name starting '02'), on every non-PIH attachment (in practice the QR attachment): the attachment's cbc:EmbeddedDocumentBinaryObject must be non-empty and cac:Signature/cbc:SignatureMethod must equal 'urn:oasis:names:specification:ubl:dsig:enveloped:xades'. Although the official text says every document, standard invoices are not checked.",
"en_fix": "In cac:Signature set `<cbc:SignatureMethod>urn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod>`, and make sure the QR attachment is not empty.",
"ar_meaning": "للفواتير المبسطة وإشعاراتها (@name يبدأ بـ '02')، على كل مرفق عدا مرفق PIH (عمليًا مرفق QR): يجب أن يكون cbc:EmbeddedDocumentBinaryObject في المرفق غير فارغ، وأن تساوي قيمة cac:Signature/cbc:SignatureMethod القيمة 'urn:oasis:names:specification:ubl:dsig:enveloped:xades'. رغم أن النص الرسمي يذكر كل مستند، لا تُفحص الفواتير القياسية.",
"ar_fix": "في cac:Signature ضع `<cbc:SignatureMethod>urn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod>`، وتأكد أن مرفق QR غير فارغ.",
"applies_to": "simplified",
"fields": [
"KSA-15"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-30",
"url_ar": "https://matheel.app/akhta/br-ksa-30"
},
{
"id": "BR-KSA-31",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-31]- For Simplified Tax Invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02), transaction types \"self-billing\" (KSA-2, position 7 = True) is not allowed.",
"fails_when": "not( (substring(./@name, 3,1) = '1' or substring(./@name, 3,1) = '0') and (substring(./@name, 4,1) = '1' or substring(./@name, 4,1) = '0') and (substring(./@name, 5,1) = '1' or substring(./@name, 5,1) = '0') and (substring(./@name, 6,1) = '1' or substring(./@name, 6,1) = '0') and (substring(./@name, 7,1) = '0'))",
"en_title": "Simplified invoices cannot be self-billed (KSA-2 position 7 = 0)",
"ar_title": "الفاتورة المبسطة لا تكون فوترة ذاتية (الخانة 7 = 0)",
"en_meaning": "For InvoiceTypeCode @name starting '02' (simplified), the check requires characters 3 to 6 of @name to each be '0' or '1' and character 7 (self-billing) to be '0'. So a value such as '0200001' fails, as does any non-binary flag in positions 3–6.",
"en_fix": "Set the 7th character of the InvoiceTypeCode name attribute to 0, e.g. `<cbc:InvoiceTypeCode name=\"0200000\">388</cbc:InvoiceTypeCode>`; self-billing is not allowed on simplified invoices.",
"ar_meaning": "عندما تبدأ قيمة @name في InvoiceTypeCode بـ '02' (مبسطة)، يتطلب الفحص أن تكون الخانات من 3 إلى 6 في @name كلٌّ منها '0' أو '1'، وأن تكون الخانة 7 (الفوترة الذاتية) '0'. لذلك تفشل قيمة مثل '0200001'، وكذلك أي قيمة غير ثنائية في الخانات 3 إلى 6.",
"ar_fix": "اجعل الخانة السابعة في سمة name لعنصر InvoiceTypeCode صفرًا، مثل `<cbc:InvoiceTypeCode name=\"0200000\">388</cbc:InvoiceTypeCode>`؛ الفوترة الذاتية غير مسموحة في الفواتير المبسطة.",
"applies_to": "simplified",
"fields": [
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-31",
"url_ar": "https://matheel.app/akhta/br-ksa-31"
},
{
"id": "BR-KSA-33",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-33]-Each invoice must have an invoice counter value (KSA-16).",
"fails_when": "not((cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'ICV'] and (cac:AdditionalDocumentReference/cbc:UUID) != ''))",
"en_title": "Every invoice needs an invoice counter value (ICV, KSA-16)",
"ar_title": "كل فاتورة تحتاج قيمة عداد الفاتورة (ICV، KSA-16)",
"en_meaning": "The invoice must contain a cac:AdditionalDocumentReference with cbc:ID = 'ICV', and a non-empty cbc:UUID under cac:AdditionalDocumentReference, which holds the invoice counter value (KSA-16).",
"en_fix": "Add `<cac:AdditionalDocumentReference><cbc:ID>ICV</cbc:ID><cbc:UUID>10</cbc:UUID></cac:AdditionalDocumentReference>`, with your counter value in cbc:UUID.",
"ar_meaning": "يجب أن تحتوي الفاتورة على cac:AdditionalDocumentReference قيمة cbc:ID فيه 'ICV'، وعلى cbc:UUID غير فارغ تحت cac:AdditionalDocumentReference يحمل قيمة عداد الفاتورة (KSA-16).",
"ar_fix": "أضف `<cac:AdditionalDocumentReference><cbc:ID>ICV</cbc:ID><cbc:UUID>10</cbc:UUID></cac:AdditionalDocumentReference>` مع قيمة العداد الخاصة بك في cbc:UUID.",
"applies_to": "all",
"fields": [
"KSA-16"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-33",
"url_ar": "https://matheel.app/akhta/br-ksa-33"
},
{
"id": "BR-KSA-34",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-34]-The invoice counter value (KSA-16) contains only digits.",
"fails_when": "not(matches(cac:AdditionalDocumentReference/cbc:UUID, '^[0-9]*$'))",
"en_title": "Invoice counter value (ICV, KSA-16) must contain only digits",
"ar_title": "قيمة عداد الفاتورة (ICV، KSA-16) أرقام فقط",
"en_meaning": "The cbc:UUID inside cac:AdditionalDocumentReference (the ICV counter, KSA-16) must match ^[0-9]*$: digits only, with no letters, spaces, signs or separators.",
"en_fix": "Write the counter as plain digits, e.g. `<cbc:UUID>10</cbc:UUID>` in the ICV reference.",
"ar_meaning": "يجب أن تطابق قيمة cbc:UUID داخل cac:AdditionalDocumentReference (عداد ICV، KSA-16) النمط ^[0-9]*$: أرقام فقط، بلا حروف أو مسافات أو إشارات أو فواصل.",
"ar_fix": "اكتب العداد أرقامًا فقط، مثل `<cbc:UUID>10</cbc:UUID>` في مرجع ICV.",
"applies_to": "all",
"fields": [
"KSA-16"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-34",
"url_ar": "https://matheel.app/akhta/br-ksa-34"
},
{
"id": "BR-KSA-35",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-35]-If the invoice contains a supply end date (KSA-24), then the invoice must contain a supply date (KSA-5).",
"fails_when": "not(exists(../cbc:ActualDeliveryDate) and normalize-space(../cbc:ActualDeliveryDate) != '')",
"en_title": "A supply end date (KSA-24) requires a supply date (KSA-5)",
"ar_title": "تاريخ انتهاء التوريد (KSA-24) يتطلب تاريخ التوريد (KSA-5)",
"en_meaning": "Applies only when cac:Delivery/cbc:LatestDeliveryDate (supply end date, KSA-24) is present: the same cac:Delivery must also contain a non-blank cbc:ActualDeliveryDate (supply date, KSA-5).",
"en_fix": "Add the start date next to the end date, e.g. `<cac:Delivery><cbc:ActualDeliveryDate>2022-09-01</cbc:ActualDeliveryDate><cbc:LatestDeliveryDate>2022-09-30</cbc:LatestDeliveryDate></cac:Delivery>`.",
"ar_meaning": "تنطبق فقط عند وجود cac:Delivery/cbc:LatestDeliveryDate (تاريخ انتهاء التوريد، KSA-24): يجب أن يحتوي عنصر cac:Delivery نفسه على cbc:ActualDeliveryDate (تاريخ التوريد، KSA-5) غير فارغ.",
"ar_fix": "أضف تاريخ البداية بجانب تاريخ الانتهاء، مثل `<cac:Delivery><cbc:ActualDeliveryDate>2022-09-01</cbc:ActualDeliveryDate><cbc:LatestDeliveryDate>2022-09-30</cbc:LatestDeliveryDate></cac:Delivery>`.",
"applies_to": "conditional",
"fields": [
"KSA-24",
"KSA-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-35",
"url_ar": "https://matheel.app/akhta/br-ksa-35"
},
{
"id": "BR-KSA-36",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-36]-If the invoice contains a supply end date (KSA-24), then this date must be greater than or equal to the supply date (KSA-5).",
"fails_when": "(exists(../cbc:ActualDeliveryDate) and normalize-space(../cbc:ActualDeliveryDate) != '') and (string-length(string(../cbc:ActualDeliveryDate)) = 10 and matches( string(../cbc:ActualDeliveryDate), '((18|19|20)[0-9]{2}[\\-](0[13578]|1[02])[\\-](0[1-9]|[12][0-9]|3[01]))|(18|19|20)[0-9]{2}[\\-](0[469]|11)[\\-](0[1-9]|[12][0-9]|30)|(18|19|20)[0-9]{2}[\\-](02)[\\-](0[1-9]|1[0-9]|2[0-8])|(((18|19|20)(04|08|[2468][048]|[13579][26]))|2000)[\\-](02)[\\-]29')) and (string-length( .) = 10 and matches( string(.), '((18|19|20)[0-9]{2}[\\-](0[13578]|1[02])[\\-](0[1-9]|[12][0-9]|3[01]))|(18|19|20)[0-9]{2}[\\-](0[469]|11)[\\-](0[1-9]|[12][0-9]|30)|(18|19|20)[0-9]{2}[\\-](02)[\\-](0[1-9]|1[0-9]|2[0-8])|(((18|19|20)(04|08|[2468][048]|[13579][26]))|2000)[\\-](02)[\\-]29') )and not(xs:date(.) >= xs:date(../cbc:ActualDeliveryDate) )",
"en_title": "Supply end date (KSA-24) must not be before supply date (KSA-5)",
"ar_title": "تاريخ انتهاء التوريد (KSA-24) لا يسبق تاريخ التوريد (KSA-5)",
"en_meaning": "Applies when cac:Delivery has both cbc:ActualDeliveryDate (KSA-5) and cbc:LatestDeliveryDate (KSA-24) as valid YYYY-MM-DD dates: the end date must be greater than or equal to the supply date. If either date is missing or not a valid YYYY-MM-DD date, this rule does not compare them.",
"en_fix": "Make cbc:LatestDeliveryDate the same day as or later than cbc:ActualDeliveryDate, both in YYYY-MM-DD format.",
"ar_meaning": "تنطبق عندما يحتوي cac:Delivery على cbc:ActualDeliveryDate (KSA-5) و cbc:LatestDeliveryDate (KSA-24) بتاريخين صحيحين بصيغة YYYY-MM-DD: يجب أن يكون تاريخ الانتهاء مساويًا لتاريخ التوريد أو بعده. إذا غاب أحد التاريخين أو لم يكن بصيغة YYYY-MM-DD صحيحة فلا تُجري القاعدة المقارنة.",
"ar_fix": "اجعل cbc:LatestDeliveryDate في نفس يوم cbc:ActualDeliveryDate أو بعده، وكلاهما بصيغة YYYY-MM-DD.",
"applies_to": "conditional",
"fields": [
"KSA-24",
"KSA-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-36",
"url_ar": "https://matheel.app/akhta/br-ksa-36"
},
{
"id": "BR-KSA-37",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-37]-The seller address building number must contain 4 digits.",
"fails_when": "not(matches(cac:PostalAddress/cbc:BuildingNumber, '^[0-9]{4}$'))",
"en_title": "Seller building number must be exactly 4 digits",
"ar_title": "رقم مبنى البائع يجب أن يكون 4 أرقام بالضبط",
"en_meaning": "The seller's address cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:BuildingNumber must match ^[0-9]{4}$: exactly four digits. A missing building number also fails this check.",
"en_fix": "Provide the seller building number as four digits, e.g. `<cbc:BuildingNumber>2322</cbc:BuildingNumber>`.",
"ar_meaning": "يجب أن تطابق قيمة رقم المبنى في عنوان البائع cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:BuildingNumber النمط ^[0-9]{4}$: أربعة أرقام بالضبط. غياب رقم المبنى يُفشل الفحص أيضًا.",
"ar_fix": "أدخل رقم مبنى البائع من أربعة أرقام، مثل `<cbc:BuildingNumber>2322</cbc:BuildingNumber>`.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-37",
"url_ar": "https://matheel.app/akhta/br-ksa-37"
},
{
"id": "BR-KSA-39",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-39]-The invoice must contain the seller VAT registration number or seller group VAT registration number (BT-31).",
"fails_when": "not(((cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) != '' and (cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cac:TaxScheme[normalize-space(cbc:ID) = 'VAT'])))",
"en_title": "Seller VAT registration number (BT-31) is required",
"ar_title": "رقم التسجيل الضريبي للبائع (BT-31) مطلوب",
"en_meaning": "The seller party must have a cac:PartyTaxScheme with a non-empty cbc:CompanyID (BT-31) and a cac:TaxScheme whose cbc:ID is 'VAT'.",
"en_fix": "Add `<cac:PartyTaxScheme><cbc:CompanyID>…</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>` under cac:AccountingSupplierParty/cac:Party.",
"ar_meaning": "يجب أن يحتوي طرف البائع على cac:PartyTaxScheme فيه cbc:CompanyID (BT-31) غير فارغ، و cac:TaxScheme قيمة cbc:ID فيه 'VAT'.",
"ar_fix": "أضف `<cac:PartyTaxScheme><cbc:CompanyID>…</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme>` تحت cac:AccountingSupplierParty/cac:Party.",
"applies_to": "all",
"fields": [
"BT-31"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-39",
"url_ar": "https://matheel.app/akhta/br-ksa-39"
},
{
"id": "BR-KSA-40",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-40]-If it exists in the invoice, the seller VAT registration number (BT-31) must contain 15 digits. The first and the last digits are \"3\"..",
"fails_when": "not(matches(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '^[0-9]{15}$') and starts-with(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '3') and ends-with(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '3'))",
"en_title": "Seller VAT number (BT-31): 15 digits, starting and ending with 3",
"ar_title": "الرقم الضريبي للبائع (BT-31): 15 رقمًا يبدأ وينتهي بـ 3",
"en_meaning": "When the seller has a cac:PartyTaxScheme with TaxScheme cbc:ID 'VAT' and a cbc:CompanyID, that CompanyID (BT-31) must be exactly 15 digits, with the first and last digit both '3'.",
"en_fix": "Use the seller's 15-digit VAT number in cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, with no spaces, letters or prefixes.",
"ar_meaning": "عندما يحتوي طرف البائع على cac:PartyTaxScheme بقيمة TaxScheme cbc:ID تساوي 'VAT' ومعه cbc:CompanyID، يجب أن يتكون CompanyID (BT-31) من 15 رقمًا بالضبط، أولها وآخرها '3'.",
"ar_fix": "استخدم الرقم الضريبي للبائع المكون من 15 رقمًا في cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID دون مسافات أو حروف أو بادئات.",
"applies_to": "conditional",
"fields": [
"BT-31"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-40",
"url_ar": "https://matheel.app/akhta/br-ksa-40"
},
{
"id": "BR-KSA-42",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "The buyer name (BT-44) must be present in the tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).",
"fails_when": "not((cac:PartyLegalEntity/cbc:RegistrationName) != '')",
"en_title": "Standard tax invoices and their notes need the buyer name (BT-44)",
"ar_title": "الفاتورة الضريبية وإشعاراتها تتطلب اسم المشتري (BT-44)",
"en_meaning": "For standard tax invoices and their notes (InvoiceTypeCode @name starting '01'), the buyer party cac:AccountingCustomerParty/cac:Party must have a non-empty cac:PartyLegalEntity/cbc:RegistrationName (BT-44).",
"en_fix": "Add `<cac:PartyLegalEntity><cbc:RegistrationName>…</cbc:RegistrationName></cac:PartyLegalEntity>` with the buyer's name under cac:AccountingCustomerParty/cac:Party.",
"ar_meaning": "للفواتير الضريبية القياسية وإشعاراتها (قيمة @name في InvoiceTypeCode تبدأ بـ '01')، يجب أن يحتوي طرف المشتري cac:AccountingCustomerParty/cac:Party على cac:PartyLegalEntity/cbc:RegistrationName (BT-44) غير فارغ.",
"ar_fix": "أضف `<cac:PartyLegalEntity><cbc:RegistrationName>…</cbc:RegistrationName></cac:PartyLegalEntity>` باسم المشتري تحت cac:AccountingCustomerParty/cac:Party.",
"applies_to": "standard",
"fields": [
"BT-44",
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-42",
"url_ar": "https://matheel.app/akhta/br-ksa-42"
},
{
"id": "BR-KSA-44",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-44]-If it exists in the invoice,the buyer VAT registration number or buyer group VAT registration number (BT-48) must contain 15 digits. The first digit and the last digit is \"3\".",
"fails_when": "string-length(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) > 0 and not(exists(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) and matches(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '^[0-9]{15}$') and starts-with(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '3') and ends-with(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID, '3'))",
"en_title": "Buyer VAT number (BT-48): 15 digits, starting and ending with 3",
"ar_title": "الرقم الضريبي للمشتري (BT-48): 15 رقمًا يبدأ وينتهي بـ 3",
"en_meaning": "Applies only when the buyer has a non-empty cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48): it must be exactly 15 digits, with the first and last digit both '3'.",
"en_fix": "Either put the buyer's 15-digit VAT number in cac:PartyTaxScheme/cbc:CompanyID with no spaces or letters, or leave out cac:PartyTaxScheme/cbc:CompanyID if the buyer has no VAT number.",
"ar_meaning": "تنطبق فقط عند وجود cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) غير فارغ للمشتري: يجب أن يتكون من 15 رقمًا بالضبط، أولها وآخرها '3'.",
"ar_fix": "إما أن تضع الرقم الضريبي للمشتري المكون من 15 رقمًا في cac:PartyTaxScheme/cbc:CompanyID بلا مسافات أو حروف، أو تحذف cac:PartyTaxScheme/cbc:CompanyID إذا لم يكن للمشتري رقم ضريبي.",
"applies_to": "conditional",
"fields": [
"BT-48"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-44",
"url_ar": "https://matheel.app/akhta/br-ksa-44"
},
{
"id": "BR-KSA-49",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-49]-If the tax exemption reason code (BT-121) is equal to VATEX-SA-EDU or VATEX-SA-HEA, then the other buyer ID (BT-46) is mandatory and must be national ID (BT-46-1 = NAT).",
"fails_when": "not(exists(//cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID) and (//cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID/@schemeID) = 'NAT')",
"en_title": "EDU/HEA exemption requires buyer national ID (BT-46, scheme NAT)",
"ar_title": "إعفاء EDU/HEA يتطلب هوية المشتري الوطنية (BT-46 بنوع NAT)",
"en_meaning": "When any cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory has cbc:TaxExemptionReasonCode 'VATEX-SA-EDU' or 'VATEX-SA-HEA' (BT-121), the buyer must have cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID (BT-46) with schemeID='NAT' (BT-46-1).",
"en_fix": "Add the buyer's national ID: `<cac:PartyIdentification><cbc:ID schemeID=\"NAT\">…</cbc:ID></cac:PartyIdentification>` under cac:AccountingCustomerParty/cac:Party.",
"ar_meaning": "عندما يحتوي أي cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على cbc:TaxExemptionReasonCode بقيمة 'VATEX-SA-EDU' أو 'VATEX-SA-HEA' (BT-121)، يجب أن يحتوي طرف المشتري على cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID (BT-46) مع schemeID='NAT' (BT-46-1).",
"ar_fix": "أضف رقم الهوية الوطنية للمشتري: `<cac:PartyIdentification><cbc:ID schemeID=\"NAT\">…</cbc:ID></cac:PartyIdentification>` تحت cac:AccountingCustomerParty/cac:Party.",
"applies_to": "conditional",
"fields": [
"BT-121",
"BT-46",
"BT-46-1"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-49",
"url_ar": "https://matheel.app/akhta/br-ksa-49"
},
{
"id": "BR-KSA-51",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-51]-The line amount with VAT (KSA-12) must be Invoice line net amount (BT-131) + Line VAT amount (KSA-11).",
"fails_when": "not( format-number((cbc:RoundingAmount),'#.00') = format-number( (round(( (cbc:TaxAmount) + (../cbc:LineExtensionAmount) ) * 100 ) div 100), '#.00') )",
"en_title": "Line amount with VAT (KSA-12) = line net amount + line VAT",
"ar_title": "مبلغ البند شامل الضريبة (KSA-12) = صافي البند + ضريبته",
"en_meaning": "For each cac:InvoiceLine/cac:TaxTotal, cbc:RoundingAmount (KSA-12) must equal the line's cbc:LineExtensionAmount (BT-131) plus cbc:TaxAmount (KSA-11), compared to 2 decimal places after rounding the sum. A missing cbc:RoundingAmount also fails.",
"en_fix": "Set the line's cac:TaxTotal/cbc:RoundingAmount to LineExtensionAmount + TaxAmount, rounded to 2 decimals.",
"ar_meaning": "لكل cac:InvoiceLine/cac:TaxTotal، يجب أن تساوي قيمة cbc:RoundingAmount (KSA-12) مجموع cbc:LineExtensionAmount (BT-131) للبند و cbc:TaxAmount (KSA-11)، مع المقارنة لمنزلتين عشريتين بعد تقريب المجموع. غياب cbc:RoundingAmount يُفشل الفحص أيضًا.",
"ar_fix": "اجعل cac:TaxTotal/cbc:RoundingAmount في البند مساويًا لـ LineExtensionAmount + TaxAmount مقربًا لمنزلتين عشريتين.",
"applies_to": "all",
"fields": [
"KSA-12",
"BT-131",
"KSA-11"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-51",
"url_ar": "https://matheel.app/akhta/br-ksa-51"
},
{
"id": "BR-KSA-52",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-52]-The line VAT amount (KSA-11) is mandatory for tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).",
"fails_when": "not(every $line in //cac:InvoiceLine satisfies exists($line/cac:TaxTotal/cbc:TaxAmount) and ($line/cac:TaxTotal/cbc:TaxAmount) != '')",
"en_title": "Each line needs a line VAT amount (KSA-11) on standard invoices",
"ar_title": "كل بند يحتاج مبلغ ضريبة البند (KSA-11) في الفاتورة القياسية",
"en_meaning": "For standard tax invoices and their notes (InvoiceTypeCode @name starting '01'), every cac:InvoiceLine must contain a non-empty cac:TaxTotal/cbc:TaxAmount (KSA-11).",
"en_fix": "Add `<cac:TaxTotal><cbc:TaxAmount currencyID=\"…\">…</cbc:TaxAmount></cac:TaxTotal>` to every invoice line.",
"ar_meaning": "للفواتير الضريبية القياسية وإشعاراتها (قيمة @name في InvoiceTypeCode تبدأ بـ '01')، يجب أن يحتوي كل cac:InvoiceLine على cac:TaxTotal/cbc:TaxAmount (KSA-11) غير فارغ.",
"ar_fix": "أضف `<cac:TaxTotal><cbc:TaxAmount currencyID=\"…\">…</cbc:TaxAmount></cac:TaxTotal>` إلى كل بند في الفاتورة.",
"applies_to": "standard",
"fields": [
"KSA-11",
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-52",
"url_ar": "https://matheel.app/akhta/br-ksa-52"
},
{
"id": "BR-KSA-53",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-53]-The line amount with VAT (KSA-12) is mandatory for tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).",
"fails_when": "not(every $line in //cac:InvoiceLine satisfies exists($line/cac:TaxTotal/cbc:RoundingAmount) and ($line/cac:TaxTotal/cbc:RoundingAmount) != '')",
"en_title": "Each line needs a line amount with VAT (KSA-12) on standard invoices",
"ar_title": "كل بند يحتاج مبلغه شامل الضريبة (KSA-12) بالفاتورة القياسية",
"en_meaning": "For standard tax invoices and their notes (InvoiceTypeCode @name starting '01'), every cac:InvoiceLine must contain a non-empty cac:TaxTotal/cbc:RoundingAmount (KSA-12).",
"en_fix": "Add `<cbc:RoundingAmount currencyID=\"…\">…</cbc:RoundingAmount>` inside each line's cac:TaxTotal, after cbc:TaxAmount.",
"ar_meaning": "للفواتير الضريبية القياسية وإشعاراتها (قيمة @name في InvoiceTypeCode تبدأ بـ '01')، يجب أن يحتوي كل cac:InvoiceLine على cac:TaxTotal/cbc:RoundingAmount (KSA-12) غير فارغ.",
"ar_fix": "أضف `<cbc:RoundingAmount currencyID=\"…\">…</cbc:RoundingAmount>` داخل cac:TaxTotal لكل بند، بعد cbc:TaxAmount.",
"applies_to": "standard",
"fields": [
"KSA-12",
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-53",
"url_ar": "https://matheel.app/akhta/br-ksa-53"
},
{
"id": "BR-KSA-56",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-56]-For credit notes ((BT-3) has the value of 381) and debit notes ((BT-3) has the value of 383), the billing reference ID (BT-25) is mandatory.",
"fails_when": "not(exists(./cac:InvoiceDocumentReference/cbc:ID) and (./cac:InvoiceDocumentReference/cbc:ID) != '')",
"en_title": "Credit and debit notes must reference the original invoice (BT-25)",
"ar_title": "إشعارات الدائن والمدين يجب أن تشير للفاتورة الأصلية (BT-25)",
"en_meaning": "When cbc:InvoiceTypeCode (BT-3) is 381 (credit note) or 383 (debit note), the document must have at least one cac:BillingReference, and each cac:BillingReference must contain a non-empty cac:InvoiceDocumentReference/cbc:ID (BT-25).",
"en_fix": "Add `<cac:BillingReference><cac:InvoiceDocumentReference><cbc:ID>…</cbc:ID></cac:InvoiceDocumentReference></cac:BillingReference>` with the original invoice number.",
"ar_meaning": "عندما تكون قيمة cbc:InvoiceTypeCode (BT-3) هي 381 (إشعار دائن) أو 383 (إشعار مدين)، يجب أن يحتوي المستند على cac:BillingReference واحد على الأقل، وأن يحتوي كل cac:BillingReference على cac:InvoiceDocumentReference/cbc:ID (BT-25) غير فارغ.",
"ar_fix": "أضف `<cac:BillingReference><cac:InvoiceDocumentReference><cbc:ID>…</cbc:ID></cac:InvoiceDocumentReference></cac:BillingReference>` برقم الفاتورة الأصلية.",
"applies_to": "credit_debit_notes",
"fields": [
"BT-3",
"BT-25"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-56",
"url_ar": "https://matheel.app/akhta/br-ksa-56"
},
{
"id": "BR-KSA-60",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-60]-Cryptographic stamp (KSA-15) must exist in simplified tax invoices and associated credit notes and debit notes (KSA-2, position 1 and 2 = 02).",
"fails_when": "not(exists(//cac:Signature) and (//cac:Signature) != '')",
"en_title": "Simplified invoices must include the cac:Signature block (KSA-15)",
"ar_title": "الفاتورة المبسطة تتطلب عنصر cac:Signature (KSA-15)",
"en_meaning": "For simplified invoices and their notes (InvoiceTypeCode @name starting '02'), the document must contain a cac:Signature element with non-empty content. The check looks at the UBL cac:Signature element, not at the signature inside ext:UBLExtensions.",
"en_fix": "Add `<cac:Signature><cbc:ID>urn:oasis:names:specification:ubl:signature:Invoice</cbc:ID><cbc:SignatureMethod>urn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod></cac:Signature>` (the values other KSA rules require).",
"ar_meaning": "للفواتير المبسطة وإشعاراتها (قيمة @name في InvoiceTypeCode تبدأ بـ '02')، يجب أن يحتوي المستند على عنصر cac:Signature بمحتوى غير فارغ. الفحص ينظر إلى عنصر cac:Signature في UBL، لا إلى التوقيع داخل ext:UBLExtensions.",
"ar_fix": "أضف `<cac:Signature><cbc:ID>urn:oasis:names:specification:ubl:signature:Invoice</cbc:ID><cbc:SignatureMethod>urn:oasis:names:specification:ubl:dsig:enveloped:xades</cbc:SignatureMethod></cac:Signature>` (وهي القيم التي تتطلبها قواعد KSA الأخرى).",
"applies_to": "simplified",
"fields": [
"KSA-15",
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-60",
"url_ar": "https://matheel.app/akhta/br-ksa-60"
},
{
"id": "BR-KSA-61",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-61]-Previous invoice hash (KSA-13) must exist in an invoice.",
"fails_when": "not((cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'PIH'] and exists(cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'PIH']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) and (cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'PIH']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) != '' and (cac:AdditionalDocumentReference[normalize-space(cbc:ID) = 'PIH']/cac:Attachment/cbc:EmbeddedDocumentBinaryObject[normalize-space(@mimeCode) = 'text/plain'])))",
"en_title": "Every invoice needs the previous invoice hash (PIH, KSA-13)",
"ar_title": "كل فاتورة تحتاج تجزئة الفاتورة السابقة (PIH، KSA-13)",
"en_meaning": "The invoice must contain a cac:AdditionalDocumentReference with cbc:ID 'PIH' whose cac:Attachment has a non-empty cbc:EmbeddedDocumentBinaryObject with mimeCode='text/plain'.",
"en_fix": "Add `<cac:AdditionalDocumentReference><cbc:ID>PIH</cbc:ID><cac:Attachment><cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">…</cbc:EmbeddedDocumentBinaryObject></cac:Attachment></cac:AdditionalDocumentReference>` with the previous invoice's hash.",
"ar_meaning": "يجب أن تحتوي الفاتورة على cac:AdditionalDocumentReference قيمة cbc:ID فيه 'PIH'، ويحتوي cac:Attachment فيه على cbc:EmbeddedDocumentBinaryObject غير فارغ مع mimeCode='text/plain'.",
"ar_fix": "أضف `<cac:AdditionalDocumentReference><cbc:ID>PIH</cbc:ID><cac:Attachment><cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">…</cbc:EmbeddedDocumentBinaryObject></cac:Attachment></cac:AdditionalDocumentReference>` بتجزئة الفاتورة السابقة.",
"applies_to": "all",
"fields": [
"KSA-13"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-61",
"url_ar": "https://matheel.app/akhta/br-ksa-61"
},
{
"id": "BR-KSA-63",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-63]-If the buyer country code (BT-55) is \"SA\", then these fields are mandatory:street name (BT-50), building number (KSA-18), postal code (BT-53), city (BT-52), District (KSA-4), country code (BT-55).For more information please access this link:https://splonline.com.sa/en/national-address-1/",
"fails_when": "not((exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) and normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName)!='' and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:BuildingNumber) and normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:BuildingNumber)!='' and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone) and normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone)!='' and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) and normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName)!='' and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) and normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName)!='' and exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) and normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode)!=''))",
"en_title": "Saudi buyer needs a full national address on standard invoices",
"ar_title": "المشتري السعودي يحتاج عنوانًا وطنيًا كاملًا (فاتورة قياسية)",
"en_meaning": "When the buyer's cac:PostalAddress/cac:Country/cbc:IdentificationCode (BT-55) is 'SA', the buyer address must have non-blank cbc:StreetName (BT-50), cbc:BuildingNumber (KSA-18), cbc:PostalZone (BT-53), cbc:CityName (BT-52), cbc:CitySubdivisionName (district, KSA-4) and the country code. The check only runs on standard tax invoices and their notes (@name starting '01'), which the official text does not state.",
"en_fix": "Fill all six fields under cac:AccountingCustomerParty/cac:Party/cac:PostalAddress: cbc:StreetName, cbc:BuildingNumber, cbc:PostalZone, cbc:CityName, cbc:CitySubdivisionName and cac:Country/cbc:IdentificationCode.",
"ar_meaning": "عندما تكون قيمة cac:PostalAddress/cac:Country/cbc:IdentificationCode (BT-55) للمشتري 'SA'، يجب أن يحتوي عنوانه على cbc:StreetName (BT-50) و cbc:BuildingNumber (KSA-18) و cbc:PostalZone (BT-53) و cbc:CityName (BT-52) و cbc:CitySubdivisionName (الحي، KSA-4) ورمز الدولة، وكلها غير فارغة. الفحص يُطبَّق فقط على الفواتير الضريبية القياسية وإشعاراتها (@name يبدأ بـ '01')، وهذا لا يذكره النص الرسمي.",
"ar_fix": "املأ الحقول الستة تحت cac:AccountingCustomerParty/cac:Party/cac:PostalAddress: cbc:StreetName و cbc:BuildingNumber و cbc:PostalZone و cbc:CityName و cbc:CitySubdivisionName و cac:Country/cbc:IdentificationCode.",
"applies_to": "standard",
"fields": [
"BT-55",
"BT-50",
"KSA-18",
"BT-53",
"BT-52",
"KSA-4"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-63",
"url_ar": "https://matheel.app/akhta/br-ksa-63"
},
{
"id": "BR-KSA-66",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-66]-Seller postal code (BT-38) must be 5 digits.",
"fails_when": "not(exists(cbc:PostalZone) and matches(cbc:PostalZone, '^[0-9]{5}$'))",
"en_title": "Seller postal code (BT-38) must be exactly 5 digits",
"ar_title": "الرمز البريدي للبائع (BT-38) يجب أن يكون 5 أرقام بالضبط",
"en_meaning": "The seller's cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone (BT-38) must exist and match ^[0-9]{5}$: exactly five digits.",
"en_fix": "Provide the seller postal code as five digits, e.g. `<cbc:PostalZone>23333</cbc:PostalZone>`.",
"ar_meaning": "يجب أن يوجد cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone (BT-38) للبائع وأن يطابق النمط ^[0-9]{5}$: خمسة أرقام بالضبط.",
"ar_fix": "أدخل الرمز البريدي للبائع من خمسة أرقام، مثل `<cbc:PostalZone>23333</cbc:PostalZone>`.",
"applies_to": "all",
"fields": [
"BT-38"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-66",
"url_ar": "https://matheel.app/akhta/br-ksa-66"
},
{
"id": "BR-KSA-67",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-67]-If the buyer country code (BT-55) is \"SA\", then the Buyer postal code(BT-53) must be 5 digits.",
"fails_when": "(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) = 'SA' and not(matches(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:PostalZone, '^[0-9]{5}$'))",
"en_title": "Saudi buyer postal code (BT-53) must be 5 digits",
"ar_title": "الرمز البريدي للمشتري السعودي (BT-53) 5 أرقام بالضبط",
"en_meaning": "When the buyer country code (BT-55) is 'SA', the buyer's cac:PostalAddress/cbc:PostalZone (BT-53) must match ^[0-9]{5}$. The check only runs on standard tax invoices and their notes (@name starting '01'), which the official text does not state.",
"en_fix": "Provide the buyer postal code as five digits, e.g. `<cbc:PostalZone>12345</cbc:PostalZone>` under cac:AccountingCustomerParty/cac:Party/cac:PostalAddress.",
"ar_meaning": "عندما يكون رمز دولة المشتري (BT-55) هو 'SA'، يجب أن يطابق cac:PostalAddress/cbc:PostalZone (BT-53) للمشتري النمط ^[0-9]{5}$. الفحص يُطبَّق فقط على الفواتير الضريبية القياسية وإشعاراتها (@name يبدأ بـ '01')، وهذا لا يذكره النص الرسمي.",
"ar_fix": "أدخل الرمز البريدي للمشتري من خمسة أرقام، مثل `<cbc:PostalZone>12345</cbc:PostalZone>` تحت cac:AccountingCustomerParty/cac:Party/cac:PostalAddress.",
"applies_to": "standard",
"fields": [
"BT-55",
"BT-53"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-67",
"url_ar": "https://matheel.app/akhta/br-ksa-67"
},
{
"id": "BR-KSA-68",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-68]-Tax currency code (BT-6) must exist in an invoice.",
"fails_when": "not(exists(cbc:TaxCurrencyCode) and (cbc:TaxCurrencyCode) != '')",
"en_title": "Every invoice needs a tax currency code (BT-6)",
"ar_title": "كل فاتورة تحتاج رمز عملة الضريبة (BT-6)",
"en_meaning": "The invoice root must contain a non-empty cbc:TaxCurrencyCode (BT-6). This rule checks presence only, not the value.",
"en_fix": "Add `<cbc:TaxCurrencyCode>` with the tax currency code at invoice level, next to cbc:DocumentCurrencyCode.",
"ar_meaning": "يجب أن يحتوي جذر الفاتورة على cbc:TaxCurrencyCode (BT-6) غير فارغ. القاعدة تتحقق من الوجود فقط، لا من القيمة.",
"ar_fix": "أضف `<cbc:TaxCurrencyCode>` برمز عملة الضريبة على مستوى الفاتورة، بجانب cbc:DocumentCurrencyCode.",
"applies_to": "all",
"fields": [
"BT-6"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-68",
"url_ar": "https://matheel.app/akhta/br-ksa-68"
},
{
"id": "BR-KSA-69",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-69]-A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Zero rated' shall have a VAT exception reason code (BT-121).",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and normalize-space(cbc:TaxExemptionReasonCode )!='' )",
"en_title": "Zero-rated (Z) VAT breakdown needs a reason code (BT-121)",
"ar_title": "تفصيل الضريبة الصفرية (Z) يحتاج رمز السبب (BT-121)",
"en_meaning": "Applies to each document-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory whose cbc:ID is 'Z' (zero rated): it must contain a non-blank cbc:TaxExemptionReasonCode (BT-121). This rule checks only that a code is present, not which code it is.",
"en_fix": "Inside every TaxCategory with cbc:ID 'Z', add `<cbc:TaxExemptionReasonCode>` with the applicable code; the zero-rated codes named in the rule's text are VATEX-SA-32, VATEX-SA-33, VATEX-SA-34-1 to VATEX-SA-34-5, VATEX-SA-35, VATEX-SA-36, VATEX-SA-EDU, VATEX-SA-HEA, VATEX-SA-MLTRY and VATEX-SA-DIPLOMAT.",
"ar_meaning": "تنطبق على كل عنصر cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى المستند قيمة cbc:ID فيه 'Z' (نسبة صفرية): يجب أن يحتوي على cbc:TaxExemptionReasonCode (BT-121) غير فارغ. القاعدة تتحقق من وجود الرمز فقط، لا من قيمته.",
"ar_fix": "داخل كل TaxCategory قيمة cbc:ID فيه 'Z' أضف `<cbc:TaxExemptionReasonCode>` بالرمز المناسب؛ الرموز المذكورة في نص القاعدة هي VATEX-SA-32 و VATEX-SA-33 و VATEX-SA-34-1 إلى VATEX-SA-34-5 و VATEX-SA-35 و VATEX-SA-36 و VATEX-SA-EDU و VATEX-SA-HEA و VATEX-SA-MLTRY و VATEX-SA-DIPLOMAT.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-121"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-69",
"url_ar": "https://matheel.app/akhta/br-ksa-69"
},
{
"id": "BR-KSA-70",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-70]-The invoice must contain Invoice Issue Time (KSA-25). This value should be in the format: hh:mm:ss for time expressed in local time (eg 19:20:30) or hh:mm:ssZ for time expressed in UTC (eg 19:20:30Z).\"The invoice must contain Invoice Issue Time (KSA-25). This value should be in the format: hh:mm:ss for time expressed in local time (eg 19:20:30) or hh:mm:ssZ for time expressed in UTC (eg 19:20:30Z).",
"fails_when": "not(exists(cbc:IssueTime) and (cbc:IssueTime) != '' and (matches(cbc:IssueTime, '^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$') or matches(cbc:IssueTime, '^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])Z$')))",
"en_title": "Invoice issue time (KSA-25) is required as hh:mm:ss or hh:mm:ssZ",
"ar_title": "وقت الإصدار (KSA-25) مطلوب بصيغة hh:mm:ss أو hh:mm:ssZ",
"en_meaning": "The invoice must have a non-empty cbc:IssueTime (KSA-25) in 24-hour hh:mm:ss (local time) or hh:mm:ssZ (UTC) format. Fractional seconds or offsets such as +03:00 are not accepted by the pattern.",
"en_fix": "Use exactly this shape: `<cbc:IssueTime>19:20:30</cbc:IssueTime>` or `<cbc:IssueTime>19:20:30Z</cbc:IssueTime>`.",
"ar_meaning": "يجب أن تحتوي الفاتورة على cbc:IssueTime (KSA-25) غير فارغ بصيغة 24 ساعة hh:mm:ss (توقيت محلي) أو hh:mm:ssZ (توقيت UTC). لا يقبل النمط أجزاء الثانية ولا فروق التوقيت مثل +03:00.",
"ar_fix": "استخدم هذا الشكل تحديدًا: `<cbc:IssueTime>19:20:30</cbc:IssueTime>` أو `<cbc:IssueTime>19:20:30Z</cbc:IssueTime>`.",
"applies_to": "all",
"fields": [
"KSA-25"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-70",
"url_ar": "https://matheel.app/akhta/br-ksa-70"
},
{
"id": "BR-KSA-71",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "If the Invoice is a simplified invoice type and is a summary invoice (KSA-2, position 1 and 2 = 02, position 6 = 1),then the buyer name must be present.",
"fails_when": "not(exists(//cac:AccountingCustomerParty/cac:Party//cac:PartyLegalEntity/cbc:RegistrationName) and normalize-space(//cac:AccountingCustomerParty/cac:Party//cac:PartyLegalEntity/cbc:RegistrationName)!='')",
"en_title": "Simplified summary invoices need the buyer name",
"ar_title": "الفاتورة المبسطة الملخصة تتطلب اسم المشتري",
"en_meaning": "For simplified summary invoices (InvoiceTypeCode @name starting '02' with position 6 = '1'), the buyer must have a non-empty cac:PartyLegalEntity/cbc:RegistrationName under cac:AccountingCustomerParty/cac:Party.",
"en_fix": "Add `<cac:PartyLegalEntity><cbc:RegistrationName>…</cbc:RegistrationName></cac:PartyLegalEntity>` with the buyer's name under cac:AccountingCustomerParty/cac:Party.",
"ar_meaning": "للفواتير المبسطة الملخصة (قيمة @name في InvoiceTypeCode تبدأ بـ '02' والخانة 6 = '1')، يجب أن يحتوي طرف المشتري على cac:PartyLegalEntity/cbc:RegistrationName غير فارغ تحت cac:AccountingCustomerParty/cac:Party.",
"ar_fix": "أضف `<cac:PartyLegalEntity><cbc:RegistrationName>…</cbc:RegistrationName></cac:PartyLegalEntity>` باسم المشتري تحت cac:AccountingCustomerParty/cac:Party.",
"applies_to": "simplified",
"fields": [
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-71",
"url_ar": "https://matheel.app/akhta/br-ksa-71"
},
{
"id": "BR-KSA-72",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "If the Invoice is a simplified invoice type and is a summary invoice (KSA-2, position 1 and 2 = 02, position 6 = 1), then a supply date (KSA-5) and supply end date (KSA-24) must be present",
"fails_when": "not(//cbc:ActualDeliveryDate and //cbc:LatestDeliveryDate)",
"en_title": "Simplified summary invoices need supply start and end dates",
"ar_title": "الفاتورة المبسطة الملخصة تتطلب تاريخي بداية التوريد ونهايته",
"en_meaning": "For simplified summary invoices (@name starting '02' with position 6 = '1'), the invoice must contain both cbc:ActualDeliveryDate (KSA-5) and cbc:LatestDeliveryDate (KSA-24). Unlike the official text, the check only runs when the buyer's postal address country code is 'SA'.",
"en_fix": "Add `<cac:Delivery><cbc:ActualDeliveryDate>…</cbc:ActualDeliveryDate><cbc:LatestDeliveryDate>…</cbc:LatestDeliveryDate></cac:Delivery>` covering the summarised period.",
"ar_meaning": "للفواتير المبسطة الملخصة (@name يبدأ بـ '02' والخانة 6 = '1')، يجب أن تحتوي الفاتورة على cbc:ActualDeliveryDate (KSA-5) و cbc:LatestDeliveryDate (KSA-24) معًا. بخلاف النص الرسمي، لا يُجرى الفحص إلا عندما يكون رمز الدولة في عنوان المشتري 'SA'.",
"ar_fix": "أضف `<cac:Delivery><cbc:ActualDeliveryDate>…</cbc:ActualDeliveryDate><cbc:LatestDeliveryDate>…</cbc:LatestDeliveryDate></cac:Delivery>` بالفترة التي تلخصها الفاتورة.",
"applies_to": "simplified",
"fields": [
"KSA-2",
"KSA-5",
"KSA-24"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-72",
"url_ar": "https://matheel.app/akhta/br-ksa-72"
},
{
"id": "BR-KSA-73",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-73]-If Pre-Paid amount (BT-113) is provided, then the following data is mandatory to provide as additional invoice line(s) -Prepayment ID (KSA-26) -Sequential invoice number (BT-1) of the prepayment invoice(s)-Prepayment Issue Date (KSA-28) -Issue date (BT-2) of the prepayment invoice(s) Prepayment Issue Time (KSA-29) - Issue time (KSA-25) of the prepayment invoice(s) Prepayment Document Type Code (KSA-30)- Invoice type code (BT-3) must be 386.",
"fails_when": "not(exists(./cbc:ID) and exists(./cbc:IssueDate) and exists(./cbc:IssueTime) and exists(./cbc:DocumentTypeCode) )",
"en_title": "Prepaid amount (BT-113) requires full prepayment reference on lines",
"ar_title": "المبلغ المدفوع مسبقًا (BT-113) يتطلب مرجع دفعة مقدمة كامل",
"en_meaning": "When cac:LegalMonetaryTotal/cbc:PrepaidAmount (BT-113) is greater than 0, at least one cac:InvoiceLine must carry a cac:DocumentReference, and every line cac:DocumentReference must contain cbc:ID (KSA-26), cbc:IssueDate (KSA-28), cbc:IssueTime (KSA-29) and cbc:DocumentTypeCode (KSA-30). The value '386' named in the official text is checked separately by BR-KSA-74.",
"en_fix": "On the prepayment adjustment line add `<cac:DocumentReference><cbc:ID>…</cbc:ID><cbc:IssueDate>…</cbc:IssueDate><cbc:IssueTime>…</cbc:IssueTime><cbc:DocumentTypeCode>386</cbc:DocumentTypeCode></cac:DocumentReference>` with the prepayment invoice's number, date and time.",
"ar_meaning": "عندما تكون قيمة cac:LegalMonetaryTotal/cbc:PrepaidAmount (BT-113) أكبر من 0، يجب أن يحتوي بند واحد على الأقل من cac:InvoiceLine على cac:DocumentReference، ويجب أن يحتوي كل cac:DocumentReference في البنود على cbc:ID (KSA-26) و cbc:IssueDate (KSA-28) و cbc:IssueTime (KSA-29) و cbc:DocumentTypeCode (KSA-30). القيمة '386' المذكورة في النص الرسمي تُفحص بشكل منفصل في BR-KSA-74.",
"ar_fix": "في بند تسوية الدفعة المقدمة أضف `<cac:DocumentReference><cbc:ID>…</cbc:ID><cbc:IssueDate>…</cbc:IssueDate><cbc:IssueTime>…</cbc:IssueTime><cbc:DocumentTypeCode>386</cbc:DocumentTypeCode></cac:DocumentReference>` برقم فاتورة الدفعة المقدمة وتاريخها ووقتها.",
"applies_to": "conditional",
"fields": [
"BT-113",
"KSA-26",
"BT-1",
"KSA-28",
"BT-2",
"KSA-29",
"KSA-25",
"KSA-30",
"BT-3"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-73",
"url_ar": "https://matheel.app/akhta/br-ksa-73"
},
{
"id": "BR-KSA-74",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-74]-Prepayment Document Type Code (KSA-30) for the Invoice line document reference must be '386'.",
"fails_when": "normalize-space(./cac:TaxCategory/cbc:Percent)='' or not( format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)-0.01), '#.00')) or format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)+0.01), '#.00')) or format-number(./cbc:TaxAmount,'#.00') = (format-number((( round((((./cbc:TaxableAmount * (./cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/xs:decimal(cbc:Percent) )) div 100) * 100 + 0.01)) div 100)), '#.00')))",
"en_title": "Prepayment document type code (KSA-30) on lines must be 386",
"ar_title": "رمز نوع مستند الدفعة المقدمة (KSA-30) يجب أن يكون 386",
"en_meaning": "When cac:LegalMonetaryTotal/cbc:PrepaidAmount is greater than 0, every cac:InvoiceLine/cac:DocumentReference that has a cbc:DocumentTypeCode (KSA-30) must have the value '386'.",
"en_fix": "Set `<cbc:DocumentTypeCode>386</cbc:DocumentTypeCode>` in each line's cac:DocumentReference.",
"ar_meaning": "عندما تكون قيمة cac:LegalMonetaryTotal/cbc:PrepaidAmount أكبر من 0، يجب أن تكون قيمة cbc:DocumentTypeCode (KSA-30) في كل cac:InvoiceLine/cac:DocumentReference يحتوي عليه هي '386'.",
"ar_fix": "ضع `<cbc:DocumentTypeCode>386</cbc:DocumentTypeCode>` في cac:DocumentReference لكل بند.",
"applies_to": "conditional",
"fields": [
"KSA-30"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-74",
"url_ar": "https://matheel.app/akhta/br-ksa-74"
},
{
"id": "BR-KSA-75",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-75]-If Prepayment Document Type code (KSA-30) is provided in an Invoice Line, then the following data is mandatory to provide in that invoice line - Prepayment VAT category Taxable Amount (KSA-31) - Sum total of taxable amounts subject to specific VAT Category code of the prepayment invoice(s); Prepayment VAT Category Tax Amount (KSA-32) - Sum total of tax amounts subject to specific VAT Category code of the prepayment invoice(s); Prepayment VAT category code (KSA-33) - the VAT category code of the associated Prepayment invoice(s); Prepayment VAT rate (KSA-34) - VAT rate of the specific VAT Category code of the prepayment invoice(s)",
"fails_when": "not( exists(../cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount) and exists(../cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:Percent) and exists(../cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount) and exists(../cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID))",
"en_title": "Prepayment lines need taxable amount, tax amount, category and rate",
"ar_title": "سطر الدفعة المقدمة يتطلب المبالغ والفئة والنسبة الضريبية",
"en_meaning": "In an invoice with cac:LegalMonetaryTotal/cbc:PrepaidAmount > 0, every invoice line that has a cac:DocumentReference must carry cac:TaxTotal/cac:TaxSubtotal with cbc:TaxableAmount (KSA-31), cbc:TaxAmount (KSA-32), cac:TaxCategory/cbc:ID (KSA-33) and cac:TaxCategory/cbc:Percent (KSA-34). The executed check keys on the presence of cac:DocumentReference in the line, not specifically on the document type code (KSA-30).",
"en_fix": "In each prepayment line, add a cac:TaxTotal containing a cac:TaxSubtotal with cbc:TaxableAmount, cbc:TaxAmount and a cac:TaxCategory holding cbc:ID and cbc:Percent for the prepaid invoice's VAT category.",
"ar_meaning": "في الفاتورة التي يكون فيها cac:LegalMonetaryTotal/cbc:PrepaidAmount أكبر من صفر، يجب أن يحتوي كل سطر فيه cac:DocumentReference على cac:TaxTotal/cac:TaxSubtotal يضم cbc:TaxableAmount (KSA-31) و cbc:TaxAmount (KSA-32) و cac:TaxCategory/cbc:ID (KSA-33) و cac:TaxCategory/cbc:Percent (KSA-34). يعتمد الفحص الفعلي على وجود cac:DocumentReference في السطر، وليس على رمز نوع المستند (KSA-30) تحديدًا.",
"ar_fix": "في كل سطر دفعة مقدمة، أضف cac:TaxTotal يحتوي على cac:TaxSubtotal فيه cbc:TaxableAmount و cbc:TaxAmount و cac:TaxCategory يضم cbc:ID و cbc:Percent حسب فئة ضريبة فاتورة الدفعة المقدمة.",
"applies_to": "conditional",
"fields": [
"KSA-30",
"KSA-31",
"KSA-32",
"KSA-33",
"KSA-34"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-75",
"url_ar": "https://matheel.app/akhta/br-ksa-75"
},
{
"id": "BR-KSA-76",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-76]-An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is \"Zero rated\" the Prepayment VAT rate (KSA-34) shall be 0 (zero).",
"fails_when": "cac:TaxCategory[normalize-space(cbc:ID)='Z'][ cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and not(((xs:decimal(cac:TaxCategory/cbc:Percent))=0))",
"en_title": "Zero-rated (Z) prepayment line VAT rate must be 0",
"ar_title": "نسبة ضريبة الدفعة المقدمة بالنسبة الصفرية (Z) تساوي صفرًا",
"en_meaning": "In an invoice with cac:LegalMonetaryTotal/cbc:PrepaidAmount > 0, each line-level cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory has cbc:ID 'Z' (VAT scheme) must have cac:TaxCategory/cbc:Percent (KSA-34) equal to 0. A missing cbc:Percent also triggers the warning.",
"en_fix": "In that line's cac:TaxSubtotal/cac:TaxCategory with cbc:ID Z, set `<cbc:Percent>0.00</cbc:Percent>`.",
"ar_meaning": "في الفاتورة التي يكون فيها cac:LegalMonetaryTotal/cbc:PrepaidAmount أكبر من صفر، يجب أن تكون قيمة cac:TaxCategory/cbc:Percent (KSA-34) مساوية للصفر في كل cac:TaxTotal/cac:TaxSubtotal على مستوى السطر تكون فئته cbc:ID = 'Z' (نظام VAT). وغياب cbc:Percent يؤدي أيضًا إلى ظهور التحذير.",
"ar_fix": "في cac:TaxSubtotal/cac:TaxCategory لذلك السطر ذي cbc:ID = Z، ضع `<cbc:Percent>0.00</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-33",
"KSA-34"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-76",
"url_ar": "https://matheel.app/akhta/br-ksa-76"
},
{
"id": "BR-KSA-77",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-77]-An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is \"Exempt from VAT\" the Prepayment VAT rate (KSA-34) shall be 0 (zero).",
"fails_when": "cac:TaxCategory[normalize-space(cbc:ID)='E'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and not(((xs:decimal(cac:TaxCategory/cbc:Percent))=0))",
"en_title": "Exempt (E) prepayment line VAT rate must be 0",
"ar_title": "نسبة ضريبة الدفعة المقدمة المعفاة (E) تساوي صفرًا",
"en_meaning": "In an invoice with cac:LegalMonetaryTotal/cbc:PrepaidAmount > 0, each line-level cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory has cbc:ID 'E' (VAT scheme) must have cac:TaxCategory/cbc:Percent (KSA-34) equal to 0. A missing cbc:Percent also triggers the warning.",
"en_fix": "In that line's cac:TaxSubtotal/cac:TaxCategory with cbc:ID E, set `<cbc:Percent>0.00</cbc:Percent>`.",
"ar_meaning": "في الفاتورة التي يكون فيها cac:LegalMonetaryTotal/cbc:PrepaidAmount أكبر من صفر، يجب أن تكون قيمة cac:TaxCategory/cbc:Percent (KSA-34) مساوية للصفر في كل cac:TaxTotal/cac:TaxSubtotal على مستوى السطر تكون فئته cbc:ID = 'E' (نظام VAT). وغياب cbc:Percent يؤدي أيضًا إلى ظهور التحذير.",
"ar_fix": "في cac:TaxSubtotal/cac:TaxCategory لذلك السطر ذي cbc:ID = E، ضع `<cbc:Percent>0.00</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-33",
"KSA-34"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-77",
"url_ar": "https://matheel.app/akhta/br-ksa-77"
},
{
"id": "BR-KSA-78",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-78]-An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is \"Not subject to VAT\" the Prepayment VAT rate (KSA-34) shall be 0 (zero).",
"fails_when": "cac:TaxCategory[normalize-space(cbc:ID)='O'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and not(((xs:decimal(cac:TaxCategory/cbc:Percent))=0))",
"en_title": "Not-subject (O) prepayment line VAT rate must be 0",
"ar_title": "نسبة ضريبة الدفعة المقدمة غير الخاضعة (O) تساوي صفرًا",
"en_meaning": "In an invoice with cac:LegalMonetaryTotal/cbc:PrepaidAmount > 0, each line-level cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory has cbc:ID 'O' (VAT scheme) must have cac:TaxCategory/cbc:Percent (KSA-34) equal to 0. A missing cbc:Percent also triggers the warning.",
"en_fix": "In that line's cac:TaxSubtotal/cac:TaxCategory with cbc:ID O, set `<cbc:Percent>0.00</cbc:Percent>`.",
"ar_meaning": "في الفاتورة التي يكون فيها cac:LegalMonetaryTotal/cbc:PrepaidAmount أكبر من صفر، يجب أن تكون قيمة cac:TaxCategory/cbc:Percent (KSA-34) مساوية للصفر في كل cac:TaxTotal/cac:TaxSubtotal على مستوى السطر تكون فئته cbc:ID = 'O' (نظام VAT). وغياب cbc:Percent يؤدي أيضًا إلى ظهور التحذير.",
"ar_fix": "في cac:TaxSubtotal/cac:TaxCategory لذلك السطر ذي cbc:ID = O، ضع `<cbc:Percent>0.00</cbc:Percent>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-33",
"KSA-34"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-78",
"url_ar": "https://matheel.app/akhta/br-ksa-78"
},
{
"id": "BR-KSA-79",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-79]-The Prepayment VAT Category Tax Amount (KSA-32) must be Prepayment VAT category Taxable Amount( (KSA-31) x Prepayment VAT rate (KSA-34) /100).",
"fails_when": "(not(format-number(./cbc:TaxAmount,'#.00') = format-number(( round((((xs:decimal(./cbc:TaxableAmount) * (0)) div 100) * 100 + 0.01)) div 100), '#.00') )) or (not(format-number(./cbc:TaxAmount, '#.00') = format-number(round(xs:decimal(./cbc:TaxableAmount) * xs:decimal(./cac:TaxCategory/cbc:Percent) div 100, 2), '#.00')))",
"en_title": "Line VAT breakdown: tax amount = taxable amount x rate / 100",
"ar_title": "ضريبة تفصيل السطر = المبلغ الخاضع × النسبة ÷ 100",
"en_meaning": "For every line-level cac:TaxTotal/cac:TaxSubtotal (the prepayment breakdown), cbc:TaxAmount (KSA-32) must equal cbc:TaxableAmount (KSA-31) x cac:TaxCategory/cbc:Percent (KSA-34) / 100 rounded to two decimals, within 0.01; a missing or empty cbc:Percent fails. For categories Z and E (and O without a rate) the tax amount must be 0.00, and the check runs on such lines whether or not cbc:PrepaidAmount is present.",
"en_fix": "Compute the line TaxSubtotal's cbc:TaxAmount as cbc:TaxableAmount x cbc:Percent / 100 rounded to 2 decimals (e.g. 1000 at 15.00 gives 150.00), and use 0.00 with a 0 rate for Z or E.",
"ar_meaning": "في كل cac:TaxTotal/cac:TaxSubtotal على مستوى السطر (تفصيل الدفعة المقدمة)، يجب أن يساوي cbc:TaxAmount (KSA-32) حاصل cbc:TaxableAmount (KSA-31) × cac:TaxCategory/cbc:Percent (KSA-34) ÷ 100 مقرّبًا إلى خانتين عشريتين بفارق لا يتجاوز 0.01، وغياب cbc:Percent أو فراغه يُعد مخالفة. وفي الفئتين Z و E (و O دون نسبة) يجب أن يكون مبلغ الضريبة 0.00، ويُطبَّق الفحص على هذه الأسطر سواء وُجد cbc:PrepaidAmount أم لا.",
"ar_fix": "احسب cbc:TaxAmount في TaxSubtotal السطر بضرب cbc:TaxableAmount في cbc:Percent وقسمة الناتج على 100 مع التقريب إلى خانتين (مثال: 1000 بنسبة 15.00 تعطي 150.00)، واستخدم 0.00 بنسبة صفر للفئتين Z و E.",
"applies_to": "conditional",
"fields": [
"KSA-32",
"KSA-31",
"KSA-34"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-79",
"url_ar": "https://matheel.app/akhta/br-ksa-79"
},
{
"id": "BR-KSA-80",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-80] - The Pre-Paid amount (BT-113) must be equal to the sum total of the Prepayment VAT category Taxable Amount (KSA-31) and the Prepayment VAT Category Tax Amount (KSA-32).",
"fails_when": "(($prepaid-amount = 0 or not($prepaid-amount-exists)) and (($taxable-amount-exists) or ($tax-amount-exists))) or (($prepaid-amount != 0 ) and ($taxable-amount-sum > 0) and ($tax-amount-sum > 0) and $any-document-type-code-not-386 ) or (format-number($prepaid-amount, '#.00') != format-number($total-tax-amount, '#.00'))",
"en_title": "Prepaid amount must equal prepayment taxable plus tax amounts",
"ar_title": "المبلغ المدفوع مسبقًا يساوي مجموع مبالغ الدفعات وضريبتها",
"en_meaning": "cac:LegalMonetaryTotal/cbc:PrepaidAmount (BT-113) must equal, to two decimals, the sum of all line-level cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount (KSA-31) plus cbc:TaxAmount (KSA-32). The executed check also warns when such line-level subtotals exist while PrepaidAmount is 0 or absent, and when PrepaidAmount is non-zero, both sums are positive and any line cac:DocumentReference/cbc:DocumentTypeCode is not 386.",
"en_fix": "Set cbc:PrepaidAmount to the total of the prepayment lines' TaxableAmount plus TaxAmount (e.g. 1000 + 150 gives `<cbc:PrepaidAmount currencyID=\"SAR\">1150.00</cbc:PrepaidAmount>`), use DocumentTypeCode 386 in those lines, and include line-level cac:TaxSubtotal only when there is a prepayment.",
"ar_meaning": "يجب أن يساوي cac:LegalMonetaryTotal/cbc:PrepaidAmount (BT-113)، مقرّبًا إلى خانتين، مجموع كل cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount (KSA-31) على مستوى الأسطر مضافًا إليه مجموع cbc:TaxAmount (KSA-32). ويُصدر الفحص الفعلي التحذير أيضًا إذا وُجدت هذه التفاصيل على مستوى السطر بينما PrepaidAmount صفر أو غير موجود، وإذا كان PrepaidAmount غير صفري والمجموعان موجبين وكان أي cac:DocumentReference/cbc:DocumentTypeCode في الأسطر غير 386.",
"ar_fix": "اجعل cbc:PrepaidAmount مساويًا لمجموع TaxableAmount و TaxAmount في أسطر الدفعات المقدمة (مثال: 1000 + 150 تعطي `<cbc:PrepaidAmount currencyID=\"SAR\">1150.00</cbc:PrepaidAmount>`)، واستخدم DocumentTypeCode = 386 في تلك الأسطر، ولا تضع cac:TaxSubtotal على مستوى السطر إلا عند وجود دفعة مقدمة.",
"applies_to": "conditional",
"fields": [
"BT-113",
"KSA-31",
"KSA-32"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-80",
"url_ar": "https://matheel.app/akhta/br-ksa-80"
},
{
"id": "BR-KSA-81",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-81]-The other Buyer ID (BT-46) must present in the tax invoice and associated debit notes and credit notes (KSA-2, position 1 and 2 = 01), where the buyer VAT registration number or buyer group VAT registration number (BT-48) is not provided.",
"fails_when": "not(exists(./cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID) and normalize-space(./cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID) !='' )",
"en_title": "Standard invoice without buyer VAT number needs another buyer ID",
"ar_title": "الفاتورة الضريبية دون رقم ضريبي للمشتري تتطلب معرّفًا آخر له",
"en_meaning": "For standard tax invoices and their notes (KSA-2, cbc:InvoiceTypeCode/@name, starting 01), if cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) is absent, the buyer's cac:PartyIdentification/cbc:ID (BT-46) must be present and non-empty. The check looks only at whether the CompanyID element exists, not whether it is empty.",
"en_fix": "Either give the buyer VAT number in cac:PartyTaxScheme/cbc:CompanyID, or add a non-empty cac:PartyIdentification/cbc:ID under the buyer's cac:AccountingCustomerParty/cac:Party.",
"ar_meaning": "في الفواتير الضريبية القياسية وإشعاراتها (KSA-2، أي cbc:InvoiceTypeCode/@name، يبدأ بـ 01)، إذا لم يوجد cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) فيجب أن يوجد cac:PartyIdentification/cbc:ID (BT-46) للمشتري بقيمة غير فارغة. يتحقق الفحص من وجود عنصر CompanyID فقط، لا من كونه فارغًا.",
"ar_fix": "إما أن تضع الرقم الضريبي للمشتري في cac:PartyTaxScheme/cbc:CompanyID، أو تضيف cac:PartyIdentification/cbc:ID غير فارغ تحت cac:AccountingCustomerParty/cac:Party.",
"applies_to": "standard",
"fields": [
"BT-46",
"KSA-2",
"BT-48"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-81",
"url_ar": "https://matheel.app/akhta/br-ksa-81"
},
{
"id": "BR-KSA-82",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-82]-An Invoice line (BG-25) where Prepayment Document Type Code (KSA-30) is provided, then Item net price (BT-146); Invoice line allowance amount (BT-136); Invoice line charge amount (BT-141); Item line net amount (BT-131); line VAT amount (KSA-11); and line amount with VAT (KSA-12) for that line shall be 0 (Zero), if exist.",
"fails_when": "not( (../cbc:LineExtensionAmount)=0.00) or not((../cac:TaxTotal/cbc:TaxAmount)=0.00) or not((../cac:TaxTotal/cbc:RoundingAmount)=0) or not((../cac:Price/cbc:PriceAmount)=0.00)",
"en_title": "Prepayment lines must carry zero line amounts",
"ar_title": "مبالغ سطر الدفعة المقدمة يجب أن تكون صفرًا",
"en_meaning": "In an invoice with cbc:PrepaidAmount > 0, each line with a cac:DocumentReference of type 386 must have cbc:LineExtensionAmount, cac:TaxTotal/cbc:TaxAmount, cac:TaxTotal/cbc:RoundingAmount and cac:Price/cbc:PriceAmount equal to 0, and any line cac:AllowanceCharge/cbc:Amount equal to 0. Unlike the 'if exist' wording, the check fails when LineExtensionAmount, TaxAmount, RoundingAmount or PriceAmount is missing.",
"en_fix": "In prepayment lines write those amounts as zero, e.g. `<cbc:LineExtensionAmount currencyID=\"SAR\">0.00</cbc:LineExtensionAmount>`, cac:TaxTotal with cbc:TaxAmount 0 and cbc:RoundingAmount 0, and cac:Price/cbc:PriceAmount 0.00; the prepaid values go only in the line's cac:TaxSubtotal.",
"ar_meaning": "في الفاتورة التي يكون فيها cbc:PrepaidAmount أكبر من صفر، يجب أن تكون قيم cbc:LineExtensionAmount و cac:TaxTotal/cbc:TaxAmount و cac:TaxTotal/cbc:RoundingAmount و cac:Price/cbc:PriceAmount صفرًا في كل سطر فيه cac:DocumentReference من النوع 386، وكذلك أي cac:AllowanceCharge/cbc:Amount في السطر. وخلافًا لعبارة \"إن وجدت\" في النص الرسمي، يفشل الفحص إذا غاب LineExtensionAmount أو TaxAmount أو RoundingAmount أو PriceAmount.",
"ar_fix": "في أسطر الدفعات المقدمة اكتب هذه المبالغ صفرًا، مثل `<cbc:LineExtensionAmount currencyID=\"SAR\">0.00</cbc:LineExtensionAmount>`، و cac:TaxTotal بقيمة cbc:TaxAmount = 0 و cbc:RoundingAmount = 0، و cac:Price/cbc:PriceAmount = 0.00؛ أما قيم الدفعة المقدمة فتوضع في cac:TaxSubtotal للسطر فقط.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-30",
"BT-146",
"BT-136",
"BT-141",
"BT-131",
"KSA-11",
"KSA-12"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-82",
"url_ar": "https://matheel.app/akhta/br-ksa-82"
},
{
"id": "BR-KSA-83",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-83]-A VAT breakdown (BG-23) with VAT Category code (BT-118) 'Exempt from VAT' or 'Zero rated' or 'Not subject to VAT' shall have a VAT exemption (or exception) reason text (BT-120) with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason text - specific to Saudi Arabia.",
"fails_when": "not((contains($taxExemptionReason, 'VATEX-SA-29FinancialservicesmentionedinArticle29oftheVATRegulations') and string-length($taxExemptionReason) <68) or (contains($taxExemptionReason, 'VATEX-SA-29-7LifeinsuranceservicesmentionedinArticle29oftheVATRegulations')and string-length($taxExemptionReason) <74) or (contains($taxExemptionReason, 'VATEX-SA-30RealestatetransactionsmentionedinArticle30oftheVATRegulations') and string-length($taxExemptionReason) <73) or( contains($taxExemptionReason, 'VATEX-SA-32Exportofgoods') and string-length($taxExemptionReason) <25 )or (contains($taxExemptionReason, 'VATEX-SA-33Exportofservices') and string-length($taxExemptionReason) <28 ) or (contains($taxExemptionReason, 'VATEX-SA-34-1TheinternationaltransportofGoods') and string-length($taxExemptionReason) <46 ) or (contains($taxExemptionReason, 'VATEX-SA-34-2internationaltransportofpassengers') and string-length($taxExemptionReason) <48 ) or (contains($taxExemptionReason, 'VATEX-SA-34-3servicesdirectlyconnectedandincidentaltoaSupplyofinternationalpassengertransport') and string-length($taxExemptionReason) <94 ) or (contains($taxExemptionReason, 'VATEX-SA-34-4Supplyofaqualifyingmeansoftransport') and string-length($taxExemptionReason) <49 ) or (contains($taxExemptionReason, 'VATEX-SA-34-5AnyservicesrelatingtoGoodsorpassengertransportation,asdefinedinarticletwentyfiveoftheseRegulations') and string-length($taxExemptionReason) <112 )or (contains($taxExemptionReason, 'VATEX-SA-35Medicinesandmedicalequipment') and string-length($taxExemptionReason) <40 ) or (contains($taxExemptionReason, 'VATEX-SA-36Qualifyingmetals') and string-length($taxExemptionReason) <28 ) or (contains($taxExemptionReason, 'VATEX-SA-EDUPrivateeducationtocitizen') and string-length($taxExemptionReason) <38 ) or (contains($taxExemptionReason, 'VATEX-SA-HEAPrivatehealthcaretocitizen') and string-length($taxExemptionReason) <39 ) or (matches(normalize-space(cbc:TaxExemptionReasonCode),'VATEX-SA-OOS') )or (contains($taxExemptionReason, 'VATEX-SA-MLTRYsupplyofqualifiedmilitarygoods') and string-length($taxExemptionReason) <45 ) or (normalize-space(cbc:TaxExemptionReasonCode)=''))",
"en_title": "Exemption reason code in the VAT breakdown needs a reason text",
"ar_title": "رمز سبب الإعفاء في تفصيل الضريبة يتطلب نص السبب",
"en_meaning": "For document-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID Z, E or O, if cbc:TaxExemptionReasonCode is present then cbc:TaxExemptionReason (BT-120) must be present and non-empty. The executed check does not compare the text with the paragraph 11.2.4 list and does not fire when the reason code is absent.",
"en_fix": "Next to the reason code, add the reason text, e.g. `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode><cbc:TaxExemptionReason>Export of goods</cbc:TaxExemptionReason>`.",
"ar_meaning": "في cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى المستند ذات cbc:ID = Z أو E أو O، إذا وُجد cbc:TaxExemptionReasonCode فيجب أن يوجد cbc:TaxExemptionReason (BT-120) بقيمة غير فارغة. الفحص الفعلي لا يقارن النص بقائمة الفقرة 11.2.4، ولا يعمل إذا غاب رمز السبب.",
"ar_fix": "أضف نص السبب بجانب رمزه، مثل `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode><cbc:TaxExemptionReason>Export of goods</cbc:TaxExemptionReason>`.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-120"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-83",
"url_ar": "https://matheel.app/akhta/br-ksa-83"
},
{
"id": "BR-KSA-84",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "The Document level allowance VAT rate (BT-96), Document level Charge VAT rate (BT-103), VAT category rate(BT-119), Invoiced item VAT rate (BT-152), Prepayment VAT rate(KSA-34) must be limited to one of the following values (5 or 15) when the relevant Document level allowance VAT category code (BT-95), Document level Charge VAT category code(BT-102), VAT category code(BT-118), Invoiced item VAT category code(BT-151), Prepayment VAT Category Code (KSA-33) is \"S\"- \"Standard rated\". In other words, for Standard Rate VAT Category the rate can either be 15% or 5%.",
"fails_when": "exists(./cbc:Percent) and not(floor(number(./cbc:Percent)) = 15 or floor(number(./cbc:Percent = 5)))",
"en_title": "Standard-rated (S) VAT rate must be 15 or 5",
"ar_title": "نسبة الضريبة للفئة القياسية S يجب أن تكون 15 أو 5",
"en_meaning": "Wherever a VAT cac:TaxCategory or cac:ClassifiedTaxCategory has cbc:ID 'S' (document allowances and charges, document and line cac:TaxSubtotal, line items), its cbc:Percent, if present, must be 15 or 5. The executed check compares the whole-number part with 15 (floor), so a value such as 15.50 also passes, while 5 must match exactly.",
"en_fix": "Use `<cbc:Percent>15.00</cbc:Percent>`, or 5.00 where the 5% rate applies, in every S-category tax category.",
"ar_meaning": "أينما وُجدت cac:TaxCategory أو cac:ClassifiedTaxCategory لضريبة VAT بقيمة cbc:ID = 'S' (الخصومات والرسوم على مستوى المستند، و cac:TaxSubtotal على مستوى المستند والسطر، وبنود الأسطر)، يجب أن تكون قيمة cbc:Percent إن وُجدت 15 أو 5. يقارن الفحص الفعلي الجزء الصحيح من القيمة بالعدد 15، لذا تمر قيمة مثل 15.50 أيضًا، بينما يجب أن تطابق القيمة 5 تمامًا.",
"ar_fix": "استخدم `<cbc:Percent>15.00</cbc:Percent>`، أو 5.00 حيث تنطبق نسبة 5%، في كل فئة ضريبية من النوع S.",
"applies_to": "conditional",
"fields": [
"BT-96",
"BT-103",
"BT-119",
"BT-152",
"KSA-34",
"BT-95",
"BT-102",
"BT-118",
"BT-151",
"KSA-33"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-84",
"url_ar": "https://matheel.app/akhta/br-ksa-84"
},
{
"id": "BR-KSA-85",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-85]-The Buyer's contact phone number (BT-57) shall start with \"0\" or \"+\", followed by a maximum of 15 number and minimum 4 character after the \"+\" or \"0\" , if exist.",
"fails_when": "string-length(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Telephone) > 0 and not(exists(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Telephone) and matches(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Telephone, '^(?:0|\\+)[0-9]{4,15}$'))",
"en_title": "Buyer phone must start with 0 or + followed by 4 to 15 digits",
"ar_title": "هاتف المشتري يبدأ بـ 0 أو + ويليه من 4 إلى 15 رقمًا",
"en_meaning": "If cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Telephone (BT-57) is non-empty, it must match ^(?:0|\\+)[0-9]{4,15}$: a leading 0 or + followed by 4 to 15 digits and nothing else. Spaces, dashes and brackets therefore fail.",
"en_fix": "Write the number without separators, e.g. `<cbc:Telephone>+966500000000</cbc:Telephone>` or `<cbc:Telephone>0500000000</cbc:Telephone>`.",
"ar_meaning": "إذا كان cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Telephone (BT-57) غير فارغ فيجب أن يطابق النمط ^(?:0|\\+)[0-9]{4,15}$، أي أن يبدأ بـ 0 أو + ويليه من 4 إلى 15 رقمًا فقط. لذلك تُرفض المسافات والشرطات والأقواس.",
"ar_fix": "اكتب الرقم دون فواصل، مثل `<cbc:Telephone>+966500000000</cbc:Telephone>` أو `<cbc:Telephone>0500000000</cbc:Telephone>`.",
"applies_to": "conditional",
"fields": [
"BT-57"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-85",
"url_ar": "https://matheel.app/akhta/br-ksa-85"
},
{
"id": "BR-KSA-86",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-86]- Buyer's Contact Email Address (BT-58) shall follow the following format ** XXX@YYY.ZZ where: The [XXX] should consist of alphanumeric characters (a-z, A-Z, 0-9), dots ('.'), underscores ('_'), or hyphens ('-'). It must start and end with an alphanumeric character. The [YYY] should consist of alphanumeric characters (a-z, A-Z, 0-9), hyphens ('-'), and dots ('.'). It must start and end with an alphanumeric character. The [ZZ] should be a valid extension with a maximum 3 and a minimum 2 alphabets (a-z, A-Z), If exist. Multiple emails can be provided using semicolon ';' separator.",
"fails_when": "string-length(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail) > 0 and not(exists(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail) and matches(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail, '^(?:[a-zA-Z0-9](?:[_a-zA-Z0-9.-]*[a-zA-Z0-9_])?@(?:[a-zA-Z0-9]([-.\\w]*[a-zA-Z0-9])+\\.)+[a-zA-Z]{2,3}(?:;|$))+$'))",
"en_title": "Buyer email should follow the XXX@YYY.ZZ format",
"ar_title": "بريد المشتري الإلكتروني يتبع صيغة XXX@YYY.ZZ",
"en_meaning": "Describes the format of cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail (BT-58): a local part and domain of letters, digits, dots and hyphens (plus underscores in the local part) that start and end alphanumeric, and a 2-3 letter extension. In the SDK 3.4.8 schematron this check is commented out, so the validator does not run it.",
"en_fix": "Use a plain address such as `<cbc:ElectronicMail>name@example.com</cbc:ElectronicMail>`; per the message, separate several addresses with ';'.",
"ar_meaning": "تصف القاعدة صيغة cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:ElectronicMail (BT-58): اسم مستخدم ونطاق من الحروف والأرقام والنقاط والشرطات (مع الشرطة السفلية في اسم المستخدم)، يبدآن وينتهيان بحرف أو رقم، وامتداد من حرفين إلى ثلاثة. هذا الفحص معطّل (داخل تعليق) في ملف schematron الخاص بـ SDK 3.4.8، لذا لا يشغّله المدقق.",
"ar_fix": "استخدم عنوانًا بسيطًا مثل `<cbc:ElectronicMail>name@example.com</cbc:ElectronicMail>`، وحسب النص الرسمي افصل بين العناوين المتعددة بالرمز ';'.",
"applies_to": "conditional",
"fields": [
"BT-58"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-86",
"url_ar": "https://matheel.app/akhta/br-ksa-86"
},
{
"id": "BR-KSA-87",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-87] If the tax exchange rate (KSA-36) exists, then Source Currency Code (KSA-37), Target Currency Code (KSA-38) and Calculation Rate (KSA-39) shall be provided",
"fails_when": "exists(/ubl:Invoice/cac:TaxExchangeRate) and not(exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode) != '' and exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) != '' and exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) != '')",
"en_title": "Tax exchange rate needs source currency, target currency and rate",
"ar_title": "سعر صرف الضريبة يتطلب عملة المصدر وعملة الهدف والسعر",
"en_meaning": "If /ubl:Invoice/cac:TaxExchangeRate (KSA-36) exists, it must contain non-empty cbc:SourceCurrencyCode (KSA-37), cbc:TargetCurrencyCode (KSA-38) and cbc:CalculationRate (KSA-39).",
"en_fix": "Complete the block, e.g. `<cac:TaxExchangeRate><cbc:SourceCurrencyCode>USD</cbc:SourceCurrencyCode><cbc:TargetCurrencyCode>SAR</cbc:TargetCurrencyCode><cbc:CalculationRate>3.75</cbc:CalculationRate></cac:TaxExchangeRate>`, or leave out cac:TaxExchangeRate entirely.",
"ar_meaning": "إذا وُجد /ubl:Invoice/cac:TaxExchangeRate (KSA-36) فيجب أن يحتوي على cbc:SourceCurrencyCode (KSA-37) و cbc:TargetCurrencyCode (KSA-38) و cbc:CalculationRate (KSA-39) بقيم غير فارغة.",
"ar_fix": "أكمل العنصر، مثل `<cac:TaxExchangeRate><cbc:SourceCurrencyCode>USD</cbc:SourceCurrencyCode><cbc:TargetCurrencyCode>SAR</cbc:TargetCurrencyCode><cbc:CalculationRate>3.75</cbc:CalculationRate></cac:TaxExchangeRate>`، أو احذف cac:TaxExchangeRate كليًا.",
"applies_to": "conditional",
"fields": [
"KSA-36",
"KSA-37",
"KSA-38",
"KSA-39"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-87",
"url_ar": "https://matheel.app/akhta/br-ksa-87"
},
{
"id": "BR-KSA-88",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-88] If exist, Source Currency Code (KSA-37) must be the same as Invoice currency code (BT-5)",
"fails_when": "exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode) != '' and not(matches(normalize-space(//cbc:DocumentCurrencyCode), /ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:SourceCurrencyCode !='') )",
"en_title": "Exchange-rate source currency must equal the invoice currency",
"ar_title": "عملة المصدر في سعر الصرف تطابق عملة الفاتورة",
"en_meaning": "If cac:TaxExchangeRate/cbc:SourceCurrencyCode (KSA-37) is present and non-empty, it must match cbc:DocumentCurrencyCode (BT-5).",
"en_fix": "Put the same code as cbc:DocumentCurrencyCode in cac:TaxExchangeRate/cbc:SourceCurrencyCode (e.g. USD in both).",
"ar_meaning": "إذا وُجد cac:TaxExchangeRate/cbc:SourceCurrencyCode (KSA-37) بقيمة غير فارغة فيجب أن يطابق cbc:DocumentCurrencyCode (BT-5).",
"ar_fix": "ضع في cac:TaxExchangeRate/cbc:SourceCurrencyCode الرمز نفسه الموجود في cbc:DocumentCurrencyCode (مثل USD في كليهما).",
"applies_to": "conditional",
"fields": [
"KSA-37",
"BT-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-88",
"url_ar": "https://matheel.app/akhta/br-ksa-88"
},
{
"id": "BR-KSA-89",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-89] If exists, Target Currency Code (KSA-38) must be the same as the Tax currency code (BT-6)",
"fails_when": "exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) != '' and not(matches(normalize-space(//cbc:TaxCurrencyCode), /ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:TargetCurrencyCode !='') )",
"en_title": "Exchange-rate target currency must equal the tax currency",
"ar_title": "عملة الهدف في سعر الصرف تطابق عملة الضريبة",
"en_meaning": "If cac:TaxExchangeRate/cbc:TargetCurrencyCode (KSA-38) is present and non-empty, it must match cbc:TaxCurrencyCode (BT-6). The executed check compares with TaxCurrencyCode as the message says, although the test string displayed for the rule mentions DocumentCurrencyCode.",
"en_fix": "Set cbc:TargetCurrencyCode to the cbc:TaxCurrencyCode value, which must be SAR (BR-KSA-EN16931-02): `<cbc:TargetCurrencyCode>SAR</cbc:TargetCurrencyCode>`.",
"ar_meaning": "إذا وُجد cac:TaxExchangeRate/cbc:TargetCurrencyCode (KSA-38) بقيمة غير فارغة فيجب أن يطابق cbc:TaxCurrencyCode (BT-6). يقارن الفحص الفعلي بـ TaxCurrencyCode كما ينص النص الرسمي، رغم أن نص الاختبار المعروض للقاعدة يذكر DocumentCurrencyCode.",
"ar_fix": "اجعل cbc:TargetCurrencyCode مساويًا لقيمة cbc:TaxCurrencyCode التي يجب أن تكون SAR (BR-KSA-EN16931-02): `<cbc:TargetCurrencyCode>SAR</cbc:TargetCurrencyCode>`.",
"applies_to": "conditional",
"fields": [
"KSA-38",
"BT-6"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-89",
"url_ar": "https://matheel.app/akhta/br-ksa-89"
},
{
"id": "BR-KSA-90",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-90] If exists, the allowed maximum number of digits for the Tax Exchange Rate (KSA-39) is 14.",
"fails_when": "exists(/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) and (/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate) != '' and not(string-length(normalize-space(/ubl:Invoice/cac:TaxExchangeRate/cbc:CalculationRate)) < 15)",
"en_title": "Tax exchange rate may be at most 14 characters long",
"ar_title": "سعر صرف الضريبة لا يتجاوز 14 خانة",
"en_meaning": "If cac:TaxExchangeRate/cbc:CalculationRate (KSA-39) is present and non-empty, its trimmed length must be under 15 characters. The check counts every character, including the decimal point, not only digits; the test string displayed for the rule is a copy of BR-KSA-89's.",
"en_fix": "Shorten the rate to 14 characters or fewer, e.g. `<cbc:CalculationRate>3.75</cbc:CalculationRate>`.",
"ar_meaning": "إذا وُجد cac:TaxExchangeRate/cbc:CalculationRate (KSA-39) بقيمة غير فارغة فيجب أن يقل طوله بعد حذف المسافات عن 15 حرفًا. يعدّ الفحص كل الأحرف بما فيها الفاصلة العشرية، لا الأرقام وحدها، ونص الاختبار المعروض للقاعدة منسوخ من BR-KSA-89.",
"ar_fix": "اختصر السعر إلى 14 حرفًا أو أقل، مثل `<cbc:CalculationRate>3.75</cbc:CalculationRate>`.",
"applies_to": "conditional",
"fields": [
"KSA-39"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-90",
"url_ar": "https://matheel.app/akhta/br-ksa-90"
},
{
"id": "BR-KSA-92",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-92]-If it's a B2G invoice transaction type (KSA 2, position 9 = 01), then the Contract ID (BT-12) must be present in a tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).",
"fails_when": "not(exists(cac:ContractDocumentReference/cbc:ID) and (normalize-space(cac:ContractDocumentReference/cbc:ID) != ''))",
"en_title": "B2G invoices must include a contract ID",
"ar_title": "فواتير القطاع الحكومي يجب أن تتضمن رقم العقد",
"en_meaning": "When cbc:InvoiceTypeCode/@name (KSA-2) is 9 characters long, starts with 01 or 02 and has 1 as its 9th character (B2G), cac:ContractDocumentReference/cbc:ID (BT-12) must be present and non-empty. The message mentions only tax invoices (01), but the executed check also covers 02.",
"en_fix": "Add `<cac:ContractDocumentReference><cbc:ID>...</cbc:ID></cac:ContractDocumentReference>` with the contract number.",
"ar_meaning": "عندما يكون cbc:InvoiceTypeCode/@name (KSA-2) بطول 9 أحرف ويبدأ بـ 01 أو 02 وحرفه التاسع 1 (معاملة مع جهة حكومية B2G)، يجب أن يوجد cac:ContractDocumentReference/cbc:ID (BT-12) بقيمة غير فارغة. النص الرسمي يذكر الفواتير الضريبية (01) فقط، لكن الفحص الفعلي يشمل 02 أيضًا.",
"ar_fix": "أضف `<cac:ContractDocumentReference><cbc:ID>...</cbc:ID></cac:ContractDocumentReference>` مع رقم العقد.",
"applies_to": "conditional",
"fields": [
"KSA-2",
"BT-12"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-92",
"url_ar": "https://matheel.app/akhta/br-ksa-92"
},
{
"id": "BR-KSA-93",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-93]-An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is \"Zero-rated\" the Prepayment VAT exception reason code (KSA-41) should be provided.",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and normalize-space(cbc:TaxExemptionReasonCode )!='' )",
"en_title": "Zero-rated (Z) line VAT breakdown needs an exemption reason code",
"ar_title": "تفصيل ضريبة السطر بالنسبة الصفرية (Z) يتطلب رمز سبب الإعفاء",
"en_meaning": "Each line-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID 'Z' (VAT) must have a non-empty cbc:TaxExemptionReasonCode (KSA-41). The executed check tests presence only (allowed values are checked by BR-KSA-CL-07), and it is evaluated only when the document also contains a standard-rated (S) VAT category.",
"en_fix": "Add a reason code to that line TaxCategory, e.g. `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode>`.",
"ar_meaning": "يجب أن يحتوي كل cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى السطر فئته cbc:ID = 'Z' (VAT) على عنصر cbc:TaxExemptionReasonCode (KSA-41) غير فارغ. الفحص الفعلي يتحقق من الوجود فقط (القيم المسموحة تتحقق منها BR-KSA-CL-07)، ولا يُقيَّم إلا إذا احتوى المستند أيضًا على فئة ضريبة قياسية (S).",
"ar_fix": "أضف رمز سبب إلى فئة الضريبة في ذلك السطر، مثل `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-33",
"KSA-41"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-93",
"url_ar": "https://matheel.app/akhta/br-ksa-93"
},
{
"id": "BR-KSA-94",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-94]-An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is \" Exempt from VAT \" the Prepayment VAT exemption reason code (KSA-41) should be provided.",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and normalize-space(cbc:TaxExemptionReasonCode )!='' )",
"en_title": "Exempt (E) line VAT breakdown needs an exemption reason code",
"ar_title": "تفصيل ضريبة السطر المعفاة (E) يتطلب رمز سبب الإعفاء",
"en_meaning": "Each line-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID 'E' (VAT) must have a non-empty cbc:TaxExemptionReasonCode (KSA-41). The executed check tests presence only (allowed values are checked by BR-KSA-CL-07), and it is evaluated only when the document also contains a standard-rated (S) VAT category.",
"en_fix": "Add a reason code to that line TaxCategory, e.g. `<cbc:TaxExemptionReasonCode>VATEX-SA-29</cbc:TaxExemptionReasonCode>`.",
"ar_meaning": "يجب أن يحتوي كل cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى السطر فئته cbc:ID = 'E' (VAT) على عنصر cbc:TaxExemptionReasonCode (KSA-41) غير فارغ. الفحص الفعلي يتحقق من الوجود فقط (القيم المسموحة تتحقق منها BR-KSA-CL-07)، ولا يُقيَّم إلا إذا احتوى المستند أيضًا على فئة ضريبة قياسية (S).",
"ar_fix": "أضف رمز سبب إلى فئة الضريبة في ذلك السطر، مثل `<cbc:TaxExemptionReasonCode>VATEX-SA-29</cbc:TaxExemptionReasonCode>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-33",
"KSA-41"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-94",
"url_ar": "https://matheel.app/akhta/br-ksa-94"
},
{
"id": "BR-KSA-95",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-95]-An Invoice line (BG-25) where the Prepayment VAT category code (KSA-33) is \" Not subject to VAT \" the Prepayment VAT exception reason code (KSA-41) should be provided.",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and normalize-space(cbc:TaxExemptionReasonCode )!='' )",
"en_title": "Not-subject (O) line VAT breakdown needs an exemption reason code",
"ar_title": "تفصيل ضريبة السطر غير الخاضعة (O) يتطلب رمز سبب الإعفاء",
"en_meaning": "Each line-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID 'O' (VAT) must have a non-empty cbc:TaxExemptionReasonCode (KSA-41). The executed check tests presence only (allowed values are checked by BR-KSA-CL-07), and it is evaluated only when the document also contains a standard-rated (S) VAT category.",
"en_fix": "Add a reason code to that line TaxCategory, e.g. `<cbc:TaxExemptionReasonCode>VATEX-SA-OOS</cbc:TaxExemptionReasonCode>`.",
"ar_meaning": "يجب أن يحتوي كل cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى السطر فئته cbc:ID = 'O' (VAT) على عنصر cbc:TaxExemptionReasonCode (KSA-41) غير فارغ. الفحص الفعلي يتحقق من الوجود فقط (القيم المسموحة تتحقق منها BR-KSA-CL-07)، ولا يُقيَّم إلا إذا احتوى المستند أيضًا على فئة ضريبة قياسية (S).",
"ar_fix": "أضف رمز سبب إلى فئة الضريبة في ذلك السطر، مثل `<cbc:TaxExemptionReasonCode>VATEX-SA-OOS</cbc:TaxExemptionReasonCode>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-33",
"KSA-41"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-95",
"url_ar": "https://matheel.app/akhta/br-ksa-95"
},
{
"id": "BR-KSA-96",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-96]-An Invoice line (BG-25) with the Prepayment VAT category code (KSA-33) 'Exempt from VAT' or 'Zero rated' or 'Not subject to VAT' shall have a Prepayment VAT exemption(or exception) reason text (KSA-42) with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason text - specific to Saudi Arabia.",
"fails_when": "not(exists(cbc:TaxExemptionReason) and normalize-space(cbc:TaxExemptionReason))",
"en_title": "Line exemption reason code needs a reason text",
"ar_title": "رمز سبب الإعفاء في السطر يتطلب نص السبب",
"en_meaning": "For line-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID Z, E or O (VAT), if cbc:TaxExemptionReasonCode is present then cbc:TaxExemptionReason (KSA-42) must be present and non-empty. The executed check does not compare the text with the paragraph 11.2.4 list, and it is evaluated only when the document also contains a standard-rated (S) VAT category.",
"en_fix": "Add the reason text next to the line's reason code, e.g. `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode><cbc:TaxExemptionReason>Export of goods</cbc:TaxExemptionReason>`.",
"ar_meaning": "في cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى السطر ذات cbc:ID = Z أو E أو O (VAT)، إذا وُجد cbc:TaxExemptionReasonCode فيجب أن يوجد cbc:TaxExemptionReason (KSA-42) بقيمة غير فارغة. الفحص الفعلي لا يقارن النص بقائمة الفقرة 11.2.4، ولا يُقيَّم إلا إذا احتوى المستند أيضًا على فئة ضريبة قياسية (S).",
"ar_fix": "أضف نص السبب بجانب رمز السبب في السطر، مثل `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode><cbc:TaxExemptionReason>Export of goods</cbc:TaxExemptionReason>`.",
"applies_to": "conditional",
"fields": [
"BG-25",
"KSA-33",
"KSA-42"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-96",
"url_ar": "https://matheel.app/akhta/br-ksa-96"
},
{
"id": "BR-KSA-97",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-97]-If the Document Currency Code (BT-5) is different from \"SAR\", then the value in \"Invoice total VAT amount (BT-110)\" cannot be the same as the value in \"Invoice total VAT amount in accounting currency (BT-111)\".",
"fails_when": "(./cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount > 0) and (./cac:TaxTotal[not(cac:TaxSubtotal)]/cbc:TaxAmount > 0) and (round(./cac:TaxTotal[cac:TaxSubtotal]/cbc:TaxAmount * 100) div 100 = round(./cac:TaxTotal[not(cac:TaxSubtotal)]/cbc:TaxAmount * 100) div 100)",
"en_title": "Non-SAR invoice: SAR VAT total must differ from the VAT total",
"ar_title": "فاتورة بغير الريال: إجمالي الضريبة بالريال يختلف عن الإجمالي",
"en_meaning": "When cbc:DocumentCurrencyCode (BT-5) is not SAR, the warning fires if both document cac:TaxTotal/cbc:TaxAmount values are above 0 and the one with cac:TaxSubtotal (BT-110) equals the one without (BT-111) after rounding to 2 decimals. The expression shown for the rule is the failure condition, not the pass condition.",
"en_fix": "Put the VAT total in the invoice currency in the cac:TaxTotal that has subtotals, and the VAT total converted to SAR in the separate cac:TaxTotal without subtotals, e.g. `<cac:TaxTotal><cbc:TaxAmount currencyID=\"SAR\">...</cbc:TaxAmount></cac:TaxTotal>`.",
"ar_meaning": "عندما لا يكون cbc:DocumentCurrencyCode (BT-5) هو SAR، يظهر التحذير إذا كانت قيمتا cac:TaxTotal/cbc:TaxAmount على مستوى المستند أكبر من صفر، وكانت القيمة التي تحتوي على cac:TaxSubtotal (BT-110) مساوية للقيمة التي لا تحتوي عليه (BT-111) بعد التقريب إلى خانتين. التعبير المعروض للقاعدة هو شرط الفشل لا شرط النجاح.",
"ar_fix": "ضع إجمالي الضريبة بعملة الفاتورة في cac:TaxTotal الذي يحتوي على التفاصيل، وإجمالي الضريبة محوّلًا إلى الريال في cac:TaxTotal المنفصل دون تفاصيل، مثل `<cac:TaxTotal><cbc:TaxAmount currencyID=\"SAR\">...</cbc:TaxAmount></cac:TaxTotal>`.",
"applies_to": "conditional",
"fields": [
"BT-5",
"BT-110",
"BT-111"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-97",
"url_ar": "https://matheel.app/akhta/br-ksa-97"
},
{
"id": "BR-KSA-98",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-98] - The simplified invoice should be submitted within 24 hours of issuing the invoice.",
"fails_when": "(cbc:InvoiceTypeCode[substring(@name, 1, 2) = '02']) and (exists(cbc:IssueDate) and exists(cbc:IssueTime) and (current-dateTime() - xs:dateTime(concat(cbc:IssueDate, 'T', cbc:IssueTime))) > xs:dayTimeDuration('P1D'))",
"en_title": "Simplified invoices should be submitted within 24 hours",
"ar_title": "تُرسل الفاتورة المبسطة خلال 24 ساعة من إصدارها",
"en_meaning": "For simplified documents (cbc:InvoiceTypeCode/@name starting 02), the warning fires when more than 24 hours (P1D) separate cbc:IssueDate + cbc:IssueTime from the validator's current date and time. The expression shown for the rule is the failure condition.",
"en_fix": "Submit the simplified document within 24 hours of the cbc:IssueDate and cbc:IssueTime it carries, and make sure those values are the real issue date and time.",
"ar_meaning": "في المستندات المبسطة (cbc:InvoiceTypeCode/@name يبدأ بـ 02)، يظهر التحذير إذا مضى أكثر من 24 ساعة (P1D) بين cbc:IssueDate مع cbc:IssueTime ووقت التحقق الحالي لدى المدقق. التعبير المعروض للقاعدة هو شرط الفشل.",
"ar_fix": "أرسل المستند المبسط خلال 24 ساعة من cbc:IssueDate و cbc:IssueTime المذكورين فيه، وتأكد أنهما تاريخ الإصدار ووقته الفعليان.",
"applies_to": "simplified",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-98",
"url_ar": "https://matheel.app/akhta/br-ksa-98"
},
{
"id": "BR-KSA-99",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "If it exists in the invoice, the buyer VAT registration number or buyer group VAT registration number (BT-48) should not be left empty in the tax invoice and associated credit notes and debit notes (KSA-2, position 1 and 2 = 01).",
"fails_when": "normalize-space(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) = '' and (exists(//cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID))",
"en_title": "Buyer VAT number must not be empty when the element is present",
"ar_title": "رقم ضريبة المشتري لا يكون فارغًا عند وجود العنصر",
"en_meaning": "For standard tax invoices and their notes (KSA-2 @name starting 01), if cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) is present, its trimmed value must not be empty. The test string shown for the rule is malformed; this describes the executed condition.",
"en_fix": "Fill cbc:CompanyID with the buyer's VAT number, or remove the empty element (BR-KSA-81 then requires another buyer ID in cac:PartyIdentification/cbc:ID).",
"ar_meaning": "في الفواتير الضريبية القياسية وإشعاراتها (KSA-2 يبدأ بـ 01)، إذا وُجد cac:AccountingCustomerParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID (BT-48) فيجب ألا تكون قيمته فارغة بعد حذف المسافات. نص الاختبار المعروض للقاعدة غير سليم الصياغة، وهذا الوصف للشرط المنفّذ فعليًا.",
"ar_fix": "املأ cbc:CompanyID بالرقم الضريبي للمشتري، أو احذف العنصر الفارغ (وعندها تتطلب BR-KSA-81 معرّفًا آخر للمشتري في cac:PartyIdentification/cbc:ID).",
"applies_to": "standard",
"fields": [
"BT-48",
"KSA-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-99",
"url_ar": "https://matheel.app/akhta/br-ksa-99"
},
{
"id": "BR-KSA-CL-01",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-CL-01]-Currency code (BT-5) must be according to ISO 4217:2005",
"fails_when": "not(((not(contains(normalize-space(.), ' ')) and contains(' AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYN BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XAG XAU XBA XBB XBC XBD XCD XDR XOF XPD XPF XPT XSU XTS XUA XXX YER ZAR ZMW ZWL ', concat(' ', normalize-space(.), ' ')))))",
"en_title": "Invoice currency code must be a valid ISO 4217 code",
"ar_title": "رمز عملة الفاتورة يجب أن يكون صالحًا وفق ISO 4217",
"en_meaning": "cbc:DocumentCurrencyCode (BT-5), and the @currencyID of line cac:TaxSubtotal/cbc:TaxAmount, line cac:TaxSubtotal/cbc:TaxableAmount and cbc:PayableRoundingAmount, must be a single ISO 4217 code from the list in the rule (e.g. SAR, USD, EUR).",
"en_fix": "Use an uppercase three-letter code from the list, e.g. `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`.",
"ar_meaning": "يجب أن يكون cbc:DocumentCurrencyCode (BT-5)، وكذلك @currencyID في cac:TaxSubtotal/cbc:TaxAmount و cac:TaxSubtotal/cbc:TaxableAmount على مستوى السطر وفي cbc:PayableRoundingAmount، رمزًا واحدًا وفق ISO 4217 من القائمة الواردة في القاعدة (مثل SAR و USD و EUR).",
"ar_fix": "استخدم رمزًا من ثلاثة أحرف كبيرة من القائمة، مثل `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`.",
"applies_to": "all",
"fields": [
"BT-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-cl-01",
"url_ar": "https://matheel.app/akhta/br-ksa-cl-01"
},
{
"id": "BR-KSA-CL-02",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-CL-02]-All currencyID attributes (BT-5) must have the same value as the invoice currency code (BT-5), except for the invoice total VAT amount in accounting currency (BT-111).",
"fails_when": "not(exists(@currencyID) and matches(normalize-space(//cbc:DocumentCurrencyCode), @currencyID) and (@currencyID !='') )",
"en_title": "Every amount's currencyID must match the invoice currency",
"ar_title": "سمة currencyID لكل مبلغ تطابق عملة الفاتورة",
"en_meaning": "Each checked amount element (cbc:Amount, cbc:BaseAmount, cbc:LineExtensionAmount, cbc:PriceAmount, the cac:LegalMonetaryTotal amounts, document cac:TaxSubtotal amounts, line cac:TaxTotal and cac:TaxSubtotal amounts) must have a non-empty @currencyID matching cbc:DocumentCurrencyCode (BT-5). Document-level cac:TaxTotal/cbc:TaxAmount is not in the checked list, which leaves room for the SAR VAT total (BT-111).",
"en_fix": "Set currencyID to the invoice currency on every amount, e.g. `<cbc:LineExtensionAmount currencyID=\"SAR\">100.00</cbc:LineExtensionAmount>` when BT-5 is SAR.",
"ar_meaning": "يجب أن يحمل كل عنصر مبلغ مشمول بالفحص (cbc:Amount و cbc:BaseAmount و cbc:LineExtensionAmount و cbc:PriceAmount ومبالغ cac:LegalMonetaryTotal ومبالغ cac:TaxSubtotal على مستوى المستند ومبالغ cac:TaxTotal و cac:TaxSubtotal على مستوى السطر) سمة @currencyID غير فارغة تطابق cbc:DocumentCurrencyCode (BT-5). العنصر cac:TaxTotal/cbc:TaxAmount على مستوى المستند غير مشمول بالقائمة، مما يسمح بإجمالي الضريبة بالريال (BT-111).",
"ar_fix": "اجعل currencyID مساويًا لعملة الفاتورة في كل مبلغ، مثل `<cbc:LineExtensionAmount currencyID=\"SAR\">100.00</cbc:LineExtensionAmount>` عندما تكون BT-5 هي SAR.",
"applies_to": "all",
"fields": [
"BT-5",
"BT-111"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-cl-02",
"url_ar": "https://matheel.app/akhta/br-ksa-cl-02"
},
{
"id": "BR-KSA-CL-03",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-CL-03]-Mime code must be according to subset of IANA code list.",
"fails_when": "not(((not(contains(normalize-space(@mimeCode), ' ')) and contains(' text/csv text/plain application/pdf image/png image/jpeg image/tiff application/acad application/dwg drawing/dwg application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet ', concat(' ', normalize-space(@mimeCode), ' ')))))",
"en_title": "Attachment mimeCode must be one of the allowed types",
"ar_title": "قيمة mimeCode للمرفق يجب أن تكون من الأنواع المسموحة",
"en_meaning": "Every cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject must have @mimeCode equal to one of: text/csv, text/plain, application/pdf, image/png, image/jpeg, image/tiff, application/acad, application/dwg, drawing/dwg, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet.",
"en_fix": "Use a listed value, e.g. `<cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">...</cbc:EmbeddedDocumentBinaryObject>` for the PIH and QR attachments.",
"ar_meaning": "يجب أن تكون قيمة @mimeCode في كل cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject إحدى القيم التالية: text/csv, text/plain, application/pdf, image/png, image/jpeg, image/tiff, application/acad, application/dwg, drawing/dwg, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet.",
"ar_fix": "استخدم قيمة من القائمة، مثل `<cbc:EmbeddedDocumentBinaryObject mimeCode=\"text/plain\">...</cbc:EmbeddedDocumentBinaryObject>` لمرفقي PIH و QR.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-cl-03",
"url_ar": "https://matheel.app/akhta/br-ksa-cl-03"
},
{
"id": "BR-KSA-CL-04",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-CL-04]-If VAT category Code (BT-118) is 'Z', or 'E', VAT exemption (or exception) reason code (BT-121) must exist with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason code - specific to Saudi Arabia.",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='Z' and contains(' VATEX-SA-32 VATEX-SA-33 VATEX-SA-34-1 VATEX-SA-34-2 VATEX-SA-34-3 VATEX-SA-34-4 VATEX-SA-34-5 VATEX-SA-35 VATEX-SA-36 VATEX-SA-EDU VATEX-SA-HEA VATEX-SA-MLTRY VATEX-SA-DIPLOMAT VATEX-SA-DUTYFREE VATEX-SA-ROYALDECREE VATEX-SA-32(bis) ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='E' and contains(' VATEX-SA-29 VATEX-SA-29-7 VATEX-SA-30 ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='O' and contains(' VATEX-SA-OOS ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or normalize-space(cbc:TaxExemptionReasonCode)='' )",
"en_title": "VAT exemption reason code must fit the VAT category",
"ar_title": "رمز سبب الإعفاء يجب أن يناسب فئة الضريبة",
"en_meaning": "For document-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID Z, E or O, a present cbc:TaxExemptionReasonCode (BT-121) must belong to that category: Z: VATEX-SA-32, VATEX-SA-33, VATEX-SA-34-1, VATEX-SA-34-2, VATEX-SA-34-3, VATEX-SA-34-4, VATEX-SA-34-5, VATEX-SA-35, VATEX-SA-36, VATEX-SA-EDU, VATEX-SA-HEA, VATEX-SA-MLTRY, VATEX-SA-DIPLOMAT, VATEX-SA-DUTYFREE, VATEX-SA-ROYALDECREE, VATEX-SA-32(bis); E: VATEX-SA-29, VATEX-SA-29-7, VATEX-SA-30; O: VATEX-SA-OOS. Unlike the message, the executed check also covers O, and an absent or empty code does not fail this rule (BR-KSA-23, BR-KSA-24 and BR-KSA-69 cover missing codes).",
"en_fix": "Use a code that matches the category, e.g. `<cbc:ID>E</cbc:ID>` with `<cbc:TaxExemptionReasonCode>VATEX-SA-29</cbc:TaxExemptionReasonCode>`.",
"ar_meaning": "في cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى المستند ذات cbc:ID = Z أو E أو O، يجب أن ينتمي cbc:TaxExemptionReasonCode (BT-121) إن وُجد إلى الفئة نفسها: Z: VATEX-SA-32, VATEX-SA-33, VATEX-SA-34-1, VATEX-SA-34-2, VATEX-SA-34-3, VATEX-SA-34-4, VATEX-SA-34-5, VATEX-SA-35, VATEX-SA-36, VATEX-SA-EDU, VATEX-SA-HEA, VATEX-SA-MLTRY, VATEX-SA-DIPLOMAT, VATEX-SA-DUTYFREE, VATEX-SA-ROYALDECREE, VATEX-SA-32(bis)؛ E: VATEX-SA-29, VATEX-SA-29-7, VATEX-SA-30؛ O: VATEX-SA-OOS. وخلافًا للنص الرسمي، يشمل الفحص الفعلي الفئة O أيضًا، ولا يفشل إذا غاب الرمز أو كان فارغًا (تغطي BR-KSA-23 و BR-KSA-24 و BR-KSA-69 حالة غياب الرمز).",
"ar_fix": "استخدم رمزًا يناسب الفئة، مثل `<cbc:ID>E</cbc:ID>` مع `<cbc:TaxExemptionReasonCode>VATEX-SA-29</cbc:TaxExemptionReasonCode>`.",
"applies_to": "conditional",
"fields": [
"BT-118",
"BT-121"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-cl-04",
"url_ar": "https://matheel.app/akhta/br-ksa-cl-04"
},
{
"id": "BR-KSA-CL-06",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-CL-06]-Code for the reason for document level charge (BT-105) and the code for the reason for invoice line charge (BT-145) MUST be coded using UNTDID 7161 code list. https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred7161.htm",
"fails_when": "not(contains( ' AA AAA AAC AAD AAE AAF AAH AAI AAS AAT AAV AAY AAZ ABA ABB ABC ABD ABF ABK ABL ABN ABR ABS ABT ABU ACF ACG ACH ACI ACJ ACK ACL ACM ACS ADC ADE ADJ ADK ADL ADM ADN ADO ADP ADQ ADR ADT ADW ADY ADZ AEA AEB AEC AED AEF AEH AEI AEJ AEK AEL AEM AEN AEO AEP AES AET AEU AEV AEW AEX AEY AEZ AJ AU CA CAB CAD CAE CAF CAI CAJ CAK CAL CAM CAN CAO CAPCAQ CAR CAS CAT CAU CAV CAW CD CG CS CT DAB DAD DL EG EP ER FAA FAB FAC FC FH FI GAA HAA HD HH IAA AB ID IF IR IS KO L1 LA LAA LAB LF MAE MI ML NAA OA PA PAA PC PL RAB RAC RAD RAF RE RF RH RV SA SAA SAD SAE SAI SG SH SM SU TAB AC TT TV V1 V2 WH XAA YY ZZZ ', cbc:AllowanceChargeReasonCode))",
"en_title": "Charge reason codes must come from UNTDID 7161",
"ar_title": "رموز أسباب الرسوم يجب أن تكون من قائمة UNTDID 7161",
"en_meaning": "For every cac:AllowanceCharge with cbc:ChargeIndicator true that is not inside cac:Price (document-level and line-level charges), cbc:AllowanceChargeReasonCode (BT-105, BT-145) must be one of the UNTDID 7161 codes listed in the rule. The executed check is a substring match against that list; the test string displayed for the rule does not reflect it.",
"en_fix": "Use a listed code, e.g. `<cbc:AllowanceChargeReasonCode>LF</cbc:AllowanceChargeReasonCode>` in the charge.",
"ar_meaning": "في كل cac:AllowanceCharge قيمة cbc:ChargeIndicator فيه true وليس داخل cac:Price (الرسوم على مستوى المستند وعلى مستوى السطر)، يجب أن يكون cbc:AllowanceChargeReasonCode (BT-105, BT-145) أحد رموز UNTDID 7161 الواردة في القاعدة. الفحص الفعلي مطابقة جزئية للنص مع تلك القائمة، ونص الاختبار المعروض للقاعدة لا يعكس ذلك.",
"ar_fix": "استخدم رمزًا من القائمة، مثل `<cbc:AllowanceChargeReasonCode>LF</cbc:AllowanceChargeReasonCode>` في الرسم.",
"applies_to": "conditional",
"fields": [
"BT-105",
"BT-145"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-cl-06",
"url_ar": "https://matheel.app/akhta/br-ksa-cl-06"
},
{
"id": "BR-KSA-CL-07",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-CL-07]-If the Prepayment VAT Category Code(KSA-33) is 'Z', or 'E' or 'O', the Prepayment VAT exemption (or exception) reason code(KSA-41) must exist with one of the values from paragraph 11.2.4 of XML implementation standards on Tax exemption (or exception) reason code - specific to Saudi Arabia.",
"fails_when": "not(exists(cbc:TaxExemptionReasonCode) and ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='Z' and contains(' VATEX-SA-32 VATEX-SA-33 VATEX-SA-34-1 VATEX-SA-34-2 VATEX-SA-34-3 VATEX-SA-34-4 VATEX-SA-34-5 VATEX-SA-35 VATEX-SA-36 VATEX-SA-EDU VATEX-SA-HEA VATEX-SA-MLTRY VATEX-SA-DIPLOMAT VATEX-SA-DUTYFREE ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='E' and contains(' VATEX-SA-29 VATEX-SA-29-7 VATEX-SA-30 ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or ((not(contains(normalize-space(cbc:TaxExemptionReasonCode), ' ')) and normalize-space(cbc:ID) ='O' and contains(' VATEX-SA-OOS ', concat(' ', normalize-space(cbc:TaxExemptionReasonCode), ' ')))) or normalize-space(cbc:TaxExemptionReasonCode)='' )",
"en_title": "Prepayment exemption reason code must fit its VAT category",
"ar_title": "رمز سبب إعفاء الدفعة المقدمة يناسب فئتها الضريبية",
"en_meaning": "For line-level cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory with cbc:ID Z, E or O (VAT), a present cbc:TaxExemptionReasonCode (KSA-41) must belong to that category: Z: VATEX-SA-32, VATEX-SA-33, VATEX-SA-34-1, VATEX-SA-34-2, VATEX-SA-34-3, VATEX-SA-34-4, VATEX-SA-34-5, VATEX-SA-35, VATEX-SA-36, VATEX-SA-EDU, VATEX-SA-HEA, VATEX-SA-MLTRY, VATEX-SA-DIPLOMAT, VATEX-SA-DUTYFREE; E: VATEX-SA-29, VATEX-SA-29-7, VATEX-SA-30; O: VATEX-SA-OOS. An absent or empty code does not fail this rule (BR-KSA-93 to BR-KSA-95 cover that), and it is evaluated only when the document also contains a standard-rated (S) VAT category.",
"en_fix": "Use a code that matches the line's category, e.g. `<cbc:ID>Z</cbc:ID>` with `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode>`.",
"ar_meaning": "في cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory على مستوى السطر ذات cbc:ID = Z أو E أو O (VAT)، يجب أن ينتمي cbc:TaxExemptionReasonCode (KSA-41) إن وُجد إلى الفئة نفسها: Z: VATEX-SA-32, VATEX-SA-33, VATEX-SA-34-1, VATEX-SA-34-2, VATEX-SA-34-3, VATEX-SA-34-4, VATEX-SA-34-5, VATEX-SA-35, VATEX-SA-36, VATEX-SA-EDU, VATEX-SA-HEA, VATEX-SA-MLTRY, VATEX-SA-DIPLOMAT, VATEX-SA-DUTYFREE؛ E: VATEX-SA-29, VATEX-SA-29-7, VATEX-SA-30؛ O: VATEX-SA-OOS. ولا يفشل الفحص إذا غاب الرمز أو كان فارغًا (تغطي ذلك BR-KSA-93 إلى BR-KSA-95)، ولا يُقيَّم إلا إذا احتوى المستند أيضًا على فئة ضريبة قياسية (S).",
"ar_fix": "استخدم رمزًا يناسب فئة السطر، مثل `<cbc:ID>Z</cbc:ID>` مع `<cbc:TaxExemptionReasonCode>VATEX-SA-32</cbc:TaxExemptionReasonCode>`.",
"applies_to": "conditional",
"fields": [
"KSA-33",
"KSA-41"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-cl-07",
"url_ar": "https://matheel.app/akhta/br-ksa-cl-07"
},
{
"id": "BR-KSA-DEC-01",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-DEC-01]-The allowance percentage values (BT-94, BT-138) must be from 0.00 to 100.00, with maximum two decimal places. Only numerals are accepted, the percentage symbol (%) is not allowed.",
"fails_when": "string-length(cbc:MultiplierFactorNumeric) > 0 and not(xs:decimal(cbc:MultiplierFactorNumeric) >= 0 and xs:decimal(cbc:MultiplierFactorNumeric) <= 100 and string-length(substring-after(cbc:MultiplierFactorNumeric,'.')) <=2)",
"en_title": "Document allowance percentage must be 0-100 with up to 2 decimals",
"ar_title": "نسبة خصم المستند من 0 إلى 100 وبخانتين عشريتين كحد أقصى",
"en_meaning": "For each document-level cac:AllowanceCharge with cbc:ChargeIndicator false (not inside cac:Price), a non-empty cbc:MultiplierFactorNumeric (BT-94) must be a number from 0 to 100 with at most two decimals. The message also names the line allowance percentage (BT-138), but the executed check covers only document-level allowances.",
"en_fix": "Write the percentage as a plain number without a % sign, e.g. `<cbc:MultiplierFactorNumeric>10.00</cbc:MultiplierFactorNumeric>`.",
"ar_meaning": "في كل cac:AllowanceCharge على مستوى المستند قيمة cbc:ChargeIndicator فيه false (وليس داخل cac:Price)، يجب أن يكون cbc:MultiplierFactorNumeric (BT-94) إن لم يكن فارغًا رقمًا من 0 إلى 100 بخانتين عشريتين كحد أقصى. يذكر النص الرسمي أيضًا نسبة خصم السطر (BT-138)، لكن الفحص الفعلي يشمل خصومات المستند فقط.",
"ar_fix": "اكتب النسبة رقمًا مجردًا دون رمز %، مثل `<cbc:MultiplierFactorNumeric>10.00</cbc:MultiplierFactorNumeric>`.",
"applies_to": "conditional",
"fields": [
"BT-94",
"BT-138"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-dec-01",
"url_ar": "https://matheel.app/akhta/br-ksa-dec-01"
},
{
"id": "BR-KSA-DEC-02",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-DEC-02]-The VAT rates (BT-96, BT-103, BT-119, BT-152, KSA-34) must be from 0.00 to 100.00, with maximum two decimals.Only numerals are accepted, the percentage symbol (%) is not allowed.",
"fails_when": "not(xs:decimal(.) >= 0 and xs:decimal(.) <= 100 and string-length(substring-after(.,'.')) <=2 and not (contains('%',(.))) )",
"en_title": "VAT rates must be 0-100 with at most two decimals",
"ar_title": "نسب الضريبة من 0 إلى 100 وبخانتين عشريتين كحد أقصى",
"en_meaning": "Every non-empty cbc:Percent under cac:AllowanceCharge/cac:TaxCategory, cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory, cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory and line cac:TaxSubtotal/cac:TaxCategory must be a decimal from 0 to 100 with at most two decimals and no % sign.",
"en_fix": "Write `<cbc:Percent>15.00</cbc:Percent>`, not `15%` or `15.000`.",
"ar_meaning": "يجب أن يكون كل cbc:Percent غير فارغ تحت cac:AllowanceCharge/cac:TaxCategory و cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory و cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory و cac:TaxSubtotal/cac:TaxCategory على مستوى السطر رقمًا عشريًا من 0 إلى 100 بخانتين عشريتين كحد أقصى ودون رمز %.",
"ar_fix": "اكتب `<cbc:Percent>15.00</cbc:Percent>` وليس `15%` أو `15.000`.",
"applies_to": "all",
"fields": [
"BT-96",
"BT-103",
"BT-119",
"BT-152",
"KSA-34"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-dec-02",
"url_ar": "https://matheel.app/akhta/br-ksa-dec-02"
},
{
"id": "BR-KSA-DEC-03",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-DEC-03]-VAT amount at line level (KSA-11) must have a maximum two decimals.",
"fails_when": "not(string-length(substring-after(cac:TaxTotal/cbc:TaxAmount,'.'))<=2)",
"en_title": "Line VAT amount may have at most two decimals",
"ar_title": "مبلغ ضريبة السطر بخانتين عشريتين كحد أقصى",
"en_meaning": "In each cac:InvoiceLine, cac:TaxTotal/cbc:TaxAmount (KSA-11) must have no more than two digits after the decimal point.",
"en_fix": "Round the line VAT amount to 2 decimals, e.g. `<cbc:TaxAmount currencyID=\"SAR\">15.00</cbc:TaxAmount>`.",
"ar_meaning": "في كل cac:InvoiceLine، يجب ألا يتجاوز عدد الخانات بعد الفاصلة العشرية في cac:TaxTotal/cbc:TaxAmount (KSA-11) خانتين.",
"ar_fix": "قرّب مبلغ ضريبة السطر إلى خانتين، مثل `<cbc:TaxAmount currencyID=\"SAR\">15.00</cbc:TaxAmount>`.",
"applies_to": "all",
"fields": [
"KSA-11"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-dec-03",
"url_ar": "https://matheel.app/akhta/br-ksa-dec-03"
},
{
"id": "BR-KSA-DEC-04",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-DEC-04]-Amount with VAT at line level (KSA-12) must have a maximum two decimals.",
"fails_when": "not(string-length(substring-after(cac:TaxTotal/cbc:RoundingAmount,'.'))<=2)",
"en_title": "Line amount with VAT may have at most two decimals",
"ar_title": "مبلغ السطر شاملًا الضريبة بخانتين عشريتين كحد أقصى",
"en_meaning": "In each cac:InvoiceLine, cac:TaxTotal/cbc:RoundingAmount (KSA-12, the line amount with VAT) must have no more than two digits after the decimal point.",
"en_fix": "Round it to 2 decimals, e.g. `<cbc:RoundingAmount currencyID=\"SAR\">115.00</cbc:RoundingAmount>`.",
"ar_meaning": "في كل cac:InvoiceLine، يجب ألا يتجاوز عدد الخانات بعد الفاصلة العشرية في cac:TaxTotal/cbc:RoundingAmount (KSA-12، مبلغ السطر شاملًا الضريبة) خانتين.",
"ar_fix": "قرّبه إلى خانتين، مثل `<cbc:RoundingAmount currencyID=\"SAR\">115.00</cbc:RoundingAmount>`.",
"applies_to": "all",
"fields": [
"KSA-12"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-dec-04",
"url_ar": "https://matheel.app/akhta/br-ksa-dec-04"
},
{
"id": "BR-KSA-DEC-06",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-DEC-06]-Prepayment VAT category Taxable Amount (KSA-31) and Prepayment VAT Category Tax Amount (KSA-32) must have a maximum two decimals.",
"fails_when": "not(string-length(substring-after(cbc:TaxableAmount,'.')) <= 2 and string-length(substring-after(cbc:TaxAmount,'.')) <= 2)",
"en_title": "Prepayment taxable and tax amounts may have at most two decimals",
"ar_title": "مبالغ الدفعة المقدمة وضريبتها بخانتين عشريتين كحد أقصى",
"en_meaning": "In an invoice with cbc:PrepaidAmount > 0, each line-level cac:TaxTotal/cac:TaxSubtotal must have cbc:TaxableAmount (KSA-31) and cbc:TaxAmount (KSA-32) with at most two decimals. The test string displayed for the rule refers to cbc:RoundingAmount, but the executed check reads the TaxSubtotal amounts.",
"en_fix": "Round both values to 2 decimals, e.g. `<cbc:TaxableAmount currencyID=\"SAR\">1000.00</cbc:TaxableAmount>` and `<cbc:TaxAmount currencyID=\"SAR\">150.00</cbc:TaxAmount>`.",
"ar_meaning": "في الفاتورة التي يكون فيها cbc:PrepaidAmount أكبر من صفر، يجب أن يكون cbc:TaxableAmount (KSA-31) و cbc:TaxAmount (KSA-32) في كل cac:TaxTotal/cac:TaxSubtotal على مستوى السطر بخانتين عشريتين كحد أقصى. نص الاختبار المعروض للقاعدة يشير إلى cbc:RoundingAmount، لكن الفحص الفعلي يقرأ مبالغ TaxSubtotal.",
"ar_fix": "قرّب القيمتين إلى خانتين، مثل `<cbc:TaxableAmount currencyID=\"SAR\">1000.00</cbc:TaxableAmount>` و `<cbc:TaxAmount currencyID=\"SAR\">150.00</cbc:TaxAmount>`.",
"applies_to": "conditional",
"fields": [
"KSA-31",
"KSA-32"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-dec-06",
"url_ar": "https://matheel.app/akhta/br-ksa-dec-06"
},
{
"id": "BR-KSA-EN16931-01",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-01]-Business process (BT-23) must be \"reporting:1.0\".",
"fails_when": "not(exists(./cbc:ProfileID) and (normalize-space(./cbc:ProfileID)) = 'reporting:1.0')",
"en_title": "Business process (ProfileID) must be reporting:1.0",
"ar_title": "معرّف العملية ProfileID يجب أن يكون reporting:1.0",
"en_meaning": "The invoice must contain cbc:ProfileID (BT-23) whose trimmed value is exactly 'reporting:1.0'.",
"en_fix": "Add `<cbc:ProfileID>reporting:1.0</cbc:ProfileID>`.",
"ar_meaning": "يجب أن تحتوي الفاتورة على cbc:ProfileID (BT-23) تكون قيمته بعد حذف المسافات 'reporting:1.0' تمامًا.",
"ar_fix": "أضف `<cbc:ProfileID>reporting:1.0</cbc:ProfileID>`.",
"applies_to": "all",
"fields": [
"BT-23"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-01",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-01"
},
{
"id": "BR-KSA-EN16931-02",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-02]-VAT accounting currency code (BT-6) must be \"SAR\".",
"fails_when": "not((normalize-space(upper-case(.))) = 'SAR')",
"en_title": "VAT accounting currency (TaxCurrencyCode) must be SAR",
"ar_title": "عملة احتساب الضريبة TaxCurrencyCode يجب أن تكون SAR",
"en_meaning": "cbc:TaxCurrencyCode (BT-6) must be SAR, compared after trimming and upper-casing. Its presence is required separately by BR-KSA-68.",
"en_fix": "Use `<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>`.",
"ar_meaning": "يجب أن تكون قيمة cbc:TaxCurrencyCode (BT-6) هي SAR، وتتم المقارنة بعد حذف المسافات وتحويل الأحرف إلى كبيرة. ووجود العنصر نفسه تشترطه القاعدة BR-KSA-68.",
"ar_fix": "استخدم `<cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>`.",
"applies_to": "all",
"fields": [
"BT-6"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-02",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-02"
},
{
"id": "BR-KSA-EN16931-03",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-03]-Allowance/Charge amount (BT-92, BT-99, BT-136, BT-141) must equal base amount (BT-93, BT-100, BT-137, BT-142) * percentage (BT-94, BT-101, BT-138, BT-143) / 100 if base amount and percentage exists.",
"fails_when": "string-length(./cbc:Amount) > 0 and string-length(./cbc:BaseAmount) > 0 and not ( format-number(./cbc:Amount,'#.00') = format-number(( floor((((./cbc:BaseAmount * ./cbc:MultiplierFactorNumeric) div 100) * 100 + 0.5)) div 100), '#.00'))",
"en_title": "Allowance/charge amount must equal base amount × percentage / 100",
"ar_title": "مبلغ الخصم أو الرسم = المبلغ الأساسي × النسبة ÷ 100",
"en_meaning": "For each document-level or line-level cac:AllowanceCharge that has both cbc:Amount and cbc:BaseAmount, cbc:Amount must equal cbc:BaseAmount × cbc:MultiplierFactorNumeric / 100. The executed check rounds the computed value to two decimals and compares it with cbc:Amount formatted to two decimals; the published test expression shows an exact comparison.",
"en_fix": "Calculate cbc:Amount from the base and the percentage and round to two decimals: base 200.00 with `<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>` needs `<cbc:Amount currencyID=\"SAR\">20.00</cbc:Amount>`. If the allowance or charge is not percentage-based, leave out both cbc:BaseAmount and cbc:MultiplierFactorNumeric.",
"ar_meaning": "لكل عنصر cac:AllowanceCharge على مستوى الفاتورة أو البند يحتوي على cbc:Amount و cbc:BaseAmount معاً، يجب أن يساوي cbc:Amount ناتج cbc:BaseAmount × cbc:MultiplierFactorNumeric ÷ 100. التحقق الفعلي يقرّب الناتج إلى خانتين عشريتين ويقارنه بقيمة cbc:Amount بعد تنسيقها بخانتين، بينما يظهر التعبير المنشور مقارنة مطابقة تامة.",
"ar_fix": "احسب cbc:Amount من المبلغ الأساسي والنسبة وقرّبه إلى خانتين عشريتين: مبلغ أساسي 200.00 مع `<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>` يتطلب `<cbc:Amount currencyID=\"SAR\">20.00</cbc:Amount>`. وإذا لم يكن الخصم أو الرسم محسوباً بنسبة فاحذف cbc:BaseAmount و cbc:MultiplierFactorNumeric معاً.",
"applies_to": "conditional",
"fields": [
"BT-92",
"BT-99",
"BT-136",
"BT-141",
"BT-93",
"BT-100",
"BT-137",
"BT-142",
"BT-94",
"BT-101",
"BT-138",
"BT-143"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-03",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-03"
},
{
"id": "BR-KSA-EN16931-04",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-04]-Allowance/Charge base amount (BT-93, BT-100, BT-137, BT-142) must be provided when allowance/Charge percentage (BT-94, BT-101,BT-138, BT-143) is provided.",
"fails_when": "not(exists(../cbc:BaseAmount))",
"en_title": "An allowance/charge percentage needs a base amount",
"ar_title": "نسبة الخصم أو الرسم تتطلب وجود المبلغ الأساسي",
"en_meaning": "Applies when a document-level or line-level cac:AllowanceCharge contains cbc:MultiplierFactorNumeric (the percentage). The same cac:AllowanceCharge must then also contain cbc:BaseAmount.",
"en_fix": "Add `<cbc:BaseAmount currencyID=\"SAR\">…</cbc:BaseAmount>` next to cbc:MultiplierFactorNumeric in that cac:AllowanceCharge, or remove the percentage if the amount is not percentage-based.",
"ar_meaning": "تنطبق عندما يحتوي cac:AllowanceCharge على مستوى الفاتورة أو البند على cbc:MultiplierFactorNumeric (النسبة المئوية). عندها يجب أن يحتوي نفس العنصر cac:AllowanceCharge على cbc:BaseAmount أيضاً.",
"ar_fix": "أضف `<cbc:BaseAmount currencyID=\"SAR\">…</cbc:BaseAmount>` بجانب cbc:MultiplierFactorNumeric داخل نفس cac:AllowanceCharge، أو احذف النسبة إذا لم يكن المبلغ محسوباً بنسبة.",
"applies_to": "conditional",
"fields": [
"BT-93",
"BT-100",
"BT-137",
"BT-142",
"BT-94",
"BT-101",
"BT-138",
"BT-143"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-04",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-04"
},
{
"id": "BR-KSA-EN16931-05",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-05]-Allowance/Charge percentage (BT-94, BT-101, BT-138, BT-143) must be provided when the allowance/Charge base amount (BT-93, BT-100, BT-137, BT-142) is provided.",
"fails_when": "not(exists(../cbc:MultiplierFactorNumeric))",
"en_title": "An allowance/charge base amount needs a percentage",
"ar_title": "المبلغ الأساسي للخصم أو الرسم يتطلب وجود النسبة",
"en_meaning": "Applies when a document-level or line-level cac:AllowanceCharge contains cbc:BaseAmount. The same cac:AllowanceCharge must then also contain cbc:MultiplierFactorNumeric (the percentage).",
"en_fix": "Add `<cbc:MultiplierFactorNumeric>…</cbc:MultiplierFactorNumeric>` to that cac:AllowanceCharge, or remove cbc:BaseAmount if the allowance or charge is a fixed amount.",
"ar_meaning": "تنطبق عندما يحتوي cac:AllowanceCharge على مستوى الفاتورة أو البند على cbc:BaseAmount. عندها يجب أن يحتوي نفس العنصر على cbc:MultiplierFactorNumeric (النسبة المئوية) أيضاً.",
"ar_fix": "أضف `<cbc:MultiplierFactorNumeric>…</cbc:MultiplierFactorNumeric>` إلى نفس cac:AllowanceCharge، أو احذف cbc:BaseAmount إذا كان الخصم أو الرسم مبلغاً ثابتاً.",
"applies_to": "conditional",
"fields": [
"BT-94",
"BT-101",
"BT-138",
"BT-143",
"BT-93",
"BT-100",
"BT-137",
"BT-142"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-05",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-05"
},
{
"id": "BR-KSA-EN16931-06",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-06]-Charge on price level (BG-29) is not allowed. The value of Indicator should be 'false'.",
"fails_when": "(cbc:ChargeIndicator) = true()",
"en_title": "Price-level allowance/charge must have ChargeIndicator false",
"ar_title": "الخصم على مستوى السعر يجب أن يكون ChargeIndicator = false",
"en_meaning": "Applies to cac:InvoiceLine/cac:Price/cac:AllowanceCharge. Its cbc:ChargeIndicator must be false, because a charge on price level is not allowed; the executed check fails only when the indicator is true.",
"en_fix": "Use `<cbc:ChargeIndicator>false</cbc:ChargeIndicator>` in the price-level cac:AllowanceCharge, so it only expresses a discount on the item price.",
"ar_meaning": "تنطبق على cac:InvoiceLine/cac:Price/cac:AllowanceCharge. يجب أن تكون قيمة cbc:ChargeIndicator فيه false لأن الرسوم الإضافية على مستوى السعر غير مسموحة، والتحقق الفعلي يفشل فقط عندما تكون القيمة true.",
"ar_fix": "استخدم `<cbc:ChargeIndicator>false</cbc:ChargeIndicator>` في cac:AllowanceCharge الخاص بالسعر، بحيث يعبّر فقط عن خصم على سعر الصنف.",
"applies_to": "conditional",
"fields": [
"BG-29"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-06",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-06"
},
{
"id": "BR-KSA-EN16931-07",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[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.",
"fails_when": "not(xs:decimal(../../cbc:PriceAmount) = xs:decimal(.) - xs:decimal(../cbc:Amount))",
"en_title": "Net item price must equal gross price minus price discount",
"ar_title": "صافي سعر الصنف = السعر الإجمالي ناقص خصم السعر",
"en_meaning": "Applies when cac:InvoiceLine/cac:Price/cac:AllowanceCharge contains cbc:BaseAmount (gross price, BT-148). Then cac:Price/cbc:PriceAmount (net price, BT-146) must exactly equal that cbc:BaseAmount minus the cbc:Amount (price discount, BT-147) of the same cac:AllowanceCharge.",
"en_fix": "Make the numbers consistent: e.g. gross `<cbc:BaseAmount currencyID=\"SAR\">100.00</cbc:BaseAmount>` and discount `<cbc:Amount currencyID=\"SAR\">10.00</cbc:Amount>` require `<cbc:PriceAmount currencyID=\"SAR\">90.00</cbc:PriceAmount>`.",
"ar_meaning": "تنطبق عندما يحتوي cac:InvoiceLine/cac:Price/cac:AllowanceCharge على cbc:BaseAmount (السعر الإجمالي BT-148). عندها يجب أن يساوي cac:Price/cbc:PriceAmount (صافي السعر BT-146) بالضبط قيمة cbc:BaseAmount ناقص cbc:Amount (خصم السعر BT-147) في نفس العنصر.",
"ar_fix": "اجعل الأرقام متسقة: مثلاً سعر إجمالي `<cbc:BaseAmount currencyID=\"SAR\">100.00</cbc:BaseAmount>` وخصم `<cbc:Amount currencyID=\"SAR\">10.00</cbc:Amount>` يتطلبان `<cbc:PriceAmount currencyID=\"SAR\">90.00</cbc:PriceAmount>`.",
"applies_to": "conditional",
"fields": [
"BT-146",
"BT-148",
"BT-147"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-07",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-07"
},
{
"id": "BR-KSA-EN16931-08",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-08]-Only one tax total (BG-22) with tax subtotals must be provided.Refer to Calculation of VAT.",
"fails_when": "not(count(./cac:TaxTotal[cac:TaxSubtotal]) = 1)",
"en_title": "Exactly one TaxTotal with tax subtotals per invoice",
"ar_title": "إجمالي ضريبة واحد فقط يحتوي على تفاصيل الضريبة",
"en_meaning": "Counts the document-level cac:TaxTotal elements that contain at least one cac:TaxSubtotal (the VAT breakdown). There must be exactly one such cac:TaxTotal.",
"en_fix": "Put all cac:TaxSubtotal elements inside a single cac:TaxTotal. Any other document-level cac:TaxTotal must contain only cbc:TaxAmount and no cac:TaxSubtotal.",
"ar_meaning": "تَعُدّ عناصر cac:TaxTotal على مستوى الفاتورة التي تحتوي على cac:TaxSubtotal واحد على الأقل (تفاصيل الضريبة). يجب أن يكون عددها واحداً بالضبط.",
"ar_fix": "ضع جميع عناصر cac:TaxSubtotal داخل عنصر cac:TaxTotal واحد. وأي cac:TaxTotal آخر على مستوى الفاتورة يجب أن يحتوي على cbc:TaxAmount فقط بدون cac:TaxSubtotal.",
"applies_to": "all",
"fields": [
"BG-22"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-08",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-08"
},
{
"id": "BR-KSA-EN16931-09",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-09]-Only one tax total (BG-22) without tax subtotals (BG-23) must be provided when tax currency code is provided .",
"fails_when": "not(count(../cac:TaxTotal[not(cac:TaxSubtotal)]) = 1)",
"en_title": "With a tax currency code, add one TaxTotal without subtotals",
"ar_title": "عند وجود رمز عملة الضريبة يلزم إجمالي ضريبة بدون تفاصيل",
"en_meaning": "Applies when cbc:TaxCurrencyCode is present. The invoice must then contain exactly one document-level cac:TaxTotal that has no cac:TaxSubtotal.",
"en_fix": "Add one cac:TaxTotal holding only the tax amount, e.g. `<cac:TaxTotal><cbc:TaxAmount currencyID=\"SAR\">0.60</cbc:TaxAmount></cac:TaxTotal>`, alongside the cac:TaxTotal that carries the subtotals; do not add a second one without subtotals.",
"ar_meaning": "تنطبق عند وجود cbc:TaxCurrencyCode. عندها يجب أن تحتوي الفاتورة على عنصر cac:TaxTotal واحد بالضبط على مستوى الفاتورة لا يحتوي على cac:TaxSubtotal.",
"ar_fix": "أضف عنصر cac:TaxTotal واحداً يحتوي على مبلغ الضريبة فقط، مثل `<cac:TaxTotal><cbc:TaxAmount currencyID=\"SAR\">0.60</cbc:TaxAmount></cac:TaxTotal>`، إلى جانب cac:TaxTotal الذي يحمل التفاصيل، ولا تضف عنصراً ثانياً بدون تفاصيل.",
"applies_to": "conditional",
"fields": [
"BG-22",
"BG-23"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-09",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-09"
},
{
"id": "BR-KSA-EN16931-11",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-11]-Invoice line net amount (BT-131) must equal (Invoiced quantity (BT-129) * (Item net price (BT-146) / item price base quantity (BT-149))-) + Sum of invoice line charge amount (BT-141) - Sum of invoice line allowance amount (BT-136).",
"fails_when": "count((.)) > 0 and not ( ( ( not(exists(cac:Price/cbc:BaseQuantity)) and xs:decimal(cbc:LineExtensionAmount) = round( (( (floor((xs:decimal(cbc:InvoicedQuantity) * xs:decimal(cac:Price/cbc:PriceAmount) ) * 10 * 10 *10 )div 10 + 0.00000000001) ) div 100 )+ sum((cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount))) - sum((cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount))),2) +0.01) ) or ( ( not(exists(cac:Price/cbc:BaseQuantity)) and xs:decimal(cbc:LineExtensionAmount) = round( (( (floor((xs:decimal(cbc:InvoicedQuantity) * xs:decimal(cac:Price/cbc:PriceAmount) ) * 10 * 10 *10 )div 10 + 0.00000000001) ) div 100 )+ sum((cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount))) - sum((cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount))),2) -0.01) ) or ( ( not(exists(cac:Price/cbc:BaseQuantity)) and xs:decimal(cbc:LineExtensionAmount) = round( (( (floor((xs:decimal(cbc:InvoicedQuantity) * xs:decimal(cac:Price/cbc:PriceAmount) ) * 10 * 10 *10 )div 10 + 0.00000000001) ) div 100 )+ sum((cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount))) - sum((cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount))),2) ) ) or ( exists(cac:Price/cbc:BaseQuantity) and xs:decimal(cbc:LineExtensionAmount) = round(( (floor((xs:decimal(cbc:InvoicedQuantity) * (xs:decimal(cac:Price/cbc:PriceAmount) div xs:decimal(cac:Price/cbc:BaseQuantity)) ) * 10 * 10 * 10) div 10 + 0.00000000001 ) div 100 ) + sum((cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount))) - sum((cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount))) ,2 ) ) or ( exists(cac:Price/cbc:BaseQuantity) and xs:decimal(cbc:LineExtensionAmount) = round(( (floor((xs:decimal(cbc:InvoicedQuantity) * (xs:decimal(cac:Price/cbc:PriceAmount) div xs:decimal(cac:Price/cbc:BaseQuantity)) ) * 10 * 10 * 10) div 10 + 0.00000000001 ) div 100 ) + sum((cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount))) - sum((cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount))) ,2 ) +0.01) or ( exists(cac:Price/cbc:BaseQuantity) and xs:decimal(cbc:LineExtensionAmount) = round(( (floor((xs:decimal(cbc:InvoicedQuantity) * (xs:decimal(cac:Price/cbc:PriceAmount) div xs:decimal(cac:Price/cbc:BaseQuantity)) ) * 10 * 10 * 10) div 10 + 0.00000000001 ) div 100 ) + sum((cac:AllowanceCharge[cbc:ChargeIndicator=true()]/xs:decimal(cbc:Amount))) - sum((cac:AllowanceCharge[cbc:ChargeIndicator=false()]/xs:decimal(cbc:Amount))) ,2 ) -0.01) )",
"en_title": "Line net amount = quantity × net price ± line charges/allowances",
"ar_title": "صافي البند = الكمية × صافي السعر ± رسوم وخصومات البند",
"en_meaning": "For each cac:InvoiceLine, cbc:LineExtensionAmount must equal cbc:InvoicedQuantity × cac:Price/cbc:PriceAmount (divided by cac:Price/cbc:BaseQuantity when present), plus line-level cac:AllowanceCharge charges (ChargeIndicator true) minus line-level allowances (false). The executed check truncates the quantity × price product to three decimals, rounds the result to two decimals and accepts a difference of ±0.01; the published test expression instead subtracts price-level allowance amounts (cac:Price/cac:AllowanceCharge) and ignores line-level charges.",
"en_fix": "Compute cbc:LineExtensionAmount as quantity × (PriceAmount ÷ BaseQuantity) + sum of line charge amounts − sum of line allowance amounts, rounded to two decimals. Use the net price in cbc:PriceAmount; a price-level discount is already reflected there.",
"ar_meaning": "لكل cac:InvoiceLine، يجب أن يساوي cbc:LineExtensionAmount ناتج cbc:InvoicedQuantity × cac:Price/cbc:PriceAmount (مقسوماً على cac:Price/cbc:BaseQuantity إن وُجد)، مضافاً إليه رسوم cac:AllowanceCharge على مستوى البند (ChargeIndicator = true) ومطروحاً منه خصومات البند (false). التحقق الفعلي يقتطع ناتج الكمية × السعر إلى ثلاث خانات عشرية ثم يقرّب النتيجة إلى خانتين ويقبل فرقاً بمقدار ±0.01، بينما يطرح التعبير المنشور خصومات مستوى السعر (cac:Price/cac:AllowanceCharge) ولا يحتسب رسوم البند.",
"ar_fix": "احسب cbc:LineExtensionAmount = الكمية × (PriceAmount ÷ BaseQuantity) + مجموع رسوم البند − مجموع خصومات البند، مقرّباً إلى خانتين عشريتين. ضع صافي السعر في cbc:PriceAmount، فخصم مستوى السعر يكون منعكساً فيه مسبقاً.",
"applies_to": "all",
"fields": [
"BT-131",
"BT-129",
"BT-146",
"BT-149",
"BT-141",
"BT-136"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-11",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-11"
},
{
"id": "BR-KSA-EN16931-12",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-EN16931-12]-Base quantity (BT-149) must be a positive number above zero.",
"fails_when": "string-length(.) > 0 and not(number((.)) > 0)",
"en_title": "Item price base quantity must be greater than zero",
"ar_title": "كمية أساس سعر الصنف يجب أن تكون أكبر من صفر",
"en_meaning": "Applies when cac:InvoiceLine/cac:Price/cbc:BaseQuantity (BT-149) is present with a value. The value must be a number greater than 0.",
"en_fix": "Use a positive base quantity, e.g. `<cbc:BaseQuantity unitCode=\"PCE\">1</cbc:BaseQuantity>`, or omit cbc:BaseQuantity if the price is per one unit.",
"ar_meaning": "تنطبق عند وجود قيمة في cac:InvoiceLine/cac:Price/cbc:BaseQuantity (BT-149). يجب أن تكون القيمة رقماً أكبر من 0.",
"ar_fix": "استخدم كمية أساس موجبة، مثل `<cbc:BaseQuantity unitCode=\"PCE\">1</cbc:BaseQuantity>`، أو احذف cbc:BaseQuantity إذا كان السعر لوحدة واحدة.",
"applies_to": "conditional",
"fields": [
"BT-149"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-en16931-12",
"url_ar": "https://matheel.app/akhta/br-ksa-en16931-12"
},
{
"id": "BR-KSA-F-01",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-01]-A date MUST be formatted YYYY-MM-DD, in accordance to the \"Calendar date complete representation\" as specified by ISO 8601:2004, format YYYY-MM-DD.",
"fails_when": "not(string-length(.) = 10 and matches( string(.), '[2-9][0-9]([0-9]{2}[\\-]((0[13578]|1[02])[\\-](0[1-9]|[12][0-9]|3[01])|(0[469]|11)[\\-](0[1-9]|[12][0-9]|30)|(02)[\\-](0[1-9]|1[0-9]|2[0-8]))|([02468][048]|[13579][26])[\\-](02)[\\-]29)') )",
"en_title": "Dates must use the YYYY-MM-DD format",
"ar_title": "يجب كتابة التواريخ بصيغة YYYY-MM-DD",
"en_meaning": "Checks cbc:IssueDate, cbc:DueDate, cbc:TaxPointDate, cac:Delivery/cbc:ActualDeliveryDate and cbc:LatestDeliveryDate, the billing-reference cac:InvoiceDocumentReference/cbc:IssueDate and line cac:DocumentReference/cbc:IssueDate: each must be exactly 10 characters and a valid calendar date. The executed check uses a pattern that also requires the year to be between 2000 and 9999 (no time zone suffix); the published test only requires a value castable as xs:date.",
"en_fix": "Write each date as exactly YYYY-MM-DD with no time or time zone, e.g. `<cbc:IssueDate>2024-03-15</cbc:IssueDate>`.",
"ar_meaning": "تفحص cbc:IssueDate و cbc:DueDate و cbc:TaxPointDate و cac:Delivery/cbc:ActualDeliveryDate و cbc:LatestDeliveryDate، وتاريخ المرجع cac:InvoiceDocumentReference/cbc:IssueDate، و cac:DocumentReference/cbc:IssueDate في البنود: يجب أن يكون كل منها 10 أحرف بالضبط وتاريخاً صحيحاً. التحقق الفعلي يستخدم نمطاً يشترط أيضاً أن تكون السنة بين 2000 و 9999 (بدون منطقة زمنية)، بينما يشترط التعبير المنشور فقط أن تكون القيمة قابلة للتحويل إلى xs:date.",
"ar_fix": "اكتب كل تاريخ بصيغة YYYY-MM-DD تماماً بدون وقت أو منطقة زمنية، مثل `<cbc:IssueDate>2024-03-15</cbc:IssueDate>`.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-01",
"url_ar": "https://matheel.app/akhta/br-ksa-f-01"
},
{
"id": "BR-KSA-F-02",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-02]-Allowance/Charge Indicator value MUST equal to 'false'/’True’ respectively.",
"fails_when": "not((.) = false() or (.)=true())",
"en_title": "Allowance/charge indicator must be 'false' or 'true'",
"ar_title": "مؤشر الخصم أو الرسم يجب أن يكون false أو true",
"en_meaning": "Checks cbc:ChargeIndicator in document-level and line-level cac:AllowanceCharge. The executed check accepts the boolean values false (allowance) or true (charge); the published test expression shows only '= false()', which is stricter than what is actually enforced.",
"en_fix": "Use `<cbc:ChargeIndicator>false</cbc:ChargeIndicator>` for an allowance (discount) and `<cbc:ChargeIndicator>true</cbc:ChargeIndicator>` for a charge.",
"ar_meaning": "تفحص cbc:ChargeIndicator في cac:AllowanceCharge على مستوى الفاتورة والبند. التحقق الفعلي يقبل القيمتين المنطقيتين false (خصم) أو true (رسم)، بينما يُظهر التعبير المنشور '= false()' فقط، وهو أشد مما يُطبَّق فعلياً.",
"ar_fix": "استخدم `<cbc:ChargeIndicator>false</cbc:ChargeIndicator>` للخصم و `<cbc:ChargeIndicator>true</cbc:ChargeIndicator>` للرسم الإضافي.",
"applies_to": "conditional",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-02",
"url_ar": "https://matheel.app/akhta/br-ksa-f-02"
},
{
"id": "BR-KSA-F-04",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-04]-All the document amounts and quantities must be positive, unless specified otherwise.",
"fails_when": "string-length(.) > 0 and not((.) >= 0)",
"en_title": "Invoice amounts and quantities must not be negative",
"ar_title": "مبالغ الفاتورة وكمياتها يجب ألا تكون سالبة",
"en_meaning": "Checks that listed amounts and quantities are >= 0 when they have a value: cac:LegalMonetaryTotal amounts, cac:TaxTotal/cbc:TaxAmount, cac:TaxSubtotal TaxAmount and TaxableAmount (taxable amount skipped for category 'O'), allowance/charge Amount and BaseAmount, line cbc:InvoicedQuantity, cac:Price/cbc:PriceAmount, line tax amounts and cac:TaxExchangeRate/cbc:CalculationRate. Zero is accepted.",
"en_fix": "Use positive or zero values in these elements, e.g. `<cbc:InvoicedQuantity unitCode=\"PCE\">2</cbc:InvoicedQuantity>` rather than -2.",
"ar_meaning": "تتحقق من أن المبالغ والكميات المحددة أكبر من أو تساوي 0 عند وجود قيمة: مبالغ cac:LegalMonetaryTotal، و cac:TaxTotal/cbc:TaxAmount، و TaxAmount و TaxableAmount في cac:TaxSubtotal (يُستثنى المبلغ الخاضع للضريبة للفئة 'O')، و Amount و BaseAmount في الخصومات والرسوم، و cbc:InvoicedQuantity في البنود، و cac:Price/cbc:PriceAmount، ومبالغ ضريبة البند، و cac:TaxExchangeRate/cbc:CalculationRate. القيمة صفر مقبولة.",
"ar_fix": "استخدم قيماً موجبة أو صفراً في هذه العناصر، مثل `<cbc:InvoicedQuantity unitCode=\"PCE\">2</cbc:InvoicedQuantity>` بدلاً من -2.",
"applies_to": "all",
"fields": [],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-04",
"url_ar": "https://matheel.app/akhta/br-ksa-f-04"
},
{
"id": "BR-KSA-F-05",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-05]-Prepayment Issue Time (KSA-29) must be in the format: hh:mm:ss for time expressed in local time or hh:mm:ssZ for time expressed in UTC.(eg 19:20:30)",
"fails_when": "not(((string(.) castable as xs:time)))",
"en_title": "Prepayment issue time must be a valid hh:mm:ss time",
"ar_title": "وقت إصدار الدفعة المقدمة يجب أن يكون وقتاً صحيحاً hh:mm:ss",
"en_meaning": "Applies to cac:InvoiceLine/cac:DocumentReference/cbc:IssueTime (KSA-29, prepayment issue time). The executed check only requires a value castable as xs:time (e.g. 19:20:30 or 19:20:30Z); the published test additionally requires exactly 8 characters, which would reject the hh:mm:ssZ form the official text allows.",
"en_fix": "Write the time as hh:mm:ss, e.g. `<cbc:IssueTime>19:20:30</cbc:IssueTime>`.",
"ar_meaning": "تنطبق على cac:InvoiceLine/cac:DocumentReference/cbc:IssueTime (KSA-29، وقت إصدار الدفعة المقدمة). التحقق الفعلي يشترط فقط أن تكون القيمة قابلة للتحويل إلى xs:time (مثل 19:20:30 أو 19:20:30Z)، بينما يشترط التعبير المنشور أيضاً أن تكون 8 أحرف بالضبط، وهذا يرفض صيغة hh:mm:ssZ التي يسمح بها النص الرسمي.",
"ar_fix": "اكتب الوقت بصيغة hh:mm:ss، مثل `<cbc:IssueTime>19:20:30</cbc:IssueTime>`.",
"applies_to": "conditional",
"fields": [
"KSA-29"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-05",
"url_ar": "https://matheel.app/akhta/br-ksa-f-05"
},
{
"id": "BR-KSA-F-06-C1",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C1] - Field character limits for Invoice number field (BT-1) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.",
"fails_when": "exists(cbc:ID) and string-length(cbc:ID) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C2",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C2] - Field character limits for Invoice note field (BT-22) have not been met. The maximum limit is 1000 characters.",
"fails_when": "exists((/ubl:Invoice/cbc:Note/text()[string-length() > 1000])[1])",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C3",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C3] - Field character limits for Purchase order ID field (BT-13) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cac:OrderReference/cbc:ID) and string-length(cac:OrderReference/cbc:ID) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C4",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C4] - Field character limits for the Seller Address - Street field (BT-35) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.",
"fails_when": "(string-length(cbc:StreetName) > 1000 or string-length(cbc:StreetName) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C5",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C5] - Field character limits for Contract ID field (BT-12) have not been met. The maximum limit is 127 characters .",
"fails_when": "exists(cac:ContractDocumentReference/cbc:ID) and string-length(cac:ContractDocumentReference/cbc:ID) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C6",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C6] - Field character limits for the Seller Address - Additional street field (BT-36) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cbc:AdditionalStreetName) and string-length(cbc:AdditionalStreetName) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C7",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C7] - Field character limits for the Seller Address - City field (BT-37) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.",
"fails_when": "exists(cbc:CityName) and (string-length(cbc:CityName) > 127 or string-length(cbc:CityName) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C8",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C8] - Field character limits for the Seller Address - Province/State field (BT-39) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) and string-length(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C9",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C9] - Field character limits for the Seller Address - District field (KSA-3) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.",
"fails_when": "exists(//cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) and (string-length(//cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) > 127 or string-length(//cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C10",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C10] - Field character limits for Seller name field (BT-27) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.",
"fails_when": "(string-length(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) > 1000 or string-length(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C11",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C11] - Field character limits for the Buyer Address - Additional street field (BT-51) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:AdditionalStreetName) and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:AdditionalStreetName) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C12",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C12] - Field character limits for Buyer name field (BT-44) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.",
"fails_when": "boolean(//*[matches(@name, '01\\d{5}')]) and exists(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) and (string-length(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) > 1000 or string-length(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C13",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C13] - Field character limits for Reasons for issuance of credit / debit note field (KSA-10) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters .",
"fails_when": "exists(.) and (string-length(.) > 1000 or string-length(.) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C14",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C14]Field character limits for Payment terms field (KSA-22) have not been met. The maximum limit is 1000 characters.",
"fails_when": "exists(//cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:PaymentNote) and (string-length(//cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:PaymentNote) > 1000 or string-length(//cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:PaymentNote) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C15",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C15] - Field character limits for Payment account identifier field (BT-84) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(//cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID) and string-length(//cac:PaymentMeans/cac:PayeeFinancialAccount/cbc:ID) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C16",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C16]-Field character limits for VAT exemption reason text field (BT-120) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.",
"fails_when": "(string-length(cbc:TaxExemptionReason) > 1000 or string-length(cbc:TaxExemptionReason) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C17",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C17] - Field character limits for Invoice line identifier field (BT-126) have not been met. The minimum limit is 1 character and the maximum limit is 6 characters.",
"fails_when": "exists(cbc:ID) and (string-length(cbc:ID) > 6 or string-length(cbc:ID) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C18",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C18] - Field character limits for Invoiced quantity unit of measure field (BT-130) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cbc:InvoicedQuantity/@unitCode) and string-length(cbc:InvoicedQuantity/@unitCode) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C19",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C19] - Field character limits for Item name field (BT-153) have not been met. The minimum limit is 3 character and the maximum limit is 1000 characters.",
"fails_when": "exists(cac:Item/cbc:Name) and (string-length(cac:Item/cbc:Name) > 1000 or string-length(cac:Item/cbc:Name) < 3)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C20",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C20] - Field character limits for Item standard identifier field (BT-157) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cac:Item/cac:StandardItemIdentification/cbc:ID) and string-length(cac:Item/cac:StandardItemIdentification/cbc:ID) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C21",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C21] - Field character limits for Item price base quantity unit code field (BT-150) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cac:Price/cbc:BaseQuantity/@unitCode) and string-length(cac:Price/cbc:BaseQuantity/@unitCode) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C22",
"severity": "error",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C22]-Field character limits for Billing reference ID field (BT-25) have not been met. The minimum limit is 1 character and the maximum limit is 5000 characters.",
"fails_when": "exists(./cac:InvoiceDocumentReference/cbc:ID) and (string-length(./cac:InvoiceDocumentReference/cbc:ID) > 5000 or string-length(./cac:InvoiceDocumentReference/cbc:ID) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C23",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C23] - Field character limits for the Buyer Address - Street field (BT-50) have not been met. The minimum limit is 1 character and the maximum limit is 1000 characters.",
"fails_when": "boolean(//*[matches(@name, '01\\d{5}')]) and (not(exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName)) or (exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) and (string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) > 1000 or string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) < 1)))",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C24",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C24] - Field character limits for the Buyer Address - Street field (BT-50) have not been met. The maximum limit is 1000 characters.",
"fails_when": "string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:StreetName) > 1000",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C25",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C25] - Field character limits for the Buyer Address - City field (BT-52) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.",
"fails_when": "boolean(//*[matches(@name, '01\\d{5}')]) and (not(exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName)) or (exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) < 1))",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C26",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C26] - Field character limits for the Buyer Address - City field (BT-52) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CityName) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C27",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C27] - Field character limits for the Buyer Address - Province/State field (BT-54) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) and string-length(cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity)>127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C28",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C28] - Field character limits for the Buyer Address - District field (KSA-4) have not been met. The minimum limit is 1 character and the maximum limit is 127 characters.",
"fails_when": "boolean(//*[matches(@name, '01\\d{5}')]) and (not(exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName)) or (exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) < 1))",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C29",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C29] - Field character limits for the Buyer Address - District field (KSA-4) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) and string-length(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cbc:CitySubdivisionName) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C30",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C30] - Field character limits for Item Buyer's identifier field (BT-156) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cac:Item/cac:BuyersItemIdentification/cbc:ID) and string-length(cac:Item/cac:BuyersItemIdentification/cbc:ID) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C31",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-KSA-F-06-C31] - Field character limits for Item Seller's identifier field (BT-155) have not been met. The maximum limit is 127 characters.",
"fails_when": "exists(cac:Item/cac:SellersItemIdentification/cbc:ID) and string-length(cac:Item/cac:SellersItemIdentification/cbc:ID) > 127",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C32",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C32] - Field character limits for Buyer name field (BT-44) have not been met. The maximum limit is 1000 characters.",
"fails_when": "string-length(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) > 1000",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C33",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C33] -Field character limits for Reason for the document level charge (BT-104) have not been met. The maximum limit is 1,000 characters.",
"fails_when": "(string-length(cbc:AllowanceChargeReason) > 1000 or string-length(cbc:AllowanceChargeReason) < 1)",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C34",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C34] -Field character limits for Reason for invoice line charge (BT-144) have not been met. The maximum limit is 1,000 characters.",
"fails_when": "string-length(cbc:AllowanceChargeReason) > 1000 or string-length(cbc:AllowanceChargeReason) < 1",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C35",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C35] -Field character limits for Reason for the document level allowance (BT-97) have not been met. The maximum limit is 1,000 characters.",
"fails_when": "string-length(cbc:AllowanceChargeReason) > 1000 or string-length(cbc:AllowanceChargeReason) < 1",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C36",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C36] -Field character limits for Reason for the invoice line allowance (BT-139) have not been met. The maximum limit is 1,000 characters.",
"fails_when": "string-length(cbc:AllowanceChargeReason) > 1000 or string-length(cbc:AllowanceChargeReason) < 1",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C37",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C37] - Field character limits for the contact name - Buyer's contact point field (BT-56) have not been met. The maximum limit is 1000 characters.",
"fails_when": "exists(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Name) and string-length(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Name) > 1000",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C38",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C38] - Field character limits for the contact note - Buyer's Contact Note field (KSA-35) have not been met. The maximum limit is 1000 characters.",
"fails_when": "exists(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Note) and string-length(//cac:AccountingCustomerParty/cac:Party/cac:Contact/cbc:Note) > 1000",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C39",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C39] - Field character limits for the Prepayment VAT exemption reason text (KSA-42) have not been met. The maximum limit is 1000 characters.",
"fails_when": "string-length(cbc:TaxExemptionReason) > 1000 or string-length(cbc:TaxExemptionReason) < 1",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-06-C40",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-06-C40]-Field character limits for Invoice transaction code (KSA-2) have not been met. The minimum limit is 7 characters and the maximum limit is 9 characters.",
"fails_when": "not((((string-length(@name)) >= 7) and ((string-length(@name)) <= 9) ))",
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-06",
"url_ar": "https://matheel.app/akhta/br-ksa-f-06"
},
{
"id": "BR-KSA-F-07",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-07] - The value provided in Other Buyer ID (BT-46) for scheme ID 'TIN' appears to be incorrect. Please recheck the value to avoid non-compliance.",
"fails_when": "normalize-space(@schemeID) = 'TIN' and not(string-length(normalize-space(.)) = 10 and not(translate((.), '0123456789', '')) and starts-with(normalize-space(.), '3'))",
"en_title": "Buyer TIN must be 10 digits starting with 3",
"ar_title": "رقم TIN للمشتري يجب أن يكون 10 أرقام تبدأ بـ 3",
"en_meaning": "When the buyer's cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification has cbc:ID with schemeID='TIN', the value must be exactly 10 digits starting with 3; otherwise a warning is raised. In the validator this test is the failure condition: the expression shown is TRUE when the value is wrong.",
"en_fix": "Put the correct Tax Identification Number as exactly 10 digits starting with 3, e.g. `<cbc:ID schemeID=\"TIN\">3105293847</cbc:ID>` with no letters, dashes or spaces. If the number you have does not fit this shape, check that the schemeID is the right one.",
"ar_meaning": "عندما يحتوي cac:PartyIdentification الخاص بالمشتري (cac:AccountingCustomerParty) على cbc:ID بقيمة schemeID='TIN'، يجب أن تكون القيمة 10 أرقام بالضبط تبدأ بالرقم 3، وإلا يظهر تحذير. في المدقق يمثل هذا الشرط حالة الخطأ: يكون التعبير المعروض TRUE عندما تكون القيمة غير صحيحة.",
"ar_fix": "أدخل الرقم المميز (TIN) الصحيح على شكل 10 أرقام فقط تبدأ بالرقم 3، مثل `<cbc:ID schemeID=\"TIN\">3105293847</cbc:ID>` بدون حروف أو شرطات أو مسافات. وإذا كان الرقم المتوفر لديك لا يطابق هذا الشكل فتحقق من أن schemeID صحيح.",
"applies_to": "conditional",
"fields": [
"BT-46"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-07",
"url_ar": "https://matheel.app/akhta/br-ksa-f-07"
},
{
"id": "BR-KSA-F-08",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-08] - The value provided in Other Seller ID (BT-29) or Other Buyer ID (BT-46) for the scheme ID 'CRN' appears to be incorrect. Please recheck the value to avoid non-compliance.",
"fails_when": "(exists(cac:Party/cac:PartyIdentification/cbc:ID) and normalize-space(cac:Party/cac:PartyIdentification/cbc:ID/@schemeID) = 'CRN') and not( string-length(normalize-space(cac:Party/cac:PartyIdentification/cbc:ID)) = 10 and not(translate((cac:Party/cac:PartyIdentification/cbc:ID), '0123456789', '')))",
"en_title": "Seller/buyer CRN must be exactly 10 digits",
"ar_title": "رقم السجل التجاري CRN يجب أن يكون 10 أرقام",
"en_meaning": "When the seller's or buyer's cac:Party/cac:PartyIdentification (cac:AccountingSupplierParty or cac:AccountingCustomerParty) has cbc:ID with schemeID='CRN', the value must be exactly 10 digits; otherwise a warning is raised. In the validator this test is the failure condition: the expression shown is TRUE when the value is wrong.",
"en_fix": "Put the correct commercial registration number as exactly 10 digits, e.g. `<cbc:ID schemeID=\"CRN\">1105293847</cbc:ID>` with no letters, dashes or spaces. If the number you have does not fit this shape, check that the schemeID is the right one.",
"ar_meaning": "عندما يحتوي cac:PartyIdentification الخاص بالبائع أو المشتري (cac:AccountingSupplierParty أو cac:AccountingCustomerParty) على cbc:ID بقيمة schemeID='CRN'، يجب أن تكون القيمة 10 أرقام بالضبط، وإلا يظهر تحذير. في المدقق يمثل هذا الشرط حالة الخطأ: يكون التعبير المعروض TRUE عندما تكون القيمة غير صحيحة.",
"ar_fix": "أدخل رقم السجل التجاري الصحيح على شكل 10 أرقام فقط، مثل `<cbc:ID schemeID=\"CRN\">1105293847</cbc:ID>` بدون حروف أو شرطات أو مسافات. وإذا كان الرقم المتوفر لديك لا يطابق هذا الشكل فتحقق من أن schemeID صحيح.",
"applies_to": "conditional",
"fields": [
"BT-29",
"BT-46"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-08",
"url_ar": "https://matheel.app/akhta/br-ksa-f-08"
},
{
"id": "BR-KSA-F-09",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-09] - The value provided in Other Seller ID (BT-29) or Other Buyer ID (BT-46) for the scheme ID '700' appears to be incorrect. Please recheck the value to avoid non-compliance.",
"fails_when": "(exists(cac:Party/cac:PartyIdentification/cbc:ID) and normalize-space(cac:Party/cac:PartyIdentification/cbc:ID/@schemeID) = '700') and not( starts-with(normalize-space(cac:Party/cac:PartyIdentification/cbc:ID), '7') and string-length(normalize-space(cac:Party/cac:PartyIdentification/cbc:ID)) = 10 and not(translate((cac:Party/cac:PartyIdentification/cbc:ID), '0123456789', '')))",
"en_title": "Seller/buyer '700' number must be 10 digits starting with 7",
"ar_title": "الرقم الموحد 700 يجب أن يكون 10 أرقام تبدأ بـ 7",
"en_meaning": "When the seller's or buyer's cac:Party/cac:PartyIdentification (cac:AccountingSupplierParty or cac:AccountingCustomerParty) has cbc:ID with schemeID='700', the value must be exactly 10 digits starting with 7; otherwise a warning is raised. In the validator this test is the failure condition: the expression shown is TRUE when the value is wrong.",
"en_fix": "Put the correct 700 number as exactly 10 digits starting with 7, e.g. `<cbc:ID schemeID=\"700\">7105293847</cbc:ID>` with no letters, dashes or spaces. If the number you have does not fit this shape, check that the schemeID is the right one.",
"ar_meaning": "عندما يحتوي cac:PartyIdentification الخاص بالبائع أو المشتري (cac:AccountingSupplierParty أو cac:AccountingCustomerParty) على cbc:ID بقيمة schemeID='700'، يجب أن تكون القيمة 10 أرقام بالضبط تبدأ بالرقم 7، وإلا يظهر تحذير. في المدقق يمثل هذا الشرط حالة الخطأ: يكون التعبير المعروض TRUE عندما تكون القيمة غير صحيحة.",
"ar_fix": "أدخل الرقم 700 الصحيح على شكل 10 أرقام فقط تبدأ بالرقم 7، مثل `<cbc:ID schemeID=\"700\">7105293847</cbc:ID>` بدون حروف أو شرطات أو مسافات. وإذا كان الرقم المتوفر لديك لا يطابق هذا الشكل فتحقق من أن schemeID صحيح.",
"applies_to": "conditional",
"fields": [
"BT-29",
"BT-46"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-09",
"url_ar": "https://matheel.app/akhta/br-ksa-f-09"
},
{
"id": "BR-KSA-F-10",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-10] - The value provided in Other Buyer ID (BT-46) for the scheme ID 'NAT' appears to be incorrect. Please recheck the value to avoid non-compliance.",
"fails_when": "(exists(.) and normalize-space(@schemeID) = 'NAT') and not( starts-with(normalize-space(.), '1') and string-length(normalize-space(.)) = 10 and not(translate((.), '0123456789', '')))",
"en_title": "Buyer national ID (NAT) must be 10 digits starting with 1",
"ar_title": "رقم الهوية الوطنية NAT للمشتري 10 أرقام تبدأ بـ 1",
"en_meaning": "When the buyer's cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification has cbc:ID with schemeID='NAT', the value must be exactly 10 digits starting with 1; otherwise a warning is raised. In the validator this test is the failure condition: the expression shown is TRUE when the value is wrong. The published test uses cac:Party/cac:PartyIdentification paths although its context is the cbc:ID itself; the executed check tests the cbc:ID value directly.",
"en_fix": "Put the correct national ID number as exactly 10 digits starting with 1, e.g. `<cbc:ID schemeID=\"NAT\">1105293847</cbc:ID>` with no letters, dashes or spaces. If the number you have does not fit this shape, check that the schemeID is the right one.",
"ar_meaning": "عندما يحتوي cac:PartyIdentification الخاص بالمشتري (cac:AccountingCustomerParty) على cbc:ID بقيمة schemeID='NAT'، يجب أن تكون القيمة 10 أرقام بالضبط تبدأ بالرقم 1، وإلا يظهر تحذير. في المدقق يمثل هذا الشرط حالة الخطأ: يكون التعبير المعروض TRUE عندما تكون القيمة غير صحيحة. يستخدم التعبير المنشور مسارات cac:Party/cac:PartyIdentification رغم أن سياقه هو cbc:ID نفسه، بينما يفحص التحقق الفعلي قيمة cbc:ID مباشرة.",
"ar_fix": "أدخل رقم الهوية الوطنية الصحيح على شكل 10 أرقام فقط تبدأ بالرقم 1، مثل `<cbc:ID schemeID=\"NAT\">1105293847</cbc:ID>` بدون حروف أو شرطات أو مسافات. وإذا كان الرقم المتوفر لديك لا يطابق هذا الشكل فتحقق من أن schemeID صحيح.",
"applies_to": "conditional",
"fields": [
"BT-46"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-10",
"url_ar": "https://matheel.app/akhta/br-ksa-f-10"
},
{
"id": "BR-KSA-F-11",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-11] - The value provided in Other Buyer ID (BT-46) for the scheme ID 'IQA' appears to be incorrect. Please recheck the value to avoid non-compliance.",
"fails_when": "normalize-space(@schemeID) = 'IQA' and not(string-length(normalize-space(.)) = 10 and not(translate((.), '0123456789', '')) and starts-with(normalize-space(.), '2'))",
"en_title": "Buyer Iqama number (IQA) must be 10 digits starting with 2",
"ar_title": "رقم الإقامة IQA للمشتري 10 أرقام تبدأ بـ 2",
"en_meaning": "When the buyer's cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification has cbc:ID with schemeID='IQA', the value must be exactly 10 digits starting with 2; otherwise a warning is raised. In the validator this test is the failure condition: the expression shown is TRUE when the value is wrong.",
"en_fix": "Put the correct Iqama number as exactly 10 digits starting with 2, e.g. `<cbc:ID schemeID=\"IQA\">2105293847</cbc:ID>` with no letters, dashes or spaces. If the number you have does not fit this shape, check that the schemeID is the right one.",
"ar_meaning": "عندما يحتوي cac:PartyIdentification الخاص بالمشتري (cac:AccountingCustomerParty) على cbc:ID بقيمة schemeID='IQA'، يجب أن تكون القيمة 10 أرقام بالضبط تبدأ بالرقم 2، وإلا يظهر تحذير. في المدقق يمثل هذا الشرط حالة الخطأ: يكون التعبير المعروض TRUE عندما تكون القيمة غير صحيحة.",
"ar_fix": "أدخل رقم الإقامة الصحيح على شكل 10 أرقام فقط تبدأ بالرقم 2، مثل `<cbc:ID schemeID=\"IQA\">2105293847</cbc:ID>` بدون حروف أو شرطات أو مسافات. وإذا كان الرقم المتوفر لديك لا يطابق هذا الشكل فتحقق من أن schemeID صحيح.",
"applies_to": "conditional",
"fields": [
"BT-46"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-11",
"url_ar": "https://matheel.app/akhta/br-ksa-f-11"
},
{
"id": "BR-KSA-F-12",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-12] - The Other Seller/Buyer schema ID (BT-29-1 or BT-46-1) contains spaces. Please recheck the attribute and remove the empty space to avoid non-compliance.",
"fails_when": "$scheme-raw and $scheme-up = $allowed-here and $scheme-raw != $scheme-trim",
"en_title": "Seller/buyer ID schemeID must not contain extra spaces",
"ar_title": "رمز schemeID لمعرّف البائع أو المشتري بدون مسافات زائدة",
"en_meaning": "Looks at the schemeID attribute of cac:Party/cac:PartyIdentification/cbc:ID for the seller and buyer. A warning is raised when the value, once spaces are normalised and it is upper-cased, is an allowed scheme (seller: CRN, MOM, MLS, 700, SAG, OTH; buyer: TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, OTH, PAS) but the raw attribute contains leading, trailing or repeated spaces. The test shown is the failure condition.",
"en_fix": "Write the schemeID with no surrounding spaces, e.g. `<cbc:ID schemeID=\"CRN\">…</cbc:ID>` rather than `schemeID=\" CRN \"`.",
"ar_meaning": "تفحص الخاصية schemeID في cac:Party/cac:PartyIdentification/cbc:ID للبائع والمشتري. يظهر تحذير عندما تكون القيمة، بعد توحيد المسافات وتحويلها لأحرف كبيرة، رمزاً مسموحاً (البائع: CRN, MOM, MLS, 700, SAG, OTH؛ المشتري: TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, OTH, PAS) لكن القيمة الأصلية تحتوي على مسافات في البداية أو النهاية أو مسافات متكررة. التعبير المعروض هو شرط الخطأ.",
"ar_fix": "اكتب schemeID بدون مسافات حوله، مثل `<cbc:ID schemeID=\"CRN\">…</cbc:ID>` بدلاً من `schemeID=\" CRN \"`.",
"applies_to": "conditional",
"fields": [
"BT-29-1",
"BT-46-1"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-12",
"url_ar": "https://matheel.app/akhta/br-ksa-f-12"
},
{
"id": "BR-KSA-F-13",
"severity": "warning",
"source": "ZATCA KSA rules",
"official_text": "[BR-KSA-F-13] - Please recheck Other Seller/Buyer ID (BT-29 or BT-46) as it contains an invalid value.",
"fails_when": "$bad-pattern-exists",
"en_title": "Seller/buyer ID must not be a placeholder digit sequence",
"ar_title": "معرّف البائع أو المشتري يجب ألا يكون تسلسل أرقام وهمياً",
"en_meaning": "Looks at seller and buyer cac:Party/cac:PartyIdentification/cbc:ID values whose schemeID is an allowed scheme (seller: CRN, MOM, MLS, 700, SAG, OTH; buyer: TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, OTH, PAS). A warning is raised when an all-digit value contains 8 ascending digits (01234567, 12345678, 23456789), 8 descending digits (76543210, 87654321, 98765432) or the same digit 8 times in a row. The test shown is a variable holding this failure condition.",
"en_fix": "Enter the party's real identification number instead of a test or placeholder value such as 1234567890 or 0000000000.",
"ar_meaning": "تفحص قيم cac:Party/cac:PartyIdentification/cbc:ID للبائع والمشتري التي يكون schemeID فيها رمزاً مسموحاً (البائع: CRN, MOM, MLS, 700, SAG, OTH؛ المشتري: TIN, CRN, MOM, MLS, 700, SAG, NAT, GCC, IQA, OTH, PAS). يظهر تحذير عندما تكون القيمة أرقاماً فقط وتحتوي على 8 أرقام تصاعدية (01234567, 12345678, 23456789) أو 8 أرقام تنازلية (76543210, 87654321, 98765432) أو نفس الرقم مكرراً 8 مرات متتالية. التعبير المعروض متغير يحمل شرط الخطأ هذا.",
"ar_fix": "أدخل رقم التعريف الحقيقي للطرف بدلاً من قيمة تجريبية أو وهمية مثل 1234567890 أو 0000000000.",
"applies_to": "conditional",
"fields": [
"BT-29",
"BT-46"
],
"url_en": "https://matheel.app/en/zatca-errors/br-ksa-f-13",
"url_ar": "https://matheel.app/akhta/br-ksa-f-13"
},
{
"id": "BR-O-01",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-O-01]-An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is \"Not subject to VAT\" shall contain exactly at least one VAT breakdown group (BG-23) with the VAT category code (BT-118) equal to \"Not subject to VAT\".",
"fails_when": "not(((exists(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) > 0)) or (not(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O'])))",
"en_title": "'Not subject to VAT' (O) items need an O VAT breakdown",
"ar_title": "البنود غير الخاضعة للضريبة O تتطلب تفصيل ضريبة للفئة O",
"en_meaning": "Applies when any line cac:Item/cac:ClassifiedTaxCategory or document-level cac:AllowanceCharge/cac:TaxCategory uses VAT category 'O' (Not subject to VAT). The invoice must then have a cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'O'. The executed check requires at least one such breakdown; the published test expression requires exactly one.",
"en_fix": "Add a VAT breakdown for category O: a cac:TaxSubtotal containing `<cac:TaxCategory><cbc:ID>O</cbc:ID>…<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` with the taxable and tax amounts for those lines.",
"ar_meaning": "تنطبق عندما يستخدم أي بند في cac:Item/cac:ClassifiedTaxCategory أو أي خصم أو رسم على مستوى الفاتورة في cac:AllowanceCharge/cac:TaxCategory فئة الضريبة 'O' (غير خاضع للضريبة). عندها يجب أن تحتوي الفاتورة على cac:TaxTotal/cac:TaxSubtotal تكون فيه قيمة cac:TaxCategory/cbc:ID هي 'O'. التحقق الفعلي يشترط وجود تفصيل واحد على الأقل، بينما يشترط التعبير المنشور واحداً بالضبط.",
"ar_fix": "أضف تفصيل ضريبة للفئة O: عنصر cac:TaxSubtotal يحتوي على `<cac:TaxCategory><cbc:ID>O</cbc:ID>…<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` مع المبلغ الخاضع للضريبة ومبلغ الضريبة لتلك البنود.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BG-20",
"BG-21",
"BT-151",
"BT-95",
"BT-102",
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-o-01",
"url_ar": "https://matheel.app/akhta/br-o-01"
},
{
"id": "BR-O-08",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-O-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is \" Not subject to VAT\" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are \"Not subject to VAT\".",
"fails_when": "count(/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'O'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'])> 0 and not(exists(../../../cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']) or exists(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'O']])) or not((xs:decimal(../cbc:TaxableAmount) = (sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='O']/xs:decimal(cbc:Amount)))))",
"en_title": "'Not subject to VAT' (O) taxable amount must match its lines",
"ar_title": "المبلغ الخاضع للضريبة للفئة O يطابق مجموع بنودها",
"en_meaning": "For each cac:TaxSubtotal with VAT category 'O' (Not subject to VAT), cbc:TaxableAmount must equal the sum of cbc:LineExtensionAmount of lines with category O, plus document-level charges, minus document-level allowances with category O. The executed check also warns if no line or document-level allowance/charge uses category O. The published test expression is written so that it passes whenever O lines or allowances/charges exist, without comparing amounts.",
"en_fix": "Set the O breakdown's cbc:TaxableAmount to Σ line net amounts (O) + Σ document charges (O) − Σ document allowances (O), and remove the O breakdown if no line or allowance/charge uses category O.",
"ar_meaning": "لكل cac:TaxSubtotal بفئة الضريبة 'O' (غير خاضع للضريبة)، يجب أن يساوي cbc:TaxableAmount مجموع cbc:LineExtensionAmount للبنود ذات الفئة O، مضافاً إليه الرسوم ومطروحاً منه الخصومات على مستوى الفاتورة ذات الفئة O. كما يُظهر التحقق الفعلي تحذيراً إذا لم يستخدم أي بند أو خصم أو رسم على مستوى الفاتورة الفئة O. التعبير المنشور مكتوب بحيث ينجح بمجرد وجود بنود أو خصومات أو رسوم بالفئة O دون مقارنة المبالغ.",
"ar_fix": "اجعل cbc:TaxableAmount في تفصيل الفئة O مساوياً لمجموع صافي البنود (O) + مجموع رسوم الفاتورة (O) − مجموع خصومات الفاتورة (O)، واحذف تفصيل الفئة O إذا لم يستخدمها أي بند أو خصم أو رسم.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-116",
"BT-131",
"BT-92",
"BT-99",
"BT-151",
"BT-95",
"BT-102"
],
"url_en": "https://matheel.app/en/zatca-errors/br-o-08",
"url_ar": "https://matheel.app/akhta/br-o-08"
},
{
"id": "BR-O-09",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-O-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where the VAT category code (BT-118) is \"Not subject to VAT\" shall be 0 (zero).",
"fails_when": "not(xs:decimal(../cbc:TaxAmount) = 0)",
"en_title": "'Not subject to VAT' (O) breakdown tax amount must be 0",
"ar_title": "مبلغ الضريبة في تفصيل الفئة O يجب أن يكون صفراً",
"en_meaning": "For each cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'O' (Not subject to VAT) with tax scheme VAT, the subtotal's cbc:TaxAmount must be exactly 0.",
"en_fix": "Set `<cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>` in the O cac:TaxSubtotal, and move any taxed amounts to the breakdown of their correct category.",
"ar_meaning": "لكل cac:TaxTotal/cac:TaxSubtotal تكون فيه cac:TaxCategory/cbc:ID بقيمة 'O' (غير خاضع للضريبة) ضمن نظام الضريبة VAT، يجب أن يكون cbc:TaxAmount في هذا التفصيل 0 بالضبط.",
"ar_fix": "ضع `<cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>` في cac:TaxSubtotal الخاص بالفئة O، وانقل أي مبالغ خاضعة للضريبة إلى تفصيل فئتها الصحيحة.",
"applies_to": "conditional",
"fields": [
"BT-117",
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-o-09",
"url_ar": "https://matheel.app/akhta/br-o-09"
},
{
"id": "BR-S-01",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-S-01]-An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151, BT-95 or BT-102) is \"Standard rated\" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with \"Standard rated\".",
"fails_when": "not(((exists(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'S']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'S'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'S']) > 0)) or (not(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'S']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'S'])))",
"en_title": "Standard-rated (S) items need an S VAT breakdown",
"ar_title": "البنود الخاضعة للنسبة الأساسية S تتطلب تفصيل ضريبة للفئة S",
"en_meaning": "Applies when any line cac:Item/cac:ClassifiedTaxCategory or document-level cac:AllowanceCharge/cac:TaxCategory uses VAT category 'S' (Standard rated). The invoice must then have a cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'S'. The executed check requires at least one such breakdown, as the official text says; the published test expression requires exactly one.",
"en_fix": "Add a VAT breakdown for category S: a cac:TaxSubtotal containing `<cac:TaxCategory><cbc:ID>S</cbc:ID>…<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` with the taxable and tax amounts for those lines.",
"ar_meaning": "تنطبق عندما يستخدم أي بند في cac:Item/cac:ClassifiedTaxCategory أو أي خصم أو رسم على مستوى الفاتورة في cac:AllowanceCharge/cac:TaxCategory فئة الضريبة 'S' (النسبة الأساسية). عندها يجب أن تحتوي الفاتورة على cac:TaxTotal/cac:TaxSubtotal تكون فيه قيمة cac:TaxCategory/cbc:ID هي 'S'. التحقق الفعلي يشترط وجود تفصيل واحد على الأقل كما في النص الرسمي، بينما يشترط التعبير المنشور واحداً بالضبط.",
"ar_fix": "أضف تفصيل ضريبة للفئة S: عنصر cac:TaxSubtotal يحتوي على `<cac:TaxCategory><cbc:ID>S</cbc:ID>…<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` مع المبلغ الخاضع للضريبة ومبلغ الضريبة لتلك البنود.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BG-20",
"BG-21",
"BT-151",
"BT-95",
"BT-102",
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-s-01",
"url_ar": "https://matheel.app/akhta/br-s-01"
},
{
"id": "BR-S-05",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-S-05]-For invoice items (BG-25) in which the VAT category code of invoiced items (BT-151) is \"Standard rated\" the VAT rate of the invoiced item (BT-152) must be greater than zero.",
"fails_when": "not((cbc:Percent) > 0)",
"en_title": "Standard-rated (S) line VAT rate must be above zero",
"ar_title": "نسبة الضريبة للبند ذي الفئة S يجب أن تكون أكبر من صفر",
"en_meaning": "Applies to each invoice line item with VAT category 'S' (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory). Its cbc:Percent must be greater than 0 (a missing cbc:Percent also fails).",
"en_fix": "Set the rate in that tax category, e.g. `<cbc:Percent>15.00</cbc:Percent>`, or use the VAT category code that matches the rate.",
"ar_meaning": "تنطبق على كل بند في الفاتورة بفئة الضريبة 'S' (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory). يجب أن تكون قيمة cbc:Percent فيه أكبر من 0 (وغياب cbc:Percent يؤدي أيضاً إلى الفشل).",
"ar_fix": "حدد النسبة في فئة الضريبة هذه، مثل `<cbc:Percent>15.00</cbc:Percent>`، أو استخدم رمز فئة الضريبة المناسب للنسبة.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BT-151",
"BT-152"
],
"url_en": "https://matheel.app/en/zatca-errors/br-s-05",
"url_ar": "https://matheel.app/akhta/br-s-05"
},
{
"id": "BR-S-06",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-S-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is \"Standard rated\" the Document level allowance VAT rate (BT-96) shall be greater than zero.",
"fails_when": "not((cbc:Percent) > 0)",
"en_title": "Standard-rated (S) document allowance VAT rate must be above zero",
"ar_title": "نسبة ضريبة الخصم ذي الفئة S يجب أن تكون أكبر من صفر",
"en_meaning": "Applies to each document-level allowance (cbc:ChargeIndicator false) with VAT category 'S' (cac:AllowanceCharge/cac:TaxCategory). Its cbc:Percent must be greater than 0 (a missing cbc:Percent also fails).",
"en_fix": "Set the rate in that tax category, e.g. `<cbc:Percent>15</cbc:Percent>`, or use the VAT category code that matches the rate.",
"ar_meaning": "تنطبق على كل خصم على مستوى الفاتورة (cbc:ChargeIndicator = false) بفئة الضريبة 'S' (cac:AllowanceCharge/cac:TaxCategory). يجب أن تكون قيمة cbc:Percent فيه أكبر من 0 (وغياب cbc:Percent يؤدي أيضاً إلى الفشل).",
"ar_fix": "حدد النسبة في فئة الضريبة هذه، مثل `<cbc:Percent>15</cbc:Percent>`، أو استخدم رمز فئة الضريبة المناسب للنسبة.",
"applies_to": "conditional",
"fields": [
"BG-20",
"BT-95",
"BT-96"
],
"url_en": "https://matheel.app/en/zatca-errors/br-s-06",
"url_ar": "https://matheel.app/akhta/br-s-06"
},
{
"id": "BR-S-07",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-S-07]--In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is \"Standard rated\" the Document level charge VAT rate (BT-103) shall be greater than zero.",
"fails_when": "not((cbc:Percent) > 0)",
"en_title": "Standard-rated (S) document charge VAT rate must be above zero",
"ar_title": "نسبة ضريبة الرسم ذي الفئة S يجب أن تكون أكبر من صفر",
"en_meaning": "Applies to each document-level charge (cbc:ChargeIndicator true) with VAT category 'S' (cac:AllowanceCharge/cac:TaxCategory). Its cbc:Percent must be greater than 0 (a missing cbc:Percent also fails).",
"en_fix": "Set the rate in that tax category, e.g. `<cbc:Percent>15</cbc:Percent>`, or use the VAT category code that matches the rate.",
"ar_meaning": "تنطبق على كل رسم إضافي على مستوى الفاتورة (cbc:ChargeIndicator = true) بفئة الضريبة 'S' (cac:AllowanceCharge/cac:TaxCategory). يجب أن تكون قيمة cbc:Percent فيه أكبر من 0 (وغياب cbc:Percent يؤدي أيضاً إلى الفشل).",
"ar_fix": "حدد النسبة في فئة الضريبة هذه، مثل `<cbc:Percent>15</cbc:Percent>`، أو استخدم رمز فئة الضريبة المناسب للنسبة.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-102",
"BT-103"
],
"url_en": "https://matheel.app/en/zatca-errors/br-s-07",
"url_ar": "https://matheel.app/akhta/br-s-07"
},
{
"id": "BR-S-08",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-S-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is \" Standard rated\" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are \"Standard Rate\".",
"fails_when": "count(/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'])> 0 and not(exists(../../../cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'S']) or exists(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'S']])) or not( sum((../../cac:TaxSubtotal[cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:TaxableAmount)))=(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:LineExtensionAmount) ) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='S']/xs:decimal(cbc:Amount)) ))",
"en_title": "Standard-rated (S) taxable amount must match its lines",
"ar_title": "المبلغ الخاضع للضريبة للفئة S يطابق مجموع بنودها",
"en_meaning": "For each cac:TaxSubtotal with VAT category 'S' (Standard rated), cbc:TaxableAmount must equal the sum of cbc:LineExtensionAmount of lines with category S, plus document-level charges, minus document-level allowances with category S. The executed check also warns if no line or document-level allowance/charge uses category S. The executed check compares the sum of the cbc:TaxableAmount of all S breakdowns (not each one separately) with that total; the published test compares the single breakdown and passes whenever S lines or allowances/charges exist.",
"en_fix": "Set the S breakdown's cbc:TaxableAmount to Σ line net amounts (S) + Σ document charges (S) − Σ document allowances (S), and remove the S breakdown if no line or allowance/charge uses category S.",
"ar_meaning": "لكل cac:TaxSubtotal بفئة الضريبة 'S' (النسبة الأساسية)، يجب أن يساوي cbc:TaxableAmount مجموع cbc:LineExtensionAmount للبنود ذات الفئة S، مضافاً إليه الرسوم ومطروحاً منه الخصومات على مستوى الفاتورة ذات الفئة S. كما يُظهر التحقق الفعلي تحذيراً إذا لم يستخدم أي بند أو خصم أو رسم على مستوى الفاتورة الفئة S. التحقق الفعلي يقارن مجموع cbc:TaxableAmount لكل تفاصيل الفئة S (وليس كل تفصيل على حدة) بذلك الإجمالي، بينما يقارن التعبير المنشور التفصيل الواحد وينجح بمجرد وجود بنود أو خصومات أو رسوم بالفئة S.",
"ar_fix": "اجعل cbc:TaxableAmount في تفصيل الفئة S مساوياً لمجموع صافي البنود (S) + مجموع رسوم الفاتورة (S) − مجموع خصومات الفاتورة (S)، واحذف تفصيل الفئة S إذا لم يستخدمها أي بند أو خصم أو رسم.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-116",
"BT-131",
"BT-92",
"BT-99",
"BT-151",
"BT-95",
"BT-102"
],
"url_en": "https://matheel.app/en/zatca-errors/br-s-08",
"url_ar": "https://matheel.app/akhta/br-s-08"
},
{
"id": "BR-S-09",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-S-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is \"Standard rated\" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119) / 100), rounded to two decimals.",
"fails_when": "$checkOne or not($checkTwo)",
"en_title": "Standard-rated (S) tax amount = taxable amount × rate / 100",
"ar_title": "ضريبة الفئة S = المبلغ الخاضع للضريبة × النسبة ÷ 100",
"en_meaning": "For each cac:TaxSubtotal with VAT category 'S', cbc:TaxAmount must equal cbc:TaxableAmount × cac:TaxCategory/cbc:Percent / 100 rounded to two decimals. The executed check allows a difference of 0.01 per invoice line (0.01 × number of cac:InvoiceLine) and also warns if cbc:Percent is empty; the published test expression shows a tolerance of ±1.",
"en_fix": "Compute the subtotal tax from its own taxable amount and rate, e.g. TaxableAmount 4.00 at `<cbc:Percent>15.00</cbc:Percent>` gives `<cbc:TaxAmount currencyID=\"SAR\">0.60</cbc:TaxAmount>`.",
"ar_meaning": "لكل cac:TaxSubtotal بفئة الضريبة 'S'، يجب أن يساوي cbc:TaxAmount ناتج cbc:TaxableAmount × cac:TaxCategory/cbc:Percent ÷ 100 مقرّباً إلى خانتين عشريتين. التحقق الفعلي يسمح بفرق قدره 0.01 لكل بند (0.01 × عدد عناصر cac:InvoiceLine) ويُظهر تحذيراً أيضاً إذا كانت cbc:Percent فارغة، بينما يُظهر التعبير المنشور هامشاً قدره ±1.",
"ar_fix": "احسب ضريبة التفصيل من المبلغ الخاضع للضريبة والنسبة الخاصين به، مثلاً TaxableAmount بقيمة 4.00 مع `<cbc:Percent>15.00</cbc:Percent>` تعطي `<cbc:TaxAmount currencyID=\"SAR\">0.60</cbc:TaxAmount>`.",
"applies_to": "conditional",
"fields": [
"BT-117",
"BG-23",
"BT-118",
"BT-116",
"BT-119"
],
"url_en": "https://matheel.app/en/zatca-errors/br-s-09",
"url_ar": "https://matheel.app/akhta/br-s-09"
},
{
"id": "BR-S-10",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-S-10]-A VAT breakdown (BG-23) with VAT Category code (BT-118) \"Standard rate\" shall not have a VAT exemption reason code (BT-121) or VAT exemption reason text (BT-120).",
"fails_when": "(/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory/cbc:ID/text() = 'S') and (exists(cbc:TaxExemptionReason) or exists(cbc:TaxExemptionReasonCode))",
"en_title": "Standard-rated (S) VAT breakdown must not have an exemption reason",
"ar_title": "تفصيل الضريبة للفئة S يجب ألا يحتوي على سبب إعفاء",
"en_meaning": "For each cac:TaxSubtotal/cac:TaxCategory with cbc:ID 'S' and tax scheme VAT, neither cbc:TaxExemptionReason (BT-120) nor cbc:TaxExemptionReasonCode (BT-121) may be present.",
"en_fix": "Remove cbc:TaxExemptionReason and cbc:TaxExemptionReasonCode from the S tax category in the VAT breakdown.",
"ar_meaning": "لكل cac:TaxSubtotal/cac:TaxCategory تكون فيه cbc:ID بقيمة 'S' ضمن نظام الضريبة VAT، يجب ألا يوجد cbc:TaxExemptionReason (BT-120) ولا cbc:TaxExemptionReasonCode (BT-121).",
"ar_fix": "احذف cbc:TaxExemptionReason و cbc:TaxExemptionReasonCode من فئة الضريبة S.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-121",
"BT-120"
],
"url_en": "https://matheel.app/en/zatca-errors/br-s-10",
"url_ar": "https://matheel.app/akhta/br-s-10"
},
{
"id": "BR-Z-01",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-Z-01]-An Invoice that contains an Invoice line (BG-25), a Document level allowance (BG-20) or a Document level charge (BG-21) where the VAT category code (BT-151 or BT-95 or BT-102) is \"Zero rated\" shall contain in the VAT breakdown (BG-23) at least one VAT category code (BT-118) equal with \"Zero rated\".",
"fails_when": "not(((exists(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) or exists(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z'])) and (count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) > 0)) or (not(//cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) and not(//cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z'])))",
"en_title": "Zero-rated (Z) items need a Z VAT breakdown",
"ar_title": "البنود الخاضعة لنسبة الصفر Z تتطلب تفصيل ضريبة للفئة Z",
"en_meaning": "Applies when any line cac:Item/cac:ClassifiedTaxCategory or document-level cac:AllowanceCharge/cac:TaxCategory uses VAT category 'Z' (Zero rated). The invoice must then have a cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'Z'. At least one such breakdown is required.",
"en_fix": "Add a VAT breakdown for category Z: a cac:TaxSubtotal containing `<cac:TaxCategory><cbc:ID>Z</cbc:ID>…<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` with the taxable and tax amounts for those lines.",
"ar_meaning": "تنطبق عندما يستخدم أي بند في cac:Item/cac:ClassifiedTaxCategory أو أي خصم أو رسم على مستوى الفاتورة في cac:AllowanceCharge/cac:TaxCategory فئة الضريبة 'Z' (نسبة الصفر). عندها يجب أن تحتوي الفاتورة على cac:TaxTotal/cac:TaxSubtotal تكون فيه قيمة cac:TaxCategory/cbc:ID هي 'Z'. يُشترط وجود تفصيل واحد على الأقل.",
"ar_fix": "أضف تفصيل ضريبة للفئة Z: عنصر cac:TaxSubtotal يحتوي على `<cac:TaxCategory><cbc:ID>Z</cbc:ID>…<cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>` مع المبلغ الخاضع للضريبة ومبلغ الضريبة لتلك البنود.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BG-20",
"BG-21",
"BT-151",
"BT-95",
"BT-102",
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-z-01",
"url_ar": "https://matheel.app/akhta/br-z-01"
},
{
"id": "BR-Z-05",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-Z-05]-In an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is \"Zero rated\" the Invoiced item VAT rate (BT-152) shall be 0 (zero).",
"fails_when": "not((xs:decimal(cbc:Percent) = 0))",
"en_title": "Zero-rated (Z) line VAT rate must be 0",
"ar_title": "نسبة الضريبة للبند ذي الفئة Z يجب أن تكون صفراً",
"en_meaning": "Applies to each invoice line item with VAT category 'Z' (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory). Its cbc:Percent must be exactly 0.",
"en_fix": "Set the rate in that tax category, e.g. `<cbc:Percent>0.00</cbc:Percent>`, or use the VAT category code that matches the rate.",
"ar_meaning": "تنطبق على كل بند في الفاتورة بفئة الضريبة 'Z' (cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory). يجب أن تكون قيمة cbc:Percent فيه 0 بالضبط.",
"ar_fix": "حدد النسبة في فئة الضريبة هذه، مثل `<cbc:Percent>0.00</cbc:Percent>`، أو استخدم رمز فئة الضريبة المناسب للنسبة.",
"applies_to": "conditional",
"fields": [
"BG-25",
"BT-151",
"BT-152"
],
"url_en": "https://matheel.app/en/zatca-errors/br-z-05",
"url_ar": "https://matheel.app/akhta/br-z-05"
},
{
"id": "BR-Z-06",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-Z-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is \"Zero rated\" the Document level allowance VAT rate (BT-96) shall be 0 (zero).",
"fails_when": "not((xs:decimal(cbc:Percent) = 0))",
"en_title": "Zero-rated (Z) document allowance VAT rate must be 0",
"ar_title": "نسبة ضريبة الخصم ذي الفئة Z يجب أن تكون صفراً",
"en_meaning": "Applies to each document-level allowance (cbc:ChargeIndicator false) with VAT category 'Z' (cac:AllowanceCharge/cac:TaxCategory). Its cbc:Percent must be exactly 0.",
"en_fix": "Set the rate in that tax category, e.g. `<cbc:Percent>0</cbc:Percent>`, or use the VAT category code that matches the rate.",
"ar_meaning": "تنطبق على كل خصم على مستوى الفاتورة (cbc:ChargeIndicator = false) بفئة الضريبة 'Z' (cac:AllowanceCharge/cac:TaxCategory). يجب أن تكون قيمة cbc:Percent فيه 0 بالضبط.",
"ar_fix": "حدد النسبة في فئة الضريبة هذه، مثل `<cbc:Percent>0</cbc:Percent>`، أو استخدم رمز فئة الضريبة المناسب للنسبة.",
"applies_to": "conditional",
"fields": [
"BG-20",
"BT-95",
"BT-96"
],
"url_en": "https://matheel.app/en/zatca-errors/br-z-06",
"url_ar": "https://matheel.app/akhta/br-z-06"
},
{
"id": "BR-Z-07",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-Z-07]-In a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is \"Zero rated\" the Document level charge VAT rate (BT-103) shall be 0 (zero).",
"fails_when": "cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'] and not(((/ubl:Invoice/cac:AllowanceCharge/cac:TaxCategory /cbc:Percent)=0))",
"en_title": "Zero-rated (Z) document charge VAT rate must be 0",
"ar_title": "نسبة ضريبة الرسم ذي الفئة Z يجب أن تكون صفراً",
"en_meaning": "Applies when the invoice has a document-level cac:AllowanceCharge with cbc:ChargeIndicator true and VAT category 'Z'. The executed check then requires that a document-level cac:AllowanceCharge/cac:TaxCategory/cbc:Percent equals 0; as written it passes if any document-level allowance or charge has rate 0, not specifically the Z charge. Read literally, the published test would fail every invoice without a Z charge, but the validator only evaluates it when such a charge exists.",
"en_fix": "In every document-level charge with category Z, set `<cbc:Percent>0</cbc:Percent>` in its cac:TaxCategory.",
"ar_meaning": "تنطبق عندما تحتوي الفاتورة على cac:AllowanceCharge على مستوى الفاتورة بقيمة cbc:ChargeIndicator = true وفئة ضريبة 'Z'. عندها يشترط التحقق الفعلي أن تكون قيمة cac:AllowanceCharge/cac:TaxCategory/cbc:Percent على مستوى الفاتورة مساوية 0؛ وبصيغته الحالية ينجح إذا كانت نسبة أي خصم أو رسم على مستوى الفاتورة 0، وليس الرسم ذو الفئة Z تحديداً. ولو قُرئ التعبير المنشور حرفياً لفشلت كل فاتورة لا تحتوي على رسم بالفئة Z، لكن المدقق لا يطبقه إلا عند وجود هذا الرسم.",
"ar_fix": "في كل رسم إضافي على مستوى الفاتورة بالفئة Z، ضع `<cbc:Percent>0</cbc:Percent>` داخل cac:TaxCategory الخاص به.",
"applies_to": "conditional",
"fields": [
"BG-21",
"BT-102",
"BT-103"
],
"url_en": "https://matheel.app/en/zatca-errors/br-z-07",
"url_ar": "https://matheel.app/akhta/br-z-07"
},
{
"id": "BR-Z-08",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-Z-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is \" Zero rated\" the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are \"Zero Rated\".",
"fails_when": "count(/*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'Z'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT'])> 0 and not(exists(../../../cac:AllowanceCharge/cac:TaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']) or exists(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory[cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']/cbc:ID[normalize-space(.) = 'Z']])) or not( (xs:decimal(../cbc:TaxableAmount) =(sum(../../../cac:InvoiceLine[cac:Item/cac:ClassifiedTaxCategory/normalize-space(cbc:ID)='Z']/xs:decimal(cbc:LineExtensionAmount)) + sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=true()][cac:TaxCategory/normalize-space(cbc:ID)='Z']/xs:decimal(cbc:Amount)) - sum(../../../cac:AllowanceCharge[cbc:ChargeIndicator=false()][cac:TaxCategory/normalize-space(cbc:ID)='Z']/xs:decimal(cbc:Amount)) )))",
"en_title": "Zero-rated (Z) taxable amount must match its lines",
"ar_title": "المبلغ الخاضع للضريبة للفئة Z يطابق مجموع بنودها",
"en_meaning": "For each cac:TaxSubtotal with VAT category 'Z' (Zero rated), cbc:TaxableAmount must equal the sum of cbc:LineExtensionAmount of lines with category Z, plus document-level charges, minus document-level allowances with category Z. The executed check also warns if no line or document-level allowance/charge uses category Z. The published test expression sums category 'S' amounts instead of 'Z' and passes whenever Z lines or allowances/charges exist; the executed check uses 'Z'.",
"en_fix": "Set the Z breakdown's cbc:TaxableAmount to Σ line net amounts (Z) + Σ document charges (Z) − Σ document allowances (Z), and remove the Z breakdown if no line or allowance/charge uses category Z.",
"ar_meaning": "لكل cac:TaxSubtotal بفئة الضريبة 'Z' (نسبة الصفر)، يجب أن يساوي cbc:TaxableAmount مجموع cbc:LineExtensionAmount للبنود ذات الفئة Z، مضافاً إليه الرسوم ومطروحاً منه الخصومات على مستوى الفاتورة ذات الفئة Z. كما يُظهر التحقق الفعلي تحذيراً إذا لم يستخدم أي بند أو خصم أو رسم على مستوى الفاتورة الفئة Z. التعبير المنشور يجمع مبالغ الفئة 'S' بدلاً من 'Z' وينجح بمجرد وجود بنود أو خصومات أو رسوم بالفئة Z، بينما يستخدم التحقق الفعلي الفئة 'Z'.",
"ar_fix": "اجعل cbc:TaxableAmount في تفصيل الفئة Z مساوياً لمجموع صافي البنود (Z) + مجموع رسوم الفاتورة (Z) − مجموع خصومات الفاتورة (Z)، واحذف تفصيل الفئة Z إذا لم يستخدمها أي بند أو خصم أو رسم.",
"applies_to": "conditional",
"fields": [
"BG-23",
"BT-118",
"BT-116",
"BT-131",
"BT-92",
"BT-99",
"BT-151",
"BT-95",
"BT-102"
],
"url_en": "https://matheel.app/en/zatca-errors/br-z-08",
"url_ar": "https://matheel.app/akhta/br-z-08"
},
{
"id": "BR-Z-09",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-Z-09]-The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is \"Zero rated\" shall equal 0 (zero).",
"fails_when": "not(xs:decimal(../cbc:TaxAmount) = 0)",
"en_title": "Zero-rated (Z) breakdown tax amount must be 0",
"ar_title": "مبلغ الضريبة في تفصيل الفئة Z يجب أن يكون صفراً",
"en_meaning": "For each cac:TaxTotal/cac:TaxSubtotal whose cac:TaxCategory/cbc:ID is 'Z' (Zero rated) with tax scheme VAT, the subtotal's cbc:TaxAmount must be exactly 0.",
"en_fix": "Set `<cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>` in the Z cac:TaxSubtotal, and move any taxed amounts to the breakdown of their correct category.",
"ar_meaning": "لكل cac:TaxTotal/cac:TaxSubtotal تكون فيه cac:TaxCategory/cbc:ID بقيمة 'Z' (نسبة الصفر) ضمن نظام الضريبة VAT، يجب أن يكون cbc:TaxAmount في هذا التفصيل 0 بالضبط.",
"ar_fix": "ضع `<cbc:TaxAmount currencyID=\"SAR\">0.00</cbc:TaxAmount>` في cac:TaxSubtotal الخاص بالفئة Z، وانقل أي مبالغ خاضعة للضريبة إلى تفصيل فئتها الصحيحة.",
"applies_to": "conditional",
"fields": [
"BT-117",
"BG-23",
"BT-118"
],
"url_en": "https://matheel.app/en/zatca-errors/br-z-09",
"url_ar": "https://matheel.app/akhta/br-z-09"
}
]
[
{
"id": "BR-02",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-02]-An Invoice shall have an Invoice number (BT-1).",
"fails_when": "not(exists(cbc:ID) and (cbc:ID) !='')",
"en_title": "Every invoice needs an invoice number (BT-1)",
"ar_title": "يجب أن تحمل كل فاتورة رقم فاتورة (BT-1)",
"en_meaning": "Checks that the document root (ubl:Invoice or cn:CreditNote) has a cbc:ID element and that it is not empty.",
"en_fix": "Add a non-empty invoice number directly under the root element, e.g. `<cbc:ID>INV-0001</cbc:ID>`.",
"ar_meaning": "تتحقق القاعدة من أن العنصر الجذر للمستند (ubl:Invoice أو cn:CreditNote) يحتوي على العنصر cbc:ID وأنه غير فارغ.",
"ar_fix": "أضف رقم فاتورة غير فارغ مباشرة تحت العنصر الجذر، مثل `<cbc:ID>INV-0001</cbc:ID>`.",
"applies_to": "all",
"fields": [
"BT-1"
],
"url_en": "https://matheel.app/en/zatca-errors/br-02",
"url_ar": "https://matheel.app/akhta/br-02"
},
{
"id": "BR-03",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-03]-An Invoice shall have an Invoice issue date (BT-2).",
"fails_when": "not(exists(cbc:IssueDate) and (cbc:IssueDate) !='')",
"en_title": "Every invoice needs an issue date (BT-2)",
"ar_title": "يجب أن تحمل كل فاتورة تاريخ إصدار (BT-2)",
"en_meaning": "Checks that the document root has a cbc:IssueDate element and that it is not empty.",
"en_fix": "Add the issue date directly under the root element in the UBL date format YYYY-MM-DD, e.g. `<cbc:IssueDate>2026-10-24</cbc:IssueDate>`.",
"ar_meaning": "تتحقق القاعدة من أن العنصر الجذر للمستند يحتوي على العنصر cbc:IssueDate وأنه غير فارغ.",
"ar_fix": "أضف تاريخ الإصدار مباشرة تحت العنصر الجذر بصيغة التاريخ في UBL (YYYY-MM-DD)، مثل `<cbc:IssueDate>2026-10-24</cbc:IssueDate>`.",
"applies_to": "all",
"fields": [
"BT-2"
],
"url_en": "https://matheel.app/en/zatca-errors/br-03",
"url_ar": "https://matheel.app/akhta/br-03"
},
{
"id": "BR-04",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-04]-An Invoice shall have an Invoice type code (BT-3).",
"fails_when": "not((exists(cbc:InvoiceTypeCode) and (cbc:InvoiceTypeCode) !='') or (exists(cbc:CreditNoteTypeCode) and (cbc:CreditNoteTypeCode) !=''))",
"en_title": "Every invoice needs an invoice type code (BT-3)",
"ar_title": "يجب أن تحمل كل فاتورة رمز نوع الفاتورة (BT-3)",
"en_meaning": "Checks that the document has a non-empty cbc:InvoiceTypeCode (or, in a cn:CreditNote document, a non-empty cbc:CreditNoteTypeCode).",
"en_fix": "Add a type code under the root element, e.g. `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>` as in the official samples; the value must also be in the BR-CL-01 code list.",
"ar_meaning": "تتحقق القاعدة من وجود العنصر cbc:InvoiceTypeCode غير فارغ (أو العنصر cbc:CreditNoteTypeCode غير فارغ في مستند من نوع cn:CreditNote).",
"ar_fix": "أضف رمز النوع تحت العنصر الجذر، مثل `<cbc:InvoiceTypeCode name=\"0100000\">388</cbc:InvoiceTypeCode>` كما في النماذج الرسمية، ويجب أن تكون القيمة ضمن قائمة الرموز في القاعدة BR-CL-01.",
"applies_to": "all",
"fields": [
"BT-3"
],
"url_en": "https://matheel.app/en/zatca-errors/br-04",
"url_ar": "https://matheel.app/akhta/br-04"
},
{
"id": "BR-05",
"severity": "error",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-05]-An Invoice shall have an Invoice currency code (BT-5).",
"fails_when": "not(exists(cbc:DocumentCurrencyCode) and (cbc:DocumentCurrencyCode) !='')",
"en_title": "Every invoice needs a currency code (BT-5)",
"ar_title": "يجب أن تحمل كل فاتورة رمز عملة الفاتورة (BT-5)",
"en_meaning": "Checks that the document root has a cbc:DocumentCurrencyCode element and that it is not empty.",
"en_fix": "Add the invoice currency under the root element, e.g. `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`; the value must be an ISO 4217 code (see BR-CL-04).",
"ar_meaning": "تتحقق القاعدة من أن العنصر الجذر يحتوي على العنصر cbc:DocumentCurrencyCode وأنه غير فارغ.",
"ar_fix": "أضف عملة الفاتورة تحت العنصر الجذر، مثل `<cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>`، ويجب أن تكون القيمة رمزًا من ISO 4217 (انظر BR-CL-04).",
"applies_to": "all",
"fields": [
"BT-5"
],
"url_en": "https://matheel.app/en/zatca-errors/br-05",
"url_ar": "https://matheel.app/akhta/br-05"
},
{
"id": "BR-06",
"severity": "warning",
"source": "EN 16931 (CEN) rules",
"official_text": "[BR-06]-An Invoice shall contain the Seller name (BT-27).",
"fails_when": "not(exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) and (cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName) !='')",
"en_title": "The seller's legal name (BT-27) must be present",
"ar_title": "يجب ذكر الاسم القانوني للبائع (BT-27)",
"en_meaning": "Checks that cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName exists and is not empty.",
"en_fix": "Add the seller name: `<cac:AccountingSupplierParty><cac:Party><cac:PartyLegalEntity><cbc:RegistrationName>Seller name</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty>`.",
"ar_meaning": "تتحقق القاعدة من وجود العنصر cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:RegistrationName وأنه غير فارغ.",
"ar_fix": "أضف اسم البائع: `<cac:AccountingSupplierParty><cac:Party><cac:PartyLegalEntity><cbc:RegistrationName>Seller name</cbc:RegistrationName></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty>`.",
"applies_to": "all",
"fields": [
"BT-27"
],
"url_en": "https://matheel.app/en/zatca-errors/br-06",
"url_ar": "https://matheel.app/akhta/br-06"
},
{
"id": "BR-08",
"severity": "warning",
"source": "EN 16931 (CEN) rules",