-
- Downloads
[FIX] l10n_it_edi: fiscal code format
According to
www.agenziaentrate.gov.it/portale/web/guest/schede/istanze/richiesta-ts_cf/informazioni-codificazione-pf
The tax identification number of natural persons
consists of an alphanumeric expression of sixteen characters.
The first fifteen characters are indicative of the master data
of each individual in the following order:
- 3 alphabetic characters for the surname;
- 3 alphabetic characters for the first name;
- 2 numeric characters for the year of birth;
- 1 alphabetic character for the month of birth;
- 2 numeric characters for the day of birth and sex;
- 4 characters, 1 alphabetic and 3 numeric for the Italian municipality
or foreign state of birth.
The sixteenth character, alphabetic, serves as a control.
The main fix is about this part:
When two or more individuals have master data generating
the same tax code (homocodes), the tax code is differentiated
for each of them. For this purpose, systematic substitutions
of one or more digits starting from the right one are made
within the seven numeric characters contained in the code
with corresponding alphabetic characters according to the
following table:
0 = L 4 = Q 8 = U
1 = M 5 = R 9 = V
2 = N 6 = S
3 = P 7 = T
Also the check for iva number format was incomplete.
Indeed, The three penultimate digits correspond to the region of the
VAT office and must be between 001 and 100 inclusive,
or equal to 120, 121, 888 or 999.
We use the stdnum library's methods for the validation of fiscal code
and iva number format.
opw-2797408
closes odoo/odoo#95594
Signed-off-by:
Josse Colpaert <jco@odoo.com>
Showing
- addons/l10n_it_edi/models/res_partner.py 3 additions, 3 deletionsaddons/l10n_it_edi/models/res_partner.py
- addons/l10n_it_edi/tests/__init__.py 1 addition, 0 deletionsaddons/l10n_it_edi/tests/__init__.py
- addons/l10n_it_edi/tests/test_res_partner.py 61 additions, 0 deletionsaddons/l10n_it_edi/tests/test_res_partner.py
addons/l10n_it_edi/tests/test_res_partner.py
0 → 100644
Please register or sign in to comment