From 95fcbb805e4166f969312ecfe85b950dfac15c6f Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Thu, 9 May 2024 18:53:18 -0400 Subject: [PATCH 1/2] Yukon Age Amount Fixes #293 --- .../credits/age_amount/age_threshold.yaml | 12 ++++++++++ .../tax/income/credits/age_amount/base.yaml | 13 +++++++++++ .../income/credits/age_amount/reduction.yaml | 22 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age_threshold.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/reduction.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age_threshold.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age_threshold.yaml new file mode 100644 index 000000000..662dad74f --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age_threshold.yaml @@ -0,0 +1,12 @@ +description: Yukon limits teh age amount credit to filers at or above this age threshold. +values: + 2022-01-01: 65 +metadata: + unit: year + period: year + label: Yukon age amount age threshold + reference: + - title: Worksheet for the Yukon 2023 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf#page=1 + +# TODO: 2022 reference & law reference diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base.yaml new file mode 100644 index 000000000..58df7a36f --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base.yaml @@ -0,0 +1,13 @@ +description: Yukon provides this base age amount credit. +values: + 2022-01-01: + 2023-01-01: 8_369 +metadata: + unit: currency-CAD + period: year + label: Yukon age amount base + reference: + - title: Worksheet for the Yukon 2023 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf#page=1 + +# TODO: 2022 values & 2022 reference & law reference diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/reduction.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/reduction.yaml new file mode 100644 index 000000000..af6bc19bd --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/reduction.yaml @@ -0,0 +1,22 @@ +description: Yukon reduces the age amount credit by this rate, based on adjusted net income. +metadata: + type: marginal_rate + threshold_unit: currency-CAD + rate_unit: /1 + label: Yukon age amount credit reduction + reference: + - title: Worksheet for the Yukon 2023 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf#page=1 + +# TODO: 2022 values & 2022 reference & law reference + +brackets: + - threshold: + 2022-01-01: 0 + rate: + 2022-01-01: 0 + - threshold: + 2022-01-01: + 2023-01-01: 42_335 + rate: + 2022-01-01: 0.15 From 03f3d239d9ddec9f263fe8418194fddb7cf0c346 Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Tue, 14 May 2024 12:05:28 -0400 Subject: [PATCH 2/2] variables Co-authored-by: Zhirui Li --- .../credits/age_amount/yt_age_amount_credit.py | 16 ++++++++++++++++ .../yt_age_amount_credit_eligible_person.py | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit.py create mode 100644 policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit_eligible_person.py diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit.py new file mode 100644 index 000000000..1c8f895e4 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit.py @@ -0,0 +1,16 @@ +from policyengine_canada.model_api import * + + +class yt_age_amount_credit(Variable): + value_type = float + entity = Person + label = "Yukon age amount credit" + definition_period = YEAR + defined_for = "yt_age_amount_credit_eligible_person" + + def formula(person, period, parameters): + income = person("individual_net_income", period) + p = parameters(period).gov.provinces.yt.tax.income.credits.age_amount + base = p.base + reduction = p.reduction.calc(income) + return max_(base - reduction, 0) diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit_eligible_person.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit_eligible_person.py new file mode 100644 index 000000000..1000d75be --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/age_amount/yt_age_amount_credit_eligible_person.py @@ -0,0 +1,14 @@ +from policyengine_canada.model_api import * + + +class yt_age_amount_credit_eligible_person(Variable): + value_type = bool + entity = Person + label = "Yukon age amount credit eligible person" + definition_period = YEAR + defined_for = ProvinceCode.YT + + def formula(person, period, parameters): + age = person("age", period) + p = parameters(period).gov.provinces.yt.tax.income.credits.age_amount + return age >= p.age_threshold