feature(regional): Italian Localization

Added setup.py for italy under regional
Included fiscal regimes, tax exemption reasons and custom fields

Issue #16259
This commit is contained in:
Gaurav 2019-01-06 12:40:28 +05:30
parent 750fe6eaea
commit a4aa80fe05
2 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,32 @@
# coding=utf-8
fiscal_regimes = [
"RF01-Ordinario",
"RF02-Contribuenti minimi (art.1, c.96-117, L. 244/07)",
"RF04-Agricoltura e attività connesse e pesca (artt.34 e 34-bis, DPR 633/72)",
"RF05-Vendita sali e tabacchi (art.74, c.1, DPR. 633/72)",
"RF06-Commercio fiammiferi (art.74, c.1, DPR 633/72)",
"RF07-Editoria (art.74, c.1, DPR 633/72)",
"RF08-Gestione servizi telefonia pubblica (art.74, c.1, DPR 633/72)",
"RF09-Rivendita documenti di trasporto pubblico e di sosta (art.74, c.1, DPR 633/72)",
"RF10-Intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72 (art.74, c.6, DPR 633/72)",
"RF11-Agenzie viaggi e turismo (art.74-ter, DPR 633/72)",
"RF12-Agriturismo (art.5, c.2, L. 413/91)",
"RF13-Vendite a domicilio (art.25-bis, c.6, DPR 600/73)",
"RF14-Rivendita beni usati, oggetti darte, dantiquariato o da collezione (art.36, DL 41/95)",
"RF15-Agenzie di vendite allasta di oggetti darte, antiquariato o da collezione (art.40-bis, DL 41/95)",
"RF16-IVA per cassa P.A. (art.6, c.5, DPR 633/72)",
"RF17-IVA per cassa (art. 32-bis, DL 83/2012)",
"RF18-Altro",
"RF19-Regime forfettario (art.1, c.54-89, L. 190/2014)"
]
tax_exemption_reasons = [
"N1-Escluse ex art. 15",
"N2-Non Soggette",
"N3-Non Imponibili",
"N4-Esenti",
"N5-Regime del margine / IVA non esposta in fattura",
"N6-Inversione Contabile",
"N7-IVA assolta in altro stato UE"
]

View File

@ -0,0 +1,37 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# coding=utf-8
from __future__ import unicode_literals
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
from erpnext.regional.italy import fiscal_regimes, tax_exemption_reasons
def setup(company=None, patch=True):
make_custom_fields()
def make_custom_fields(update=True):
fiscal_code_field = dict(fieldname='fiscal_code', label='Fiscal Code', fieldtype='Data', insert_after='tax_id', print_hide=1)
custom_fields = {
'Company': [
fiscal_code_field,
dict(fieldname='fiscal_regime', label='Fiscal Regime',
fieldtype='Select', insert_after='fiscal_code', print_hide=1,
options="\n".join(map(lambda x: x.decode('utf-8'), fiscal_regimes)))
],
'Customer': [
fiscal_code_field,
dict(fieldname='recipient_code', label='Recipient Code',
fieldtype='Data', insert_after='fiscal_code', print_hide=1, default="0000000"),
dict(fieldname='pec', label='Recipient PEC',
fieldtype='Data', insert_after='fiscal_code', print_hide=1)
],
'Sales Taxes and Charges': [
dict(fieldname='tax_exemption_reason', label='Tax Exemption Reason',
fieldtype='Select', insert_after='included_in_print_rate', print_hide=1,
options="\n".join(map(lambda x: x.decode('utf-8'), tax_exemption_reasons)))
]
}
create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch, update=update)