ALIGNED-IBRP-O-08-OM

[ALIGNED-IBRP-O-08-OM] - In a VAT breakdown (IBG-23) where the VAT category code (IBT-118) is " O" the VAT category taxable amount (IBT-116) MUST be 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-99) where the VAT category codes (IBT-151, IBT-095, IBT-102) are “O" 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 "O".

About

ID
ALIGNED-IBRP-O-08-OM
Flag
fatal
Context
ubl:Invoice/cac:TaxTotal/cac:TaxSubtotal | cn:CreditNote/cac:TaxTotal/cac:TaxSubtotal
Test
$isSimplified or not($vatCategory = 'O') or ( cbc:TaxableAmount castable as xs:decimal and u:slack( xs:decimal(cbc:TaxableAmount), xs:decimal( sum($lines[cac:Item/cac:ClassifiedTaxCategory/cbc:ID = $vatCategory]/cbc:LineExtensionAmount) - sum($allowances[cac:TaxCategory/cbc:ID = $vatCategory]/cbc:Amount) + sum($charges[cac:TaxCategory/cbc:ID = $vatCategory]/cbc:Amount) ), 0.02 ) )