F-REM086

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:Reminder/cac:LegalMonetaryTotal
Test
(count(../cac:PaymentTerms) > 0) and not ( (format-number(cbc:PayableAmount,'##.00') = format-number(sum(../cac:PaymentTerms/cbc:Amount),'##.00')) or (format-number(cbc:PayableAmount,'##.00') = format-number(../cac:PaymentTerms[1]/cbc:Amount,'##.00')))

Checked with Denmark OIOUBL 2.1 Reminder