[ALIGNED-IBRP-E-08-OM] - In a VAT breakdown (IBG-23) where the VAT category code (IBT-118) is "E" the VAT category taxable amount (IBT-116) MUST be the VAT category taxable amount (IBT-116) must equal the sum of Invoice line net amounts (IBT-131) minus the sum of Document level allowance amounts (IBT-092) plus the sum of Document level charge amounts (IBT-099) where the VAT category codes (IBT-151,IBT-95, IBT-102) is “E" unless invoice transaction type is a simplified tax invoice (X1XXXXXXXXXXXXXXXXXX), where a VAT category taxable amount (IBT-116) is not required if VAT category code (IBT-118) equal to "E".
ALIGNED-IBRP-E-08-OMubl:Invoice/cac:TaxTotal/cac:TaxSubtotal | cn:CreditNote/cac:TaxTotal/cac:TaxSubtotalnot($isInvoiceCurrency and $vatCategory = 'E') or ( cbc:TaxableAmount castable as xs:decimal and (not(exists($rate)) or $rate castable as xs:decimal) and u:slack( xs:decimal(cbc:TaxableAmount), xs:decimal( round( ( sum( for $l in $lines[ cac:Item/cac:ClassifiedTaxCategory/cbc:ID = $vatCategory and (if (exists($rate)) then (cac:Item/cac:ClassifiedTaxCategory/cbc:Percent castable as xs:decimal and xs:decimal(cac:Item/cac:ClassifiedTaxCategory/cbc:Percent) = xs:decimal($rate)) else true()) ] return xs:decimal($l/cbc:LineExtensionAmount) ) - sum( for $a in $allowances[ cac:TaxCategory/cbc:ID = $vatCategory and (if (exists($rate)) then (cac:TaxCategory/cbc:Percent castable as xs:decimal and xs:decimal(cac:TaxCategory/cbc:Percent) = xs:decimal($rate)) else true()) ] return xs:decimal($a/cbc:Amount) ) + sum( for $c in $charges[ cac:TaxCategory/cbc:ID = $vatCategory and (if (exists($rate)) then (cac:TaxCategory/cbc:Percent castable as xs:decimal and xs:decimal(cac:TaxCategory/cbc:Percent) = xs:decimal($rate)) else true()) ] return xs:decimal($c/cbc:Amount) ) ) * 100 ) div 100 ), 0.02 ) )