ibr-131-ae

Allowance amount (IBT-092, IBT-136) must equal base amount (IBT-093, IBT-137) * percentage (IBT-094, IBT-138) /100 if base amount and percentage exists

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
cac:AllowanceCharge[cbc:ChargeIndicator = false()][not(ancestor::cac:Price)]
Test
not(exists(cbc:BaseAmount) and exists(cbc:MultiplierFactorNumeric)) or number(cbc:Amount) = (number(cbc:BaseAmount) * number(cbc:MultiplierFactorNumeric) div 100) or number(cbc:Amount) = round((number(cbc:BaseAmount) * number(cbc:MultiplierFactorNumeric) div 100) * 100) div 100

Checked with PINT UAE Invoice, PINT UAE Credit Note