InvoiceSpec / Rules Registry / ro-efactura-cius / RO-EFACTURA-BR-RO-Z2
fatal ASSERTION · RO-EFACTURA-BR-RO-Z2 RO e-Factura (Romanian ANAF CIUS-RO) (UBL-2.1) Jurisdiction: RO

RO-EFACTURA-BR-RO-Z2: Romanian Seller & Buyer CountrySubentity (BT-39 / BT-54) must use valid ISO 3166-2:RO county codes (e.g. RO-B, RO-CJ) and Sector 1-6 for Bucharest

Official RO e-Factura (Romanian ANAF CIUS-RO) Spec ↗
01. Technical Specification & XPath Evaluation Context

This fatal rule enforces the Romanian CIUS (ro-efactura-cius) requirement that the Seller's and Buyer's Country Subentity (BT-39 and BT-54 respectively) must be a valid ISO 3166-2:RO county code. The context XPath selects the CountrySubentity element within the Seller's PostalAddress (cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity). The Schematron test uses the XPath 2.0 matches() function with the regular expression '^RO-[A-Z]{1,2}$'. This pattern requires the string to start with 'RO-', followed by one or two uppercase letters (A-Z), and nothing else. The rule triggers when the CountrySubentity value does not match this pattern. Note: The assertion message also mentions 'Sector 1-6 for Bucharest', but the provided XPath test does not accommodate that; it only allows codes like 'RO-B' or 'RO-CJ'. This discrepancy may indicate that the rule is incomplete or that the message is broader than the test. In practice, for Bucharest, the ISO 3166-2:RO code is 'RO-B', which matches the pattern, so the sector requirement might be handled elsewhere or is a misinterpretation. The rule is fatal, meaning the invoice will be rejected if violated.

Evaluated XPath Location:
/ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity
Deterministic Remediation Steps

1. Identify the cbc:CountrySubentity element within the PostalAddress of both AccountingSupplierParty and AccountingCustomerParty. 2. Replace its text content with the appropriate ISO 3166-2:RO code for the county or Bucharest. Use the format 'RO-' followed by one or two uppercase letters (e.g., 'RO-B' for Bucharest, 'RO-CJ' for Cluj, 'RO-TM' for Timiș). 3. Ensure that the code is exactly as per ISO 3166-2:RO; do not use full county names or other formats. 4. If the element is missing, add it with the correct code. 5. Validate the invoice against the ro-efactura-cius Schematron to confirm compliance.

02. Side-by-Side UBL-2.1 Payload Diff (Rejected vs. Compliant)
--- a/invoice-rejected.xml (RO-EFACTURA-BR-RO-Z2) FAIL
1 <ubl:Invoice xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
2 <cac:AccountingSupplierParty>
3 <cac:Party>
4 <cac:PostalAddress>
5 <!-- Incorrect: CountrySubentity uses full county name instead of ISO code -->
6 <cbc:CountrySubentity>Cluj</cbc:CountrySubentity>
7 <cbc:CountrySubentityCode>RO-CJ</cbc:CountrySubentityCode>
8 </cac:PostalAddress>
9 </cac:Party>
10 </cac:AccountingSupplierParty>
11 </ubl:Invoice>
+++ b/invoice-compliant.xml (EN 16931 VALID)
PASS
1 <ubl:Invoice xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
2 <cac:AccountingSupplierParty>
3 <cac:Party>
4 <cac:PostalAddress>
5 + <!-- Correct: CountrySubentity uses ISO 3166-2:RO code -->
6 + <cbc:CountrySubentity>RO-CJ</cbc:CountrySubentity>
7 <cbc:CountrySubentityCode>RO-CJ</cbc:CountrySubentityCode>
8 </cac:PostalAddress>
9 </cac:Party>
10 </cac:AccountingSupplierParty>
11 </ubl:Invoice>
03. Interactive RO e-Factura (Romanian ANAF CIUS-RO) Validation & Auto-Fix Workbench
3 CREDITS
invoice.xmlUBL-2.1
DETECTED SOURCECustom ERP / Billing Engine
BT-131 LINE SUM0.00 EUR
BT-106 HEADER0.00 EUR
SCHEMATRON: 4 FATAL, 1 WARN· 1ms
RO e-Factura (ANAF CIUS-RO)
BR-01An Invoice shall have a valid EN 16931 Specification identifier (BT-24)
Spec & Diff
xpath: /ubl:Invoice/cbc:CustomizationID

Missing <cbc:CustomizationID> or value does not declare EN 16931 CIUS compliance.

fix: Insert <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>.

PEPPOL-EN16931-R020Seller electronic address (BT-34) MUST be provided with a valid EAS @schemeID
Spec & Diff
xpath: /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cbc:EndpointID

Missing <cbc:EndpointID schemeID="..."> inside <cac:AccountingSupplierParty>/<cac:Party>.

fix: Add <cbc:EndpointID schemeID="9930">DE123456789</cbc:EndpointID> as the first child of Seller <cac:Party>.

BR-DE-15Buyer reference / Leitweg-ID (BT-10) is missing
Spec & Diff
xpath: /ubl:Invoice/cbc:BuyerReference

No <cbc:BuyerReference> (BT-10) found. Mandatory in XRechnung 3.0 (BR-DE-15) and required in Peppol BIS 3.0 (PEPPOL-EN16931-R003) when OrderReference is absent.

fix: Insert <cbc:BuyerReference>991-12849-74</cbc:BuyerReference> in the document header.

RO-EFACTURA-BR-RO-010Romanian ANAF CIUS-RO CustomizationID required
Spec & Diff
xpath: /ubl:Invoice/cbc:CustomizationID

ANAF SPV requires exact CustomizationID urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1.

fix: Set cbc:CustomizationID to ANAF CIUS-RO:1.0.1 URN.

RO-EFACTURA-BR-RO-Z2Missing ISO 3166-2:RO County Code in cbc:CountrySubentity (BT-39)
Spec & Diff
xpath: /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity

Romanian ANAF CIUS-RO requires ISO 3166-2:RO county codes (e.g. RO-B, RO-CJ).

fix: Insert <cbc:CountrySubentity>RO-B</cbc:CountrySubentity> inside PostalAddress.

Automate Custom ERP / Billing Engine → RO e-Factura (ANAF CIUS-RO) AP Delivery

Deploy certified Peppol Access Point & ZUGFeRD ERP connector

04. Adjacent RO e-Factura (Romanian ANAF CIUS-RO) Assertions Browse All Rules →