now allows downloading, defaults include health care and better leave calc. This is probably good enough now, so I have also saved a snapshot/csv of the data

This commit is contained in:
2025-01-31 20:07:40 +11:00
parent ae867d8fac
commit c2886faa30
7 changed files with 90 additions and 17 deletions

12
db.py
View File

@@ -41,7 +41,7 @@ def init_db():
cur.execute('''INSERT INTO finance (D_Salary, D_Num_fortnights_pay, School_Fees, Car_loan_via_pay, Car_loan, Car_balloon, Living_Expenses, Savings, Interest_Rate,
Inflation, Mich_present, Overseas_trip, Mark_reno, D_leave_owed_in_days, D_TLS_shares, M_TLS_shares, D_CBA_shares, TLS_price, CBA_price, Overseas_trip_date, Mark_reno_date, Sell_shares)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(4762.29, 6, 22000, 620, 1001.12, 45824.68, 78000, 412000, 5.0, 3.9, 10000, 32000, 10000, 90.6, 1000, 750, 1095, 3.99, 160.61, '2025-06-01', '2025-09-01', 5))
(4762.29, 6, 22000, 620, 1001.12, 45824.68, 83000, 412000, 5.0, 3.9, 10000, 32000, 10000, 90.6, 1000, 750, 1095, 3.99, 160.61, '2025-06-01', '2025-09-01', 6))
# NOTE: 1001.12 car-pay -- is 1017.99 (actual rate) - 16.87 (car park)
# NOTE: o/s trip. ~ $4kpp flights x3, then ~$3k / week in barcelona accom, $100pp/pd for food ($2k), + spending money
conn.commit()
@@ -55,6 +55,16 @@ def get_finance_data():
conn.close()
return dict(finance)
def get_budget_data(finance_data, CBA, TLS):
# annual bills - health ins (5k), rates (2.4), electricity (1.5), gas (2), internet (1.6), car insurance (.7), rego (.8), house insurance (2.4), GFC (2.2), phones (.5), melb. pollen (.03), nabu casa (.1), eweka (.1) --- noting phone is elevated presuming I also go onto Aldi plan, but that there is no family discount
bills = 19330
BUDGET=[]
BUDGET.append( ('Bills', f"${bills:,.2f}") )
BUDGET.append( ('Buffer', f"${CBA*finance_data['CBA_price']+TLS*finance_data['TLS_price']:,.2f}") )
BUDGET.append( ('Monthly budget', f"${((finance_data['Living_Expenses']-12000) / 12):,.2f}" ) )
BUDGET.append( ('Weekly budget', f"${((finance_data['Living_Expenses']-12000) / 52):,.2f}" ) )
return BUDGET
def update_finance(data):
conn = connect_db()