BR-CIUS-PT-17
In an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is "Exempt from VAT" shall have a VAT exemption reason code (BT-160) or VAT exemption reason text (BT-160).
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
cac:InvoiceLine/cac:Item[(cac:ClassifiedTaxCategory/cbc:ID = 'E' or cac:ClassifiedTaxCategory/cbc:ID = 'ISE')]/cac:AdditionalItemProperty/cbc:Name | cac:CreditNoteLine/cac:Item[(cac:ClassifiedTaxCategory/cbc:ID = 'E' or cac:ClassifiedTaxCategory/cbc:ID = 'ISE')]/cac:AdditionalItemProperty/cbc:Name
$cnt17.1 > 0 or $cnt17.2 > 0
Checked with Portugal CIUS-PT Invoice (UBL), Portugal CIUS-PT Credit Note (UBL)