put back ioniq 6 future bills, but use bill data to set values - assumption at present is they are yearly bills, could do better, but good enough for now. This commit also changes selects to return bill_type not bill_type_id and removed some debugs for bill amt in calc loop

This commit is contained in:
2025-09-05 12:20:08 +10:00
parent ebac4aaf66
commit c5cfc00793
4 changed files with 34 additions and 22 deletions

4
db.py
View File

@@ -275,11 +275,11 @@ def get_bill_data(order_by):
conn = connect_db(True)
cur = conn.cursor()
if order_by == "order_by_date_only":
cur.execute('''SELECT bd.id, bt.id as bill_type_id, bt.name, bd.amount, bd.bill_date, bd.estimated
cur.execute('''SELECT bd.id, bt.id as bill_type, bt.name, bd.amount, bd.bill_date, bd.estimated
FROM bill_type bt, bill_data bd
where bt.id = bd.bill_type order by bd.bill_date desc''')
else:
cur.execute('''SELECT bd.id, bt.id as bill_type_id, bt.name, bd.amount, bd.bill_date, bd.estimated
cur.execute('''SELECT bd.id, bt.id as bill_type, bt.name, bd.amount, bd.bill_date, bd.estimated
FROM bill_type bt, bill_data bd
where bt.id = bd.bill_type order by bt.name, bd.bill_date desc''')
bd = cur.fetchall()