VRBL-INV-EN16931-M-89

Basic Info

Rule An Invoice that contains an Invoice Line Group, a Allowance Group or a Charge Group where the Tax Category ID is "Standard rated" must contain in the Tax Sub Total at least one Tax Subtotal Category ID equal with "Standard rated".
Context /ubl:Invoice
Pattern vrbl-invoice-en16931-ubl-model
Severity fatal

Implementation

    ((count(cac:AllowanceCharge/cac:TaxCategory[normalize-space(cbc:ID) = 'S']) + count(cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'S'])) > 0    and    count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S']) > 0)    or    ((count(cac:AllowanceCharge/cac:TaxCategory[normalize-space(cbc:ID) = 'S']) + count(cac:InvoiceLine/cac:Item/cac:ClassifiedTaxCategory[normalize-space(cbc:ID) = 'S'])) = 0    and    count(cac:TaxTotal/cac:TaxSubtotal/cac:TaxCategory[normalize-space(cbc:ID) = 'S']) = 0)