Skip to content

Commit

Permalink
[IMP] l10n_es_aeat_mod369: Changes on export file
Browse files Browse the repository at this point in the history
  • Loading branch information
aritzolea committed Feb 21, 2024
1 parent 403d088 commit eb421c2
Show file tree
Hide file tree
Showing 7 changed files with 565 additions and 535 deletions.
284 changes: 142 additions & 142 deletions l10n_es_aeat_mod369/data/2022/04/aeat.model.export.config.line.csv

Large diffs are not rendered by default.

280 changes: 140 additions & 140 deletions l10n_es_aeat_mod369/data/2022/05/aeat.model.export.config.line.csv

Large diffs are not rendered by default.

168 changes: 84 additions & 84 deletions l10n_es_aeat_mod369/data/2022/06/aeat.model.export.config.line.csv

Large diffs are not rendered by default.

168 changes: 84 additions & 84 deletions l10n_es_aeat_mod369/data/2022/07/aeat.model.export.config.line.csv

Large diffs are not rendered by default.

168 changes: 84 additions & 84 deletions l10n_es_aeat_mod369/data/2022/08/aeat.model.export.config.line.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion l10n_es_aeat_mod369/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ msgstr "Informe AEAT Modelo 369"
#. module: l10n_es_aeat_mod369
#: model:ir.ui.menu,name:l10n_es_aeat_mod369.menu_aeat_mod369_report
msgid "AEAT 369 model"
msgstr "Modelo 369 AEAT"
msgstr "Modelo 369"

#. module: l10n_es_aeat_mod369
#: model_terms:ir.ui.view,arch_db:l10n_es_aeat_mod369.view_l10n_es_aeat_mod369_report_tree
Expand Down
30 changes: 30 additions & 0 deletions l10n_es_aeat_mod369/models/mod369_line_grouped.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,20 @@ def _compute_totals(self):
)
tax_id = fields.Many2one(string="Tax", comodel_name="account.tax")
vat_type = fields.Float(string="VAT Type", related="tax_id.amount")
vat_type_str = fields.Char(compute="_compute_vat_type_str")
service_type = fields.Selection(
related="tax_id.service_type",
string="Service type",
)
base = fields.Float(string="Base total", compute="_compute_totals")
base_str = fields.Char(compute="_compute_base_str")
amount = fields.Float(string="Amount total", compute="_compute_totals")
amount_str = fields.Char(compute="_compute_amount_str")
is_refund = fields.Boolean()
refund_fiscal_year = fields.Integer()
refund_period = fields.Char()
tax_correction = fields.Float()
tax_correction_str = fields.Char(compute="_compute_tax_correction_str")
# page 8 fields
is_page_8_line = fields.Boolean(
string="Is part of page 8", help="Used to filter for grouped lines for page 8"
Expand All @@ -131,6 +135,32 @@ def _compute_totals(self):
total_deposit = fields.Float(string="Total to deposit ES")
total_return = fields.Float(string="Total to return EM")

@api.depends("vat_type")
def _compute_vat_type_str(self):
for line in self:
vat_type_split = str(line.vat_type).split(".")
line.vat_type_str = vat_type_split[0].zfill(3) + vat_type_split[1].zfill(2)

Check warning on line 142 in l10n_es_aeat_mod369/models/mod369_line_grouped.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_aeat_mod369/models/mod369_line_grouped.py#L141-L142

Added lines #L141 - L142 were not covered by tests

@api.depends("base")
def _compute_base_str(self):
for line in self:
base_split = str(line.base).split(".")
line.base_str = base_split[0].zfill(15) + base_split[1].zfill(2)

Check warning on line 148 in l10n_es_aeat_mod369/models/mod369_line_grouped.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_aeat_mod369/models/mod369_line_grouped.py#L147-L148

Added lines #L147 - L148 were not covered by tests

@api.depends("amount")
def _compute_amount_str(self):
for line in self:
amount_split = str(line.amount).split(".")
line.amount_str = amount_split[0].zfill(15) + amount_split[1].zfill(2)

Check warning on line 154 in l10n_es_aeat_mod369/models/mod369_line_grouped.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_aeat_mod369/models/mod369_line_grouped.py#L153-L154

Added lines #L153 - L154 were not covered by tests

@api.depends("tax_correction")
def _compute_tax_correction_str(self):
for line in self:
tax_correction_split = str(line.tax_correction).split(".")
line.tax_correction_str = tax_correction_split[0].zfill(

Check warning on line 160 in l10n_es_aeat_mod369/models/mod369_line_grouped.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_aeat_mod369/models/mod369_line_grouped.py#L159-L160

Added lines #L159 - L160 were not covered by tests
15
) + tax_correction_split[1].zfill(2)

@api.depends("oss_country_id", "oss_country_id.code")
def _compute_country_code(self):
for line in self:
Expand Down

0 comments on commit eb421c2

Please sign in to comment.