Skip to content

Commit

Permalink
Northwest Territories Credit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenyaokun committed Apr 19, 2023
1 parent 0ceb90a commit 823c2b4
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ metadata:
label: Northwest Territories living tax credit high income base
reference:
- title: Government of Canada - Credit
href: https://www.canada.ca/en/revenue-agency/services/forms-publications/tax-packages-years/general-income-tax-benefit-package/northwest-territories/5012-tc.html
href: https://www.canada.ca/en/revenue-agency/services/forms-publications/tax-packages-years/general-income-tax-benefit-package/northwest-territories/5012-tc.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: Northwest Territories living tax credit middle income supplement
values:
2022-12-31: 762
2022-12-31: 312
metadata:
unit: currency-CAD
label: Northwest Territories living tax credit middle income supplement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,62 @@
period: 2023
input:
province_code: NT
nt_income_tax_before_credits: 10_000
individual_net_income: 12_000
output:
nt_living_tax_credit: 312

- name: Income below 12_000
period: 2023
input:
province_code: NT
individual_net_income: 10_000
output:
nt_living_tax_credit: 260

- name: Income between 12_000 and 48_000
period: 2023
input:
province_code: NT
nt_income_tax_before_credits: 42_000
individual_net_income: 42_000
output:
nt_living_tax_credit: 687

- name: Income between 12_000 and 48_000
period: 2023
input:
province_code: NT
individual_net_income: 48_000
output:
nt_living_tax_credit: 762

- name: Income between 48_000 and 66_000
period: 2023
input:
province_code: NT
individual_net_income: 58_000
output:
nt_living_tax_credit: 862

- name: Income between 48_000 and 66_000
period: 2023
input:
province_code: NT
nt_income_tax_before_credits: 58_000
individual_net_income: 65_999
output:
nt_living_tax_credit: 772
nt_living_tax_credit: 941.99

- name: Income above 66_000
period: 2023
input:
province_code: NT
nt_income_tax_before_credits: 67_000
individual_net_income: 67_000
output:
nt_living_tax_credit: 942

- name: Income above 66_000
period: 2023
input:
province_code: NT
individual_net_income: 66_001
output:
nt_living_tax_credit: 942
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def formula(person, period, parameters):
p = parameters(
period
).gov.provinces.nt.tax.income.credits.living_tax_credit
net_income = person("individual_net_income", period)
lower = p.threshold.middle.base * p.threshold.low_income_rate
middle = (p.threshold.high.base - p.threshold.middle.base) * p.threshold.middle.rate + p.threshold.middle.supplement
higher = (net_income - p.income_threshold) * p.threshold.high.rate + p.threshold.high.supplement
lower = person("nt_ltc_lower_threshold", period)
middle = person("nt_ltc_middle_threshold", period)
higher = person("nt_ltc_higher_threshold", period)

return (
min_(lower + middle + higher, p.max_amount)
)

Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
from policyengine_canada.model_api import *


class ntltc_high_base(Variable):
class nt_ltc_higher_threshold(Variable):
value_type = float
entity = Person
label = "Higher income for living tax credit"
definition_period = YEAR
defined_for = ProvinceCode.NT

def formula(household, period, parameters):
def formula(person, period, parameters):
p = parameters(
period
).gov.provinces.nt.tax.income.credits.living_tax_credit
net_income = person("individual_net_income", period)
eligible = (p.threshold.high.base < net_income) & (net_income < p.income_threshold)
eligible = (p.threshold.high.base < net_income )

return (
(net_income - p.threshold.high.base) * p.threshold.high.rate * eligible + p.threshold.high.supplement
return eligible * (
(net_income - p.threshold.high.base) * p.threshold.high.rate + p.threshold.high.supplement
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def formula(person, period, parameters):
net_income = person("individual_net_income", period)
eligible = p.threshold.middle.base >= net_income

return (
net_income * p.threshold.low_income_rate * eligible
return eligible * (
net_income * p.threshold.low_income_rate
)
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def formula(person, period, parameters):
period
).gov.provinces.nt.tax.income.credits.living_tax_credit
net_income = person("individual_net_income", period)
eligible = (p.threshold.middle.base < net_income) & (p.threshold.high.base >= net_income)
eligible = (p.threshold.middle.base < net_income <= p.threshold.high.base)

return (
(net_income - p.threshold.middle.base) * p.threshold.middle.rate * eligible + p.threshold.middle.supplement
return eligible * (
(net_income - p.threshold.middle.base) * p.threshold.middle.rate + p.threshold.middle.supplement
)

0 comments on commit 823c2b4

Please sign in to comment.