From 82ae8ba0f0cca9fa17a4b126d548637c992c7329 Mon Sep 17 00:00:00 2001 From: Luis Torres Date: Thu, 25 Aug 2022 21:48:12 +0000 Subject: [PATCH] [IMP] l10n_pe: Welcome ISC tax The SUNAT requires than when a ISC tax is used on an invoice, on the cbc:TierRange attribute be specified the ISC type. Now, the 3 options could be: - 01: System to value - 02: Application of the Fixed Amount - 03: Retail Price System To this, now was added a new field on the tax, with this options. Extra, the ISC could have many amount options, for now, only is generated a tax for 0%, that allows to the customer only change the percentage that will to use. Legal Reference: Catalog No 08: https://cpe.sunat.gob.pe/node/88 Guide for the Preparation of Electronic Invoice: https://cpe.sunat.gob.pe/sites/default/files/inline-files/gu%C3%ADa%20xml%20para%20factura%20electr%C3%B3nica%20%28ubl%202.0%29_0.pdf Impuesto selectivo al consumo (ISC): https://www.gob.pe/7918-impuesto-selectivo-al-consumo-isc closes odoo/odoo#98962 Signed-off-by: Josse Colpaert --- addons/l10n_pe/data/account_tax_data.xml | 37 +++++++++++++++++++++++ addons/l10n_pe/models/account_tax.py | 13 ++++++++ addons/l10n_pe/views/account_tax_view.xml | 2 ++ 3 files changed, 52 insertions(+) diff --git a/addons/l10n_pe/data/account_tax_data.xml b/addons/l10n_pe/data/account_tax_data.xml index f63e5d6697f..b5a159812dc 100644 --- a/addons/l10n_pe/data/account_tax_data.xml +++ b/addons/l10n_pe/data/account_tax_data.xml @@ -132,6 +132,43 @@ }), ]"/> + + + 0% ISC + ISC + 2000 + S + 0.0 + sale + 1 + 1 + + + + diff --git a/addons/l10n_pe/models/account_tax.py b/addons/l10n_pe/models/account_tax.py index 6c0da4f4bcb..10b6a5c7804 100644 --- a/addons/l10n_pe/models/account_tax.py +++ b/addons/l10n_pe/models/account_tax.py @@ -26,6 +26,12 @@ class AccountTax(models.Model): help="Follow the UN/ECE 5305 standard from the United Nations Economic Commission for Europe for more " "information http://www.unece.org/trade/untdid/d08a/tred/tred5305.htm" ) + l10n_pe_edi_isc_type = fields.Selection([ + ('01', 'System to value'), + ('02', 'Application of the Fixed Amount'), + ('03', 'Retail Price System'), + ], 'ISC Type', + help='Used in Selective Consumption Tax to indicate the type of calculation for the ISC.') class AccountTaxTemplate(models.Model): @@ -52,11 +58,18 @@ class AccountTaxTemplate(models.Model): help="Follow the UN/ECE 5305 standard from the United Nations Economic Commission for Europe for more " "information http://www.unece.org/trade/untdid/d08a/tred/tred5305.htm" ) + l10n_pe_edi_isc_type = fields.Selection([ + ('01', 'System to value'), + ('02', 'Application of the Fixed Amount'), + ('03', 'Retail Price System'), + ], 'ISC Type', + help='Used in Selective Consumption Tax to indicate the type of calculation for the ISC.') def _get_tax_vals(self, company, tax_template_to_tax): val = super()._get_tax_vals(company, tax_template_to_tax) val.update({ 'l10n_pe_edi_tax_code': self.l10n_pe_edi_tax_code, 'l10n_pe_edi_unece_category': self.l10n_pe_edi_unece_category, + 'l10n_pe_edi_isc_type': self.l10n_pe_edi_isc_type, }) return val diff --git a/addons/l10n_pe/views/account_tax_view.xml b/addons/l10n_pe/views/account_tax_view.xml index 0180fe8b6ed..c51d523238b 100644 --- a/addons/l10n_pe/views/account_tax_view.xml +++ b/addons/l10n_pe/views/account_tax_view.xml @@ -11,6 +11,8 @@ attrs="{'invisible': [('country_code', '!=', 'PE')]}"/> +