fix up annotation bug where we put daily amt, not bill amt in annot
This commit is contained in:
9
calc.py
9
calc.py
@@ -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:
|
||||||
@@ -230,7 +230,7 @@ def calculate_savings_depletion(finance, bill_data, bill_type):
|
|||||||
# monthly increase living expenses by a monthly inflation multiplier
|
# monthly increase living expenses by a monthly inflation multiplier
|
||||||
Living_Expenses += (Inflation/100.0)/12 * Living_Expenses
|
Living_Expenses += (Inflation/100.0)/12 * Living_Expenses
|
||||||
daily_living_expenses = Living_Expenses / 365
|
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():
|
if current_date.date() == school_fees_date.date():
|
||||||
current_savings -= School_Fees
|
current_savings -= School_Fees
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user