Zum Inhalt springen

Value calculations and decimal rounding

The Tax Agency requires the input of unit.quantity, unit.price, vat.type/code/percentage, and value.discount to calculate the other values. Only 2 decimal places are allowed for these values.

Line (entry) level

vat.amount and vat.inclusive are rounded to the 8th decimal place.  

value.base and vat.exclusive are not mapped to the AdE portal, but we recommend computing them consistently with the logic described above to ensure that vat.amount is calculated accurately. 

Document totals level

total_vat.amount: the value provided via SIGN IT lite is recalculated and overwritten by the AdE portal as the sum of the line-level VAT amounts. This value is rounded by AdE (in the background) to the 8th decimal place.   

payments[].amount, payments[].discount, and total_vat.inclusive values are rounded to 2 decimal places.  The value provided via SIGN IT lite for total_vat.inclusive is ignored by the AdE portal, as it is calculated directly by AdE based on the individual entries.  

total_vat.exclusive: the value provided via SIGN IT lite is ignored by the AdE portal, as it is calculated directly by AdE based on the individual entries.

API FieldDefinitionFormula
value.baseTotal amount of the entry (VAT excluded) before discounts(unit.price x unit.quantity) ÷ (1 + (vat.percentage ÷ 100)) Note: unit.price is VAT included
vat.inclusiveTotal amount of the entry (VAT included) after discounts, if applicable.(unit.price x unit.quantity) - value.discount Note: unit.price is VAT included
vat.exclusiveTotal amount of the entry (VAT excluded) after discounts. This is the net taxable base on which VAT is calculated.vat.inclusive ÷ (1 + (vat.percentage ÷ 100))
vat.amountVAT amountvat.inclusive - vat.exclusive
Following these guidelines will help you avoid: 
  • Validation WARNING "Validation checks failed.. Reasons: Received total VAT amount XXX is not equal to Tax Agency computed total VAT amount XXX", and  

  • Record transmission failures with validation ERROR "Validation checks failed.. Reasons: La somma delle tipologie di pagamento non risulta uguale al Totale complessivo" 

Payload example

{
"content": {
"type": "TRANSACTION",
"record": {
"id": "{{recordIntentionIdA}}"
},
"operation": {
"type": "RECEIPT",
"document": {
"number": "INV-12346",
"total_vat": {
"amount": "1.15104322",
"exclusive": "9.19895678",
"inclusive": "10.35"
}
},
"entries": [
{
"type": "SALE",
"details": {
"concept": "GOOD"
},
"data": {
"type": "ITEM",
"text": "Prod A",
"unit": {
"quantity": "1.00",
"price": "9.00"
},
"value": {
"base": "8.18181818",
"discount": "1.00"
},
"vat": {
"type": "VAT_RATE",
"code": "REDUCED_1",
"percentage": "10.00",
"exclusive": "7.27272727",
"inclusive": "8.00",
"amount": "0.72727273"
}
}
},
{
"type": "SALE",
"details": {
"concept": "GOOD"
},
"data": {
"type": "ITEM",
"text": "Prod B",
"unit": {
"quantity": "2.00",
"price": "1.20"
},
"value": {
"base": "1.96721311",
"discount": "0.05"
},
"vat": {
"type": "VAT_RATE",
"code": "STANDARD",
"percentage": "22.00",
"exclusive": "1.92622951",
"inclusive": "2.35",
"amount": "0.42377049"
}
}
}
],
"customer": {
"type": "EXTERNAL"
},
"payments": [
{
"type": "CASH",
"details": {
"amount": "10.35"
}
}
]
}
}
}

Was this page helpful?