Compare commits
3 Commits
0a179c2503
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3de927aa0f | |||
| e123fdaf49 | |||
| d8bef8bbe7 |
2
calc.py
2
calc.py
@@ -285,6 +285,8 @@ def calculate_savings_depletion(finance, bill_data, bill_type):
|
|||||||
D_CBA_shares -= 1
|
D_CBA_shares -= 1
|
||||||
Sell_shares -= 1
|
Sell_shares -= 1
|
||||||
|
|
||||||
|
# can run out, if so, no need to add :)
|
||||||
|
if actual_sell>0:
|
||||||
current_savings += actual_sell
|
current_savings += actual_sell
|
||||||
add_annotation(finance, current_date, current_savings, actual_sell, "Sell shares" )
|
add_annotation(finance, current_date, current_savings, actual_sell, "Sell shares" )
|
||||||
|
|
||||||
|
|||||||
4
db.py
4
db.py
@@ -100,6 +100,7 @@ def init_db():
|
|||||||
ann_growth_avg REAL,
|
ann_growth_avg REAL,
|
||||||
ann_growth_max REAL,
|
ann_growth_max REAL,
|
||||||
ann_growth_simple REAL,
|
ann_growth_simple REAL,
|
||||||
|
which_growth STRING,
|
||||||
FOREIGN KEY(freq) REFERENCES bill_freq(id)
|
FOREIGN KEY(freq) REFERENCES bill_freq(id)
|
||||||
)''')
|
)''')
|
||||||
|
|
||||||
@@ -379,7 +380,7 @@ def insert_bill_type( bt, fq ):
|
|||||||
conn = connect_db(False)
|
conn = connect_db(False)
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
print( f"fq={fq}" )
|
print( f"fq={fq}" )
|
||||||
cur.execute( f"insert into bill_type ( 'name', 'freq', 'ann_growth_min', 'ann_growth_avg', 'ann_growth_max', 'ann_growth_simple' ) values ( '{bt}', {fq}, 0, 0, 0, 0 )" )
|
cur.execute( f"insert into bill_type ( name, freq, ann_growth_min, ann_growth_avg, ann_growth_max, ann_growth_simple, which_growth ) values ( '{bt}', {fq}, 0, 0, 0, 0, 'cpi' )" )
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
return
|
return
|
||||||
@@ -403,6 +404,7 @@ def delete_bill(id):
|
|||||||
def delete_bill_type( id ):
|
def delete_bill_type( id ):
|
||||||
conn = connect_db(False)
|
conn = connect_db(False)
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
|
cur.execute( f"delete from bill_data where bill_type = '{id}'" )
|
||||||
cur.execute( f"delete from bill_type where id = '{id}'" )
|
cur.execute( f"delete from bill_type where id = '{id}'" )
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user