MYDATA-312
Sum of classifications with type and category not matching with related total in invoice summary: ….
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:invoiceSummary[inv:incomeClassification]
Test
every $c in inv:incomeClassification satisfies gr:same(gr:dec($c/icls:amount), gr:sum($lines[concat(normalize-space(icls:classificationType), '|', normalize-space(icls:classificationCategory)) = concat(normalize-space($c/icls:classificationType), '|', normalize-space($c/icls:classificationCategory))]/icls:amount))
Checked with myDATA 2.0.2