Updated files to produce accounting information.

This commit is contained in:
john
2023-09-04 14:56:34 -04:00
parent 3757989fcc
commit 9d74519c3e
2 changed files with 21 additions and 8 deletions

View File

@@ -42,6 +42,7 @@
<ul>
<li><a href="#loan_information">Loan Information</a></li>
<li><a href="#loan_history">Loan History</a></li>
<li><a href="#loan_accounting">Loan Accounting</a></li>
<li><a href="#loan_amortization">Future Amortization</a></li>
<li><a href="#email">Email Statement</a></li>
<li><a href="#add_payment">Add a Regular Payment</a></li>
@@ -110,6 +111,20 @@
</tbody>
</table>
</div>
<div id="loan_accounting">
<h3>Loan Accounting</h3>
<textarea border="1px" width="70%" cols="120" rows="25">
{% for item in model.past_payments %}
{{item.payment_date }} * "{{item.payee}}" "Payment #{{ item.payment_number}}"
{{item.payment_account}} {{ "%.2f"|format(item.payment_amount * -1) }} USD
{{item.loan_account}} {{ "%.2f"|format(item.principal_payment) }} USD
{{item.interest_account}} {{ "%.2f"|format(item.interest_payment) }} USD
{% if item.late_fee != 0 %}
{{item.late_fee_account}} {{ "%.2f"|format(item.late_fee) }} USD
{% endif %}
{% endfor %}
</textarea>
</div>
<div id="loan_amortization">
<table border="1px">
<thead>

View File

@@ -346,17 +346,15 @@ def amortizeLoan(loan):
payment_record['interest_to_date'] = total_interest
payment_record['annual_interest_to_date'] = annual_interest
payment_record['late_fee'] = late_fee
payment_record['payee'] = loan["lender"]["name"]
payment_record['payment_account'] = loan["accounting"]["payment_account"]
payment_record['loan_account'] = loan["accounting"]["loan_account"]
payment_record['interest_account'] = loan["accounting"]["interest_account"]
payment_record['late_fee_account'] = "Expenses:Interest:LateFees"
past_payments.append(payment_record)
payment_number = payment_number + 1
print("; Autogenerated 'ledger' transaction")
print(f'{payment_date} * " payee Mortgage Payment {payment_number-1}"')
print(f" Assets:Current:Checking -{payment_amount} USD")
print(f" Liabilities:Mortgages:Mortgage {principal_payment} USD")
print(f" Expenses:Rental:MortgageInterest")
print(";")
#check for the extra payment flag, if its there, don't advance the next payment date
if len(payment) > 3 and payment[3] == "extra":
print("Extra payment flag: " + payment[3])
@@ -523,7 +521,7 @@ def selectTemplate(formatType):
def main():
app.debug = True
app.run(host = '0.0.0.0')
app.run(host = '0.0.0.0', port='8000')
if __name__ == '__main__':