add a button to recalc bills by removing all esimated bills and rebuild them
This commit is contained in:
7
main.py
7
main.py
@@ -2,7 +2,7 @@
|
||||
from flask import Flask, render_template, request, redirect, url_for, Response, jsonify
|
||||
from calc import calculate_savings_depletion, calc_key_dates
|
||||
from db import init_db, get_finance_data, update_finance, get_budget_data, insert_cset, get_comp_set_data, get_comp_set_options, get_bill_freqs
|
||||
from db import get_bill_data, new_bill, update_bill_data, delete_bill
|
||||
from db import get_bill_data, new_bill, update_bill_data, delete_bill, delete_estimated_bills
|
||||
from db import get_bill_ui, save_ui
|
||||
from db import get_bill_types, insert_bill_type, update_bill_type, delete_bill_type, use_growth
|
||||
from bills import process_bill_data, calc_future_totals, set_bill_type_growth
|
||||
@@ -142,6 +142,7 @@ def update():
|
||||
request.form['Ioniq6_future']
|
||||
)
|
||||
update_finance(finance_data)
|
||||
# FIXME: need code here to delete/rebuild future bills if we change "D # Pays to quit "
|
||||
return redirect(url_for('index'))
|
||||
|
||||
@app.route('/bills')
|
||||
@@ -214,6 +215,10 @@ def SaveUI():
|
||||
save_ui( data )
|
||||
return "200"
|
||||
|
||||
@app.route('/force_recalc_bills', methods=['POST'])
|
||||
def force_recalc_bills():
|
||||
delete_estimated_bills()
|
||||
return "200"
|
||||
|
||||
# Main program
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user