aligned-ibrp-051-jp

Tax category tax amount (ibt-117) = tax category taxable amount (ibt-116) x (tax category rate (ibt-119) / 100), rounded to integer. The rounded result amount shall be between the floor and the ceiling.

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:TaxSubtotal[cbc:TaxAmount/@currencyID=/ubl:Invoice/cbc:DocumentCurrencyCode/text()]
Test
((cac:TaxCategory/normalize-space(upper-case(cbc:ID)) != 'O') and ((round(cac:TaxCategory/xs:decimal(cbc:Percent)) != 0 and ( xs:decimal(cbc:TaxAmount) >= floor(xs:decimal(cbc:TaxableAmount) * (cac:TaxCategory/xs:decimal(cbc:Percent) div 100))) and ( xs:decimal(cbc:TaxAmount) <= ceiling(xs:decimal(cbc:TaxableAmount) * (cac:TaxCategory/xs:decimal(cbc:Percent) div 100)))) or (round(cac:TaxCategory/xs:decimal(cbc:Percent)) = 0 and (xs:decimal(cbc:TaxAmount) = 0)))) or (not(cac:TaxCategory/cbc:Percent) and (cac:TaxCategory/normalize-space(upper-case(cbc:ID)) = 'O') and (xs:decimal(cbc:TaxAmount) = 0))

Checked with PINT JP Invoice