Updated files to produce current daily interest accrual information. Fixed calculation bug. Added current balance to loan information screen.
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
<tr><td><b>Term: </b></td><td>{{model.parameters.periods }} months </td></tr>
|
||||
<tr><td><b>Next Payment Due Date:</b></td><td> {{model.parameters.next_due_date}} </td></tr>
|
||||
<tr><td><b>Payment Due:</b></td><td> {{ "$%.2f"|format(model.parameters.next_payment_amt) }} </td></tr>
|
||||
<tr><td><b>Current Balance</b></td><td> {{ "$%.2f"|format(model.current_balance) }}</td></tr>
|
||||
<tr><td><b>Daily Interest Accrual:</b></td><td> {{ "$%.2f"|format(model.current_daily_interest_accrual) }}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -385,6 +385,9 @@ def amortizeLoan(loan):
|
||||
else:
|
||||
loan["parameters"]["next_payment_amt"] = monthly_payment
|
||||
|
||||
loan["current_balance"] = remaining_principal
|
||||
loan["current_daily_interest_accrual"] = (remaining_principal * daily_interest_rate).quantize(Decimal("0.00"))
|
||||
|
||||
# loop over remaining scheduled payments and present estimated amortization
|
||||
while (payment_number <= total_periods) and (remaining_principal > 0):
|
||||
days_since_last_payment = (next_bill_date - interest_paid_through_date).days
|
||||
@@ -419,7 +422,7 @@ def amortizeLoan(loan):
|
||||
next_bill_date = date(year=old_bill_date.year, month=old_bill_date.month + 1, day=payment_day_of_month)
|
||||
else:
|
||||
next_bill_date = date(year=old_bill_date.year + 1, month=1, day=payment_day_of_month)
|
||||
loan["current_daily_interest_accrual"] = (remaining_principal * daily_interest_rate).quantize(Decimal("0.00"))
|
||||
|
||||
loan["balloon_payment"] = remaining_principal
|
||||
loan["past_payments"] = past_payments
|
||||
loan["future_payments"] = future_payments
|
||||
|
||||
Reference in New Issue
Block a user