-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General Rules Errors #40
Comments
I would recommend just look into the XML and understand why it is not valid... it can be that XML is not properly generated for multiple line items, that is why you are getting the "generic error" p.s. if you have your XML, you can send it to me and I can try to find what is wrong with line items... You can send me only |
Below is the xml which is getting passed in sandbox and not failed while sending it with API.
|
Because of truncated input, I cannot understand if it is a simplified invoice or ordinary invoice. I can see that customer party is present, therefore I can assume it is Invoice (388) with subtype (01). Could you elaborate and send exactly what kind of error you are getting from API when you are trying to submit it? EDIT: also for this part: <cac:Price>
<cbc:PriceAmount currencyID="SAR">1250</cbc:PriceAmount>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:AllowanceChargeReason></cbc:AllowanceChargeReason>
<cbc:Amount currencyID="SAR">0</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price> I can think that Zatca can raise the validation error or any error as in their specification they have this business rule (BR-KSA-F-03) and you have empty element
Please note: the second line item in your example does not have this "EMPTY" discount |
@mustafa9229 from the zatca test submission I can see they return 500 error, meaning they have bugs on their side and it is just the unhandled exception on their end. Regarding the errors on the browser console, you should just go through every error reported and check/fix it. Seems that your line_amount calculation is incorrect (I do not know your payload). Regarding the first error, it is generic error meaning that your XML is not valid somewhere... |
The XML I used is for a Simplified Invoice
|
lets taka a single line calculation :
For the above xml i am getting the following error..
|
@mustafa9229 <cac:TaxTotal>
<cbc:TaxAmount currencyID="SAR">5218.5</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="SAR">12250</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="SAR">1837.5</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
<cbc:Percent>15</cbc:Percent>
<cac:TaxScheme>
<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="SAR">22540</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="SAR">3381</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5305">S</cbc:ID>
<cbc:Percent>15</cbc:Percent>
<cac:TaxScheme>
<cbc:ID schemeAgencyID="6" schemeID="UN/ECE 5153">VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal> According to the documentation every Breakdown should be specified only once and the amount should be a SUM Regarding the second one: <cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="PCE">44.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="SAR">968.00</cbc:LineExtensionAmount>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="SAR">145.20</cbc:TaxAmount>
<cbc:RoundingAmount currencyID="SAR">1113.20</cbc:RoundingAmount>
</cac:TaxTotal>
<cac:Item>
<cbc:Name>dsd</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">22.00</cbc:PriceAmount>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:AllowanceChargeReason>discount</cbc:AllowanceChargeReason>
<cbc:Amount currencyID="SAR">2.00</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price>
</cac:InvoiceLine> As you can see |
I wanted to inform you all that XML is getting validated on the sandbox test xml site. However, the same data is not accepted by Zatca. The strange part is that when I add only one line item, Zatca is accepting the invoice . On the other hand, when I add more than one line item, Zatca is throwing me some general business rules error. Fortunately, the XML for the same invoice which has multiple line items is accepted by the sandbox test portal xml validator.
Please let me know if anyone is facing the same problem. The problem is clear – for one line item invoices I am getting the response perfectly, but for multiple line items it is not accepting and throwing the business rules errors
The text was updated successfully, but these errors were encountered: