remove debug, and handle (by skipping) future dated bills
This commit is contained in:
6
bills.py
6
bills.py
@@ -213,9 +213,7 @@ def actually_add_estimated_new_quarter_bill( bill_type, bill_info, yr, q ):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def actually_add_estimated_new_quarter_bill_forced( bill_type, bill_info, yr, q ):
|
def actually_add_estimated_new_quarter_bill_forced( bill_type, bill_info, yr, q ):
|
||||||
print( f"Being asked to add a FORCED qtr bill for {yr}-q{q} - likely a GAS bill, as its the only one, *sigh*" )
|
|
||||||
last_yrs_qtr_amount = bill_info[bill_type]['qtr'][yr-1][q]
|
last_yrs_qtr_amount = bill_info[bill_type]['qtr'][yr-1][q]
|
||||||
print( f"amt is based on forced qtr amount for last year: {last_yrs_qtr_amount}" )
|
|
||||||
amt=last_yrs_qtr_amount*(1+bill_info[bill_type]['growth']/100)
|
amt=last_yrs_qtr_amount*(1+bill_info[bill_type]['growth']/100)
|
||||||
new_date = f'{yr}-{q*3:02d}-01'
|
new_date = f'{yr}-{q*3:02d}-01'
|
||||||
new_estimated_bill( bill_info, yr, bill_type, amt, new_date )
|
new_estimated_bill( bill_info, yr, bill_type, amt, new_date )
|
||||||
@@ -309,6 +307,10 @@ def process_bill_data(bd, bt, bf):
|
|||||||
|
|
||||||
for bill in bd:
|
for bill in bd:
|
||||||
bill_type = bill['bill_type_id']
|
bill_type = bill['bill_type_id']
|
||||||
|
if bill['bill_date'] == 'future':
|
||||||
|
print("Having a future data - skip this one")
|
||||||
|
continue
|
||||||
|
|
||||||
yr= int(bill['bill_date'][:4])
|
yr= int(bill['bill_date'][:4])
|
||||||
# new bill type
|
# new bill type
|
||||||
if not bill_type in bill_info:
|
if not bill_type in bill_info:
|
||||||
|
|||||||
Reference in New Issue
Block a user