Skip to content

Commit

Permalink
[IMP] l10n_es_aeat_mod390: 2024 tax mapping and BOE export format
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobaeza committed Jan 14, 2025
1 parent 920aae1 commit 15b5875
Show file tree
Hide file tree
Showing 12 changed files with 659 additions and 23 deletions.
17 changes: 12 additions & 5 deletions l10n_es_aeat_mod390/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2017-2024 Tecnativa - Pedro M. Baeza
# Copyright 2017,2025 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl

{
Expand All @@ -10,6 +10,11 @@
"license": "AGPL-3",
"depends": ["l10n_es_aeat_mod303"],
"data": [
# 2019
"data/l10n.es.aeat.map.tax.csv",
"data/l10n.es.aeat.map.tax.line.account.csv", # Should be before the main one
"data/l10n.es.aeat.map.tax.line.tax.csv", # Should be before the main one
"data/l10n.es.aeat.map.tax.line.csv",
"data/aeat_export_mod390_2019_sub04_data.xml",
"data/aeat_export_mod390_2019_sub07_data.xml",
"data/aeat_export_mod390_2019_sub08_data.xml",
Expand All @@ -22,11 +27,13 @@
# 2023
"data/2023/aeat.model.export.config.csv",
"data/2023/aeat.model.export.config.line.csv",
# 2024
"data/2024/aeat.model.export.config.csv",
"data/2024/aeat.model.export.config.line.csv",
"data/2024/l10n.es.aeat.map.tax.csv",
"data/2024/l10n.es.aeat.map.tax.line.tax.csv", # Should be before the main one
"data/2024/l10n.es.aeat.map.tax.line.csv",
# rest of stuff
"data/l10n.es.aeat.map.tax.csv",
"data/l10n.es.aeat.map.tax.line.account.csv", # Should be before the main one
"data/l10n.es.aeat.map.tax.line.tax.csv", # Should be before the main one
"data/l10n.es.aeat.map.tax.line.csv",
"views/mod390_view.xml",
"views/account_move_view.xml",
"security/ir.model.access.csv",
Expand Down
2 changes: 1 addition & 1 deletion l10n_es_aeat_mod390/data/2023/aeat.model.export.config.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
id,active,date_start,date_end,model_id:id,model_number,name
aeat_mod390_2023_main_export_config,True,"2023-01-01",,"model_l10n_es_aeat_mod390_report","390","Mod.390 2023-actualidad"
aeat_mod390_2023_main_export_config,True,"2023-01-01","2023-12-31","model_l10n_es_aeat_mod390_report","390","Mod.390 2023"
aeat_mod390_2023_sub02_export_config,"False",,,,"390","Mod.390 2023 - Página 2"
7 changes: 7 additions & 0 deletions l10n_es_aeat_mod390/data/2024/aeat.model.export.config.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id,active,date_start,date_end,model_id:id,model_number,name
aeat_mod390_2024_main_export_config,True,"2024-01-01",,"model_l10n_es_aeat_mod390_report","390","Mod.390 2024-actualidad"
aeat_mod390_2024_sub02_export_config,"False",,,,"390","Mod.390 2024 - Página 2"
aeat_mod390_2024_sub02_bis_export_config,"False",,,,"390","Mod.390 2024 - Página 2 (bis)"
aeat_mod390_2024_sub03_export_config,"False",,,,"390","Mod.390 2024 - Página 3"
aeat_mod390_2024_sub04_export_config,"False",,,,"390","Mod.390 2024 - Página 4"
aeat_mod390_2024_sub05_export_config,"False",,,,"390","Mod.390 2024 - Página 5"
413 changes: 413 additions & 0 deletions l10n_es_aeat_mod390/data/2024/aeat.model.export.config.line.csv

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions l10n_es_aeat_mod390/data/2024/l10n.es.aeat.map.tax.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,model,date_from,date_to
aeat_mod390_2024_map,"390",2024-01-01,
136 changes: 136 additions & 0 deletions l10n_es_aeat_mod390/data/2024/l10n.es.aeat.map.tax.line.csv

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions l10n_es_aeat_mod390/data/2024/l10n.es.aeat.map.tax.line.tax.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id,name
p_iva2_bc,account_tax_template_p_iva2_bc
p_iva7-5_bc,account_tax_template_p_iva7-5_bc
p_iva2_sc,account_tax_template_p_iva2_sc
p_iva7-5_sc,account_tax_template_p_iva7-5_sc
p_iva2_ic_bc,account_tax_template_p_iva2_ic_bc
p_iva2_ic_sc,account_tax_template_p_iva2_ic_sc
p_iva7-5_ic_bc,account_tax_template_p_iva7-5_ic_bc
p_iva7-5_ic_sc,account_tax_template_p_iva7-5_ic_sc
p_iva2_nd,account_tax_template_p_iva2_nd
p_iva5_nd,account_tax_template_p_iva5_nd
p_iva7-5_nd,account_tax_template_p_iva7-5_nd
p_iva2_ibc,account_tax_template_p_iva2_ibc
p_iva7-5_ibc,account_tax_template_p_iva7-5_ibc
s_iva2b,account_tax_template_s_iva2b
s_iva2s,account_tax_template_s_iva2s
s_iva7-5b,account_tax_template_s_iva7-5b
s_iva7-5s,account_tax_template_s_iva7-5s
s_req026,account_tax_template_s_req026
s_req1,account_tax_template_s_req1
p_req026,account_tax_template_p_req026
p_req1,account_tax_template_p_req1
p_iva0_isc,account_tax_template_p_iva0_isc
p_iva2_isc,account_tax_template_p_iva2_isc
p_iva5_isc,account_tax_template_p_iva5_isc
p_iva7-5_isc,account_tax_template_p_iva7-5_isc
p_iva0_s_bc,account_tax_template_p_iva0_s_bc
p_iva0_s_sc,account_tax_template_p_iva0_s_sc
2 changes: 1 addition & 1 deletion l10n_es_aeat_mod390/data/l10n.es.aeat.map.tax.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,model,date_from,date_to
aeat_mod390_map,"390",,
aeat_mod390_map,"390",,2023-12-31
Binary file added l10n_es_aeat_mod390/docs/dr390e2024.xlsx
Binary file not shown.
Binary file modified l10n_es_aeat_mod390/docs/instr390.pdf
Binary file not shown.
74 changes: 58 additions & 16 deletions l10n_es_aeat_mod390/models/mod390.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,34 +382,46 @@ def _compute_casilla_33(self):
lambda x: x.field_number
in (
700,
667,
1,
702,
669,
3,
5, # Régimen ordinario
704,
671,
500,
706,
673,
502,
504, # Intragrupo - no incluido aún
708,
675,
643,
710,
677,
645,
647, # Criterio de caja - no incluido aún
712,
679,
7,
714,
681,
9,
11, # Bienes usados, etc - no incluido aún
13, # Agencias de viajes - no incluido aún
716,
683,
21,
718,
685,
23,
25, # Adquis. intracomunitaria bienes
720,
687,
545,
722,
689,
547,
551, # Adquis. intracomunitaria servicios
27, # IVA otras operaciones sujeto pasivo
Expand All @@ -428,34 +440,46 @@ def _compute_casilla_34(self):
lambda x: x.field_number
in (
701,
668,
2,
703,
670,
4,
6, # Régimen ordinario
705,
672,
501,
707,
674,
503,
505, # Intragrupo - no incluido aún
709,
676,
644,
711,
646,
678,
46,
648, # Criterio de caja - no incluido aún
713,
680,
8,
715,
682,
10,
12, # Bienes usados, etc - no incluido aún
14, # Agencias de viajes - no incluido aún
717,
684,
22,
719,
686,
24,
26, # Adquis. intracomunitaria bienes
721,
688,
546,
723,
690,
548,
552, # Adquis. intracomunitaria servicios
28, # IVA otras operaciones sujeto pasivo
Expand All @@ -474,8 +498,10 @@ def _compute_casilla_47(self):
lambda x: x.field_number
in (
664,
692,
36,
666,
694,
600,
602,
42, # Recargo de equivalencia
Expand Down Expand Up @@ -510,7 +536,7 @@ def _compute_casilla_48(self):
for report in self:
report.casilla_48 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (190, 192, 555, 603, 194, 557, 605, 724)
lambda x: x.field_number in (695, 190, 724, 697, 603, 605)
).mapped("amount")
)

Expand All @@ -519,7 +545,7 @@ def _compute_casilla_49(self):
for report in self:
report.casilla_49 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (191, 193, 556, 604, 195, 558, 606, 725)
lambda x: x.field_number in (696, 191, 725, 698, 604, 606)
).mapped("amount")
)

Expand All @@ -528,7 +554,7 @@ def _compute_casilla_50(self):
for report in self:
report.casilla_50 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (196, 611, 613)
lambda x: x.field_number in (749, 196, 728, 751, 611, 613)
).mapped("amount")
)

