Skip to content

Commit

Permalink
Complete
Browse files Browse the repository at this point in the history
  • Loading branch information
okeyiii committed Jul 17, 2023
1 parent 0f71af7 commit c9a2626
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 16 deletions.
5 changes: 5 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- bump: minor
changes:
added:
- Nova Scotia Basic personal amount.

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ metadata:
- title: Nova Scotia Basic Personal Amount
href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf
- title: Nova Scotia Basic Personal Amount
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ metadata:
- title: Nova Scotia Basic Personal Amount
href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf
- title: Nova Scotia Basic Personal Amount
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ metadata:
- title: Nova Scotia Basic Personal Amount
href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf
- title: Nova Scotia Basic Personal Amount
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ metadata:
- title: Nova Scotia Basic Personal Amount
href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf
- title: Nova Scotia Basic Personal Amount
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ metadata:
- title: Nova Scotia Basic Personal Amount
href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf
- title: Nova Scotia Basic Personal Amount
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
pension_and_savings_plan_income: 0
province_code: AB
output:
ab_pension_credit: 0
ab_pension_credit: 0
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
province_code: NS
total_individual_pre_tax_income: 76_000
output:
ns_basic_personal_credits: 8_481
ns_basic_personal_credits: 8_481
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,25 @@ class ns_basic_personal_credits(Variable):
defined_for = ProvinceCode.NS

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

return select([taxable_income <= p.lower_income_threshold,
p.lower_income_threshold < taxable_income < p.higher_income_threshold,
taxable_income >= p.higher_income_threshold],

[p.additional_amount + p.basic_amount,
p.basic_amount + 3000 - p.applicable_rate*(taxable_income - p.lower_income_threshold),
p.basic_amount])
return select(
[
taxable_income <= p.lower_income_threshold,
p.lower_income_threshold
< taxable_income
< p.higher_income_threshold,
taxable_income >= p.higher_income_threshold,
],
[
p.additional_amount + p.basic_amount,
p.basic_amount
+ 3000
- p.applicable_rate
* (taxable_income - p.lower_income_threshold),
p.basic_amount,
],
)

0 comments on commit c9a2626

Please sign in to comment.