moved some hard-coded dates to top of calc.py for ease of use in multiple functions, but also just for code readability, they are more like constants than variables. Code now works out key_dates for use in dealing with future bills / next steps

This commit is contained in:
2025-09-11 17:52:28 +10:00
parent b69ec82510
commit 4389045ed5
3 changed files with 43 additions and 12 deletions

View File

@@ -291,7 +291,7 @@ def get_growth_value( bt, bill_type ):
# and I didn't want to input 12 of them at the same price), and it always
# occurs for future bills
################################################################################
def process_bill_data(bd, bt, bf):
def process_bill_data(bd, bt, bf, key_dates):
# this maps a bill id to a freq id (e.g. bill #34 - has a frequency of #2 (which might be quarterly)
bt_id_freq = {row["id"]: row["freq"] for row in bt}
bt_id_ann_growth_avg = {row["id"]: row["ann_growth_avg"] for row in bt}
@@ -495,3 +495,4 @@ def calc_future_totals(bill_info, bill_types):
# had to round to 2 decimal here to get sensible totals
total[bt['id']][yr] = round( total[bt['id']][yr], 2 )
return total