Skip to content

Commit

Permalink
Nova Scotia Basic Personal Amount
Browse files Browse the repository at this point in the history
  • Loading branch information
okeyiii committed Jul 24, 2023
1 parent c9a2626 commit cafa9ed
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Nova Scotia additional amount in basic personal amount.
description: Nova Scotia provides this additional amount under the basic personal amount.
values:
2022-01-01: 3_000
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Nova Scotia applicable rate for calculating partial basic personal amount in basic personal amount.
description: Nova Scotia employs this applicable rate for calculating partial basic personal amounts.
values:
2022-01-01: 0.06
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Nova Scotia basic amount in basic personal amount.
description: Nova Scotia provides this basic amount under basic personal amount.
values:
2022-01-01: 8_481
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Nova Scotia higher income threshold for minimum basic personal amount in basic personal amount.
description: Nova Scotia limits this higher income threshold under the basic personal amount eligibility.
values:
2022-01-01: 75_000
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Nova Scotia lower income threshold for maximum basic personal amount in basic personal amount.
description: Nova Scotia limits this lower income threshold under the basic personal amount eligibility.
values:
2022-01-01: 25_000
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,30 @@ def formula(person, period, parameters):
period
).gov.provinces.ns.tax.income.credits.ns_basic_personal_amount
taxable_income = person("total_individual_pre_tax_income", period)

# Income Condition
lower_income_condition = (taxable_income <= p.lower_income_threshold)
medium_income_condition = (p.lower_income_threshold
< taxable_income
< p.higher_income_threshold)
higher_income_condition = (taxable_income >= p.higher_income_threshold)

# Basic Personal Amount
lower_basic_personal_amount = p.additional_amount + p.basic_amount
medium_basic_personal_amount = p.basic_amount + 3000 - p.applicable_rate * (taxable_income - p.lower_income_threshold)
higher_basic_personal_amount = 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,
lower_income_condition,
medium_income_condition,
higher_income_condition,
],
[
p.additional_amount + p.basic_amount,
p.basic_amount
+ 3000
- p.applicable_rate
* (taxable_income - p.lower_income_threshold),
p.basic_amount,
lower_basic_personal_amount,
medium_basic_personal_amount,
higher_basic_personal_amount,
],
)

0 comments on commit cafa9ed

Please sign in to comment.