converted over to using a class in disp.py that defines data about each variable in the form, and use an array of these objects to format the form in templates/index.html -- provides consistency of bootstrap classes and makes it far easier to move items around columns/rows in the future, e.g. when I resign. Also, now retrieve actual values form comparison set data (still have hardcoded cset_id for now), but also stopped using separate vars for items like CBA/TLS, and buried them into the finance_data

This commit is contained in:
2025-02-12 17:25:23 +11:00
parent af38b45034
commit 65ed02812a
5 changed files with 171 additions and 173 deletions

11
calc.py
View File

@@ -1,6 +1,11 @@
# calc.py
from datetime import datetime, timedelta
# this somehow needs to connect the annotation, so maybe store it via date in an annotations array?
# not sure I need amount, etc.
def add_annotation(label,amount):
return
def calculate_savings_depletion(finance):
# Extract all the financial data from the database
D_Salary = finance['D_Salary']
@@ -174,5 +179,9 @@ def calculate_savings_depletion(finance):
current_date += timedelta(days=1)
days_count += 1
return depletion_date, savings_per_fortnight, current_savings, D_TLS_shares+M_TLS_shares, D_CBA_shares
finance['CBA']=D_CBA_shares
finance['TLS']=D_TLS_shares+M_TLS_shares
return depletion_date, savings_per_fortnight, current_savings