fix up annotation bug where we put daily amt, not bill amt in annot

This commit is contained in:
2025-10-05 12:09:21 +11:00
parent fb2fffea7b
commit b6b396342f

View File

@@ -24,8 +24,8 @@ def bill_amount_today(finance, day, bill_data, bt_id_name, total ):
amt += b['amount'] amt += b['amount']
if b['amount'] > 1000: if b['amount'] > 1000:
n=bt_id_name[ b['bill_type'] ] n=bt_id_name[ b['bill_type'] ]
print( f"bill_amt_today {n} for {day_str} has amt={amt}" ) print( f"bill_amt_today {n} for {day_str} has amt={b['amount']}" )
add_annotation(finance, day, total-amt, -amt, f"Pay {n}" ) add_annotation(finance, day, total-b['amount'], -b['amount'], f"Pay {n}" )
# bills are desc order so if the bill is before the day we are after then stop looking # bills are desc order so if the bill is before the day we are after then stop looking
if b['bill_date'] < day_str: if b['bill_date'] < day_str:
return amt return amt
@@ -118,7 +118,7 @@ def calculate_savings_depletion(finance, bill_data, bill_type):
current_date = datetime.today() current_date = datetime.today()
# TODO: need to refactor Living_Expenses to exclude bills # refactor Living_Expenses to exclude bills (as we have detailed future projections for them that usually exceed inflation)
total=0 total=0
yr=str(current_date.year) yr=str(current_date.year)
for b in bill_data: for b in bill_data:
@@ -321,6 +321,5 @@ def calc_key_dates( finance ):
else: else:
key_dates['D_hyundai_owned'] = finance['Car_buyout_date'] key_dates['D_hyundai_owned'] = finance['Car_buyout_date']
print( f"kd={key_dates}" )
return key_dates return key_dates