Expand All @@ -537,7 +563,7 @@ def _compute_casilla_51(self):
for report in self:
report.casilla_51 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (197, 612, 614)
lambda x: x.field_number in (750, 197, 729, 752, 612, 614)
).mapped("amount")
)

Expand All @@ -546,7 +572,7 @@ def _compute_casilla_52(self):
for report in self:
report.casilla_52 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (202, 204, 571, 619, 206, 573, 621)
lambda x: x.field_number in (757, 202, 732, 759, 619, 621)
).mapped("amount")
)

Expand All @@ -555,7 +581,7 @@ def _compute_casilla_53(self):
for report in self:
report.casilla_53 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (203, 205, 572, 620, 207, 574, 622)
lambda x: x.field_number in (758, 203, 733, 760, 620, 622)
).mapped("amount")
)

Expand All @@ -564,7 +590,7 @@ def _compute_casilla_54(self):
for report in self:
report.casilla_54 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (208, 623, 625)
lambda x: x.field_number in (761, 208, 734, 763, 623, 625)
).mapped("amount")
)

Expand All @@ -573,7 +599,7 @@ def _compute_casilla_55(self):
for report in self:
report.casilla_55 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (209, 624, 626)
lambda x: x.field_number in (762, 209, 735, 764, 624, 626)
).mapped("amount")
)

