Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alberta infirm dependants credit #336

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Alberta infirm dependant credit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Alberta provides this maximum amount under the infirm dependant credit.
values:
2023-01-01: 12_158
metadata:
unit: currency-CAD
period: year
label: Alberta infirm dependant credit maximum amount
reference:
- title: Alberta 2023 personal tax credits return TD1AB
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-23e.#page=1
- title: Alberta personal tax credits return worksheet TD1AB-WS
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-23e.pdf#page=1

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: Alberta provides the infirm dependant amount for filers with dependant at or above this age threshold.

values:
2023-01-01: 18
metadata:
unit: year
label: Alberta infirm dependant amount minimum dependant age
reference:
- title: Alberta 2023 personal tax credits return TD1AB
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-23e.pdf#page=1
- title: Alberta personal tax credits return worksheet TD1AB-WS
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-23e.pdf#page=1


Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Alberta provides the infirm dependant amount for filers with income of up to this threshold.
values:
2023-01-01: 20_190
metadata:
unit: currency-CAD
period: year
label: Alberta infirm dependant credit max income
reference:
- title: Alberta 2023 personal tax credits return TD1AB
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-23e.pdf#page=1
- title: Alberta personal tax credits return worksheet TD1AB-WS
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-23e.pdf#page=1

PavelMakarchuk marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Alberta phases the infirm dependant amount out above this dependant income threshold.
values:
2023-01-01: 8_032
metadata:
unit: currency-CAD
period: year
label: Alberta infirm dependant phase out start
reference:
- title: Alberta 2023 personal tax credits return TD1AB
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-23e.pdf#page=1
- title: Alberta personal tax credits return worksheet TD1AB-WS
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-23e.pdf#page=1

Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
- name: Infirm dependant net income below 8_032
period: 2023
input:
people:
p1:
is_infirm_dependant: true
infirm_dependant_income: 8_000
household:
members: p1
province_code: AB
output:
ab_infirm_dependant_credit: 12_158

- name: Infirm dependant net income over 8_032 but lower than 20_190
period: 2023
input:
people:
p1:
is_infirm_dependant: true
infirm_dependant_income: 20_000
household:
members: p1
province_code: AB
output:
ab_infirm_dependant_credit: 190

- name: Infirm dependant net income over 20_190
period: 2023
input:
people:
p1:
is_infirm_dependant: true
infirm_dependant_income: 30_190
household:
members: p1
province_code: AB
output:
ab_infirm_dependant_credit: 0


- name: Multiple infirm dependants with high income over than 20_190
period: 2023
input:
people:
p1:
is_infirm_dependant: No
infirm_dependant_income: 0
p2:
is_infirm_dependant: true
infirm_dependant_income: 30_190
p3:
is_infirm_dependant: true
infirm_dependant_income: 30_190
household:
members: [p1, p2, p3]
province_code: AB
output:
ab_infirm_dependant_credit: 0

- name: Multiple infirm dependants with low income less than 8_032
period: 2023
input:
people:
p1:
is_infirm_dependant: No
infirm_dependant_income: 0
p2:
is_infirm_dependant: true
infirm_dependant_income: 800
p3:
is_infirm_dependant: true
infirm_dependant_income: 300
household:
members: [p1, p2, p3]
province_code: AB
output:
ab_infirm_dependant_credit: 24_316

- name: Multiple infirm dependants with high income and low income
period: 2023
input:
people:
p1:
is_infirm_dependant: No
infirm_dependant_income: 0
p2:
is_infirm_dependant: true
infirm_dependant_income: 20_000
p3:
is_infirm_dependant: true
infirm_dependant_income: 800
household:
members: [p1, p2, p3]
province_code: AB
output:
ab_infirm_dependant_credit: 12_348
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from policyengine_canada.model_api import *


class ab_infirm_dependant_credit(Variable):
value_type = float
entity = Household
label = "Alberta infirm dependant credit"
definition_period = YEAR
defined_for = ProvinceCode.AB

def formula(household, period, parameters):
person = household.members
p = parameters(
period
).gov.provinces.ab.tax.income.credits.infirm_dependant
eligible = person("is_infirm_dependant", period)
infirm_dependant_income = person("infirm_dependant_income", period)
income_level_condition = infirm_dependant_income > p.phase_out_start
max_credit = eligible * p.base
partial_credit = eligible * (
p.max_net_income - infirm_dependant_income
)
per_credit = where(
oliviacaiww marked this conversation as resolved.
Show resolved Hide resolved
PavelMakarchuk marked this conversation as resolved.
Show resolved Hide resolved
income_level_condition,
max_(0, partial_credit),
max_credit,
)
return household.sum(per_credit)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from policyengine_canada.model_api import *


class infirm_dependant_income(Variable):
value_type = float
entity = Person
label = "Infirm dependant income"
definition_period = YEAR

def formula(person, period, parameters):
infirm_dependant = person("is_infirm_dependant", period)
income = person("individual_net_income", period)
return infirm_dependant * income
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from policyengine_canada.model_api import *


class is_infirm_dependant(Variable):
value_type = bool
entity = Person
label = "Is an infirm dependant"
definition_period = YEAR

# Impute dependant status on age.
def formula(person, period, parameters):
p = parameters(
period
).gov.provinces.ab.tax.income.credits.infirm_dependant
return person("age", period) >= p.infirm_dependant_age