Browse Source

[FIX] fix interest calculation for first year.

interim interest was added after accrued interest was set so it wasn't
taken into account
pull/134/head
houssine 4 years ago
parent
commit
49e512daf3
  1. 6
      easy_my_coop_loan/models/loan_issue_line.py

6
easy_my_coop_loan/models/loan_issue_line.py

@ -217,6 +217,8 @@ class LoanIssueLine(models.Model):
accrued_amount -= due_amount accrued_amount -= due_amount
due_loan_amount = due_amount due_loan_amount = due_amount
if year == 1:
interest += interim_amount
if loan_issue.interest_payment == "end": if loan_issue.interest_payment == "end":
accrued_interest += interest accrued_interest += interest
@ -235,10 +237,6 @@ class LoanIssueLine(models.Model):
due_amount += net_interest due_amount += net_interest
accrued_interest = interest accrued_interest = interest
if year == 1:
interest += interim_amount
accrued_interest = interest
accrued_net_interest += net_interest accrued_net_interest += net_interest
accrued_taxes += taxes_amount accrued_taxes += taxes_amount
vals["due_date"] = due_date vals["due_date"] = due_date

Loading…
Cancel
Save