{
  "id": "BR-AG-04",
  "country": "EU",
  "syntax": "ubl",
  "group": "ipsi",
  "severity": "fatal",
  "severity_note": "fatal, from the Flag column of the Peppol BIS Billing 3.0 UBL rules index retrieved 2026-10-18.",
  "spec": "Peppol BIS Billing 3.0, May 2026 release, EN 16931 model bound to UBL",
  "statement": "An Invoice that contains a Document level charge (BG-21) where the Document level charge VAT category code (BT-102) is \"IPSI\" 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).",
  "statement_lang": "en",
  "context": "/ubl:Invoice | /cn:CreditNote",
  "test": "(exists(//cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']) and (exists(//cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:CompanyID) or exists(//cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/(normalize-space(upper-case(cbc:ID)) = 'VAT')]/cbc:CompanyID))) or not(exists(//cac:AllowanceCharge[cbc:ChargeIndicator=true()]/cac:TaxCategory[normalize-space(cbc:ID)='M'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']))",
  "meaning": "If a document-level charge uses the VAT category \"IPSI\", the invoice must contain the Seller VAT Identifier (BT-31), the Seller Tax registration identifier (BT-32) and/or the Seller tax representative VAT identifier (BT-63). The statement capitalizes \"Tax\" in \"Seller Tax registration identifier\" and names no buyer identifier. Both the positive branch and the negative branch write normalize-space(cbc:ID)='M'. The negative branch does not omit normalize-space. Both branches call exists and require the tax scheme. The test selects a charge with ChargeIndicator=true() and no space before =.",
  "fix": "On a charge coded M, send at least one of BT-31, BT-32, or BT-63.",
  "example_fail": "A document-level charge uses category code M, and BT-31, BT-32, and BT-63 are all missing.",
  "example_pass": "That charge uses M, and at least one of BT-31, BT-32, or BT-63 is present.",
  "example_note": "Illustration of the condition in the official statement. Not an example published by the source.",
  "source_url": "https://docs.peppol.eu/poacc/billing/3.0/rules/ubl-tc434/BR-AG-04/",
  "source_retrieved": "2026-10-18",
  "last_verified": "2026-10-18"
}
