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

@Support-at-ERPgulf Thanks for your valuable response. In invoice screen there is no errors i got success 200 message only. After getting success and the generated xml file validation in zatca sandbox portal only i got the error. Ok Fine

200 OK is final . good to know it all worked for you finally :slight_smile:

@Support-at-ERPgulf Yeah Thank you. Actually we have done the same process for phase 2 in codeigniter but while validating xml for simplified invoice we are not getting any errors. Thats why we suggest you to check on these errors.
The same thing i did for standard invoice xml generated with your code in zatca validation its getting validated with no errors.

Try to validate QR with zatca mobile app as well. if you get any error let me know

@Support-at-ERPgulf I have scanned the the qr with qrksareader its showing compatible. no issues. I will check with official zatca app and let you know.

@Support-at-ERPgulf any idea on creating debit note against sales invoice which is needed for phase 2 on saudi arabia? as zatca is checking for the system to bill both credit note and debit note against sales invoice but in the erpnext do we have an option to create debit note against sales invoice?

Its accountants to decide whether they are issuing debit-note against invoices. Not common.
Btw, do you have sample XML with line-discounts.?

@Support-at-ERPgulf Thanks for your valuable and timely response. Suppose the accountants has decided to issue debit for a sales invoice which is amount entered wrongly or in some other scenarios like sudden increment in sale price or something. how the accountants will create the debit note for that which has to be send to zatca for compliance? Also in your settings you have provided an option to select simplified and standard debit note for checking compliance. Which is the invoice you are looking for? is it from purchase debit note?

1-For compliance test, we use same invoice, but internally changing code. Its not actual debit-note
2-ERPNext needs customization to issue debit note against Invoice.

Btw, do you have sample XML with line-discounts.?

@Support-at-ERPgulf Yes I am attaching the xml with line-discounts it with this message.

