Compare commits
14 Commits
e104dd8270
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 71606035fd | |||
| b8c1edc084 | |||
| f0fee15548 | |||
| 20239d72c8 | |||
| e3d2d8ea08 | |||
| 8446f59740 | |||
| 3a04b8321c | |||
| 037a9c2d87 | |||
| e7a3cb3d7d | |||
| 2ba2ece1d0 | |||
| 0a0a7b321b | |||
| 85a53c8c5f | |||
| 8e2f0ae340 | |||
| 1cf835b7e7 |
3
BUGS
3
BUGS
@@ -1,3 +1,6 @@
|
|||||||
|
* can put in dumb dates - DO SOME INPUT VALIDATION, *sigh*
|
||||||
|
- e.g. 0026-02-19 for a Gas bill
|
||||||
|
|
||||||
* kayo bills are wrong in between normal bills
|
* kayo bills are wrong in between normal bills
|
||||||
|
|
||||||
* added an electricity bill by accident for 2018, that kills lots :(
|
* added an electricity bill by accident for 2018, that kills lots :(
|
||||||
|
|||||||
3
TODO
3
TODO
@@ -1,4 +1,6 @@
|
|||||||
bills:
|
bills:
|
||||||
|
bill for the year (when removed from LE, should be dynamic)
|
||||||
|
|
||||||
bills html, and growth types are poor code repitition / lame... could I do something more like:
|
bills html, and growth types are poor code repitition / lame... could I do something more like:
|
||||||
{% for gt in growth %}
|
{% for gt in growth %}
|
||||||
{% if gt.name == 'Min' %}
|
{% if gt.name == 'Min' %}
|
||||||
@@ -13,4 +15,3 @@ CALC:
|
|||||||
* still get double health insurance bills sometimes (just viewing a new date might trigger this??? or at least when I changed years)
|
* still get double health insurance bills sometimes (just viewing a new date might trigger this??? or at least when I changed years)
|
||||||
|
|
||||||
UI:
|
UI:
|
||||||
* should try AI with how to distribute annotations better
|
|
||||||
|
|||||||
7
bills.py
7
bills.py
@@ -304,7 +304,7 @@ def get_growth_value( bt, bill_type ):
|
|||||||
finance_data = get_finance_data()
|
finance_data = get_finance_data()
|
||||||
return finance_data['Inflation']
|
return finance_data['Inflation']
|
||||||
else:
|
else:
|
||||||
match = re.match("flat-(\d+)", which )
|
match = re.match(r"flat-(\d+)", which )
|
||||||
if match:
|
if match:
|
||||||
return int(match.group(1))
|
return int(match.group(1))
|
||||||
else:
|
else:
|
||||||
@@ -643,8 +643,7 @@ def recalcFutureBills():
|
|||||||
for fb in future_car_bills:
|
for fb in future_car_bills:
|
||||||
amt=fb['amount']
|
amt=fb['amount']
|
||||||
bt=fb['bill_type']
|
bt=fb['bill_type']
|
||||||
# only can use simple growth as its a future bill
|
growth = get_growth_value( bill_types, bt )
|
||||||
growth=bill_types[bt]['ann_growth_simple']
|
|
||||||
# factor in growth for next bills
|
# factor in growth for next bills
|
||||||
for yr in range( int(car_yr), END_YEAR+1 ):
|
for yr in range( int(car_yr), END_YEAR+1 ):
|
||||||
new_date=f"{yr}-{car_mmdd}"
|
new_date=f"{yr}-{car_mmdd}"
|
||||||
@@ -661,7 +660,7 @@ def recalcFutureBills():
|
|||||||
# deal with future bills due to their starting dates being dynamic
|
# deal with future bills due to their starting dates being dynamic
|
||||||
amt=fb['amount']
|
amt=fb['amount']
|
||||||
bt=fb['bill_type']
|
bt=fb['bill_type']
|
||||||
growth=bill_types[bt]['ann_growth_simple']
|
growth = get_growth_value( bill_types, bt )
|
||||||
num_ann_bills= bf_id_num[bt_id_freq[bt]]
|
num_ann_bills= bf_id_num[bt_id_freq[bt]]
|
||||||
if num_ann_bills == 1:
|
if num_ann_bills == 1:
|
||||||
# factor in growth for next bill
|
# factor in growth for next bill
|
||||||
|
|||||||
23
calc.py
23
calc.py
@@ -66,7 +66,7 @@ def calculate_savings_depletion(finance, bill_data, bill_type):
|
|||||||
CBA_price = finance['CBA_price']
|
CBA_price = finance['CBA_price']
|
||||||
Ioniq6_future = finance['Ioniq6_future']
|
Ioniq6_future = finance['Ioniq6_future']
|
||||||
|
|
||||||
### COMPLEX tax implications with my leave I have not taken. It will be taxed in the year I 'quit' ###
|
### COMPLEX tax implications with my leave I have not taken. It will be taxed in the financial year I 'quit' ###
|
||||||
|
|
||||||
# leave in days, 10 business days to a fortnight,
|
# leave in days, 10 business days to a fortnight,
|
||||||
# paid before tax I earn $7830.42 / fortnight. Tax on that will be at 37% or $4933.16 after tax
|
# paid before tax I earn $7830.42 / fortnight. Tax on that will be at 37% or $4933.16 after tax
|
||||||
@@ -76,27 +76,30 @@ def calculate_savings_depletion(finance, bill_data, bill_type):
|
|||||||
# this is what I now earn before-tax (and I *THINK* vehicle allowance won't be paid X 12 weeks)
|
# this is what I now earn before-tax (and I *THINK* vehicle allowance won't be paid X 12 weeks)
|
||||||
pre_tax_D_earning = 8143.65
|
pre_tax_D_earning = 8143.65
|
||||||
|
|
||||||
# whenever I leave, I get 12 weeks (or 60 business days) + whatever leave they owe me
|
# whenever I quit, I get my leave paid out and I get 12 weeks (or 6 pays) -- notice
|
||||||
payout = ((60+D_leave_owed_in_days)/bus_days_in_fortnight) * pre_tax_D_earning
|
payout = ((D_leave_owed_in_days/bus_days_in_fortnight) + 6) * pre_tax_D_earning
|
||||||
|
|
||||||
# just use redundancy calc...
|
# just use redundancy calc...
|
||||||
payout = 83115.84
|
# payout = 83115.84
|
||||||
print( f"leave payout gross={payout}" )
|
print( f"leave payout gross={payout}" )
|
||||||
|
|
||||||
# However, if I quit in the next fin year - tax will be: $4,288 plus 30c for each $1 over $45,000
|
# However, if I quit in the next fin year - tax will be: $4,288 plus 30c for each $1 over $45,000
|
||||||
# (assuming the 7830.42 * ~90/bus_days_in_fortnight = ~ $64k - > 45k and < $135k bracket is 30%)
|
# (assuming the 7830.42 * ~90/bus_days_in_fortnight = ~ $64k - > 45k and < $135k bracket is 30% OR .37c for $135->$190k)
|
||||||
|
# - IF I am close to $190k+, just wait a month and quit in new financial year
|
||||||
# Given, I probably can't stop Deakin doing PAYG deductions, I won't get
|
# Given, I probably can't stop Deakin doing PAYG deductions, I won't get
|
||||||
# the tax back until the end of the financial year, so work out the
|
# the tax back until the end of the financial year, so work out the
|
||||||
# amount of tax I will get back info: tax_diff_D_leave
|
# amount of tax I will get back into: tax_diff_D_leave
|
||||||
tax_on_leave = (payout - 45000)*.37 + 4288
|
tax_on_leave = (payout - 45000)*.30 + 4288
|
||||||
D_leave_after_tax = payout - tax_on_leave
|
D_leave_after_tax = payout - tax_on_leave
|
||||||
|
|
||||||
# just use redunancy calc...
|
print(f"my calc would say D_leave_after_tax = {D_leave_after_tax}" )
|
||||||
D_leave_after_tax = 56518.77
|
|
||||||
|
# just use quick google/calc - it claims tax rules apply and are capped at 32% - its possible I get more like 75k then pay tax in July?
|
||||||
|
D_leave_after_tax = 59000
|
||||||
|
|
||||||
tax_diff_D_leave = payout - D_leave_after_tax
|
tax_diff_D_leave = payout - D_leave_after_tax
|
||||||
|
|
||||||
### FIXME: for now, assume no tax back after leave - think this may be needed if I quit anytime nowish until end of Jun
|
### FIXME: for now, assume no tax back after leave - see above comment
|
||||||
tax_diff_D_leave = 0
|
tax_diff_D_leave = 0
|
||||||
|
|
||||||
print( f"tax_diff_D_leave: {tax_diff_D_leave}")
|
print( f"tax_diff_D_leave: {tax_diff_D_leave}")
|
||||||
|
|||||||
2
crontab
2
crontab
@@ -1,2 +1,2 @@
|
|||||||
# run once every 5 days or so
|
# run once every 5 days or so
|
||||||
0 23 2-27/5 * * finplan /code/snapshot.sh
|
0 23 2-27/5 * * finplan cd /tmp && ENV="production" /code/snapshot.sh
|
||||||
|
|||||||
4
db.py
4
db.py
@@ -8,6 +8,8 @@ def connect_db(as_object):
|
|||||||
conn = sqlite3.connect('/data/finance.db')
|
conn = sqlite3.connect('/data/finance.db')
|
||||||
else:
|
else:
|
||||||
conn = sqlite3.connect('./finance.db')
|
conn = sqlite3.connect('./finance.db')
|
||||||
|
# allow deleting cset to clear our compare_to properly in finance table
|
||||||
|
conn.execute("PRAGMA foreign_keys = ON;")
|
||||||
if as_object:
|
if as_object:
|
||||||
conn.row_factory = sqlite3.Row # This allows us to access columns by name
|
conn.row_factory = sqlite3.Row # This allows us to access columns by name
|
||||||
return conn
|
return conn
|
||||||
@@ -190,7 +192,7 @@ def get_historical_data():
|
|||||||
def get_budget_data(finance_data):
|
def get_budget_data(finance_data):
|
||||||
# annual bills - health ins (5k), rates (2.6), electricity (1.2), gas (2.1) - but 1.4 in 2025 due to EU trip, internet (1.6), car insurance (.7), rego (.8), house insurance (2.4), GFC (2.6), water (1.1), eweka (.1), phones (.5), melb. pollen (.03), nabu casa (.1) --- noting phone is elevated presuming I also go onto Aldi plan, but that there is no family discount, and health will be extra after stop working
|
# annual bills - health ins (5k), rates (2.6), electricity (1.2), gas (2.1) - but 1.4 in 2025 due to EU trip, internet (1.6), car insurance (.7), rego (.8), house insurance (2.4), GFC (2.6), water (1.1), eweka (.1), phones (.5), melb. pollen (.03), nabu casa (.1) --- noting phone is elevated presuming I also go onto Aldi plan, but that there is no family discount, and health will be extra after stop working
|
||||||
# fudging below - its more like 15.2 + health, and really gas will be more than 2.1 than 1.4, so about 16+5
|
# fudging below - its more like 15.2 + health, and really gas will be more than 2.1 than 1.4, so about 16+5
|
||||||
bills = 25357.07
|
bills = 25321.03
|
||||||
BUDGET=[]
|
BUDGET=[]
|
||||||
BUDGET.append( ('Bills', f"${bills:,.2f}") )
|
BUDGET.append( ('Bills', f"${bills:,.2f}") )
|
||||||
BUDGET.append( ('Buffer', f"${finance_data['CBA']*finance_data['CBA_price']+finance_data['TLS']*finance_data['TLS_price']:,.2f}") )
|
BUDGET.append( ('Buffer', f"${finance_data['CBA']*finance_data['CBA_price']+finance_data['TLS']*finance_data['TLS_price']:,.2f}") )
|
||||||
|
|||||||
22
main.py
22
main.py
@@ -41,7 +41,10 @@ def index():
|
|||||||
depletion_date=depletion_date.date(); # just show date
|
depletion_date=depletion_date.date(); # just show date
|
||||||
|
|
||||||
# if we are comparing...(compare_to will be 0 / None to start with, and then COMP will be None
|
# if we are comparing...(compare_to will be 0 / None to start with, and then COMP will be None
|
||||||
COMP=get_comp_set_data(finance_data['compare_to'])
|
if finance_data['compare_to']:
|
||||||
|
COMP=get_comp_set_data(finance_data['compare_to'])
|
||||||
|
else:
|
||||||
|
COMP={}
|
||||||
|
|
||||||
DISP=[]
|
DISP=[]
|
||||||
# Row 1
|
# Row 1
|
||||||
@@ -50,7 +53,7 @@ def index():
|
|||||||
r.append( FP_VAR( 'Savings', 'Savings' ) )
|
r.append( FP_VAR( 'Savings', 'Savings' ) )
|
||||||
r.append( FP_VAR( 'Car Loan via Pay', 'Car_loan_via_pay', 'readonly' ) )
|
r.append( FP_VAR( 'Car Loan via Pay', 'Car_loan_via_pay', 'readonly' ) )
|
||||||
r.append( FP_VAR( 'Living Expenses', 'Living_Expenses' ) )
|
r.append( FP_VAR( 'Living Expenses', 'Living_Expenses' ) )
|
||||||
r.append( FP_VAR( 'Overseas Trip', 'Overseas_trip', 'date', 'col-auto', 'Overseas_trip_date' ) )
|
r.append( FP_VAR( 'Overseas Trip', 'Overseas_trip', 'date', 'col', 'Overseas_trip_date' ) )
|
||||||
DISP.append(r)
|
DISP.append(r)
|
||||||
|
|
||||||
# Row 2
|
# Row 2
|
||||||
@@ -59,7 +62,7 @@ def index():
|
|||||||
r.append( FP_VAR( 'Interest Rate', 'Interest_Rate' ) )
|
r.append( FP_VAR( 'Interest Rate', 'Interest_Rate' ) )
|
||||||
r.append( FP_VAR( 'Car Loan (monthly)', 'Car_loan', 'readonly' ) )
|
r.append( FP_VAR( 'Car Loan (monthly)', 'Car_loan', 'readonly' ) )
|
||||||
r.append( FP_VAR( 'Inflation', 'Inflation' ) )
|
r.append( FP_VAR( 'Inflation', 'Inflation' ) )
|
||||||
r.append( FP_VAR( 'Reno Costs', 'Mark_reno', 'date', 'col-auto', 'Mark_reno_date' ) )
|
r.append( FP_VAR( 'Reno Costs', 'Mark_reno', 'date', 'col', 'Mark_reno_date' ) )
|
||||||
DISP.append(r)
|
DISP.append(r)
|
||||||
|
|
||||||
# Row 2
|
# Row 2
|
||||||
@@ -72,7 +75,7 @@ def index():
|
|||||||
ss_opt.append( { 'val': el, 'label': f'{el} years' } )
|
ss_opt.append( { 'val': el, 'label': f'{el} years' } )
|
||||||
|
|
||||||
r.append( FP_VAR( 'Sell Shares for:', 'Sell_shares', 'select', 'col-auto', '', ss_opt ) )
|
r.append( FP_VAR( 'Sell Shares for:', 'Sell_shares', 'select', 'col-auto', '', ss_opt ) )
|
||||||
r.append( FP_VAR( 'Car Buyout', 'Car_buyout', 'date', 'col-auto', 'Car_buyout_date' ) )
|
r.append( FP_VAR( 'Car Buyout', 'Car_buyout', 'date', 'col', 'Car_buyout_date' ) )
|
||||||
DISP.append(r)
|
DISP.append(r)
|
||||||
|
|
||||||
# Row 3
|
# Row 3
|
||||||
@@ -114,14 +117,18 @@ def index():
|
|||||||
|
|
||||||
@app.route('/save', methods=['POST'])
|
@app.route('/save', methods=['POST'])
|
||||||
def save():
|
def save():
|
||||||
insert_cset( request.get_json() )
|
cset_id=insert_cset( request.get_json() )
|
||||||
return "200"
|
name = request.get_json()['vars']['name']
|
||||||
|
return jsonify( cset_id=cset_id, name=name )
|
||||||
|
|
||||||
@app.route('/update', methods=['POST'])
|
@app.route('/update', methods=['POST'])
|
||||||
def update():
|
def update():
|
||||||
|
|
||||||
old_finance_data = get_finance_data()
|
old_finance_data = get_finance_data()
|
||||||
|
|
||||||
|
raw_compare_to = request.form.get('compare_to')
|
||||||
|
compare_to_value = None if raw_compare_to == "0" else int(raw_compare_to)
|
||||||
|
|
||||||
finance_data = (
|
finance_data = (
|
||||||
request.form['D_Salary'],
|
request.form['D_Salary'],
|
||||||
request.form['D_Num_fortnights_pay'],
|
request.form['D_Num_fortnights_pay'],
|
||||||
@@ -147,9 +154,10 @@ def update():
|
|||||||
request.form['Mark_reno_date'],
|
request.form['Mark_reno_date'],
|
||||||
request.form['Car_buyout_date'],
|
request.form['Car_buyout_date'],
|
||||||
request.form['Sell_shares'],
|
request.form['Sell_shares'],
|
||||||
request.form['compare_to'],
|
compare_to_value,
|
||||||
request.form['Ioniq6_future']
|
request.form['Ioniq6_future']
|
||||||
)
|
)
|
||||||
|
|
||||||
update_finance(finance_data)
|
update_finance(finance_data)
|
||||||
new_finance_data = get_finance_data()
|
new_finance_data = get_finance_data()
|
||||||
# changed Ioniq6_future, Car_buyout_date or D_Num_fortnights_pay, so lets force recalc key_dates, and therefore estimated bills
|
# changed Ioniq6_future, Car_buyout_date or D_Num_fortnights_pay, so lets force recalc key_dates, and therefore estimated bills
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DB_FILE="finance.db"
|
if [ "$ENV" == "production" ]; then
|
||||||
|
DB_FILE="/data/finance.db"
|
||||||
|
else
|
||||||
|
DB_FILE="./finance.db"
|
||||||
|
fi
|
||||||
HISTORY_TABLE="finance_history"
|
HISTORY_TABLE="finance_history"
|
||||||
# Current date in the format you've been using
|
# Current date in the format you've been using
|
||||||
DATE_STR=$(date +%Y-%m-%d)
|
DATE_STR=$(date +%Y-%m-%d)
|
||||||
|
|||||||
@@ -456,7 +456,7 @@
|
|||||||
function SaveTab( last_tab )
|
function SaveTab( last_tab )
|
||||||
{
|
{
|
||||||
// set the drop-down for new bill to be this tab now...
|
// set the drop-down for new bill to be this tab now...
|
||||||
$("#new-bill-data-type").val( $('.nav-tabs .nav-link.active').prop('id').replace("tab-but-", "") )
|
$("#new-bill-data-type").val( $('.nav-link.active').prop('id').replace("tab-but-", "") )
|
||||||
$.ajax( { type: 'POST', url: '/saveui', contentType: 'application/json', data: JSON.stringify( { 'last_tab': last_tab } ), success: function() { } } )
|
$.ajax( { type: 'POST', url: '/saveui', contentType: 'application/json', data: JSON.stringify( { 'last_tab': last_tab } ), success: function() { } } )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||||
<script src="https://code.highcharts.com/highcharts.js"></script>
|
<script src="https://code.highcharts.com/highcharts.js"></script>
|
||||||
|
<script src="https://code.highcharts.com/modules/mouse-wheel-zoom.js"></script>
|
||||||
<script src="https://code.highcharts.com/modules/annotations.js"></script>
|
<script src="https://code.highcharts.com/modules/annotations.js"></script>
|
||||||
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
|
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
|
||||||
<script src="https://code.highcharts.com/themes/adaptive.js"></script>
|
<script src="https://code.highcharts.com/themes/adaptive.js"></script>
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Savings (<a href='https://online.macquarie.com.au/personal/#/login'>Macquarie</a>
|
<li>Savings (<a href='https://online.macquarie.com.au/personal/#/login'>Macquarie</a>
|
||||||
+<a href='https://ib.mebank.com.au/authR5/ib/login.jsp'>ME bank</a>
|
+<a href='https://ib.mebank.com.au/authR5/ib/login.jsp'>ME bank</a>
|
||||||
+<a href='https://ib.nab.com.au/login'>NAB</a>) -- noting ME bank is: $1000</li>
|
+<a href='https://ib.nab.com.au/login'>NAB</a>) -- noting ME bank is: $934.07</li>
|
||||||
<li><a href='https://www.google.com/search?q=asx+tls'>TLS</a>/<a href='https://www.google.com/search?q=asx+cba'>CBA</a> prices</li>
|
<li><a href='https://www.google.com/search?q=asx+tls'>TLS</a>/<a href='https://www.google.com/search?q=asx+cba'>CBA</a> prices</li>
|
||||||
<li>Macq <a href='https://www.macquarie.com.au/everyday-banking/savings-account.html'>Interest rate</a></li>
|
<li>Macq <a href='https://www.macquarie.com.au/everyday-banking/savings-account.html'>Interest rate</a></li>
|
||||||
<li><a href='https://deakinpeople.deakin.edu.au/psc/HCMP/EMPLOYEE/HRMS/c/NUI_FRAMEWORK.PT_AGSTARTPAGE_NUI.GBL?CONTEXTIDPARAMS=TEMPLATE_ID%3aPTPPNAVCOL&scname=ADMN_LEAVE&PTPPB_GROUPLET_ID=DU_LEAVE&CRefName=ADMN_NAVCOLL_3'>D_leave_owed_in_days</a> by: {{key_dates['D_quit_date']}}</li>
|
<li><a href='https://deakinpeople.deakin.edu.au/psc/HCMP/EMPLOYEE/HRMS/c/NUI_FRAMEWORK.PT_AGSTARTPAGE_NUI.GBL?CONTEXTIDPARAMS=TEMPLATE_ID%3aPTPPNAVCOL&scname=ADMN_LEAVE&PTPPB_GROUPLET_ID=DU_LEAVE&CRefName=ADMN_NAVCOLL_3'>D_leave_owed_in_days</a> by: {{key_dates['D_quit_date']}}</li>
|
||||||
@@ -229,7 +230,12 @@
|
|||||||
$(function() { $('[data-bs-toggle="popover"]').popover(); });
|
$(function() { $('[data-bs-toggle="popover"]').popover(); });
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
$('#Sell_shares').val( {{finance['Sell_shares']}} )
|
$('#Sell_shares').val( {{finance['Sell_shares']}} )
|
||||||
$('#compare_to').val( {{finance['compare_to']}} )
|
{% if finance['compare_to'] %}
|
||||||
|
$('#compare_to').val( {{finance['compare_to']}} )
|
||||||
|
{% else %}
|
||||||
|
// set this to Nothing by default
|
||||||
|
$('#compare_to').val( 0 )
|
||||||
|
{% endif %}
|
||||||
$('#Ioniq6_future').val( {{finance['Ioniq6_future']}} )
|
$('#Ioniq6_future').val( {{finance['Ioniq6_future']}} )
|
||||||
|
|
||||||
if( $("#Ioniq6_future option:selected"). text() == 'lease' )
|
if( $("#Ioniq6_future option:selected"). text() == 'lease' )
|
||||||
@@ -326,17 +332,18 @@
|
|||||||
offset_y = -25
|
offset_y = -25
|
||||||
{% if a['y'] > 400000 %}
|
{% if a['y'] > 400000 %}
|
||||||
offset_x = -80 -30*(6-how_many_up)
|
offset_x = -80 -30*(6-how_many_up)
|
||||||
console.log('do the hack')
|
|
||||||
{% else %}
|
{% else %}
|
||||||
offset_x = -50 -10*how_many_up
|
offset_x = -50 -10*how_many_up
|
||||||
console.log('not hack')
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
if( how_many_up > 3 )
|
if( how_many_up > 3 )
|
||||||
how_many_up=0
|
how_many_up=0
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if a['y'] < 210000 %}
|
{% if a['y'] < 250000 %}
|
||||||
offset_y -= 300
|
offset_y -= 350
|
||||||
|
{% endif %}
|
||||||
|
{% if a['y'] < 250000 and a['y'] > 200000 %}
|
||||||
|
offset_x += 100
|
||||||
{% endif %}
|
{% endif %}
|
||||||
annotations.push({
|
annotations.push({
|
||||||
labels: [{
|
labels: [{
|
||||||
@@ -357,7 +364,7 @@
|
|||||||
|
|
||||||
// Highcharts configuration
|
// Highcharts configuration
|
||||||
Highcharts.chart('graph', {
|
Highcharts.chart('graph', {
|
||||||
chart: { type: 'line' },
|
chart: { type: 'line', zooming: { type: 'x' } },
|
||||||
colors: [ 'orange' ],
|
colors: [ 'orange' ],
|
||||||
title: { text: 'Savings Over Time' },
|
title: { text: 'Savings Over Time' },
|
||||||
xAxis: {
|
xAxis: {
|
||||||
@@ -384,7 +391,7 @@
|
|||||||
{% if COMP %}
|
{% if COMP %}
|
||||||
// Highcharts configuration
|
// Highcharts configuration
|
||||||
Highcharts.chart('graph-comp', {
|
Highcharts.chart('graph-comp', {
|
||||||
chart: { type: 'line' },
|
chart: { type: 'line', zooming: { type: 'x' } },
|
||||||
colors: [
|
colors: [
|
||||||
'orange', // Custom color 1
|
'orange', // Custom color 1
|
||||||
'cyan', // Custom color 2
|
'cyan', // Custom color 2
|
||||||
@@ -432,13 +439,17 @@
|
|||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||||
<button type="button" class="btn btn-info"
|
<button type="button" class="btn btn-info"
|
||||||
onClick="
|
onClick="
|
||||||
vars['name']=$('#save_name').val();
|
vars['name'] = $('#save_name').val();
|
||||||
$.ajax( {
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '/save',
|
url: '/save',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
data: JSON.stringify( { 'vars': vars, 'savings_data' :savingsData } ),
|
data: JSON.stringify({ 'vars': vars, 'savings_data': savingsData }),
|
||||||
success: function() { $('#save_modal').modal('hide'); } } )"
|
success: function(resp) {
|
||||||
|
$('#save_modal').modal('hide');
|
||||||
|
$('#compare_to').append($('<option>', { value: resp.cset_id, text: resp.name }));
|
||||||
|
}
|
||||||
|
});"
|
||||||
>Save</button>
|
>Save</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user