From 7422321227af8548080244fdbc8e5c7fabfd17a4 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 30 Aug 2025 13:59:29 +1000 Subject: [PATCH] call calc_future_totals to pass data onto html so we can show per bill type annual amount in this year --- main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 92a283a..30ca9c0 100644 --- a/main.py +++ b/main.py @@ -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_ui, save_ui 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 collections import defaultdict, Counter from datetime import datetime, date @@ -147,9 +147,11 @@ def DisplayBillData(): bill_types = get_bill_types() bill_freqs = get_bill_freqs() 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() - 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']) def InsertBillType():