<?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 xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="signature">
                        <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>Rg5ftr1f+4XWLQnhOBop7prGRnE6d39SEYZfFzVx+Bk=</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>OGU1NTRiNjBkZDc4ZmFkOTNlMjg2MWE5OGMxNjEzYjI4Yjc2NjkxMTA2ZDA0YmZlMjZjZDFmYzdhYzJkZjJiYg==</ds:DigestValue>
                            </ds:Reference>
                        </ds:SignedInfo>
                        <ds:SignatureValue>MEYCIQDBtGM1tYEH1+5LSBuKazuSv0fpE52h3zmMW8/gX623qwIhAIpQwQ0GrKaMB3WDLKjtx8WI1RQIGmJIQbAgUpK9hJfE</ds:SignatureValue>
                        <ds:KeyInfo>
                            <ds:X509Data>
                                <ds:X509Certificate>MIID3jCCA4SgAwIBAgITEQAAOAPF90Ajs/xcXwABAAA4AzAKBggqhkjOPQQDAjBiMRUwEwYKCZImiZPyLGQBGRYFbG9jYWwxEzARBgoJkiaJk/IsZAEZFgNnb3YxFzAVBgoJkiaJk/IsZAEZFgdleHRnYXp0MRswGQYDVQQDExJQUlpFSU5WT0lDRVNDQTQtQ0EwHhcNMjQwMTExMDkxOTMwWhcNMjkwMTA5MDkxOTMwWjB1MQswCQYDVQQGEwJTQTEmMCQGA1UEChMdTWF4aW11bSBTcGVlZCBUZWNoIFN1cHBseSBMVEQxFjAUBgNVBAsTDVJpeWFkaCBCcmFuY2gxJjAkBgNVBAMTHVRTVC04ODY0MzExNDUtMzk5OTk5OTk5OTAwMDAzMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEoWCKa0Sa9FIErTOv0uAkC1VIKXxU9nPpx2vlf4yhMejy8c02XJblDq7tPydo8mq0ahOMmNo8gwni7Xt1KT9UeKOCAgcwggIDMIGtBgNVHREEgaUwgaKkgZ8wgZwxOzA5BgNVBAQMMjEtVFNUfDItVFNUfDMtZWQyMmYxZDgtZTZhMi0xMTE4LTliNTgtZDlhOGYxMWU0NDVmMR8wHQYKCZImiZPyLGQBAQwPMzk5OTk5OTk5OTAwMDAzMQ0wCwYDVQQMDAQxMTAwMREwDwYDVQQaDAhSUlJEMjkyOTEaMBgGA1UEDwwRU3VwcGx5IGFjdGl2aXRpZXMwHQYDVR0OBBYEFEX+YvmmtnYoDf9BGbKo7ocTKYK1MB8GA1UdIwQYMBaAFJvKqqLtmqwskIFzVvpP2PxT+9NnMHsGCCsGAQUFBwEBBG8wbTBrBggrBgEFBQcwAoZfaHR0cDovL2FpYTQuemF0Y2EuZ292LnNhL0NlcnRFbnJvbGwvUFJaRUludm9pY2VTQ0E0LmV4dGdhenQuZ292LmxvY2FsX1BSWkVJTlZPSUNFU0NBNC1DQSgxKS5jcnQwDgYDVR0PAQH/BAQDAgeAMDwGCSsGAQQBgjcVBwQvMC0GJSsGAQQBgjcVCIGGqB2E0PsShu2dJIfO+xnTwFVmh/qlZYXZhD4CAWQCARIwHQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMCMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwMwCgYIKwYBBQUHAwIwCgYIKoZIzj0EAwIDSAAwRQIhALE/ichmnWXCUKUbca3yci8oqwaLvFdHVjQrveI9uqAbAiA9hC4M8jgMBADPSzmd2uiPJA6gKR3LE03U75eqbC/rXA==</ds:X509Certificate>
                            </ds:X509Data>
                        </ds:KeyInfo>
                        <ds:Object>
                            <xades:QualifyingProperties xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" Target="signature">
                                <xades:SignedProperties Id="xadesSignedProperties">
                                    <xades:SignedSignatureProperties>
                                        <xades:SigningTime>2024-08-28T12:13:11</xades:SigningTime>
                                        <xades:SigningCertificate>
                                            <xades:Cert>
                                                <xades:CertDigest>
                                                    <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
                                                    <ds:DigestValue>ZDMwMmI0MTE1NzVjOTU2NTk4YzVlODhhYmI0ODU2NDUyNTU2YTVhYjhhMDFmN2FjYjk1YTA2OWQ0NjY2MjQ4NQ==</ds:DigestValue>
                                                </xades:CertDigest>
                                                <xades:IssuerSerial>
                                                    <ds:X509IssuerName>CN=PRZEINVOICESCA4-CA, DC=extgazt, DC=gov, DC=local</ds:X509IssuerName>
                                                    <ds:X509SerialNumber>379112742831380471835263969587287663520528387</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>INV/011</cbc:ID>
    <cbc:UUID>3de5f17d-c480-4935-9486-136365b66f49</cbc:UUID>
    <cbc:IssueDate>2024-08-28</cbc:IssueDate>
    <cbc:IssueTime>12:06:06</cbc:IssueTime>
    <cbc:InvoiceTypeCode name="0100000">388</cbc:InvoiceTypeCode>
    <cbc:DocumentCurrencyCode>SAR</cbc:DocumentCurrencyCode>
    <cbc:TaxCurrencyCode>SAR</cbc:TaxCurrencyCode><cac:AdditionalDocumentReference>
        <cbc:ID>ICV</cbc:ID>
        <cbc:UUID>105</cbc:UUID>
    </cac:AdditionalDocumentReference>
    <cac:AdditionalDocumentReference>
        <cbc:ID>PIH</cbc:ID>
        <cac:Attachment>
            <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">LsBApcuR1Eal+0S9nxwHc0M37GnXS+UotOJpjPYaL2I=</cbc:EmbeddedDocumentBinaryObject>
        </cac:Attachment>
    </cac:AdditionalDocumentReference><cac:AdditionalDocumentReference>
        <cbc:ID>QR</cbc:ID>
        <cac:Attachment>
            <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">ATbYtNix2YPYqSDYudiv2YQg2KfZhNiu2YTZitisINmE2LTYqNmD2KfYqiAgfCBBREFMIEdVTEYCDzM5OTk5OTk5OTkwMDAwMwMTMjAyNC0wOC0yOFQxMjowNjowNgQGMTEwLjAwBQUxNC4zNQYsUmc1ZnRyMWYrNFhXTFFuaE9Cb3A3cHJHUm5FNmQzOVNFWVpmRnpWeCtCaz0HYE1FWUNJUURCdEdNMXRZRUgxKzVMU0J1S2F6dVN2MGZwRTUyaDN6bU1XOC9nWDYyM3F3SWhBSXBRd1EwR3JLYU1CM1dETEtqdHg4V0kxUlFJR21KSVFiQWdVcEs5aEpmRQhYMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEoWCKa0Sa9FIErTOv0uAkC1VIKXxU9nPpx2vlf4yhMejy8c02XJblDq7tPydo8mq0ahOMmNo8gwni7Xt1KT9UeA==</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">2055134209</cbc:ID>
            </cac:PartyIdentification>
            <cac:PostalAddress>
                <cbc:StreetName>  شارع الفهد | Al-Fahadh Street</cbc:StreetName>
                <cbc:BuildingNumber>8596</cbc:BuildingNumber>
                <cbc:CitySubdivisionName>  مدينة الجبيل | Jubail City</cbc:CitySubdivisionName>
                <cbc:CityName>  الدمام | Dammam</cbc:CityName>
                <cbc:PostalZone>65656</cbc:PostalZone>
                <cac:Country>
                    <cbc:IdentificationCode>SA</cbc:IdentificationCode>
                </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
                <cbc:CompanyID>399999999900003</cbc:CompanyID>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:PartyLegalEntity>
                <cbc:RegistrationName>شركة عدل الخليج لشبكات  | ADAL GULF</cbc:RegistrationName>
            </cac:PartyLegalEntity>
        </cac:Party>
    </cac:AccountingSupplierParty><cac:AccountingCustomerParty>
        <cac:Party>
            <cac:PostalAddress>
                <cbc:StreetName>
 

 
