# BR-RO-100

Source: https://xmlvalid.com/rules/BR-RO-100

> Daca Codul tarii Vanzatorului (BT-40) este RO si Subdiviziunea tarii Vanzatorului (BT-39) este RO-B (corespunzator Municipiului Bucuresti), atunci Localitatea Vanzatorului (BT-37) trebuie sa fie codificata folosind lista de coduri SECTOR-RO. #If the Seller's country Code (BT-40) is RO and the Seller's country subdivision (BT-39) is RO-B (corresponding to Bucharest Municipality), then the Seller city (BT-37) must be coded using the code list SECTOR-RO(SECTOR1, SECTOR2, SECTOR3, SECTOR4, SECTOR5, SECTOR6).

- Level: error
- Rule sets: Romanian RO e-Factura rules (UBL) 1.0.9
- Context: `/ubl:Invoice | /cn:CreditNote`
- Test: `normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) = 'RO' and normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CountrySubentity) = 'RO-B' and not(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:CityName) = $SECTOR-RO-CODES)`

## Why it fails

- The seller is in Bucharest (`cbc:CountrySubentity` `RO-B`) and `cbc:CityName` holds the city name (`Bucuresti`) instead of the sector.
- The sector is written another way: `Sector 1`, `SECTOR 1` or `S1`.

## How to fix it

- For an address in Bucharest, write the sector in `cbc:CityName` as one of `SECTOR1` to `SECTOR6`. BR-RO-101, BR-RO-160 and BR-RO-202 ask the same for the buyer, the tax representative and the delivery address.

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