VRBL-INV-PT-2p1-10

Basic Info

Rule In a Tax Subtotal the Tax Subtotal Tax Scheme ID is "Exempt from VAT" the Tax Subtotal Taxable Amount = Invoice Line Extension Amount - Allowance Amount + Charge Amount, with an acceptance range of 1.00 EURO (it does not mean that this tolerance is accepted by the customer).
Context /ubl:Invoice
Pattern vrbl-invoice-pt-2p1
Severity fatal

Implementation

(boolean(cac:InvoiceLine) and ((sum(cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:DocumentCurrencyCode]/cac:TaxSubtotal[normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:TaxableAmount) - 1.00) 
<= (round((sum(cac:InvoiceLine[normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='E' or normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='ISE']/cbc:LineExtensionAmount) 
+ sum(cac:AllowanceCharge[cbc:ChargeIndicator='true'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount) 
- sum(cac:AllowanceCharge[cbc:ChargeIndicator='false'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount)) * 100) div 100)) 
and ((sum(cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:DocumentCurrencyCode]/cac:TaxSubtotal[normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:TaxableAmount) + 1.00) 
>= (round((sum(cac:InvoiceLine[normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='E' or normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='ISE']/cbc:LineExtensionAmount) 
+ sum(cac:AllowanceCharge[cbc:ChargeIndicator='true'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount) 
- sum(cac:AllowanceCharge[cbc:ChargeIndicator='false'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount)) * 100) div 100))) 
or  (boolean(cac:CreditNoteLine) and ((sum(cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:DocumentCurrencyCode]/cac:TaxSubtotal[normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:TaxableAmount) - 1.00) 
<= (round((sum(cac:CreditNoteLine[normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='E' or normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='ISE']/cbc:LineExtensionAmount) 
+ sum(cac:AllowanceCharge[cbc:ChargeIndicator='true'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount) 
- sum(cac:AllowanceCharge[cbc:ChargeIndicator='false'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount)) * 100) div 100)) 
and ((sum(cac:TaxTotal[cbc:TaxAmount/@currencyID = ../cbc:DocumentCurrencyCode]/cac:TaxSubtotal[normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:TaxableAmount) + 1.00) 
>= (round((sum(cac:CreditNoteLine[normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='E' or normalize-space(cac:Item/cac:ClassifiedTaxCategory/cbc:ID)='ISE']/cbc:LineExtensionAmount) 
+ sum(cac:AllowanceCharge[cbc:ChargeIndicator='true'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount) 
- sum(cac:AllowanceCharge[cbc:ChargeIndicator='false'][normalize-space(cac:TaxCategory/cbc:ID) = 'E' or normalize-space(cac:TaxCategory/cbc:ID) = 'ISE']/cbc:Amount)) * 100) div 100)))