شارع ١ | street 1</cbc:StreetName>
                <cbc:BuildingNumber>7896</cbc:BuildingNumber>
                <cbc:CitySubdivisionName>
 

 
الجبيل | Al Jubail</cbc:CitySubdivisionName>
                <cbc:CityName>
 

 
الجبيل | Jubail</cbc:CityName>
                <cbc:PostalZone>45632</cbc:PostalZone>
                <cac:Country>
                    <cbc:IdentificationCode>SA</cbc:IdentificationCode>
                </cac:Country>
            </cac:PostalAddress>
            <cac:PartyTaxScheme>
             <cbc:CompanyID>300000000000003</cbc:CompanyID>
                <cac:TaxScheme>
                    <cbc:ID>VAT</cbc:ID>
                </cac:TaxScheme>
            </cac:PartyTaxScheme>
            <cac:PartyLegalEntity>
                <cbc:RegistrationName> | Prasanth</cbc:RegistrationName>
            </cac:PartyLegalEntity>
        </cac:Party>
    </cac:AccountingCustomerParty><cac:Delivery>
        <cbc:ActualDeliveryDate>2024-08-28</cbc:ActualDeliveryDate>
    </cac:Delivery>
    <cac:PaymentMeans>
        <cbc:PaymentMeansCode>10</cbc:PaymentMeansCode></cac:PaymentMeans>
    <cac:AllowanceCharge>
        <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">2.00</cbc:Amount>
        <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:AllowanceCharge><cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReasonCode>RV</cbc:AllowanceChargeReasonCode>
        <cbc:AllowanceChargeReason>Loading Charge</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">4.00</cbc:Amount>
        <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:AllowanceCharge><cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReasonCode>SAA</cbc:AllowanceChargeReasonCode>
        <cbc:AllowanceChargeReason>Shipping Charge</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">10.00</cbc:Amount>
        <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:AllowanceCharge><cac:AllowanceCharge>
        <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
        <cbc:AllowanceChargeReasonCode>ADR</cbc:AllowanceChargeReasonCode>
        <cbc:AllowanceChargeReason>Other Charges</cbc:AllowanceChargeReason>
        <cbc:Amount currencyID="SAR">3.00</cbc:Amount>
        <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:AllowanceCharge><cac:TaxTotal>
        <cbc:TaxAmount currencyID="SAR">14.35</cbc:TaxAmount>
    </cac:TaxTotal>
    <cac:TaxTotal>
        <cbc:TaxAmount currencyID="SAR">14.35</cbc:TaxAmount>
        <cac:TaxSubtotal>
            <cbc:TaxableAmount currencyID="SAR">95.65</cbc:TaxableAmount>
            <cbc:TaxAmount currencyID="SAR">14.35</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">80.65</cbc:LineExtensionAmount>
        <cbc:TaxExclusiveAmount currencyID="SAR">95.65</cbc:TaxExclusiveAmount>
        <cbc:TaxInclusiveAmount currencyID="SAR">110.00</cbc:TaxInclusiveAmount>
        <cbc:AllowanceTotalAmount currencyID="SAR">2.00</cbc:AllowanceTotalAmount>
        <cbc:ChargeTotalAmount currencyID="SAR">17.00</cbc:ChargeTotalAmount><cbc:PrepaidAmount currencyID="SAR">0.00</cbc:PrepaidAmount>
        <cbc:PayableRoundingAmount currencyID="SAR">0.00</cbc:PayableRoundingAmount>
        <cbc:PayableAmount currencyID="SAR">110.00</cbc:PayableAmount>
    </cac:LegalMonetaryTotal><cac:InvoiceLine>
        <cbc:ID>1</cbc:ID>
        <cbc:InvoicedQuantity unitCode="PCE">1.000</cbc:InvoicedQuantity>
        <cbc:LineExtensionAmount currencyID="SAR">38.48</cbc:LineExtensionAmount>
        <cac:TaxTotal>
             <cbc:TaxAmount currencyID="SAR">5.77</cbc:TaxAmount>
             <cbc:RoundingAmount currencyID="SAR">44.25</cbc:RoundingAmount>
        </cac:TaxTotal>
        <cac:Item>
            <cbc:Name>  البند 1 | item 1</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">38.48</cbc:PriceAmount>
            <cbc:BaseQuantity unitCode="PCE">1</cbc:BaseQuantity>
            <cac:AllowanceCharge>
               <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
               <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
               <cbc:Amount currencyID="SAR">5.00</cbc:Amount>
            </cac:AllowanceCharge>
        </cac:Price>
    </cac:InvoiceLine><cac:InvoiceLine>
        <cbc:ID>2</cbc:ID>
        <cbc:InvoicedQuantity unitCode="PCE">1.000</cbc:InvoicedQuantity>
        <cbc:LineExtensionAmount currencyID="SAR">42.17</cbc:LineExtensionAmount>
        <cac:TaxTotal>
             <cbc:TaxAmount currencyID="SAR">6.33</cbc:TaxAmount>
             <cbc:RoundingAmount currencyID="SAR">48.50</cbc:RoundingAmount>
        </cac:TaxTotal>
        <cac:Item>
            <cbc:Name>  البند 2 | item 2</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">42.17</cbc:PriceAmount>
            <cbc:BaseQuantity unitCode="PCE">1</cbc:BaseQuantity>
            <cac:AllowanceCharge>
               <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
               <cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
               <cbc:Amount currencyID="SAR">10.00</cbc:Amount>
            </cac:AllowanceCharge>
        </cac:Price>
    </cac:InvoiceLine></Invoice>

