Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
change file name and add age eligibility to be depencies as all files
  • Loading branch information
okeyiii committed Feb 1, 2024
1 parent bd27e96 commit 53d2cfe
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Nova Scotia Age amonut supplement; 65 is eligible age
- name: Nova Scotia Age amount supplement; 65 is eligible age
period: 2023
input:
province_code: NS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ class ns_age_amount_supplement(Variable):
)

def formula(person, period, parameters):
p = parameters(period).gov.provinces.ns.tax.income.credits.age
p = parameters(period).gov.provinces.ns.tax.income.credits.age.supplement
taxable_income = person("ns_taxable_income", period)

# Calculate additional amount added to base amount
return max_(
0,
p.supplement.base
- p.supplement.phase_out_rate.calc(taxable_income),
)
reduction = p.reduction.calc(taxable_income)

return max_(p.base - reduction, 0)
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ class ns_age_tax_credit(Variable):
entity = Person
label = "Nova Scotia Age tax credit"
definition_period = YEAR
defined_for = ProvinceCode.NS
defined_for = "ns_age_amount_supplement_eligible"
reference = (
"https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1",
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ns-ws/td1ns-ws-23e.pdf#page=1",
"https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=28",
)

def formula(person, period, parameters):
age = person("age", period)
income = person("ns_taxable_income", period)
p = parameters(period).gov.provinces.ns.tax.income.credits.age
eligibility = (age >= p.age_eligibility) & (
income < p.income_eligibility
)
eligibility = (income < p.income_eligibility)

return eligibility * p.amount

0 comments on commit 53d2cfe

Please sign in to comment.