Skip to content

Commit

Permalink
Merge PR #4050 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 26, 2025
2 parents 637350c + ef77270 commit 37e9008
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
18 changes: 5 additions & 13 deletions l10n_es_aeat_mod303/models/mod303.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,11 @@ def calculate(self):
- fields.Date.to_date(mod303.date_start)
),
)
if prev_report and (
prev_report.remaining_cuota_compensar > 0
or prev_report.result_type == "C"
):
mod303.write(
{
"potential_cuota_compensar": (
prev_report.remaining_cuota_compensar
- prev_report.resultado_liquidacion
),
}
)
if prev_report.remaining_cuota_compensar > 0:
amount = prev_report.remaining_cuota_compensar
if prev_report.result_type == "C":
amount -= prev_report.resultado_liquidacion
mod303.potential_cuota_compensar = amount if amount > 0 else 0
if mod303.return_last_period:
cuota_compensar = mod303.potential_cuota_compensar
elif (
Expand All @@ -515,7 +508,6 @@ def calculate(self):
else:
cuota_compensar = 0
mod303.cuota_compensar = cuota_compensar

return res

def button_confirm(self):
Expand Down
2 changes: 2 additions & 0 deletions l10n_es_aeat_mod303/tests/test_l10n_es_aeat_mod303.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ def test_model_303_partial_compensation(self):
}
)
model303_3T.button_calculate()
model303_3T.potential_cuota_compensar = 819
model303_3T.cuota_compensar = 609
model303_3T.button_confirm()
model303_3T.button_post()
# Check move lines from 303 3T 2025
Expand Down
2 changes: 2 additions & 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 @@ -401,6 +401,8 @@ def test_model_390_using_303_02(self):

model303_4T.return_last_period = True
model303_4T.button_calculate()
model303_4T.potential_cuota_compensar = 560.85
model303_4T.cuota_compensar = 560.85
self.model390_2023.button_calculate()
# Check casilla_85, casilla_95, casilla_97, casilla_98, casilla_662
self.assertAlmostEqual(self.model390_2023.casilla_85, 0.0, 2)
Expand Down

0 comments on commit 37e9008

Please sign in to comment.