Message

Amount due for payment MUST be equal to the invoice total amount with VAT minus the paid amounts

Context
//cac:LegalMonetaryTotal
Test
((cbc:PrepaidAmount) and ((xs:decimal(cbc:PayableAmount)) = (round((xs:decimal(cbc:TaxInclusiveAmount) - xs:decimal(cbc:PrepaidAmount)) * 10 * 10) div 100))) or (not(cbc:PrepaidAmount) and (xs:decimal(cbc:PayableAmount) = xs:decimal(cbc:TaxInclusiveAmount)))
Usage
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:PayableAmount