|
|
@ -207,6 +207,8 @@ class LoanIssueLine(models.Model): |
|
|
|
for year in range(1, loan_term + 1): |
|
|
|
interest = accrued_amount * rate |
|
|
|
due_amount = 0 |
|
|
|
due_loan_amount = 0 |
|
|
|
|
|
|
|
if loan_issue.capital_payment == "end": |
|
|
|
if year == loan_term: |
|
|
|
due_amount = line.amount |
|
|
@ -214,6 +216,8 @@ class LoanIssueLine(models.Model): |
|
|
|
due_amount = line.amount * (loan_term / 100) |
|
|
|
accrued_amount -= due_amount |
|
|
|
|
|
|
|
due_loan_amount = due_amount |
|
|
|
|
|
|
|
if loan_issue.interest_payment == "end": |
|
|
|
accrued_interest += interest |
|
|
|
accrued_amount += interest |
|
|
@ -238,6 +242,7 @@ class LoanIssueLine(models.Model): |
|
|
|
accrued_net_interest += net_interest |
|
|
|
accrued_taxes += taxes_amount |
|
|
|
vals["due_date"] = due_date |
|
|
|
vals["due_loan_amount"] = due_loan_amount |
|
|
|
vals["due_amount"] = due_amount |
|
|
|
vals["interest"] = interest |
|
|
|
vals["net_interest"] = net_interest |
|
|
|