# XV-FI-04

Source: https://xmlvalid.com/rules/XV-FI-04

> InvoiceTotalVatAmount (…) must be the sum of VatRateAmount in the VAT breakdown (…) (Finvoice 3.0 guidelines, 14).

- Level: error
- Rule sets: Finvoice 3.0 calculation and payment rules Implementation guidelines 2.6 (16 September 2025)
- Context: `/Finvoice/InvoiceDetails[matches(InvoiceTypeCode, '^(INV|SEI|REC|RES)') or InvoiceTypeCode = 'TES01']`
- Test: `not(InvoiceTotalVatAmount and $vat/VatRateAmount) or fi:same(fi:dec(InvoiceTotalVatAmount), fi:dec($vat/VatRateAmount))`

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