F-INV134
The sum of PaymentTerms/Amount elements or the value of the first PaymentTerms/Amount must equal PayableAmount
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
doc:Invoice/cac:LegalMonetaryTotal
Test
(count(../cac:PaymentTerms) > 0) and not ((format-number(cbc:PayableAmount,'#0.00') = format-number(sum(../cac:PaymentTerms/cbc:Amount),'#0.00')) or (format-number(cbc:PayableAmount,'#0.00') = format-number(../cac:PaymentTerms[1]/cbc:Amount,'#0.00')))
Checked with Denmark OIOUBL 2.1 Invoice