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']
if b['amount'] > 1000:
n=bt_id_name[ b['bill_type'] ]
print( f"bill_amt_today {n} for {day_str} has amt={amt}" )
add_annotation(finance, day, total-amt, -amt, f"Pay {n}" )
print( f"bill_amt_today {n} for {day_str} has amt={b['amount']}" )
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
if b['bill_date'] < day_str:
return amt
@@ -118,7 +118,7 @@ def calculate_savings_depletion(finance, bill_data, bill_type):
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
yr=str(current_date.year)
for b in bill_data:
@@ -230,7 +230,7 @@ def calculate_savings_depletion(finance, bill_data, bill_type):
# monthly increase living expenses by a monthly inflation multiplier
Living_Expenses += (Inflation/100.0)/12 * Living_Expenses
daily_living_expenses = Living_Expenses / 365
#print(f"{current_date}: Living Exp inceased - ${Living_Expenses}")
# print(f"{current_date}: Living Exp inceased - ${Living_Expenses}")
if current_date.date() == school_fees_date.date():
current_savings -= School_Fees
@@ -321,6 +321,5 @@ def calc_key_dates( finance ):
else:
key_dates['D_hyundai_owned'] = finance['Car_buyout_date']
print( f"kd={key_dates}" )
return key_dates