diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..6fc9080fc 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Alberta infirm dependant credit. diff --git a/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/age_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/age_threshold.yaml new file mode 100644 index 000000000..0bdbb74b7 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/age_threshold.yaml @@ -0,0 +1,16 @@ +description: Alberta provides the infirm dependant amount for filers with dependant at or above this age threshold. + +values: + 2022-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.#page=1 + - title: Alberta 2023 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 + - title: Alberta 2022 personal tax credits return TD1AB + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-22e.#page=1 + - title: Alberta 2022 personal tax credits return worksheet TD1AB-WS + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/base.yaml b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/base.yaml new file mode 100644 index 000000000..3d884833b --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/base.yaml @@ -0,0 +1,19 @@ +description: Alberta provides this maximum amount under the infirm dependant credit. +values: + 2023-01-01: 12_158 + 2022-01-01: 11_212 +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 2023 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 + - title: Alberta 2022 personal tax credits return TD1AB + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-22e.#page=1 + - title: Alberta 2022 personal tax credits return worksheet TD1AB-WS + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-22e.pdf#page=1 + + diff --git a/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/income_threshold.yaml new file mode 100644 index 000000000..ac2a9a85f --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/income_threshold.yaml @@ -0,0 +1,18 @@ +description: Alberta provides the infirm dependant amount for filers with income of up to this threshold. +values: + 2023-01-01: 20_190 + 2022-01-01: 18_619 +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.#page=1 + - title: Alberta 2023 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 + - title: Alberta 2022 personal tax credits return TD1AB + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-22e.#page=1 + - title: Alberta 2022 personal tax credits return worksheet TD1AB-WS + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-22e.pdf#page=1 + diff --git a/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/phase_out_start.yaml b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/phase_out_start.yaml new file mode 100644 index 000000000..0bdec0dda --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ab/tax/income/credits/infirm_dependant/phase_out_start.yaml @@ -0,0 +1,18 @@ +description: Alberta phases the infirm dependant amount out above this dependant income threshold. +values: + 2023-01-01: 8_032 + 2022-01-01: 7_407 +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.#page=1 + - title: Alberta 2023 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 + - title: Alberta 2022 personal tax credits return TD1AB + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab/td1ab-22e.#page=1 + - title: Alberta 2022 personal tax credits return worksheet TD1AB-WS + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1ab-ws/td1ab-ws-22e.pdf#page=1 + diff --git a/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/infirm_dependants/ab_infirm_dependant.yaml b/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/infirm_dependants/ab_infirm_dependant.yaml new file mode 100644 index 000000000..dce8117df --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/infirm_dependants/ab_infirm_dependant.yaml @@ -0,0 +1,123 @@ +- 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 below 7_407 + period: 2022 + input: + people: + p1: + is_infirm_dependant: true + infirm_dependant_income: 7_000 + household: + members: p1 + province_code: AB + output: + ab_infirm_dependant_credit: 11_212 + +- 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 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 diff --git a/policyengine_canada/variables/gov/provinces/ab/tax/income/credits/infirm_dependant/ab_infirm_dependant_credit.py b/policyengine_canada/variables/gov/provinces/ab/tax/income/credits/infirm_dependant/ab_infirm_dependant_credit.py new file mode 100644 index 000000000..3326c0bf3 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/ab/tax/income/credits/infirm_dependant/ab_infirm_dependant_credit.py @@ -0,0 +1,36 @@ +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 + + reduced_threshold = max_( + 0, p.income_threshold - infirm_dependant_income + ) + + partial_credit = eligible * reduced_threshold + + capped_credit = where( + income_level_condition, + partial_credit, + max_credit, + ) + return household.sum(capped_credit) diff --git a/policyengine_canada/variables/household/person/infirm_dependant_income.py b/policyengine_canada/variables/household/person/infirm_dependant_income.py new file mode 100644 index 000000000..ebd1e497a --- /dev/null +++ b/policyengine_canada/variables/household/person/infirm_dependant_income.py @@ -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 diff --git a/policyengine_canada/variables/household/person/is_infirm_dependant.py b/policyengine_canada/variables/household/person/is_infirm_dependant.py new file mode 100644 index 000000000..448faaf57 --- /dev/null +++ b/policyengine_canada/variables/household/person/is_infirm_dependant.py @@ -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.age_threshold