# BR-AA-02

Source: https://xmlvalid.com/rules/BR-AA-02

> An Invoice that contains an Invoice line (BG-25) where the Invoiced item VAT category code (BT-151) is “Lower rate” shall contain the Seller VAT Identifier (BT-31), the Seller tax registration identifier (BT-32) and/or the Seller tax representative VAT identifier (BT-63).

- Level: error
- Rule sets: CIUS-PT rules (Portugal, UBL) 2.1.1
- Context: `//ubl:Invoice | //cn:CreditNote`
- Test: `(exists(//cac:ClassifiedTaxCategory[(normalize-space(cbc:ID) = 'AA' or normalize-space(cbc:ID) = 'RED' or normalize-space(cbc:ID) = 'INT')]) and (exists(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) or exists(//cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID))) or not(exists(//cac:ClassifiedTaxCategory[(normalize-space(cbc:ID) = 'AA' or normalize-space(cbc:ID) = 'RED' or normalize-space(cbc:ID) = 'INT')]))`

Validate a document against these rules: https://xmlvalid.com/validate
