From 870936afa0071351eb8f99cca3c094cb4fb7338e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 24 Jan 2024 10:04:38 +0100 Subject: [PATCH] [IMP] l10n_es_aeat_mod390: Include new food taxes TT47342 Co-Authored-By: Pedro M. Baeza --- .../2022/aeat.model.export.config.line.csv | 4 +- .../2023/aeat.model.export.config.line.csv | 20 +- .../data/tax_code_map_mod390_data.xml | 197 ++++++++++++++++-- l10n_es_aeat_mod390/models/mod390.py | 37 +++- 4 files changed, 226 insertions(+), 32 deletions(-) diff --git a/l10n_es_aeat_mod390/data/2022/aeat.model.export.config.line.csv b/l10n_es_aeat_mod390/data/2022/aeat.model.export.config.line.csv index f119da4904a..8be0085d194 100644 --- a/l10n_es_aeat_mod390/data/2022/aeat.model.export.config.line.csv +++ b/l10n_es_aeat_mod390/data/2022/aeat.model.export.config.line.csv @@ -254,8 +254,8 @@ aeat_mod390_2022_sub03_export_line_64,"right","True",,,,"2","aeat_mod390_2022_su aeat_mod390_2022_sub03_export_line_65,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.casilla_55}",,"5. Operaciones Reg. Gral. - IVA deducible - Total importacion bienes inversion - Cuota [55]","65","17", aeat_mod390_2022_sub03_export_line_66,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 214).amount}",,"5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 4% - Base imponible [214]","66","17", aeat_mod390_2022_sub03_export_line_67,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 215).amount}",,"5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 4% - Cuota [215]","67","17", -aeat_mod390_2022_sub03_export_line_68,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float",,"0","5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 5% - Base imponible [736]","68","17", -aeat_mod390_2022_sub03_export_line_69,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float",,"0","5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 5% - Cuota [737]","69","17", +aeat_mod390_2022_sub03_export_line_68,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 736).amount}",,"5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 5% - Base imponible [736]","68","17", +aeat_mod390_2022_sub03_export_line_69,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 737).amount}",,"5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 5% - Cuota [737]","69","17", aeat_mod390_2022_sub03_export_line_70,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 627).amount}",,"5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 10% - Base imponible [627]","70","17", aeat_mod390_2022_sub03_export_line_71,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 628).amount}",,"5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 10% - Cuota [628]","71","17", aeat_mod390_2022_sub03_export_line_72,"right","True",,,,"2","aeat_mod390_2022_sub03_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 629).amount}",,"5. Operaciones Reg. Gral. - IVA deducible - Adqui. intra. bienes corrientes - Tipo 21% - Base imponible [629]","72","17", diff --git a/l10n_es_aeat_mod390/data/2023/aeat.model.export.config.line.csv b/l10n_es_aeat_mod390/data/2023/aeat.model.export.config.line.csv index 5e096c3fb6a..d1f669606f1 100644 --- a/l10n_es_aeat_mod390/data/2023/aeat.model.export.config.line.csv +++ b/l10n_es_aeat_mod390/data/2023/aeat.model.export.config.line.csv @@ -26,8 +26,8 @@ aeat_mod390_2023_sub02_export_line_02,"left",,,,,,"aeat_mod390_2023_sub02_export aeat_mod390_2023_sub02_export_line_03,"left",,,,,,"aeat_mod390_2023_sub02_export_config","string",,"02","Página","3","2", aeat_mod390_2023_sub02_export_line_04,"left",,,,,,"aeat_mod390_2023_sub02_export_config","string",,"000>","Constante: 000>","4","4", aeat_mod390_2023_sub02_export_line_05,"left",,,,,,"aeat_mod390_2023_sub02_export_config","string",,,"Indicador de página complementaria: En blanco","5","1", -aeat_mod390_2023_sub02_export_line_06,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. ordin. - Tipo 0% - Base imponible [700]","6","17", -aeat_mod390_2023_sub02_export_line_07,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. ordin. - Tipo 0% - Cuota [701]","7","17", +aeat_mod390_2023_sub02_export_line_06,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 700).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. ordin. - Tipo 0% - Base imponible [700]","6","17", +aeat_mod390_2023_sub02_export_line_07,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 701).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. ordin. - Tipo 0% - Cuota [701]","7","17", aeat_mod390_2023_sub02_export_line_08,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 1).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. ordin. - Tipo 4% - Base imponible [01]","8","17", aeat_mod390_2023_sub02_export_line_09,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 2).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. ordin. - Tipo 4% - Cuota [02]","9","17", aeat_mod390_2023_sub02_export_line_10,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 702).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. ordin. - Tipo 5% - Base imponible [702]","10","17", @@ -68,22 +68,22 @@ aeat_mod390_2023_sub02_export_line_44,"right","True",,,,"2","aeat_mod390_2023_su aeat_mod390_2023_sub02_export_line_45,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. espec. bienes usados - Cuota [12]","45","17", aeat_mod390_2023_sub02_export_line_46,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. espec. agencias viajes - Tipo 21% - Base imponible [13]","46","17", aeat_mod390_2023_sub02_export_line_47,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Reg. espec. agencias viajes - Tipo 21% - Cuota [14]","47","17", -aeat_mod390_2023_sub02_export_line_48,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 0% - Base imponible [716]","48","17", -aeat_mod390_2023_sub02_export_line_49,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 0% - Cuota [717]","49","17", +aeat_mod390_2023_sub02_export_line_48,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 716).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 0% - Base imponible [716]","48","17", +aeat_mod390_2023_sub02_export_line_49,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 717).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 0% - Cuota [717]","49","17", aeat_mod390_2023_sub02_export_line_50,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 21).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 4% - Base imponible [21]","50","17", aeat_mod390_2023_sub02_export_line_51,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 22).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 4% - Cuota [22]","51","17", -aeat_mod390_2023_sub02_export_line_52,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 5% - Base imponible [718]","52","17", -aeat_mod390_2023_sub02_export_line_53,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 5% - Base imponible [719]","53","17", +aeat_mod390_2023_sub02_export_line_52,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 718).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 5% - Base imponible [718]","52","17", +aeat_mod390_2023_sub02_export_line_53,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 719).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 5% - Base imponible [719]","53","17", aeat_mod390_2023_sub02_export_line_54,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 23).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 10% - Base imponible [23]","54","17", aeat_mod390_2023_sub02_export_line_55,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 24).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 10% - Cuota [24]","55","17", aeat_mod390_2023_sub02_export_line_56,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 25).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 21% - Base imponible [25]","56","17", aeat_mod390_2023_sub02_export_line_57,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 26).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. bienes - Tipo 21% - Cuota [26]","57","17", -aeat_mod390_2023_sub02_export_line_58,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 0% - Base Imponible [720]","58","17", -aeat_mod390_2023_sub02_export_line_59,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 0% - Cuota [721]","59","17", +aeat_mod390_2023_sub02_export_line_58,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 720).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 0% - Base Imponible [720]","58","17", +aeat_mod390_2023_sub02_export_line_59,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 721).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 0% - Cuota [721]","59","17", aeat_mod390_2023_sub02_export_line_60,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 545).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 4% - Base Imponible [545]","60","17", aeat_mod390_2023_sub02_export_line_61,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 546).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 4% - Cuota [546]","61","17", -aeat_mod390_2023_sub02_export_line_62,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 5% - Base Imponible [722]","62","17", -aeat_mod390_2023_sub02_export_line_63,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float",,"0","5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 5% - Cuota [723]","63","17", +aeat_mod390_2023_sub02_export_line_62,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 722).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 5% - Base Imponible [722]","62","17", +aeat_mod390_2023_sub02_export_line_63,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 723).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 5% - Cuota [723]","63","17", aeat_mod390_2023_sub02_export_line_64,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 547).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 10% - Base Imponible [547]","64","17", aeat_mod390_2023_sub02_export_line_65,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 548).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 10% - Cuota [548]","65","17", aeat_mod390_2023_sub02_export_line_66,"right","True",,,,"2","aeat_mod390_2023_sub02_export_config","float","${object.tax_line_ids.filtered(lambda r: r.field_number == 551).amount}",,"5. Operaciones Reg. Gral. - Base Imponible y cuota - Adquis. intracomunit. servicios - Tipo 21% - Base Imponible [551]","66","17", diff --git a/l10n_es_aeat_mod390/data/tax_code_map_mod390_data.xml b/l10n_es_aeat_mod390/data/tax_code_map_mod390_data.xml index 6158e1ef4d7..cf26be4abd3 100644 --- a/l10n_es_aeat_mod390/data/tax_code_map_mod390_data.xml +++ b/l10n_es_aeat_mod390/data/tax_code_map_mod390_data.xml @@ -298,7 +298,7 @@ @@ -311,7 +311,7 @@ @@ -323,8 +323,6 @@ both - both - @@ -488,7 +482,7 @@ @@ -501,7 +495,7 @@ @@ -1156,7 +1150,7 @@ @@ -1170,7 +1164,7 @@ @@ -1300,6 +1294,32 @@ eval="[(6, False, [ref('l10n_es.account_tax_template_p_iva0_nd'), ref('l10n_es.account_tax_template_p_iva10_nd'), ref('l10n_es.account_tax_template_p_iva4_nd')])]" /> + + + 700 + Régimen ordinario - Base imponible 0% + regular + base + both + + + + + + 701 + Régimen ordinario - Cuota 0% + regular + amount + both + + + 702 @@ -1326,6 +1346,122 @@ eval="[(6, False, [ref('l10n_es.account_tax_template_s_iva5b'), ref('l10n_es.account_tax_template_s_iva5s')])]" /> + + + 716 + Adquisiciones intracomunitarias de bienes - Base 0% + regular + base + both + + + + + + 717 + Adquisiciones intracomunitarias de bienes - Cuota 0% + regular + amount + both + + + + + + + 718 + Adquisiciones intracomunitarias de bienes - Base 5% + regular + base + both + + + + + + 719 + Adquisiciones intracomunitarias de bienes - Cuota 5% + regular + amount + both + + + + + + + 720 + Adquisiciones intracomunitarias de servicios - Base 0% + regular + base + both + + + + + + 721 + Adquisiciones intracomunitarias de servicios - Cuota 0% + regular + amount + both + + + + + + + 722 + Adquisiciones intracomunitarias de servicios - Base 5% + regular + base + both + + + + + + 723 + Adquisiciones intracomunitarias de servicios - Cuota 5% + regular + amount + both + + + + 724 @@ -1338,7 +1474,7 @@ @@ -1353,7 +1489,38 @@ + + + + 736 + IVA deducible en adquisiciones intracomunitarias de bienes corrientes - Base 5% + regular + base + both + + + + + + 737 + IVA deducible en adquisiciones intracomunitarias de bienes corrientes - Cuota 5% + regular + amount + both + + + diff --git a/l10n_es_aeat_mod390/models/mod390.py b/l10n_es_aeat_mod390/models/mod390.py index 09d46449f8c..cb013fe8248 100644 --- a/l10n_es_aeat_mod390/models/mod390.py +++ b/l10n_es_aeat_mod390/models/mod390.py @@ -451,24 +451,35 @@ def _compute_casilla_33(self): report.tax_line_ids.filtered( lambda x: x.field_number in ( + 700, 1, - 3, 702, + 3, 5, # Régimen ordinario + 704, 500, + 706, 502, 504, # Intragrupo - no incluido aún + 708, 643, + 710, 645, 647, # Criterio de caja - no incluido aún + 712, 7, + 714, 9, 11, # Bienes usados, etc - no incluido aún 13, # Agencias de viajes - no incluido aún + 716, 21, + 718, 23, 25, # Adquis. intracomunitaria bienes + 720, 545, + 722, 547, 551, # Adquis. intracomunitaria servicios 27, # IVA otras operaciones sujeto pasivo @@ -486,24 +497,35 @@ def _compute_casilla_34(self): report.tax_line_ids.filtered( lambda x: x.field_number in ( + 701, 2, - 4, 703, + 4, 6, # Régimen ordinario + 705, 501, + 707, 503, 505, # Intragrupo - no incluido aún + 709, 644, + 711, 646, 648, # Criterio de caja - no incluido aún + 713, 8, + 715, 10, 12, # Bienes usados, etc - no incluido aún 14, # Agencias de viajes - no incluido aún + 717, 22, + 719, 24, 26, # Adquis. intracomunitaria bienes + 721, 546, + 723, 548, 552, # Adquis. intracomunitaria servicios 28, # IVA otras operaciones sujeto pasivo @@ -521,9 +543,12 @@ def _compute_casilla_47(self): report.tax_line_ids.filtered( lambda x: x.field_number in ( + 664, 36, + 666, 600, - 602, # Recargo de equivalencia + 602, + 42, # Recargo de equivalencia 44, # Modificación recargo de equivalencia 46, # Mod. recargo equiv. concurso - no incluido aún ) @@ -532,6 +557,7 @@ def _compute_casilla_47(self): @api.depends("tax_line_ids", "tax_line_ids.amount") def _compute_casilla_38(self): + """Deprecated field left for old reports. To be removed in newer versions.""" for report in self: report.casilla_38 = sum( report.tax_line_ids.filtered( @@ -541,6 +567,7 @@ def _compute_casilla_38(self): @api.depends("tax_line_ids", "tax_line_ids.amount") def _compute_casilla_39(self): + """Deprecated field left for old reports. To be removed in newer versions.""" for report in self: report.casilla_39 = sum( report.tax_line_ids.filtered( @@ -625,7 +652,7 @@ def _compute_casilla_56(self): for report in self: report.casilla_56 = sum( report.tax_line_ids.filtered( - lambda x: x.field_number in (214, 216, 579, 627, 218, 581, 629) + lambda x: x.field_number in (214, 216, 579, 627, 218, 581, 629, 736) ).mapped("amount") ) @@ -634,7 +661,7 @@ def _compute_casilla_57(self): for report in self: report.casilla_57 = sum( report.tax_line_ids.filtered( - lambda x: x.field_number in (215, 217, 580, 628, 219, 582, 630) + lambda x: x.field_number in (215, 217, 580, 628, 219, 582, 630, 737) ).mapped("amount") )