Here is the one which asked for. Also i suggest you check on the error which i have raised before that while validating the simplified sales invoice getting errors from zatca

E-invoice-ACC-SINV-2024-00010.xml

Valid : false

Errors
category : QR_CODE_ERROR
code :QRCODE_INVALID
message : Invalid QR code format, Please follow the ZATCA QR code specifications
category : SIGNATURE_ERROR
code :invoiceSignedDataDigestValue
message : wrong invoice hashing
category : SIGNATURE_ERROR
code :X509IssuerName
message : wrong X509IssuerName  
category : XSD_SCHEMA_ERROR
code :SAXParseException
message : Schema validation failed; XML does not comply with UBL 2.1 standards in line with ZATCA specifications. ERROR: org.xml.sax.SAXParseException; lineNumber: 90; columnNumber: 124; cvc-datatype-valid.1.2.1: 'GsiuvGjvchjbFhibcDhjv1886G' is not a valid value for 'base64Binary'.
category : SIGNATURE_ERROR
code :xadesSignedPropertiesDigestValue
message : wrong xadesSignedPropertiesDigestValue  
category : SIGNATURE_ERROR
code :X509SerialNumber
message : wrong X509SerialNumber  
category : SIGNATURE_ERROR
code :signatureValue
message : wrong signature Value

