Romania - D101 ANAF Declaration
by NextERP Romania https://github.com/NextERP-Romania/l10n-romania-enterprise$ 4699.60
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) • Inventory (stock) |
| Community Apps Dependencies | Show |
| Lines of code | 4860 |
| Technical Name |
l10n_ro_declaration_D101 |
| License | OPL-1 |
| Website | https://github.com/NextERP-Romania/l10n-romania-enterprise |
Romania - D101 ANAF Declaration

This module implements the generation of the D101 declaration (Declarația privind impozitul pe profit) for Romanian ANAF.
D101 is the annual corporate income tax return through which Romanian legal entities report and reconcile their corporate income tax liability for the previous fiscal year. It is the counterpart of the quarterly D100 advance payments — D101 reports the actual annual tax due on the audited financial result.
The module:
- Defines the wizard l10n.ro.anaf.d101.v10 (versiunea 10 — XSD d101_20250214.xsd, in force from 2025-02-14, OPANAF 206/11.02.2025).
- Loads the profit tax computation configuration (l10n.ro.anaf.d101.config) with field-level mappings for the 100+ tax positions (P1…P53 plus sub-fields P81…P84, P111…P113, P421…P4231, P38a…P43a, etc.) referenced in the XSD.
- Supports the four obligation codes recognized by ANAF for D101:
- 102 — Advance payments (instituții de credit, cu impozit pe profit anticipat)
- 103 — Corporate income tax — most companies
- 104 — Annual income tax for agriculture cooperatives, NGO-uri, religioase
- 105 — Income tax for foreign legal entities
- Computes the legal payment deadline (scadenta) based on cod_obligatie, fiscal year and special situations (dissolution, regularizare).
- Computes the unique nr_evid record number per declaration: 11<cod:3>01<LLAA><scadenta:6><dissolution:1>000<checksum:2> (23 digits).
- Generates the XML conformant to ANAF v3 schema (namespace mfp:anaf:dgti:d101:declaratie:v3), validates against the local XSD, saves the result on the wizard for download.
The output XML has to be validated with DUKIntegrator and signed with the digital signature before being uploaded to the ANAF e-Guvernare portal.
Notes about the XSD
The XSD published by ANAF at https://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/d101_20250214.xsd has two well-known syntax errors (a malformed attribute on the P432 line and an unclosed <xs:simpleType> block around IntPoz13SType). This module ships a locally corrected copy in data/xsd/d101_20250214.xsd, used as a binary attachment for validation. When ANAF fixes the upstream XSD, the attachment can be reverted to type="url".
Table of contents
Legal context
D101 is the annual corporate income tax return (Declarația privind impozitul pe profit) filed by Romanian legal entities to reconcile their corporate income tax for the previous fiscal year.
Filing obligation: OPANAF 587/2016 as amended. Schema: OPANAF 206/11.02.2025 (d101_20250214). XSD: https://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/d101_20250214.xsd. Namespace: mfp:anaf:dgti:d101:declaratie:v3.
Filing schedule
D101 is annual. Default deadlines per cod_obligatie:
| cod_obligatie | Filing deadline | Who files |
|---|---|---|
| 102 — Plăți anticipate impozit profit | 25.06 next year | Bănci, instituții credit |
| 103 — Impozit pe profit | 25.06 next year | Most for-profit companies |
| 104 — Impozit pe veniturile cooperativelor agricole, ONG-uri | 25.02 next year | Coop. agricole, ONG, cult |
| 105 — Impozit pe profit (PJ străine) | 25.06 next year | Foreign legal entities with PE in RO |
For dissolutions, the deadline is the 25th of the month following the dissolution event (Data_L = data lichidării, Data_B = data dizolvării).
Relationship with other declarations
D101 sits in the family of ANAF declarations sharing the same l10n_ro_declaration infrastructure:
- D100 — payment obligations to state budget (l10n_ro_declaration_D100). D100 reports the quarterly advance payments of corporate income tax (cod_oblig 102, 103) — D101 is the annual reconciliation.
- D101 — corporate income tax annual return (this module).
- D112 — payroll declaration.
- D300 — VAT declaration (l10n_ro_declaration_D300).
- D390 — intra-community VAT recap (l10n_ro_declaration_D390).
- D394 — domestic operations recap (l10n_ro_declaration_D394).
- D406 — SAF-T (l10n_ro_declaration_D406).
If your company is a micro-enterprise filing D100 with cod_oblig 121, it does not also file D101. Switch from micro to corporate tax mid-year is captured via trim_micro, primul_an_modif, ultimul_an_modif attributes on D101.
Data model
l10n.ro.anaf.declaration ─┬── name = "d101"
│
l10n.ro.anaf.declaration.version
│ ─── name = "Versiunea 10"
│ date_from = 2025-02-14
│ model = l10n.ro.anaf.d101.v10
│ validator = anaf_d101_v10_xsd (binary)
│
l10n.ro.anaf.d101.config ─┘── nomenclator P1..P53 + sub-fields
field_name (XML attribute)
account_code_from / account_code_to (PCG mapping)
formula (for derived fields)
computed (bool)
l10n.ro.anaf.d101 (TransientModel — wizard base)
└─ inherits l10n.ro.anaf.mixin
└─ extended by l10n.ro.anaf.d101.v10 (XML generation logic per version)
└─ generate_xmldict() → ordered fields
└─ build_file() → assembled XML string
└─ _compute_scadenta() → DDMMYY due date string
└─ _compute_scadenta_parts() → (next_month, next_year)
└─ _compute_nr_evid() → 23-digit unique record number
└─ generate_company_data() → {cif, caen, denumire, adresa, telefon, email}
└─ generate_sign() → {nume_declar, prenume_declar, functie_declar}
└─ generate_profit_data() → P1..P53 + sub-fields
How profit positions are computed
generate_profit_data runs in two passes:
- Account-based pass — for each non-computed config line, the wizard sums the trial-balance of accounts in account_code_from–account_code_to over the wizard period. Multiple lines with the same field_name are aggregated.
- Formula-based pass — for each computed config line, the wizard evaluates formula against the values from pass 1 (e.g. P3 + P4 - P5).
Final adjustments and signs are applied per the OPANAF 206/2025 rules. Total payable (totalPlata_A) is computed as the sum of absolute values of the main P1…P53 positions (not sub-fields).
Why the local XSD
The XSD published by ANAF at the official URL has two known syntax errors introduced in the 2025-02-14 revision:
- Line 115 — malformed attribute on P432 field: name="P432 "type=... (stray space + missing space between attributes).
- Line ~191 — IntPoz13SType defined nested inside IntPoz15SType instead of as a sibling (missing </xs:simpleType> close tag).
Both errors prevent lxml.etree.XMLSchema from parsing the file, which caused the validation step in l10n.ro.anaf.mixin.validate_xml to fail with XMLSyntaxError. To work around this, the module ships a locally corrected copy of the XSD as a binary attachment (data/xsd/d101_20250214.xsd via anaf_d101.xml).
When ANAF eventually corrects the upstream XSD, the attachment record can be reverted to type="url" pointing back at the static.anaf.ro URL.
Schema versions
ANAF updates the D101 XSD periodically (annually). Each new version introduces a sibling submodule under models/v<N>/d101_<DDMMYYYY>.py implementing version-specific generation logic, plus a new entry in l10n.ro.anaf.declaration.version referencing the new XSD attachment.
Configuration
Prerequisites
Check the configuration steps from l10n_ro_declaration module downloaded with this module — ANAF declaration setup, signature configuration, company VAT/CUI fields, CAEN code, bank account.
Profit tax computation configuration
This module ships with a complete D101 v10 nomenclator as configuration records in l10n.ro.anaf.d101.config. Each record describes one of the 100+ tax positions in the declaration (P1, P2, … P53 and their sub-fields).
| Field | Description |
|---|---|
| version_id | The D101 version (anaf_D101_v10) |
| field_name | XML attribute name on <declaratie101> (e.g. P1, P38, P421) |
| name | Human-readable label |
| account_code_from / account_code_to | PCG RO account range used for auto-computation from trial balance |
| formula | For derived fields, formula referencing other P-fields (e.g. P3 + P4 - P5) |
| computed | True if the field is derived via formula; False if mapped from accounts |
| sequence | Order |
Access the nomenclator from the menu: Accounting → Configuration → Romania → D101 — Profit Tax Configuration.
Account-based vs formula-based fields
Fields in D101 fall into two categories:
- Account-mapped fields (computed = False) — the wizard reads the trial balance for account_code_from–account_code_to over the wizard period and populates the field with the balance. Example: P1 (total revenue) is mapped to all 7% accounts (revenue accounts).
- Formula-based fields (computed = True) — the wizard evaluates a formula against the values of other P-fields after the first pass. Example: P26 (taxable profit) = P3 + P4 - P5 (gross profit ± adjustments).
Both passes run during compute_from_config on the wizard. Results can be reviewed and overridden manually before generating the XML.
Default account mappings
The shipped configuration covers the standard PCG RO mapping for income statement accounts (6% and 7%) and balance sheet adjustments. Common defaults:
| Position | Concept | Account range |
|---|---|---|
| P1 | Total revenues | 7% accounts |
| P2 | Total expenses | 6% accounts |
| P3 | Gross profit/loss before tax | (computed: P1 - P2) |
| P38 | Income tax due | (computed) |
| P50 | Final tax liability | (computed) |
Industry-specific fields you may need to adjust
Like for D100, specific industry tax fields (oil & gas, banking, mining, electricity producers — fields like P38a, P39a, P40a, P43a) ship without account mapping, because they only apply to specific sectors and depend on each company’s analytical accounts. If your company is liable for these adjustments, fill in the appropriate account_code_from / account_code_to on the relevant config records, OR override the values directly on the wizard before generating.
Running the declaration
After configuration, generate the declaration as described in USAGE.md.
Usage
To use this module, you need to be an account adviser and go to:
Accounting → Reporting → Romania → D101
Steps
- Open the wizard and complete the headers:
- Declaration / Version — D101 / Versiunea 10 (default).
- Date From / Date To — typically the full fiscal year (e.g. 01.01.YYYY to 31.12.YYYY).
- Signature — the digital signature record configured for the company.
- Bank Account — the company bank account.
- Cod Obligație — 103 (most companies), 102 (banks with advance payment), 104 (NGO / agricultural cooperatives), 105 (foreign legal entities with PE in RO).
- Optional fields for special situations:
- Tip Declarație (``d_rec``) — Initial / Rectificative / Rectificative with notification.
- Reglementare (``d_reglem``) — Yes if filing under regularizare (recalculation deadline +3 months).
- Dissolution (``Data_L``, ``Data_B``) — set the dissolution date if filing for an entity in liquidation/dissolution.
- Successor (``succesor_id``) — populates d_succ=1 and cifs=<CUI> in the XML when filing on behalf of a successor entity (art.90 alin.4 Codul de Procedură Fiscală).
- Grup Fiscal (``d_grup``) — Yes when filing as part of a fiscal group consolidation.
- Alte situații (``d_alte``) — Yes for art.105 alin.(6) special cases.
- Compute profit tax positions — click the „Compute from
Accounting” button. The wizard:
- Reads the trial balance for each account-mapped P-field over the wizard period and fills in account-derived values.
- Evaluates formula-based fields (P3, P5, P26, P38, P50, etc.) using the previously computed values.
- Review and adjust the computed positions — manually correct any amount that needs sector-specific adjustments not covered by automatic mappings (e.g. P38a for electricity producers).
- Generate the XML — click „Get Report”. The wizard:
- Produces an XML file according to d101_20250214.xsd.
- Validates against the locally bundled (corrected) XSD.
- Saves the result on the file_save field for download.
- Validate with DUKIntegrator — run ANAF’s local validator on the generated XML before signing.
- Sign with the digital signature — use ANAF’s signing tool or your installed token (Sectigo, certSIGN, etc.).
- Upload to ANAF at https://www.anaf.ro/anaf/internet/ANAF/servicii_online/inreg_inreg_pers_juridice under „Depunere declarații → D101”.
Key XML fields generated
The module generates a <declaratie101> XML element with:
Required (always present):
- luna_i, an_i — start month/year of fiscal year
- luna, an — end month/year of fiscal year
- data_i, data_s — start/end of fiscal year (DD.MM.YYYY format)
- cod_obligatie — 102/103/104/105
- cod_bug — 5503 (state budget)
- scadenta — payment deadline (DDMMYY format, 6 chars)
- nr_evid — unique 23-digit record number with checksum
- totalPlata_A — total tax payable (sum of |P1|…|P53|)
- cif, caen, denumire, adresa — taxpayer identification
- nume_declar, prenume_declar, functie_declar — declarer info
- d_rec, d_anulare, d_alte, d_reglem — declaration type flags
- d_succ, cifs — successor flags (always present, 0 if no successor)
Optional:
- temei, d_recN, d_grup — special situation flags
- data_m, data_l, data_b — modification / liquidation / dissolution dates
- telefon, fax, email — taxpayer contacts
- cifR, denR, adrR, telR, faxR, emailR — fiscal representative
- trim_micro, primul_an_modif, ultimul_an_modif — micro-enterprise switch flags
Profit tax positions:
- P1–P53 — main profit tax computation positions
- P81–P84, P91, P111–P113, P121–P122, P151, P171–P173, P411–P412, P421, P422, P4221, P4222, P423, P4231, P431, P432 — sub-positions
- P38a, P39a, P40a, P43a — sector-specific adjustments
- P481, P482 — additional adjustments
Quick reference: deadline (scadenta)
| cod_obligatie | Default deadline | With d_reglem=1 |
|---|---|---|
| 103 — most companies | 25.06.YYYY+1 | +3 months |
| 104 — NGO/agricultural | 25.02.YYYY+1 | n/a |
| 105 — foreign legal entities | 25.06.YYYY+1 | +3 months |
For dissolution scenarios (Data_L or Data_B set), the deadline is the 25th of the month following the dissolution event.
Bug Tracker
Bugs are tracked on NextERP Issues. In case of trouble, please check there if your issue has already been reported.
Do not contact contributors directly about support or help with technical issues.
Credits
Authors
- NextERP Romania
Contributors
- NextERP Romania:
- Fekete Mihai <feketemihai@nexterp.ro>
Maintainers
Current maintainer:

This module is part of the NextERP-Romania/l10n-romania-enterprise project on GitHub.
You are welcome to contribute.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module