# Need clarification about Schematron Validation

**URL:** <https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212>\
**Category:** SDK, web-based validator and sandbox\
**Created:** [November 17, 2024, 8:31am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212 "2024-11-17T08:31:23Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![hassanayoub85](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@hassanayoub85](https://zatca1.discourse.group/u/hassanayoub85)\
**Post date:** [December 11, 2024, 4:21pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/21 "2024-12-11T16:21:10Z")

</div>

@idaoud ,  
1-yes  
2- I installed it from zatca as the user manual documentation

Can you share the source of fatooranet.exe or any example for .net 8 using latest sdk?

---

<div class="post-metadata">

**Author:** ![idaoud](https://avatars.discourse-cdn.com/v4/letter/i/f9ae1b/32.png) [@idaoud](https://zatca1.discourse.group/u/idaoud)\
**Post date:** [December 11, 2024, 4:49pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/22 "2024-12-11T16:49:08Z")

</div>

Dear @hassanayoub85

Please provide the exact steps you followed after installing the SDK .Net 3.3.9 to ensure comprehensive support as usual.

Additionally, you can reach out to your RM to reach out our support team via below mail.

SP mail: [sp\_support@zatca.gov.sa](mailto:sp_support@zatca.gov.sa)

Thanks,  
Ibrahem Daoud.

---

<div class="post-metadata">

**Author:** ![jasimsa](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jasimsa](https://zatca1.discourse.group/u/jasimsa)\
**Post date:** [December 11, 2024, 5:25pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/23 "2024-12-11T17:25:57Z")

</div>

Check Ikvm.runtime.dll file version is need to use latest updated version.

If you need more clarification please send your files in my email [jasimwts@gmail.com](mailto:jasimwts@gmail.com).

---

<div class="post-metadata">

**Author:** ![hassanayoub85](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@hassanayoub85](https://zatca1.discourse.group/u/hassanayoub85)\
**Post date:** [December 12, 2024, 11:00am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/24 "2024-12-12T11:00:29Z")

</div>

Hello @jasimsa, I just sent you the files in your email.

---

<div class="post-metadata">

**Author:** ![hassanayoub85](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@hassanayoub85](https://zatca1.discourse.group/u/hassanayoub85)\
**Post date:** [December 12, 2024, 12:25pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/25 "2024-12-12T12:25:55Z")

</div>

Hello @idaoud , I just sent the files.

---

<div class="post-metadata">

**Author:** ![jasimsa](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jasimsa](https://zatca1.discourse.group/u/jasimsa)\
**Post date:** [December 12, 2024, 1:46pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/26 "2024-12-12T13:46:18Z")

</div>

Your code now working.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/zatca1/original/1X/eeff445c29ef6cb4b67e2ac0bb3766a3739906ac.png)

First you need a copy of ikvm and runtime folder from sdk folder.  
Then I will share Dlls related java.

> **[IKVM.rar](https://drive.google.com/file/d/1fYkiZpov8e8xtC9Y1B3yHgsrGOjMWAhu/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![hassanayoub85](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@hassanayoub85](https://zatca1.discourse.group/u/hassanayoub85)\
**Post date:** [December 12, 2024, 3:31pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/27 "2024-12-12T15:31:34Z")

</div>

Hi @jasimsa , Thanks alot, it works!.  
But how come that the Official SDK have this issue, they should solve it

---

<div class="post-metadata">

**Author:** ![arjun\_tech24](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@arjun\_tech24](https://zatca1.discourse.group/u/arjun_tech24)\
**Post date:** [December 12, 2024, 5:39pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/28 "2024-12-12T17:39:15Z")

</div>

@eCloud @idaoud @jasimsa

In our ERP system, we do not issue separate invoices for prepayments. Instead, customers make advance payments, and we record the prepayment amount directly during invoice generation in the frontend. The prepayment is subtracted from the total amount to calculate the net payable amount.

For example, consider the calculation shown below:

1. Invoice Details:

- Description: “Laptop”
- Quantity: 2
- Unit Price: 500
- Amount (Excl. VAT): 1000
- VAT @ 15%: 150
- Amount (Incl. VAT): 1150

1. Prepayment Handling:

- Total Amount: 1000.00
- Discount: 50.00
- Total Before VAT: 950.00
- VAT Amount: 142.50
- Amount with VAT: 1092.50
- Advance Amount: 100.00
- Net Amount Payable: 992.50

### My Understanding and Approach:

From my research, it seems I need to structure the XML as follows for the prepayment:

#### Invoice Line for Prepaid Amount:

```auto
<cac:InvoiceLine>
    <cbc:ID>2</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">0.000000</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">0.00</cbc:LineExtensionAmount>
    <cac:DocumentReference>
        <cbc:ID>46531</cbc:ID>
        <cbc:UUID>a79760f7-2f48-4da9-85a5-40459a147c80</cbc:UUID>
        <cbc:IssueDate>2022-08-15</cbc:IssueDate>
        <cbc:IssueTime>12:28:17</cbc:IssueTime>
        <cbc:DocumentTypeCode>386</cbc:DocumentTypeCode>
    </cac:DocumentReference>
    <cac:TaxTotal>
        <cbc:TaxAmount currencyID="SAR">0</cbc:TaxAmount>
        <cbc:RoundingAmount currencyID="SAR">0</cbc:RoundingAmount>
        <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="SAR">1000</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="SAR">150</cbc:TaxAmount>
            <cac:TaxCategory>
                <cbc:ID>S</cbc:ID>
                <cbc:Percent>15.00</cbc:Percent>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:TaxCategory>
        </cac:TaxSubtotal>
    </cac:TaxTotal>
    <cac:Item>
        <cbc:Name>Laptop | حاسوب محمول</cbc:Name>
        <cac:ClassifiedTaxCategory>
            <cbc:ID>S</cbc:ID>
            <cbc:Percent>15.00</cbc:Percent>
            <cac:TaxScheme>
                <cbc:ID>VAT</cbc:ID>
            </cac:TaxScheme>
        </cac:ClassifiedTaxCategory>
    </cac:Item>
    <cac:Price>
        <cbc:PriceAmount currencyID="SAR">0.00</cbc:PriceAmount>
    </cac:Price>
</cac:InvoiceLine>

```

#### Prepaid Amount in LegalMonetaryTotal:

```auto
<cac:LegalMonetaryTotal>
    <cbc:LineExtensionAmount currencyID="SAR">2000</cbc:LineExtensionAmount>
    <cbc:TaxExclusiveAmount currencyID="SAR">1900</cbc:TaxExclusiveAmount>
    <cbc:TaxInclusiveAmount currencyID="SAR">2185</cbc:TaxInclusiveAmount>
    <cbc:AllowanceTotalAmount currencyID="SAR">100</cbc:AllowanceTotalAmount>
    <cbc:PrepaidAmount currencyID="SAR">1150</cbc:PrepaidAmount>
    <cbc:PayableAmount currencyID="SAR">1035</cbc:PayableAmount>
</cac:LegalMonetaryTotal>

```

### My Question:

Since we do not generate separate prepayment invoices, we simply deduct the advance amount during the invoice generation. In this scenario, how should the XML structure look to comply with ZATCA regulations?

Could you confirm if the above XML structure is correct for such cases? If not, how should we handle the advance payment in the XML to ensure compliance?

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [December 17, 2024, 9:18am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/29 "2024-12-17T09:18:25Z")

</div>

@arjun_tech24

In my opinion, on the eInvoice side, if the sales advance payment is not reported, you do not need to include it in your eInvoice.

However, regarding tax regulations, you may want to consult a tax advisor in KSA for further clarification. Or maybe from ZATCA can give more accurate answer to your question.

---

<div class="post-metadata">

**Author:** ![Mustafa.Acar](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mustafa.Acar](https://zatca1.discourse.group/u/Mustafa.Acar)\
**Post date:** [January 2, 2025, 9:17am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/30 "2025-01-02T09:17:44Z")

</div>

Hello @eCloud ,  
Hope you are doing well. I need your help. We have created our dot net projection with using ZATCA SDK DLL. But when we deployed it to SAP BTP platform. We have faced validation error. that error is related to validation files path. Becasue SAP BTP has changed files path. That’s why it has not access to schema control files with path. Zatca side they created static path. Do you have any sample code or any suggestion to fix that path for schema control? Could you please help me?

Thanks,  
Mustafa Acar

---

<div class="post-metadata">

**Author:** ![jasimsa](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jasimsa](https://zatca1.discourse.group/u/jasimsa)\
**Post date:** [January 2, 2025, 9:38am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/31 "2025-01-02T09:38:08Z")

</div>

@Mustafa.Acar

Salam,

I am also faced this issues while deploying.

I created folders in file manager of hosting panel as follows

for example

Root Folder : Zatca  
I copied our complete ‘data’ folder into Zatca root folder.

Then I created folder - ‘A’  
within A I created folder-‘B’  
within B I created folder-‘C’

after that I deploying my released files into folder ‘C’

Now Schematron validated properly.

Try it from your side if you are facing any issues please let me know.

---

<div class="post-metadata">

**Author:** ![Mustafa.Acar](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@Mustafa.Acar](https://zatca1.discourse.group/u/Mustafa.Acar)\
**Post date:** [January 2, 2025, 9:39am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/32 "2025-01-02T09:39:43Z")

</div>

Salam @jasimsa  
Have you deployed to SAP BTP?

---

<div class="post-metadata">

**Author:** ![eCloud](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/ecloud/32/629_2.png) [@eCloud](https://zatca1.discourse.group/u/eCloud)\
**Post date:** [January 2, 2025, 11:16am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/33 "2025-01-02T11:16:48Z")

</div>

@Mustafa.Acar  
I don’t fully understand what SAP BTP is. Regarding the _RelativePath_ issue (Zatca .NET SDK), you can follow @jasimsa’s advice:

Move the **Data** folder from Zatca SDK into the **Zatca** folder, and then relocate your application executable and dependency files into the **C** folder.

---

<div class="post-metadata">

**Author:** ![jasimsa](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jasimsa](https://zatca1.discourse.group/u/jasimsa)\
**Post date:** [January 12, 2025, 8:02am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/34 "2025-01-12T08:02:12Z")

</div>

Dears,

I have one doubt.

Both Standard and Simplified invoice xml files need to validate before posting into Zatca?

> ValidationResult ValidateEInvoice(XmlDocument eInvoice, string certificateFileContent, string pihFileContent)

some people told only validate simplified invoices need to validate standard invoices no need to validate.

Please clarify

@idaoud @Malik

---

<div class="post-metadata">

**Author:** ![Malik](https://dub1.discourse-cdn.com/flex013/user_avatar/zatca1.discourse.group/malik/32/708_2.png) [@Malik](https://zatca1.discourse.group/u/Malik)\
**Post date:** [January 12, 2025, 12:13pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/35 "2025-01-12T12:13:52Z")

</div>

Hi,  
Check this video I for ZATCA might help you,

[![](https://europe1.discourse-cdn.com/flex013/uploads/zatca1/original/1X/7a14b2813e4c958c0123f717f4295cb74fc4334f.jpeg "FATOORA e-Invoicing ZATCA - KSA Phase 2 Techno-Functional Discussion on API's for IT and Finance") ](https://www.youtube.com/watch?v=db1ivDQPjks)

thanks

---

<div class="post-metadata">

**Author:** ![braa34](https://avatars.discourse-cdn.com/v4/letter/b/8e8cbc/32.png) [@braa34](https://zatca1.discourse.group/u/braa34)\
**Post date:** [December 3, 2025, 2:46pm UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/36 "2025-12-03T14:46:00Z")

</div>

can you please share this version of sdk folder? i download zatca sdk 3.4.7 but i can’t find these DLL’s

---

<div class="post-metadata">

**Author:** ![idaoud](https://avatars.discourse-cdn.com/v4/letter/i/f9ae1b/32.png) [@idaoud](https://zatca1.discourse.group/u/idaoud)\
**Post date:** [December 4, 2025, 6:27am UTC](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212/37 "2025-12-04T06:27:42Z")

</div>

Morning @braa34

Thanks for reaching out,

Please find the SDK link below. Kindly ensure that you have downloaded the latest version of SDK-DotNet after that you can navigate to the following path : zatca-einvoicing-sdk-DotNet-238-R3.4.7\Lib\Dot-Net8

SDK Installation Link: [sadzit.sharepoint.com/sites/EXTERNALZATCA/ZatcaSDK/Forms/AllItems.aspx?id=%2Fsites%2FEXTERNALZATCA%2FZatcaSDK%2FSDK%2F3%2E4%2E7%2Fzatca-einvoicing-sdk-DotNet-238-R3%2E4%2E7%2Ezip&parent=%2Fsites%2FEXTERNALZATCA%2FZatcaSDK%2FSDK%2F3%2E4%2E7&p=true&ga=1](https://sadzit.sharepoint.com/sites/EXTERNALZATCA/ZatcaSDK/Forms/AllItems.aspx?id=%2Fsites%2FEXTERNALZATCA%2FZatcaSDK%2FSDK%2F3%2E4%2E7%2Fzatca%2Deinvoicing%2Dsdk%2DDotNet%2D238%2DR3%2E4%2E7%2Ezip&parent=%2Fsites%2FEXTERNALZATCA%2FZatcaSDK%2FSDK%2F3%2E4%2E7&p=true&ga=1)

Thanks,  
Ibrahem Daoud.

[Previous page](https://zatca1.discourse.group/t/need-clarification-about-schematron-validation/4212.md?page=1)
