fatalEN 16931EN 16931 business ruleCIIUBLBG-23BT-116BT-117BT-118BT-119
The VAT category tax amount (BT-117) in a VAT breakdown (BG-23) where VAT category code (BT-118) is "IGIC" shall equal the VAT category taxable amount (BT-116) multiplied by the VAT category rate (BT-119).
The VAT category tax amount (BT-117) for category IGIC (AF) does not equal the taxable amount (BT-116) multiplied by the VAT rate (BT-119).
Set BT-117 = round(BT-116 x BT-119 / 100, 2). Round the product itself - do not sum per-line tax amounts, which drifts by a cent or two.
CII — context $VATAF
true()
UBL — context /*/cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'L'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']
(abs(xs:decimal(../cbc:TaxAmount)) - 1 < round((abs(xs:decimal(../cbc:TaxableAmount)) * (xs:decimal(cbc:Percent) div 100)) * 10 * 10) div 100 ) and (abs(xs:decimal(../cbc:TaxAmount)) + 1 > round((abs(xs:decimal(../cbc:TaxableAmount)) * (xs:decimal(cbc:Percent) div 100)) * 10 * 10) div 100 )