XV-FI-07
VatRateAmount of the … % rate (…) is neither the sum of RowVatAmount of the rows at that rate (…) nor the rate applied to VatBaseAmount (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(VatRateAmount) or (($rows and not($rows[not(RowVatAmount)])) and fi:same(fi:dec(VatRateAmount), fi:dec($rows/RowVatAmount))) or (VatBaseAmount and fi:same(fi:dec(VatRateAmount), round-half-to-even(fi:dec(VatBaseAmount) * $rate div 100, 2))) or not(VatBaseAmount or ($rows and not($rows[not(RowVatAmount)])))
Checked with Finvoice 3.0