improved when I finish work vs bluring the 12 week payout and changed to using today() instead of now() as I dont need anything but dates

This commit is contained in:
2025-05-09 14:22:59 +10:00
parent 7bc62a60dc
commit cea4cb9ed4
3 changed files with 16 additions and 9 deletions

22
calc.py
View File

@@ -49,17 +49,22 @@ def calculate_savings_depletion(finance):
# this is what I earn before-tax (and I *THINK* vehicle allowance won't be paid X 12 weeks)
pre_tax_D_earning = 7830.42
# whenever I leave, I get 12 weeks (or 60 business days) + whatever leave they owe me
payout = ((60+D_leave_owed_in_days)/bus_days_in_fortnight) * pre_tax_D_earning
# as the leave is just on top of my existing earnings and if in 2024 fin year, just take tax at 37% for the extra leave amount
D_leave_after_tax = (D_leave_owed_in_days/bus_days_in_fortnight) * pre_tax_D_earning * (1-0.37)
# hardcoded 6 represents the 12 weeks or 6 fornights of pay owed to me when I give notice or they sack me
D_leave_after_tax = payout * (1-0.37)
# However, if I quit in the next fin year - tax for 2025 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%)
# 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
# amount of tax I will get back info: tax_diff_D_leave
tax_on_leave = (pre_tax_D_earning * (D_leave_owed_in_days/bus_days_in_fortnight) - 45000)*.3 + 4288
D_leave_after_tax_new_fin_year = pre_tax_D_earning * (D_leave_owed_in_days/bus_days_in_fortnight) - tax_on_leave
tax_on_leave = (payout - 45000)*.37 + 4288
D_leave_after_tax_new_fin_year = payout - tax_on_leave
tax_diff_D_leave = D_leave_after_tax_new_fin_year-D_leave_after_tax
print( f"tax_diff_D_leave: {tax_diff_D_leave}")
### leave / tax items finished ###
@@ -75,7 +80,7 @@ def calculate_savings_depletion(finance):
daily_interest_rate = annual_interest_rate / 365
# main loop range -- start from now, and simulate till D is 60 (April 2031)
current_date = datetime.now()
current_date = datetime.today()
end_date = datetime(2031, 4, 15)
# Calculate daily living expenses
@@ -139,11 +144,14 @@ def calculate_savings_depletion(finance):
# okay, if we leave before Jun 30th 2024, then I pay full tax, otherwise I get 'extra', but have to await end of next fin year
if current_date > new_fin_year_25:
claim_tax_on_leave = True
print(f"{current_date}: D has resigned in new year- get paid out my 12 weeks + remaining leave and lose some to tax - ${D_leave_after_tax_new_fin_year}" )
current_savings += D_leave_after_tax_new_fin_year
add_annotation(finance, current_date, current_savings, D_leave_after_tax_new_fin_year, "D quit" )
else:
claim_tax_on_leave = False
print(f"{current_date}: D has resigned - get paid out my 9 weeks leave and lose 45% to tax - ${D_leave_after_tax}" )
current_savings += D_leave_after_tax
add_annotation(finance, current_date, current_savings, D_leave_after_tax, "D quit" )
print(f"{current_date}: D has resigned - get paid out my 12 weeks + remaining leave and lose some to tax - ${D_leave_after_tax}" )
current_savings += D_leave_after_tax
add_annotation(finance, current_date, current_savings, D_leave_after_tax, "D quit" )
D_leave_after_tax = 0
# its end of 'next' fin year, if tax_diff > 0, then ddp quit after new tax year and gets back the overpaid tax