Sdk versions 3.2.6 and 3.3.3

@Mudassir yes that is because of this
signResult.SignedEInvoice.InnerXml.Replace(" />", “/>”)
i avoided this

if you dont mind can u please eloborate, i still face the same issue,
also when i try to validate using the validateInvoice method, i see these in response, rest of the all the fields are true
“Validate EInvoice Signature” - false
“Validate EN Schematrons” - false
“Validate EN Schematrons” - false.

if you could help me out, it will be great help
thank you @anusv

Did you add DATA–>Rules–>Schematrons to your project ?

no I did not add those, i am directly using an XML template, populating it, with the required data, and using the SDK to sign the invoice, do we need to add the rules as well?

this is hw my signed invoice looks like

<?xml version="1.0" encoding="utf-8"?><Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
  <ext:UBLExtensions>
    <ext:UBLExtension>
        <ext:ExtensionURI>urn:oasis:names:specification:ubl:dsig:enveloped:xades</ext:ExtensionURI>
        <ext:ExtensionContent>
            <sig:UBLDocumentSignatures xmlns:sig="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2" xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2" xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2">
                <sac:SignatureInformation>
                    <cbc:ID>urn:oasis:names:specification:ubl:signature:1</cbc:ID>
                    <sbc:ReferencedSignatureID>urn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>
                    <ds:Signature Id="signature" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                        <ds:SignedInfo>
                            <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11" />
                            <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256" />
                            <ds:Reference Id="invoiceSignedData" URI="">
                                <ds:Transforms>
                                    <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                        <ds:XPath>not(//ancestor-or-self::ext:UBLExtensions)</ds:XPath>
                                    </ds:Transform>
                                    <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                        <ds:XPath>not(//ancestor-or-self::cac:Signature)</ds:XPath>
                                    </ds:Transform>
                                    <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                        <ds:XPath>not(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID='QR'])</ds:XPath>
                                    </ds:Transform>
                                    <ds:Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11" />
                                </ds:Transforms>
                                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                                <ds:DigestValue>OXXKIZeMyjr8GQalb/p0EfpZSTNRIcBN2LoczFVot5U=</ds:DigestValue>
                            </ds:Reference>
                            <ds:Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#xadesSignedProperties">
                                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                                <ds:DigestValue>ODMyMDk2N2IyNmZjM2ViMTgwMThjOTYwNzU3ZDM2NWU1MjRkN2NiNzI5YzdkYTg3ZDIxOWE3ZDNlN2JjZmYxNg==</ds:DigestValue>
                            </ds:Reference>
                        </ds:SignedInfo>
                        <ds:SignatureValue>MEYCIQDyo3T1n/i5JEfCy0GmZ0OIkqqsDphu1qBHXFpeVbpUrwIhAIGLqmXV9eIZvsFEts1YzqCT4gMq3L6YL6DdsgbKp+lY</ds:SignatureValue>
                        <ds:KeyInfo>
                            <ds:X509Data>
                                <ds:X509Certificate>MIIE8zCCBJigAwIBAgITeAAASY8IuivLIe5CXAABAABJjzAKBggqhkjOPQQDAjBiMRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxEzARBgoJkiaJk/IsZAEZFgNnb3YxFzAVBgoJkiaJk/IsZAEZFgdleHRnY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wU2VydmljZXMsQ049U2VydmljZXMsQ049Q29uZmlndXJhdGlvbixEQz1leHR6YXRjYSxEQz1nb3YsREM9bG9jYWw/Y0FDZXJ0aWZpY2F0ZT9iYXNlP29iamVjdENsYXNzPWNlcnRpZmljYXRpb25BdXRob3JpdHkwDgYDVR0PAQH/BAQDAgeAMDwGCSsGAQQBgjcVBwQvMC0GJSsGAQQBgjcVCIGGqB2E0PsShu2dJIfO+xnTwFVmgZzYLYPlxV0CAWQCARAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMDMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwIwCgYIKwYBBQUHAwMwCgYIKoZIzj0EAwIDSQAwRgIhAL4lDCvwZNiswUiF/XG5R9MkE0PFgAWLss2UtpqNBdhuAiEA5nAXr76HyZnnAksmcMfi0rsQh4SNA0cNxHVqq5iTJok=</ds:X509Certificate>
                            </ds:X509Data>
                        </ds:KeyInfo>
                        <ds:Object>
                            <xades:QualifyingProperties Target="signature" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#">
                                <xades:SignedProperties Id="xadesSignedProperties">
                                    <xades:SignedSignatureProperties>
                                        <xades:SigningTime>2024-10-16T15:32:47</xades:SigningTime>
                                        <xades:SigningCertificate>
                                            <xades:Cert>
                                                <xades:CertDigest>
                                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                                                    <ds:DigestValue>NTVmNWI2YWVjZDIxNDIxY2I5MTFiYmM5MmRmYWIyOWJjN2M2MGEyZjA5YzRiN2E1ZGMzNWZlOTVmYzIxY2QxZQ==</ds:DigestValue>
                                                </xades:CertDigest>
                                                <xades:IssuerSerial>
                                                    <ds:X509IssuerName>CN=PEZEINVOICESCA4-CA, DC=extgazt, DC=gov, DC=local</ds:X509IssuerName>
                                                    <ds:X509SerialNumber>2676089521599993929322109729006092560898214287</ds:X509SerialNumber>
                                                </xades:IssuerSerial>
                                            </xades:Cert>
                                        </xades:SigningCertificate>
                                    </xades:SignedSignatureProperties>
                                </xades:SignedProperties>
                            </xades:QualifyingProperties>
                        </ds:Object>
                    </ds:Signature>
                </sac:SignatureInformation>
            </sig:UBLDocumentSignatures>
        </ext:ExtensionContent>
    </ext:UBLExtension>
</ext:UBLExtensions>
  <cbc:ProfileID>reporting:1.0</cbc:ProfileID>
  <cbc:ID>POS_Inv_15</cbc:ID>
  <cbc:UUID>26c6c536-d197-4fb3-bd12-20ccee9549e0</cbc:UUID>
  <cbc:IssueDate>2024-10-16</cbc:IssueDate>
  <cbc:IssueTime>03:32:00Z</cbc:IssueTime>
  <cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>
  <cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
  <cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
  <cac:AdditionalDocumentReference>
    <cbc:ID>ICV</cbc:ID>
    <cbc:UUID>15</cbc:UUID>
  </cac:AdditionalDocumentReference>
  <cac:AdditionalDocumentReference>
    <cbc:ID>PIH</cbc:ID>
    <cac:Attachment>
      <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">ffLmjOiIemMUseTozxoA1XkyO600KPEXKD06M3YG5NI=</cbc:EmbeddedDocumentBinaryObject>
    </cac:Attachment>
  </cac:AdditionalDocumentReference>
  <cac:AdditionalDocumentReference>
        <cbc:ID>QR</cbc:ID>
        <cac:Attachment>
            <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">AQ1PTEFZQSBDT01QQU5ZAg8zMDAwNTY3NjkzMDAwMDMDEzIwMjQtMTAtMTZUMDY6MzI6MDAEBjEwNS4wMAUFMTMuNzAGLE9YWEtJWmVNeWpyOEdRYWxiL3AwRWZwWlNUTlJJY0JOMkxvY3pGVm90NVU9B2BNRVlDSVFEeW8zVDFuL2k1SkVmQ3kwR21aME9Ja3Fxc0RwaHUxcUJIWEZwZVZicFVyd0loQUlHTHFtWFY5ZUladnNGRXRzMVl6cUNUNGdNcTNMNllMNkRkc2diS3ArbFkIWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABMKy8o59BIWD/eQvyd/1nj/SODMpqEDpTYLoXRPi66kc3AzNx6gckBTUhKs9FIWumGhhigQRRybVyxXDH1g/AtMJSDBGAiEAviUMK/Bk2KzBSIX9cblH0yQTQ8WABYuyzZS2mo0F2G4CIQDmcBevvofJmecCSyZwx+LSuxCHhI0DRw3EdWqrmJMmiQ==</cbc:EmbeddedDocumentBinaryObject>
        </cac:Attachment>
</cac:AdditionalDocumentReference><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><cac:AccountingSupplierParty>
    <cac:Party>
      <cac:PartyIdentification>
        <cbc:ID schemeID="CRN">4030121675</cbc:ID>
      </cac:PartyIdentification>
      <cac:PostalAddress>
        <cbc:StreetName>العليا</cbc:StreetName>
        <cbc:BuildingNumber>6356</cbc:BuildingNumber>
        <cbc:PlotIdentification>3910</cbc:PlotIdentification>
        <cbc:CitySubdivisionName>العليا</cbc:CitySubdivisionName>
        <cbc:CityName>الرياض | Riyadh</cbc:CityName>
        <cbc:PostalZone>13321</cbc:PostalZone>
        <cac:Country>
          <cbc:IdentificationCode>SA</cbc:IdentificationCode>
        </cac:Country>
      </cac:PostalAddress>
      <cac:PartyTaxScheme>
        <cbc:CompanyID>300056769300003</cbc:CompanyID>
        <cac:TaxScheme>
          <cbc:ID>VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:PartyTaxScheme>
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>OLAYA COMPANY</cbc:RegistrationName>
      </cac:PartyLegalEntity>
    </cac:Party>
  </cac:AccountingSupplierParty>
  <cac:AccountingCustomerParty>
    <cac:Party>
      <cac:PostalAddress>
        <cbc:StreetName>العليا</cbc:StreetName>
      </cac:PostalAddress>
      <cac:PartyTaxScheme>
        <cac:TaxScheme>
          <cbc:ID>VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:PartyTaxScheme>
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>Farhan Fasih</cbc:RegistrationName>
      </cac:PartyLegalEntity>
    </cac:Party>
  </cac:AccountingCustomerParty>
  <cac:TaxTotal>
    <cbc:TaxAmount currencyID="SAR">13.70</cbc:TaxAmount>
  </cac:TaxTotal>
  <cac:TaxTotal>
    <cbc:TaxAmount currencyID="SAR">13.70</cbc:TaxAmount>
    <cac:TaxSubtotal>
      <cbc:TaxableAmount currencyID="SAR">91.30</cbc:TaxableAmount>
      <cbc:TaxAmount currencyID="SAR">13.70</cbc:TaxAmount>
      <cac:TaxCategory>
        <cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
        <cbc:Percent>15.00</cbc:Percent>
        <cac:TaxScheme>
          <cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:TaxCategory>
    </cac:TaxSubtotal>
  </cac:TaxTotal>
  <cac:LegalMonetaryTotal>
    <cbc:LineExtensionAmount currencyID="SAR">91.30</cbc:LineExtensionAmount>
    <cbc:TaxExclusiveAmount currencyID="SAR">91.30</cbc:TaxExclusiveAmount>
    <cbc:TaxInclusiveAmount currencyID="SAR">105.00</cbc:TaxInclusiveAmount>
    <cbc:AllowanceTotalAmount currencyID="SAR">0.00</cbc:AllowanceTotalAmount>
    <cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
    <cbc:PayableAmount currencyID="SAR">105.00</cbc:PayableAmount>
  </cac:LegalMonetaryTotal>
  <cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">2.61</cbc:LineExtensionAmount>
    <cac:TaxTotal>
      <cbc:TaxAmount currencyID="SAR">0.39</cbc:TaxAmount>
      <cbc:RoundingAmount currencyID="SAR">3.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
      <cbc:Name>Pepsi</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">2.61</cbc:PriceAmount>
      <cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">0</cbc:Amount>
      </cac:AllowanceCharge>
    </cac:Price>
  </cac:InvoiceLine>
  <cac:InvoiceLine>
    <cbc:ID>2</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">15.65</cbc:LineExtensionAmount>
    <cac:TaxTotal>
      <cbc:TaxAmount currencyID="SAR">2.35</cbc:TaxAmount>
      <cbc:RoundingAmount currencyID="SAR">18.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
      <cbc:Name>Veg Biryani</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">15.65</cbc:PriceAmount>
      <cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">0</cbc:Amount>
      </cac:AllowanceCharge>
    </cac:Price>
  </cac:InvoiceLine>
  <cac:InvoiceLine>
    <cbc:ID>3</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">4</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">73.04</cbc:LineExtensionAmount>
    <cac:TaxTotal>
      <cbc:TaxAmount currencyID="SAR">10.96</cbc:TaxAmount>
      <cbc:RoundingAmount currencyID="SAR">84.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
      <cbc:Name>Supreme Veg Biryani Pack</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">18.26</cbc:PriceAmount>
      <cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">0</cbc:Amount>
      </cac:AllowanceCharge>
    </cac:Price>
  </cac:InvoiceLine>
</Invoice>

@Mudassir

try this code,
xmlDoc.PreserveWhitespace = true;

            XmlDocument xmlDoc = new XmlDocument();
            var s =new Zatca.EInvoice.SDK.EInvoiceSigner();
            string cert = File.ReadAllText(Global.eInvoiceData_Path + @"\ZatcaConfigFiles\Certificate.crt");
            string privateKey = File.ReadAllText(Global.eInvoiceData_Path + @"\ZatcaConfigFiles\pkey.pem");
            string PIH = File.ReadAllText(Global.eInvoiceData_Path + @"\ZatcaConfigFiles\pih.txt");
          xmlDoc.PreserveWhitespace = true;
            xmlDoc.Load(@"D:\yourxml.xml");
            var ss =s.SignDocument(xmlDoc, cert , privateKey);               
            var v = new Zatca.EInvoice.SDK.EInvoiceValidator();
            var results =  v.ValidateEInvoice(ss.SignedEInvoice, cert, PIH);

check the XML,
I just Sign and Validate it its working.

<?xml version="1.0" encoding="utf-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2"><ext:UBLExtensions>
    <ext:UBLExtension>
        <ext:ExtensionURI>urn:oasis:names:specification:ubl:dsig:enveloped:xades</ext:ExtensionURI>
        <ext:ExtensionContent>
            <sig:UBLDocumentSignatures xmlns:sig="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2" xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2" xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2">
                <sac:SignatureInformation>
                    <cbc:ID>urn:oasis:names:specification:ubl:signature:1</cbc:ID>
                    <sbc:ReferencedSignatureID>urn:oasis:names:specification:ubl:signature:Invoice</sbc:ReferencedSignatureID>
                    <ds:Signature Id="signature" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                        <ds:SignedInfo>
                            <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2006/12/xml-c14n11" />
                            <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256" />
                            <ds:Reference Id="invoiceSignedData" URI="">
                                <ds:Transforms>
                                    <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                        <ds:XPath>not(//ancestor-or-self::ext:UBLExtensions)</ds:XPath>
                                    </ds:Transform>
                                    <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                        <ds:XPath>not(//ancestor-or-self::cac:Signature)</ds:XPath>
                                    </ds:Transform>
                                    <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
                                        <ds:XPath>not(//ancestor-or-self::cac:AdditionalDocumentReference[cbc:ID='QR'])</ds:XPath>
                                    </ds:Transform>
                                    <ds:Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11" />
                                </ds:Transforms>
                                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                                <ds:DigestValue>3RNj8syuVLnytuBGrgqlP1QVn2PTkhZen7eopFI/JOE=</ds:DigestValue>
                            </ds:Reference>
                            <ds:Reference Type="http://www.w3.org/2000/09/xmldsig#SignatureProperties" URI="#xadesSignedProperties">
                                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                                <ds:DigestValue>YmZjNmE4NDc1MDRjYTE4ZTQ2ZDNhZDVjZDI2ODYwMDQwNjFkNmI4YzdiNmEzYTI3ZTI5NDVmZTljNWM5ZTNhMA==</ds:DigestValue>
                            </ds:Reference>
                        </ds:SignedInfo>
                        <ds:SignatureValue>MEQCICtDUjzt65nhf35/qRYXu3uYDC5HeLUAaB8SowAmIOFFAiA4lsh+YugMr2NAmPwNtW8wQqFl/GJYOKVuY8vv/l7kfg==</ds:SignatureValue>
                        <ds:KeyInfo>
                            <ds:X509Data>
                                <ds:X509Certificate>MIIFLTCCBNKgAwIBAgITegAAT1YbGELPLmdpGgABAABPVjAKBggqhkjOPQQDAjBiMRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxEzARBgoJkiaJk/IsZAEZFgNnb3YxFzAVBgoJkiaJk/IsZAEZFgdleHRnYXp0MRswGQYDVQQDExJQRVpFSU5WT0lDRVNDQTMtQ0EwHhcNMjQwOTE5MDczMDUwWhcNMjYwOTE5MDc0MDUwWjBfMQswCQYDVQQGEwJTQTEmMCQGA1UEChMdQXdhbCBFcXVpcG1lbnQgSGlyaW5nIENvbXBhbnkxEjAQBgNVBAsTCUF3YWxCYW5jaDEUMBIGA1UEAxMLVjczNzcxN1RFU1QwVjAQBgcqhkjOPQIBBgUrgQQACgNCAARqVVnSboXamRsVue+zvE/RVd1/3rUD587hBxPmhqd2AHUfMwk5D69vN+re4seRChdeILBm9eb3d9RMU5I1Y7yco4IDazCCA2cwgdUGA1UdEQSBzTCByqSBxzCBxDFbMFkGA1UEB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BgEFBQcDAzAnBgkrBgEEAYI3FQoEGjAYMAoGCCsGAQUFBwMCMAoGCCsGAQUFBwMDMAoGCCqGSM49BAMCA0kAMEYCIQDcPgqvsTiEBfgXm2bQaPs4rTjrEIAbyItx070DQ3/i5gIhAJxZXWjo+cjU0gMcwmkakgnkJEKm7Lxa7e9mswjqrRmp</ds:X509Certificate>
                            </ds:X509Data>
                        </ds:KeyInfo>
                        <ds:Object>
                            <xades:QualifyingProperties Target="signature" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#">
                                <xades:SignedProperties Id="xadesSignedProperties">
                                    <xades:SignedSignatureProperties>
                                        <xades:SigningTime>2024-10-16T14:28:17</xades:SigningTime>
                                        <xades:SigningCertificate>
                                            <xades:Cert>
                                                <xades:CertDigest>
                                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                                                    <ds:DigestValue>NjA5ZjMwNjlkZTBiZjIyMDcwZTM4NGZkMzc0N2M4NGM2YTQ5OTc0OWI1MmE2Yjg2ZTJmOTc2YjU2YTE5NmFlNw==</ds:DigestValue>
                                                </xades:CertDigest>
                                                <xades:IssuerSerial>
                                                    <ds:X509IssuerName>CN=PEZEINVOICESCA3-CA, DC=extgazt, DC=gov, DC=local</ds:X509IssuerName>
                                                    <ds:X509SerialNumber>2720691019676834767321383131478249469464563542</ds:X509SerialNumber>
                                                </xades:IssuerSerial>
                                            </xades:Cert>
                                        </xades:SigningCertificate>
                                    </xades:SignedSignatureProperties>
                                </xades:SignedProperties>
                            </xades:QualifyingProperties>
                        </ds:Object>
                    </ds:Signature>
                </sac:SignatureInformation>
            </sig:UBLDocumentSignatures>
        </ext:ExtensionContent>
    </ext:UBLExtension>
</ext:UBLExtensions>
  
  <cbc:ProfileID>reporting:1.0</cbc:ProfileID>
  <cbc:ID>POS_Inv_15</cbc:ID>
  <cbc:UUID>26c6c536-d197-4fb3-bd12-20ccee9549e0</cbc:UUID>
  <cbc:IssueDate>2024-10-16</cbc:IssueDate>
  <cbc:IssueTime>03:32:00Z</cbc:IssueTime>
  <cbc:InvoiceTypeCode name="0200000">388</cbc:InvoiceTypeCode>
  <cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
  <cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode>
  <cac:AdditionalDocumentReference>
    <cbc:ID>ICV</cbc:ID>
    <cbc:UUID>15</cbc:UUID>
  </cac:AdditionalDocumentReference>
  <cac:AdditionalDocumentReference>
    <cbc:ID>PIH</cbc:ID>
    <cac:Attachment>
      <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">ffLmjOiIemMUseTozxoA1XkyO600KPEXKD06M3YG5NI=</cbc:EmbeddedDocumentBinaryObject>
    </cac:Attachment>
  </cac:AdditionalDocumentReference>
  <cac:AdditionalDocumentReference>
        <cbc:ID>QR</cbc:ID>
        <cac:Attachment>
            <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">AQ1PTEFZQSBDT01QQU5ZAg8zMDAwNTY3NjkzMDAwMDMDEzIwMjQtMTAtMTZUMDY6MzI6MDAEBjEwNS4wMAUFMTMuNzAGLDNSTmo4c3l1VkxueXR1QkdyZ3FsUDFRVm4yUFRraFplbjdlb3BGSS9KT0U9B2BNRVFDSUN0RFVqenQ2NW5oZjM1L3FSWVh1M3VZREM1SGVMVUFhQjhTb3dBbUlPRkZBaUE0bHNoK1l1Z01yMk5BbVB3TnRXOHdRcUZsL0dKWU9LVnVZOHZ2L2w3a2ZnPT0IWDBWMBAGByqGSM49AgEGBSuBBAAKA0IABGpVWdJuhdqZGxW577O8T9FV3X/etQPnzuEHE+aGp3YAdR8zCTkPr2836t7ix5EKF14gsGb15vd31ExTkjVjvJwJSDBGAiEA3D4Kr7E4hAX4F5tm0Gj7OK046xCAG8iLcdO9A0N/4uYCIQCcWV1o6PnI1NIDHMJpGpIJ5CRCpuy8Wu3vZrMI6q0ZqQ==</cbc:EmbeddedDocumentBinaryObject>
        </cac:Attachment>
</cac:AdditionalDocumentReference><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><cac:AccountingSupplierParty>
    <cac:Party>
      <cac:PartyIdentification>
        <cbc:ID schemeID="CRN">4030121675</cbc:ID>
      </cac:PartyIdentification>
      <cac:PostalAddress>
        <cbc:StreetName>العليا</cbc:StreetName>
        <cbc:BuildingNumber>6356</cbc:BuildingNumber>
        <cbc:PlotIdentification>3910</cbc:PlotIdentification>
        <cbc:CitySubdivisionName>العليا</cbc:CitySubdivisionName>
        <cbc:CityName>الرياض | Riyadh</cbc:CityName>
        <cbc:PostalZone>13321</cbc:PostalZone>
        <cac:Country>
          <cbc:IdentificationCode>SA</cbc:IdentificationCode>
        </cac:Country>
      </cac:PostalAddress>
      <cac:PartyTaxScheme>
        <cbc:CompanyID>300056769300003</cbc:CompanyID>
        <cac:TaxScheme>
          <cbc:ID>VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:PartyTaxScheme>
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>OLAYA COMPANY</cbc:RegistrationName>
      </cac:PartyLegalEntity>
    </cac:Party>
  </cac:AccountingSupplierParty>
  <cac:AccountingCustomerParty>
    <cac:Party>
      <cac:PostalAddress>
        <cbc:StreetName>العليا</cbc:StreetName>
      </cac:PostalAddress>
      <cac:PartyTaxScheme>
        <cac:TaxScheme>
          <cbc:ID>VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:PartyTaxScheme>
      <cac:PartyLegalEntity>
        <cbc:RegistrationName>Farhan Fasih</cbc:RegistrationName>
      </cac:PartyLegalEntity>
    </cac:Party>
  </cac:AccountingCustomerParty>
  <cac:TaxTotal>
    <cbc:TaxAmount currencyID="SAR">13.70</cbc:TaxAmount>
  </cac:TaxTotal>
  <cac:TaxTotal>
    <cbc:TaxAmount currencyID="SAR">13.70</cbc:TaxAmount>
    <cac:TaxSubtotal>
      <cbc:TaxableAmount currencyID="SAR">91.30</cbc:TaxableAmount>
      <cbc:TaxAmount currencyID="SAR">13.70</cbc:TaxAmount>
      <cac:TaxCategory>
        <cbc:ID schemeID="UN/ECE 5305" schemeAgencyID="6">S</cbc:ID>
        <cbc:Percent>15.00</cbc:Percent>
        <cac:TaxScheme>
          <cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID>
        </cac:TaxScheme>
      </cac:TaxCategory>
    </cac:TaxSubtotal>
  </cac:TaxTotal>
  <cac:LegalMonetaryTotal>
    <cbc:LineExtensionAmount currencyID="SAR">91.30</cbc:LineExtensionAmount>
    <cbc:TaxExclusiveAmount currencyID="SAR">91.30</cbc:TaxExclusiveAmount>
    <cbc:TaxInclusiveAmount currencyID="SAR">105.00</cbc:TaxInclusiveAmount>
    <cbc:AllowanceTotalAmount currencyID="SAR">0.00</cbc:AllowanceTotalAmount>
    <cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
    <cbc:PayableAmount currencyID="SAR">105.00</cbc:PayableAmount>
  </cac:LegalMonetaryTotal>
  <cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">2.61</cbc:LineExtensionAmount>
    <cac:TaxTotal>
      <cbc:TaxAmount currencyID="SAR">0.39</cbc:TaxAmount>
      <cbc:RoundingAmount currencyID="SAR">3.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
      <cbc:Name>Pepsi</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">2.61</cbc:PriceAmount>
      <cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">0</cbc:Amount>
      </cac:AllowanceCharge>
    </cac:Price>
  </cac:InvoiceLine>
  <cac:InvoiceLine>
    <cbc:ID>2</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">1</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">15.65</cbc:LineExtensionAmount>
    <cac:TaxTotal>
      <cbc:TaxAmount currencyID="SAR">2.35</cbc:TaxAmount>
      <cbc:RoundingAmount currencyID="SAR">18.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
      <cbc:Name>Veg Biryani</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">15.65</cbc:PriceAmount>
      <cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">0</cbc:Amount>
      </cac:AllowanceCharge>
    </cac:Price>
  </cac:InvoiceLine>
  <cac:InvoiceLine>
    <cbc:ID>3</cbc:ID>
    <cbc:InvoicedQuantity unitCode="PCE">4</cbc:InvoicedQuantity>
    <cbc:LineExtensionAmount currencyID="SAR">73.04</cbc:LineExtensionAmount>
    <cac:TaxTotal>
      <cbc:TaxAmount currencyID="SAR">10.96</cbc:TaxAmount>
      <cbc:RoundingAmount currencyID="SAR">84.00</cbc:RoundingAmount>
    </cac:TaxTotal>
    <cac:Item>
      <cbc:Name>Supreme Veg Biryani Pack</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">18.26</cbc:PriceAmount>
      <cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">0</cbc:Amount>
      </cac:AllowanceCharge>
    </cac:Price>
  </cac:InvoiceLine>
</Invoice>
1 Like

Thank you soo much @Ather the error which i was facing earlier is complete gone now, i am able to report the invoice, but the EN Schematron validation and KSA Schematron validation is still showing as false to me. is there any way to fix it, or i can just move ahead without resolving the issue, as i am able to report the invoices now

Is it Warning in Validation? I didn’t receive any warning when i validate it.
kindly share the screenshot or exact message and code

1 Like

I am currently using the debugger to check the validate function, in there i was able to see that the KSA and EN schematrons is failed

Check the Overall Status and please expend the ErrorMessages to see the Exact Error

image

@Mudassir ,
What version SDK do you use?
Version 3.3.3 .NetFx 4.8 eInvoice Validation is work well.

then maybe i am missing some nodes in my xml, i will once again have a detailed look.
the below is the error i am getting, and using the latest SDK version 3.3.5

@Mudassir
I also got the same validation issue for .Net Framework 4.8 on SDK version 3.3.4 and 3.3.5.
This is not a big deal because the Integration still works fine without using the validation feature of the SDK.

@ather
Are you using .Net Framework 4.8 with SDK version 3.3.5 in the example you provided?

If yes, can you please share how you setup your project please…

@eCloud I am using 4.7.2 and with SDK 3.3.3

After Sign the Invoice. Generate Hash . and Replace the Generated Hash With The Hash in XML . and Send This Hash

how do zatca-envoice-sdk-203 this sdk run…which tool is correct use this sdk …?

“I checked the README file, but when I opened the command prompt to run install.bat, my PC showed an error.”

Thanks man this really solved a problem that persisted for more than 6 months, you are legend :slight_smile: