XV-FI-06

VatBaseAmount of the … % rate (…) must be the sum of RowVatExcludedAmount of the rows at that rate (…) (Finvoice 3.0 guidelines, 14).

error: the document is invalid

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Context
/Finvoice/InvoiceDetails[matches(InvoiceTypeCode, '^(INV|SEI|REC|RES)') or InvoiceTypeCode = 'TES01']/VatSpecificationDetails[VatRatePercent]
Test
not($mine) or not(VatBaseAmount) or not($rows) or $invoiceLevel or $rate = 0 or $rows[not(RowVatExcludedAmount)] or fi:same(fi:dec(VatBaseAmount), fi:dec($rows/RowVatExcludedAmount))

Checked with Finvoice 3.0