call calc_future_totals to pass data onto html so we can show per bill type annual amount in this year

This commit is contained in:
2025-08-30 13:59:29 +10:00
parent 338b63aa06
commit 7422321227

View File

@@ -5,7 +5,7 @@ from db import init_db, get_finance_data, update_finance, get_budget_data, inser
from db import get_bill_data, new_bill, update_bill_data, delete_bill from db import get_bill_data, new_bill, update_bill_data, delete_bill
from db import get_bill_ui, save_ui from db import get_bill_ui, save_ui
from db import get_bill_types, insert_bill_type, update_bill_type, delete_bill_type, use_growth from db import get_bill_types, insert_bill_type, update_bill_type, delete_bill_type, use_growth
from bills import process_bill_data from bills import process_bill_data, calc_future_totals
from defines import END_YEAR from defines import END_YEAR
from collections import defaultdict, Counter from collections import defaultdict, Counter
from datetime import datetime, date from datetime import datetime, date
@@ -147,9 +147,11 @@ def DisplayBillData():
bill_types = get_bill_types() bill_types = get_bill_types()
bill_freqs = get_bill_freqs() bill_freqs = get_bill_freqs()
bill_ui = get_bill_ui() bill_ui = get_bill_ui()
process_bill_data(bill_data, bill_types, bill_freqs) bill_info=process_bill_data(bill_data, bill_types, bill_freqs)
total=calc_future_totals(bill_info, bill_types)
print( f"total={total}" )
bill_data = get_bill_data() bill_data = get_bill_data()
return render_template('bills.html', bill_data=bill_data, bill_types=bill_types, bill_freqs=bill_freqs, bill_ui=bill_ui, this_year=datetime.today().year, END_YEAR=END_YEAR ) return render_template('bills.html', bill_data=bill_data, bill_types=bill_types, bill_freqs=bill_freqs, bill_ui=bill_ui, this_year=datetime.today().year, END_YEAR=END_YEAR, total=total )
@app.route('/newbilltype', methods=['POST']) @app.route('/newbilltype', methods=['POST'])
def InsertBillType(): def InsertBillType():