only sell shares in the first year if its not in the same financial year, also show original buffer in comparing note

This commit is contained in:
2025-03-20 17:23:48 +11:00
parent 762746a0c1
commit 9baa3b4987
4 changed files with 8 additions and 5 deletions

3
db.py
View File

@@ -96,7 +96,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, Car_buyout, 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, Car_buyout_date, Sell_shares, compare_to, Ioniq6_future)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)''',
(4762.29, 10, 22000, 620, 2412, 45824.68, 83738.74, 84000, 421271.5, 5.0, 3.0, 10000, 30000, 10000, 94.66, 1000, 750, 1095, 3.9, 158.9, '2025-06-01', '2025-09-01', '2025-02-20', 5, 0, 0))
(4762.29, 8, 22000, 620, 2412, 45824.68, 83738.74, 84000, 427318.76, 4.75, 3.2, 10000, 30000, 10000, 94.66, 1000, 750, 1095, 4.12, 142.77, '2025-06-01', '2025-09-01', '2025-02-20', 5, 0, 0))
conn.commit()
conn.close()
@@ -200,6 +200,7 @@ def get_comp_set_data(cset_id):
if not res:
return None
COMP['vars']= dict(res)
COMP['buffer'] = COMP['vars']['CBA']*COMP['vars']['CBA_price']+COMP['vars']['TLS']*COMP['vars']['TLS_price']
conn.close()
# open new connection so we get rows back as basic array