Rounding in invoices are getting warnings

What should I do regarding the rounding and the difference 0.01 beween totals and items totals?

cac:LegalMonetaryTotal
<cbc:LineExtensionAmount currencyID=“SAR”>300.87</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID=“SAR”>300.87</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID=“SAR”>346.00</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID=“SAR”>0.00</cbc:AllowanceTotalAmount>
<cbc:PrepaidAmount currencyID=“SAR”>0.00</cbc:PrepaidAmount>
<cbc:PayableAmount currencyID=“SAR”>346.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
cac:InvoiceLine
cbc:ID1</cbc:ID>
<cbc:InvoicedQuantity unitCode=“PCE”>1.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>50.43</cbc:LineExtensionAmount>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>7.57</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>58.00</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:NameHair Trimming | قص اطراف الشعر</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.00</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>50.43</cbc:PriceAmount>
cac:AllowanceCharge
cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>
cbc:AllowanceChargeReasondiscount</cbc:AllowanceChargeReason>
<cbc:Amount currencyID=“SAR”>0.00</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price>
</cac:InvoiceLine>
cac:InvoiceLine
cbc:ID2</cbc:ID>
<cbc:InvoicedQuantity unitCode=“PCE”>1.000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID=“SAR”>250.43</cbc:LineExtensionAmount>
cac:TaxTotal
<cbc:TaxAmount currencyID=“SAR”>37.57</cbc:TaxAmount>
<cbc:RoundingAmount currencyID=“SAR”>288.00</cbc:RoundingAmount>
</cac:TaxTotal>
cac:Item
cbc:NameRoots Color | صبغة جذور</cbc:Name>
cac:ClassifiedTaxCategory
cbc:IDS</cbc:ID>
cbc:Percent15.00</cbc:Percent>
cac:TaxScheme
cbc:IDVAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
cac:Price
<cbc:PriceAmount currencyID=“SAR”>250.43</cbc:PriceAmount>
cac:AllowanceCharge
cbc:ChargeIndicatorfalse</cbc:ChargeIndicator>
cbc:AllowanceChargeReasondiscount</cbc:AllowanceChargeReason>
<cbc:Amount currencyID=“SAR”>0.00</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price>
</cac:InvoiceLine>

{
“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-S-08”,
“category”: “EN_16931”,
“message”: “[BR-S-08]-In a VAT breakdown (BG-23) where the VAT category code (BT-118) is ’ Standard rated’ the VAT category taxable amount (BT-116) shall equal the sum of Invoice line net amounts (BT-131) minus the sum of Document level allowance amounts (BT-92) plus the sum of Document level charge amounts (BT-99) where the VAT category codes (BT-151, BT-95, BT-102) are ‘Standard Rate’.”,
“status”: “WARNING”
},
{
“type”: “WARNING”,
“code”: “BR-CO-10”,
“category”: “EN_16931”,
“message”: "Sum of Invoice line net amount (BT-106) ",
“status”: “WARNING”
},
{
“type”: “WARNING”,
“code”: “BR-CO-13”,
“category”: “EN_16931”,
“message”: “Invoice total amount without VAT (BT-109) = S Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107)”,
“status”: “WARNING”
}
],
“errorMessages”: [

],
"status": "WARNING"

},
“reportingStatus”: “REPORTED”
}

@ucitco For line item 1, when we multiply the unit price of SAR 50.43 by VAT rate 15% the resulting line item tax amount will be 7.5645 which should be rounded to 7.56 but XML shows 7.57

Similarly for line item 2, when we multiply SAR 250.43 by 15% the resulting tax amount will be 37.5645 which should be rounded to 37.56 but XML shows 37.57

The rounding logic is half-up rounding at 3rd place that means 3rd decimal place of 0.005 and above will be rounded up in second digit. However, in current example the third decimal places are not 0.005 and above it is 0.004 therefore you should not round up the second decimal place.

Please try to expand the decimal places of the field Unit Price to be as per your source system and do not round it to 2 decimal places. There is no decimal place restrictions on Unit Price and quantity fields. When you increase the number of decimals in unit price, the rounding difference should get resolved. Also kindly update the rounding logic

1 Like

AS you know price declaration must include (item price + Vat), so we are letting the cashier to issue invoice by adding price including vat.

lets consider that we sell item “price inclusive” 288 SAR

So We are using equation to remove Vat from total sales

subtotal = total amount / ( 1 + VAT Ratio) ex

subtotal = 288 / ( 1.15)
= 250.43 SAR

Vat value = total amount - subtotal
= 288-250.43 = 37.57 SAR


if we depend on Original price we cant get absolute value like 288 SAR

since 250.43 *1.15 = 287.9945 which will be round to 287.99 SAR

What’s your suggestion for such scenario?

Morning @ucitco

Thanks for reaching out,

To provide comprehensive support as usual, can I kindly ask you to share the full xml via below mail?

SP mail: sp_support@zatca.gov.sa

Thanks
Ibrahem Daoud.