Dolibarr module that imports the official Romanian postal code database from data.gov.ro (Poșta Română) and provides autocomplete on address forms with e-factura CIUS-RO compliant locality and county names.
Documentație în limba română / Romanian documentation
- Official data import from data.gov.ro (Poșta Română — Infocod cu SIRUTA)
- Configurable URL for XLS download (updatable when new data is published)
- Unified table with all columns from the 3 worksheets (Bucharest, cities >50K, other localities)
- Street-level granularity — shows street names for precise postal code matching
- Smart autocomplete on Dolibarr address forms (third-parties, contacts, invoices, etc.)
- Postal code → auto-fills city + county + country
- City name → auto-fills postal code + county
- Street-aware matching for Bucharest (reads address field, matches by street name + house number)
- e-Factura CIUS-RO compliance:
- Bucharest: SECTOR1–SECTOR6 (per
$SECTOR-RO-CODESin CIUS-RO) - Counties: ISO 3166-2:RO codes (RO-AB, RO-AG, …, RO-VS)
- Respects character limits (PostalZone ≤ 20, CityName ≤ 50)
- Bucharest: SECTOR1–SECTOR6 (per
- Copy the
coduripostalero/directory intohtdocs/custom/of your Dolibarr installation - Enable the module from Home → Setup → Modules (search for "CoduriPostaleRO")
- Configure the download URL in Module Settings
- Import data from the Import page (automatic download or manual upload)
See the User Guide (EN) or User Guide (RO) for detailed instructions.
coduripostalero/
├── core/modules/modCoduriPostaleRO.class.php # Module descriptor
├── class/actions_coduripostalero.class.php # Hook actions class
├── lib/coduripostalero.lib.php # Admin helpers + county ISO mapping
├── lib/coduripostalero_functions.lib.php # Shared functions (normalize, match, etc.)
├── admin/setup.php # Settings page (URL, enable/disable)
├── admin/import.php # Import page (URL download or file upload)
├── admin/about.php # About page
├── ajax/autocomplete.php # AJAX endpoint for autocomplete
├── js/coduripostalero.js.php # jQuery UI autocomplete (JS served via PHP)
├── sql/llx_coduripostale_ro.sql # Table creation DDL
├── sql/llx_coduripostale_ro.key.sql # Index definitions
├── sql/data.sql # Default configuration seed
├── test/CoduriPostaleUnitTest.php # Standalone unit tests
├── docs/USER_GUIDE.md # User documentation (EN)
├── docs/USER_GUIDE_RO.md # User documentation (RO)
└── langs/
├── en_US/coduripostalero.lang # English translations
└── ro_RO/coduripostalero.lang # Romanian translations
This module enforces the CIUS-RO rules from RO16931-UBL-validation.sch:
| Rule | Description |
|---|---|
| BR-RO-100 | For Bucharest (RO-B), CityName = SECTOR1–SECTOR6 |
| BR-RO-110 | CountrySubentity = ISO 3166-2:RO code |
| BR-RO-L020 | PostalZone ≤ 20 characters |
| BR-RO-L050 | CityName ≤ 50 characters |
- Organization: Poșta Română / data.gov.ro
- Dataset: Coduri poștale România
- License: OGL-ROU-1.0 (Open Government Licence Romania)
- Format: XLS with 3 worksheets (Bucharest streets, cities > 50K, other localities)
- ~55,000 records total (street-level for Bucharest)
- Dolibarr ≥ 14.0 (for bundled PhpSpreadsheet)
- PHP ≥ 7.1
- jQuery UI (bundled with Dolibarr)
php test/CoduriPostaleUnitTest.phpContributions are welcome! Please read CONTRIBUTING.md before submitting a pull request.
This module is licensed under the GNU General Public License v3.0 or later.
- Finta Ionut — ionut.finta@itized.com
- ITized SRL — https://www.itized.com