In our ERP we use VAT-inclusive pricing which occasionally leads to fractional discrepancies.
For instance, let’s consider the price of a litter of gasoline, which is 1.18 (including VAT). If the quantity is 44.42, then the total amount should be:
44.42 * 1.18 = 52.41.
However, when expressed in XML tags:
cac:InvoiceLine.cbc:InvoicedQuantity = 44.42
cac:InvoiceLine.cac:Price.cbc:PriceAmount = 1.03 (excluding VAT, calculated as 1.18/1.15)
cac:InvoiceLine.cac:Price.cbc:BaseQuantity = 1
Then, the tax amount (cac:InvoiceLine.cac:TaxTotal.cbc:TaxAmount) is calculated as follows:
So, the total amount in this case is cac:InvoiceLine.cac:TaxTotal.cbc:RoundingAmount = cac:InvoiceLine.cbc:LineExtensionAmount + cac:InvoiceLine.cac:TaxTotal.cbc:TaxAmount
cac:InvoiceLine.cbc:RoundingAmount = 45.75 + 6.86 = 52.61
This total is not equal to the previous total (52.41), which was calculated from the price including VAT. There is a difference of 0.19.
How can we address this fractional discrepancies? Is there an error in our calculation or rounding?
1- UnitPrice …Qty …Percentage… you don’t have to rounded to 2 decimal …But Other figures u have to round up like Line total before tax, tax amount and Total Inclusive, …
2- So calc Is 44.42 * 1.18 * 100 / 115 = 45.5787… 45.58 ( as unit price is 1.02608… with franction )
3- Tax amount = 45.58 * 15 / 100 = 6.837 … 6.84 …Not 6.86
4- Total Include Tax 45.58 + 6.84 = 52.42 … Not 52.62
10 SAR inclusive of 15% taxes still gives me 0.01 halala difference.
(QTY) 1 * (price) 10.00 * 100 / 115 = 8.695652 = 8.70
8.70 * 15/100 = 1.305000 = 1.31
Thus total = 8.70 +1.31 = 10.01
How can we handle in XML ?
Thanks in advance!