# SDI-00421

Source: https://xmlvalid.com/rules/SDI-00421

> 2.2.2.6 <Imposta> non calcolato secondo le regole definite nelle specifiche tecniche

- Level: error
- Rule sets: SdI checks (FatturaPA ordinary invoice) Specifiche tecniche 1.9.1
- Context: `/p:FatturaElettronica/FatturaElettronicaBody/DatiBeniServizi/DatiRiepilogo`
- Test: `abs(it:dec(Imposta) - round($rate * it:dec(ImponibileImporto)) div 100) le 0.01`

In English: The VAT of a summary (Imposta, 2.2.2.6) is not its taxable amount (2.2.2.5) times its rate (2.2.2.1) divided by 100, rounded to two decimals, within one cent.

## Why it fails

- The VAT was added up from the lines' rounded VAT amounts instead of being calculated once on the summary's taxable amount.
- The rate was written as a fraction (0.22), which also fails 00424.

## How to fix it

- Set `Imposta` to `ImponibileImporto × AliquotaIVA / 100`, rounded half up to two decimals.

Validate a document against these rules: https://xmlvalid.com/validate