Expand All @@ -582,7 +608,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, 736)
lambda x: x.field_number in (765, 214, 736, 767, 627, 629)
).mapped("amount")
)

Expand All @@ -591,7 +617,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, 737)
lambda x: x.field_number in (766, 215, 737, 768, 628, 630)
).mapped("amount")
)

Expand All @@ -600,7 +626,7 @@ def _compute_casilla_58(self):
for report in self:
report.casilla_58 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (220, 631, 633)
lambda x: x.field_number in (769, 220, 738, 771, 631, 633)
).mapped("amount")
)

Expand All @@ -609,7 +635,7 @@ def _compute_casilla_59(self):
for report in self:
report.casilla_59 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (221, 632, 634)
lambda x: x.field_number in (770, 221, 739, 772, 632, 634)
).mapped("amount")
)

Expand All @@ -618,7 +644,7 @@ def _compute_casilla_597(self):
for report in self:
report.casilla_597 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (587, 589, 591, 635, 593, 595, 637)
lambda x: x.field_number in (773, 587, 740, 775, 635, 637)
).mapped("amount")
)

Expand All @@ -627,7 +653,7 @@ def _compute_casilla_598(self):
for report in self:
report.casilla_598 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number in (588, 590, 592, 636, 594, 596, 638)
lambda x: x.field_number in (774, 588, 741, 776, 636, 638)
).mapped("amount")
)

Expand Down Expand Up @@ -676,7 +702,23 @@ def _compute_casilla_108(self):
report.casilla_108 = sum(
report.tax_line_ids.filtered(
lambda x: x.field_number
in (99, 653, 103, 104, 105, 110, 112, 100, 101, 102, 227, 228)
in (
99,
653,
103,
104,
105,
110,
100,
101,
102,
125,
126,
127,
128,
227,
228,
)
).mapped("amount")
) - sum(
report.tax_line_ids.filtered(
Expand Down
1 change: 1 addition & 0 deletions l10n_es_aeat_mod390/tests/test_l10n_es_aeat_mod390.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ def test_model_390(self):
)
export_config_xml_ids = [
"l10n_es_aeat_mod390.aeat_mod390_2023_main_export_config",
"l10n_es_aeat_mod390.aeat_mod390_2024_main_export_config",
]
for xml_id in export_config_xml_ids:
export_config = self.env.ref(xml_id)
Expand Down

0 comments on commit 15b5875

Please sign in to comment.