Fixed the program to print the annual interest paid.
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
["2018-09-06", "803.00"],
|
||||
["2018-10-11", "803.00"],
|
||||
["2018-11-13", "803.00"],
|
||||
["2018-12-13", "803.00"]
|
||||
["2018-12-13", "803.00"],
|
||||
["2018-01-11", "803.00"]
|
||||
],
|
||||
"borrower": {
|
||||
"name": "Bear Houses, LLC",
|
||||
|
||||
@@ -123,6 +123,8 @@ def amortizeLoan(loan):
|
||||
|
||||
# create the payment record for the template to render
|
||||
payment_record = {}
|
||||
payment_record['year']=next_bill_date.year
|
||||
payment_record['month']=next_bill_date.month
|
||||
payment_record['payment_number'] = payment_number
|
||||
payment_record['bill_date'] = next_bill_date
|
||||
payment_record['payment_date'] = payment_date
|
||||
@@ -276,11 +278,11 @@ def main():
|
||||
# at closing. The first payment will incur interest from one month before the bill is due.
|
||||
|
||||
# read in the file
|
||||
# filename = "./10Kloan.txt"
|
||||
#filename = "./10Kloan.json"
|
||||
filename = "./testloan.json"
|
||||
# filename = "./10Kloan.json"
|
||||
# filename = "./dadmortgage.json"
|
||||
# filename = "./brendamortgage.json"
|
||||
filename = "./greenfield_mortgage.json"
|
||||
#filename = "./greenfield_mortgage.json"
|
||||
template_filename = "statement.pdf.jinja"
|
||||
|
||||
loan = loadLoanInformation(filename)
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
<td align='right'> {{ "$%.2f"|format(item.interest_payment) }} </td>
|
||||
<td align='right'> {{ "$%.2f"|format(item.new_balance) }} </td>
|
||||
</tr>
|
||||
{% if item.print_interest_total %}
|
||||
<tr><td colspan='8'"> {{ item.interest_total_message }} </td></tr>
|
||||
{% if item.month == '12' or loop.last %}
|
||||
<tr><td colspan='8'"> Total interest paid in {{item.year}} is {{ "$%.2f"|format(item.annual_interest_to_date) }}.</td></tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<tr><td colspan='8'"> Total interest paid to date is {{ "$%.2f"|format(model.total_interest_paid_to_date) }}.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Total interest paid to date is {{ "$%.2f"|format(model.total_interest_paid_to_date) }}.</p>
|
||||
<p/> <p/>
|
||||
|
||||
<p class='section_header'><font face='arial' size='14'>Remaining Amortization</font></p>
|
||||
|
||||
Reference in New Issue
Block a user