this errors can be solved it seems i dont know exactly as we also got this same errors in codeigniter but now it is solved as we validated our simplified sales invoice to zatca we are getting cleared. This is my suggestion to remove the future issues from zatca.

Can I integrate Two Companies in simulation with same Tax Id ?

on simulation, YES

same thing for production or different ?

For production, you invoice has to be posted from respective company VAT number. Otherwise there will be an accounting mismatch. If both company using same VAT, there may be a group VAT ID. check with your zatca account manager

We have added a field in company doctype to accommodate CR Number. Please make sure you fill the field with company CR , otherwise will get following warning from Zatca .

{“validationResults”:{“infoMessages”:[{“type”:“INFO”,“code”:“XSD_ZATCA_VALID”,“category”:“XSD validation”,“message”:“Complied with UBL 2.1 standards in line with ZATCA specifications”,“status”:“PASS”}],“warningMessages”:[{“type”:“WARNING”,“code”:“BR-KSA-08”,“category”:“KSA”,“message”:“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.”,“status”:“WARNING”}],“errorMessages”:,“status”:“WARNING”}

Hello,

While trying to generate the CSR and after entering the OTP we got the following message:

image (3)

Your help is greatly appreciated.

In the latest version, we are not using “zatca erpgulf” setting page . Instead we use zatca setting page inside company doctype. This we have done for easyness to setup multi company.
so in the CSR config page, enter the values like following

csr.common.name=TST-886431145-399999999900003
csr.serial.number=1-TST|2-TST|3-ed22f1d8-e6a2-1118-9b58-d9a8f11e874f
csr.organization.identifier=399999999900003
csr.organization.unit.name=399999999900003
csr.organization.name=Test Company LTD
csr.country.name=SA
csr.invoice.type=1100
csr.location.address=RIYADH
csr.industry.business.category=Testing zatca

I am using the ZATCA settings in the company doctype.
What I’ve done was to acquire the OTP and input it in the designated field and then click on the “Create CSR” button.
Is there something I am missing…? Did I do something wrong?

Just to clarify… I was originally following along with the video mentioned on your Git page but had already been informed that all settings need to be set through the company doctype and started doing exactly that when the error happened.

My understanding is that I only needed to provide the “OTP” and “pih” and that would be enough to generate the CSR…

for creating CSR, you dont need OTP. If is for compliance-CSID creation.

For CSR creation , you just need CSR-config