removed M_* variables that are no longer relevant, cleaned up interface to have columns more ordered, updated default values in DB to be more as accurate as I can make them for now

This commit is contained in:
2025-01-30 16:53:31 +11:00
parent 4b08f8830b
commit b9f54505cc
10 changed files with 34 additions and 78 deletions

11
calc.py
View File

@@ -4,9 +4,7 @@ from datetime import datetime, timedelta
def calculate_savings_depletion(finance):
# Extract all the financial data from the database
D_Salary = finance['D_Salary']
M_salary = finance['M_salary']
D_Num_fortnights_pay = finance['D_Num_fortnights_pay']
M_Num_fortnights_pay = finance['M_Num_fortnights_pay']
School_Fees = finance['School_Fees']
Car_loan_via_pay = finance['Car_loan_via_pay']
Car_loan = finance['Car_loan']
@@ -15,7 +13,6 @@ def calculate_savings_depletion(finance):
Savings = finance['Savings']
Interest_Rate = finance['Interest_Rate']
Inflation = finance['Inflation']
M_payout = finance['M_payout']
Mich_present = finance['Mich_present']
Overseas_trip = finance['Overseas_trip']
Mark_reno = finance['Mark_reno']
@@ -59,7 +56,6 @@ def calculate_savings_depletion(finance):
# significant dates - but who knows when? :)
overseas_trip_date = datetime.strptime( finance['Overseas_trip_date'], "%Y-%m-%d")
mark_reno_date = datetime.strptime( finance['Mark_reno_date'], "%Y-%m-%d")
M_payout_date = datetime.strptime( finance['M_payout_date'], "%Y-%m-%d")
# to force deakin pay cycles to match reality, we work from the 8th of Jan as our "day-zero" so we are paid on the 8/1/25, 22/1/25, etc.
days_count = ( current_date - datetime(2025,1,1) ).days
@@ -84,9 +80,6 @@ def calculate_savings_depletion(finance):
if D_Num_fortnights_pay > 0:
fortnight_income += D_Salary
D_Num_fortnights_pay -= 1
if M_Num_fortnights_pay > 0:
fortnight_income += M_salary
M_Num_fortnights_pay -= 1
if D_Num_fortnights_pay == 0 and D_leave_after_tax > 0:
print(f"D has resigned {current_date}: get paid out my 9 weeks leave and lose 45% to tax - ${D_leave_after_tax}" )
@@ -116,10 +109,6 @@ def calculate_savings_depletion(finance):
daily_living_expenses = Living_Expenses / 365
#print(f"Living Exp inceased {current_date}: ${Living_Expenses}")
if current_date.date() == M_payout_date.date():
current_savings += M_payout
print(f"payout={current_date} + {M_payout}")
if current_date.date() == school_fees_date.date():
current_savings -= School_Fees
print(f"school fees={current_date} - {School_Fees}")