MYDATA-229
An amount is not correct according to its category (invoice line: …): ….
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
inv:invoiceDetails
Test
every $k in ('withheld', 'stampDuty', 'fees') satisfies (let $amount := *[local-name() = concat($k, 'Amount')], $r := gr:tax-rate($k, normalize-space(*[local-name() = concat($k, 'PercentCategory')])) return empty($amount) or empty($r) or abs(gr:dec($amount) - round($net * $r, 2)) le 0.01)
Checked with myDATA 2.0.2