Skip to content

Commit

Permalink
[FIX] account_interests: Fix when having interval to run interest
Browse files Browse the repository at this point in the history
closes #189

X-original-commit: 04cdd73
Related: ingadhoc/account-financial-tools#654
Signed-off-by: Ignacio Cainelli <[email protected]>
Signed-off-by: rov-adhoc <[email protected]>
  • Loading branch information
rov-adhoc committed Jan 30, 2025
1 parent 8741848 commit 06794f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion academic_account_interests/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Academic Account Interests',
'version': "18.0.1.0.0",
'version': "18.0.1.1.0",
'sequence': 14,
'summary': '',
'author': 'ADHOC SA',
Expand Down
4 changes: 2 additions & 2 deletions academic_account_interests/models/res_company_interest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _calculate_debts(self, from_date, to_date, groupby=['student_id', 'partner_i
aggregates=['amount_residual:sum'],
)
for x in previous_grouped_lines:
self._update_deuda(deuda, x[0], 'Deuda periodos anteriores', x[2] * self.rate)
self._update_deuda(deuda, x[0], 'Deuda periodos anteriores', x[2] * self.rate * self.interval)
deuda[x[0]]['partner_id'] = x[1]

# Intereses por el último período
Expand All @@ -45,7 +45,7 @@ def _calculate_debts(self, from_date, to_date, groupby=['student_id', 'partner_i
)
for student, amls in last_period_lines.grouped('student_id').items():
interest = sum(
move.amount_residual * ((to_date - move.invoice_date_due).days - 1) * (self.rate / interest_rate[self.rule_type])
move.amount_residual * ((to_date - move.invoice_date_due).days) * (self.rate / interest_rate[self.rule_type])
for move, lines in amls.grouped('move_id').items()
)
self._update_deuda(deuda, student, 'Deuda último periodo', interest)
Expand Down

0 comments on commit 06794f0

Please sign in to comment.