Rounding issue causes BR-CO-15 violation

Hi dear ZATCA

We have a rounding issues which are caused the failures with ERROR status now. We would like to ask how to solve these (and similar) issues going forward.

The following numbers we got after calculation (not rounded)

TaxTotal.TaxAmount: 208.321956525  (208.32 in XML)
TaxExclusiveAmount: 1388.813043500 (1388.81 in XML)
TaxInclusiveAmount: 1597.135000025 (1597.14 in XML)

208.321956525 + 1388.813043500 == 1597.135000025
208.32 + 1388.81 != 1597.14

The question is: how we should handle this situation? Please note that it can happen on any other level which will end up in non-matching total/sum

According to the documentation the rounding should be applied on final value (as late as possible). We are applying rounding on final values when constructing XML. But in some cases we are getting these errors. Sometimes it is Warning (if mismatch in TaxTotal) and now it is Error (mismatch in TaxInclusiveAmount)

These are the official rounding rules:

Rules to minimize the risk of differences due to rounding as illustrated in the examples are:

  • All document level totals shall be rounded to two decimals for accounting;
  • Rounding shall be done on the final calculation results not on any intermediate results;
  • VAT category tax amount (BT-110) shall be rounded on document level and not as a summation of rounded Invoice line VAT amounts.

Error we are getting:

...
"errorMessages": [
    {
        "type": "ERROR",
        "code": "BR-CO-15",
        "category": "EN_16931",
        "message": "Invoice total amount with VAT (BT-112) ",
        "status": "ERROR"
    }
],
...

Best regards,
Sergei

Just as a follow up, now we have implemented proper rounding rules on our end and now all the calculations matches exactly how ZATCA is doing their calculations.
In the latest document it is stated that price and all it’s calculation is not rounded, but tax_percent and and resulting InvoiceLine amount is rounded to 2 decimals (according to the documents).

If someone have also some rounding issues, please follow the documentation and round on your end the same way how ZATCA rounding (what you send in XML as ZATCA will have only this data for calculations)

Best regards,
Sergei

which document?? please share the link to the document.

From the last document I have for reference,
UNit Price and Qty fields do not have any restrictions on the decimals.
the product of both these and all following amounts calculated need to be rounded to 2 decimals.

Yet, we have sometime experienced mismatches of 0.0x magnitude