first hard-coded version of a compare capability
This commit is contained in:
7
main.py
7
main.py
@@ -20,7 +20,12 @@ def index():
|
|||||||
if depletion_date:
|
if depletion_date:
|
||||||
depletion_date=depletion_date.date(); # just show date
|
depletion_date=depletion_date.date(); # just show date
|
||||||
|
|
||||||
return render_template('index.html', finance=finance_data, depletion_date=depletion_date, savings=savings_per_fortnight, TLS=TLS, CBA=CBA, BUDGET=BUDGET)
|
# work out comparison func, but hardcode for now:
|
||||||
|
COMP={}
|
||||||
|
COMP['date']='2025-02-05'
|
||||||
|
COMP['amount']=414887
|
||||||
|
|
||||||
|
return render_template('index.html', finance=finance_data, depletion_date=depletion_date, savings=savings_per_fortnight, TLS=TLS, CBA=CBA, BUDGET=BUDGET, COMP=COMP)
|
||||||
|
|
||||||
@app.route('/update', methods=['POST'])
|
@app.route('/update', methods=['POST'])
|
||||||
def update():
|
def update():
|
||||||
|
|||||||
@@ -206,18 +206,39 @@ window.onload = function() {
|
|||||||
<h3 class="mt-3" ><font color="green">We DONT run out of money before super kicks in!!! -- Details:</font></h3>
|
<h3 class="mt-3" ><font color="green">We DONT run out of money before super kicks in!!! -- Details:</font></h3>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if COMP %}
|
||||||
|
<h5><font color="blue">Note: value in blue below is value we should have been at when comparing to saved values</font></h5>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr><td valign="top">
|
<tr><td valign="top">
|
||||||
|
{# get comparison date so we can use it below in loop to know when to print it out #}
|
||||||
|
{% set comp_yr=COMP['date'][:4] %}
|
||||||
|
{% set comp_mon=COMP['date'][5:7] %}
|
||||||
|
{% set comp_day=COMP['date'][8:10 ] %}
|
||||||
|
{% set comp_done=namespace( val=0 ) %}
|
||||||
|
|
||||||
{% set first_yr=2025 %}
|
{% set first_yr=2025 %}
|
||||||
{% for date, dollars in savings %}
|
{% for date, dollars in savings %}
|
||||||
{% set yr=date[:4] %}
|
{% set yr=date[:4] %}
|
||||||
{% set mon=date[5:7] %}
|
{% set mon=date[5:7] %}
|
||||||
{% set day=date[8:10 ] %}
|
{% set day=date[8:10 ] %}
|
||||||
|
|
||||||
|
{% if comp_done.val == 0 and yr == comp_yr and mon == comp_mon and day|int >= comp_day|int %}
|
||||||
|
<font color="blue">
|
||||||
|
{{ COMP['date'] }}:
|
||||||
|
{{ '$%0.2f' % COMP['amount']|float }}<br>
|
||||||
|
</font>
|
||||||
|
{% set comp_done.val=1 %}
|
||||||
|
{% endif %}
|
||||||
{% if yr|int > first_yr|int and mon == '01' and day|int <= 14 %}
|
{% if yr|int > first_yr|int and mon == '01' and day|int <= 14 %}
|
||||||
</td><td> </td><td valign="top">
|
</td><td> </td><td valign="top">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<font color="black">
|
||||||
{{ date }}:
|
{{ date }}:
|
||||||
{{ '$%0.2f' % dollars|float }}<br>
|
{{ '$%0.2f' % dollars|float }}<br>
|
||||||
|
</font>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td><td> </td><td valign="top"><b>SUMMARY/BUDGET</b><br>
|
</td><td> </td><td valign="top"><b>SUMMARY/BUDGET</b><br>
|
||||||
{% for label, value in BUDGET %}
|
{% for label, value in BUDGET %}
|
||||||
|
|||||||
Reference in New Issue
Block a user