From 9341a6c31db57f4f0a47487efdd2a7c1c5950d2b Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Mon, 19 Jun 2023 22:30:34 +0000 Subject: [PATCH 01/11] Yukon Medical Expenses --- .../tax/income/credits/medical_expenses/rate.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml new file mode 100644 index 000000000..11422c114 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml @@ -0,0 +1,13 @@ +description: Medical Expenses in Yukon. +values: + 2022-01-01: 0.03 +metadata: + unit: /1 + label: Yukon Medical Expenses + reference: + - title: Yukon Tax-Medical Expenses + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf + + #line 35 -40 + #variables -- expenses + #household - \ No newline at end of file From 1164769b21424fbcd29284c385cabd7c56d0fee9 Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Mon, 19 Jun 2023 22:40:04 +0000 Subject: [PATCH 02/11] update --- .../income/credits/medical_expenses/max_amount.yaml | 10 ++++++++++ .../yt/tax/income/credits/medical_expenses/rate.yaml | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml new file mode 100644 index 000000000..4efe6a781 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml @@ -0,0 +1,10 @@ +description: The Maximum Amount in Medical Expenses in Yukon. +values: + 2022-01-01: 2,479 +metadata: + unit: currency-CAD + label: Yukon Medical Expenses + reference: + - title: Yukon Tax-Medical Expenses + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf + diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml index 11422c114..63bbd9df4 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml @@ -1,9 +1,9 @@ -description: Medical Expenses in Yukon. +description: Applicable Rate for Medical Expenses in Yukon. values: 2022-01-01: 0.03 metadata: unit: /1 - label: Yukon Medical Expenses + label: Yukon Medical Expenses Applicable Rate reference: - title: Yukon Tax-Medical Expenses href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf From 1c2b4a006f3961f6ee1d0a4dc299a981a957ad26 Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:04:59 +0000 Subject: [PATCH 03/11] Yukon Medical Expenses --- .../credits/medical_expenses/yt_medical_expenses.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml new file mode 100644 index 000000000..9746a0522 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml @@ -0,0 +1,9 @@ +- name:Medical Amount below Maximum: + period: 2022 + input: + province_code:YT + age: 19 + is_disabled: true + output: + + From 76328599d2ed747216aaaa05218b13322837da27 Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:49:21 +0000 Subject: [PATCH 04/11] Yukon Medical Expenses --- changelog_entry.yaml | 1 + .../income/credits/medical_expenses/rate.yaml | 2 +- .../sa/qc_sa_married_both_eligible.yaml | 2 +- .../sa/qc_sa_married_one_eligible.yaml | 2 +- .../medical_expenses/yt_medical_expenses.yaml | 37 +++++++++++++++++-- .../tax/income/credits/yt_medical_expenses.py | 27 ++++++++++++++ .../medical/household_medical_expenses.py | 9 +++++ 7 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py create mode 100644 policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..8b1378917 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1 @@ + diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml index 63bbd9df4..2bc4de0f3 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml @@ -10,4 +10,4 @@ metadata: #line 35 -40 #variables -- expenses - #household - \ No newline at end of file + #household - diff --git a/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_both_eligible.yaml b/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_both_eligible.yaml index fcfcb7cb6..8f78cb520 100644 --- a/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_both_eligible.yaml +++ b/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_both_eligible.yaml @@ -29,4 +29,4 @@ members: [c1, c2] province_code: QC output: - qc_sa_married_both_eligible: 1 \ No newline at end of file + qc_sa_married_both_eligible: 1 diff --git a/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_one_eligible.yaml b/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_one_eligible.yaml index 6ce860c0e..fd8414b26 100644 --- a/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_one_eligible.yaml +++ b/policyengine_canada/tests/gov/provinces/qc/tax/income/credits/sa/qc_sa_married_one_eligible.yaml @@ -28,4 +28,4 @@ members: [c1, c2] province_code: QC output: - qc_sa_married_one_eligible: 1 \ No newline at end of file + qc_sa_married_one_eligible: 1 diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml index 9746a0522..5dfeaee64 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml @@ -1,9 +1,38 @@ -- name:Medical Amount below Maximum: +- name: Zero Medeical Expenses of Net Income over Maximum Amount period: 2022 input: - province_code:YT - age: 19 - is_disabled: true + province_code: YT + claimed_medical_expenses: 0 + net_income: 10000000000 output: + yt_medical_expenses: 0 + +- name: Zero Medeical Expenses of Net Income below Maximum Amount + period: 2022 + input: + province_code: YT + claimed_medical_expenses: 0 + net_income: 100 + output: + yt_medical_expenses: 0 + +- name: Medeical Expenses of Net Income below Maximum Amount + period: 2022 + input: + province_code: YT + claimed_medical_expenses: 10000 + net_income: 100 + output: + yt_medical_expenses: 9997 + +- name: Medeical Expenses of Net Income over Maximum Amount + period: 2022 + input: + province_code: YT + claimed_medical_expenses: 4000 + net_income: 1000000000000000 + output: + yt_medical_expenses: 1_521 + diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py new file mode 100644 index 000000000..d4796d18b --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py @@ -0,0 +1,27 @@ +from policyengine_canada.model_api import * + + +class yt_medical_expenses(Variable): + value_type = float + entity = Household + label = "Yukon Medical Expenses" + definition_period = YEAR + defined_for = ProvinceCode.YT + + def formula(household, period, parameters): + p = parameters( + period + ).gov.provinces.yt.tax.income.credits.medical_expenses + + claimed_medical_expenses = household( + "household_medical_expenses", period + ) + net_income = household("household_net_income", period) + medical_expenses_rate = p.rate + + applicable_amount = min_( + p.max_amount, net_income * medical_expenses_rate + ) + + total_amount = claimed_medical_expenses - applicable_amount + return max_(total_amount, 0) diff --git a/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py new file mode 100644 index 000000000..b448e8771 --- /dev/null +++ b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py @@ -0,0 +1,9 @@ +from policyengine_canada.model_api import * + + +class household_medical_expenses(Variable): + value_type = float + entity = Household + label = "medical expenses" + unit = CAD + definition_period = YEAR From d9762d6404fb5e7cf4f5ebbb4fbd6d17ba42ad85 Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Mon, 26 Jun 2023 22:16:11 +0000 Subject: [PATCH 05/11] Yukon Medical Expenses --- changelog_entry.yaml | 5 ++++- .../credits/medical_expenses/max_amount.yaml | 2 +- .../income/credits/medical_expenses/rate.yaml | 4 ---- .../medical_expenses/yt_medical_expenses.yaml | 18 +++++++++--------- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 8b1378917..8406167fe 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1 +1,4 @@ - +- bump: minor + changes: + added: + - Yukon Medical Expenses diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml index 4efe6a781..cfb81d3fa 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml @@ -1,6 +1,6 @@ description: The Maximum Amount in Medical Expenses in Yukon. values: - 2022-01-01: 2,479 + 2022-01-01: 2_479 metadata: unit: currency-CAD label: Yukon Medical Expenses diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml index 2bc4de0f3..7ebaead5d 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml @@ -7,7 +7,3 @@ metadata: reference: - title: Yukon Tax-Medical Expenses href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf - - #line 35 -40 - #variables -- expenses - #household - diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml index 5dfeaee64..f82f15bed 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml @@ -2,8 +2,8 @@ period: 2022 input: province_code: YT - claimed_medical_expenses: 0 - net_income: 10000000000 + household_medical_expenses: 0 + household_net_income: 10_000_000_000 output: yt_medical_expenses: 0 @@ -11,8 +11,8 @@ period: 2022 input: province_code: YT - claimed_medical_expenses: 0 - net_income: 100 + household_medical_expenses: 0 + household_net_income: 100 output: yt_medical_expenses: 0 @@ -20,17 +20,17 @@ period: 2022 input: province_code: YT - claimed_medical_expenses: 10000 - net_income: 100 + household_medical_expenses: 10_000 + household_net_income: 100 output: - yt_medical_expenses: 9997 + yt_medical_expenses: 9_997 - name: Medeical Expenses of Net Income over Maximum Amount period: 2022 input: province_code: YT - claimed_medical_expenses: 4000 - net_income: 1000000000000000 + household_medical_expenses: 4_000 + household_net_income: 10_000_000_000 output: yt_medical_expenses: 1_521 From 6fc5ef6568d80c20d3b9afbfc71f146fe2a9ee13 Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Wed, 12 Jul 2023 21:51:21 +0000 Subject: [PATCH 06/11] Yukon Medical Expenses Fixes #348 --- .../credits/medical_expenses/max_amount.yaml | 2 +- .../income/credits/medical_expenses/rate.yaml | 2 +- .../provinces/yt/yt_tax_taxable_income.yaml | 40 +++++++++++++++++++ .../tax/income/credits/yt_medical_expenses.py | 2 +- .../provinces/yt/tax/yt_tax_taxable_income.py | 16 ++++++++ .../medical/household_medical_expenses.py | 2 +- 6 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml create mode 100644 policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml index cfb81d3fa..f7413d257 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml @@ -1,4 +1,4 @@ -description: The Maximum Amount in Medical Expenses in Yukon. +description: Yukon allows for the following maximum amount under the medical expense credit. values: 2022-01-01: 2_479 metadata: diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml index 7ebaead5d..aa5d29313 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml @@ -1,4 +1,4 @@ -description: Applicable Rate for Medical Expenses in Yukon. +description: Yukon provides the following percentage of the total medical expenses as a tax credit. values: 2022-01-01: 0.03 metadata: diff --git a/policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml b/policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml new file mode 100644 index 000000000..47c503777 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml @@ -0,0 +1,40 @@ +- name: Tax Income Below 50_197 + period: 2023 + input: + province_code: YT + yt_taxable_income: 0 + output: + yt_tax_taxable_income: 0 + +- name: Tax Income Between 50_197 and 100_392 + period: 2023 + input: + province_code: YT + yt_taxable_income: 60_000 + output: + yt_tax_taxable_income: 4_094.88 + +- name: Tax Income Between 100_392 and 155_625 + period: 2023 + input: + province_code: YT + yt_taxable_income: 110_000 + output: + yt_tax_taxable_income: 8777.432 + +- name: Tax Income Between 155_625 and 500_000 + period: 2023 + input: + province_code: YT + yt_taxable_income: 200_000 + output: + yt_tax_taxable_income: 19_430.56 + +- name: Tax Income Above 500_000 + period: 2023 + input: + province_code: YT + yt_taxable_income: 600_000 + output: + yt_tax_taxable_income: 147_830.56 + diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py index d4796d18b..9ea95b39d 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py @@ -24,4 +24,4 @@ def formula(household, period, parameters): ) total_amount = claimed_medical_expenses - applicable_amount - return max_(total_amount, 0) + return max_(claimed_medical_expenses - applicable_amount, 0) diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py b/policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py new file mode 100644 index 000000000..2c062f25e --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py @@ -0,0 +1,16 @@ +from policyengine_canada.model_api import * + + +class yt_tax_taxable_income(Variable): + value_type = float + entity = Person + label = "Yukon income tax" + unit = CAD + definition_period = YEAR + reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf" + defined_for = ProvinceCode.YT + + def formula(person, period, parameters): + income = person("yt_taxable_income", period) + p = parameters(period).gov.provinces.yt.tax.income.rate + return p.calc(income) diff --git a/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py index b448e8771..1c5f1c6cd 100644 --- a/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py +++ b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py @@ -4,6 +4,6 @@ class household_medical_expenses(Variable): value_type = float entity = Household - label = "medical expenses" + label = "Household medical expenses" unit = CAD definition_period = YEAR From 220ef6bcca2448d930d5c33cadf62a075d32e76e Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Mon, 31 Jul 2023 20:50:05 +0000 Subject: [PATCH 07/11] Yukon Medical Expenses Fixes #348 --- changelog_entry.yaml | 2 +- .../household/expenses/medical/household_medical_expenses.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 8406167fe..b8ef7a44b 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,4 +1,4 @@ - bump: minor changes: added: - - Yukon Medical Expenses + - Yukon medical expense credit. diff --git a/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py index 1c5f1c6cd..f57c124fe 100644 --- a/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py +++ b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py @@ -1,7 +1,7 @@ from policyengine_canada.model_api import * -class household_medical_expenses(Variable): +class medical_expenses(Variable): value_type = float entity = Household label = "Household medical expenses" From a3a9b879ce8d6ebda5173c0bd7811068cec0e6b2 Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:46:03 +0000 Subject: [PATCH 08/11] Yukon Medical Expenses Fixes #348 --- .../credits/medical_expenses/max_amount.yaml | 2 +- .../income/credits/medical_expenses/rate.yaml | 4 +- .../medical_expenses/yt_medical_expenses.yaml | 16 ++++---- .../provinces/yt/yt_tax_taxable_income.yaml | 40 ------------------- .../tax/income/credits/yt_medical_expenses.py | 5 +-- .../provinces/yt/tax/yt_tax_taxable_income.py | 16 -------- 6 files changed, 12 insertions(+), 71 deletions(-) delete mode 100644 policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml delete mode 100644 policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml index f7413d257..ec283cfed 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml @@ -6,5 +6,5 @@ metadata: label: Yukon Medical Expenses reference: - title: Yukon Tax-Medical Expenses - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf#page=2 diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml index aa5d29313..b95ac2abb 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml @@ -3,7 +3,7 @@ values: 2022-01-01: 0.03 metadata: unit: /1 - label: Yukon Medical Expenses Applicable Rate + label: Yukon Medical Expenses credit applicable rate reference: - title: Yukon Tax-Medical Expenses - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf#page=2 diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml index f82f15bed..87c25be42 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml @@ -1,35 +1,35 @@ -- name: Zero Medeical Expenses of Net Income over Maximum Amount +- name: Zero Medical Expenses of Net Income over Maximum Amount period: 2022 input: province_code: YT - household_medical_expenses: 0 + medical_expenses: 0 household_net_income: 10_000_000_000 output: yt_medical_expenses: 0 -- name: Zero Medeical Expenses of Net Income below Maximum Amount +- name: Zero Medical Expenses of Net Income below Maximum Amount period: 2022 input: province_code: YT - household_medical_expenses: 0 + medical_expenses: 0 household_net_income: 100 output: yt_medical_expenses: 0 -- name: Medeical Expenses of Net Income below Maximum Amount +- name: Medical Expenses of Net Income below Maximum Amount period: 2022 input: province_code: YT - household_medical_expenses: 10_000 + medical_expenses: 10_000 household_net_income: 100 output: yt_medical_expenses: 9_997 -- name: Medeical Expenses of Net Income over Maximum Amount +- name: Medical Expenses of Net Income over Maximum Amount period: 2022 input: province_code: YT - household_medical_expenses: 4_000 + medical_expenses: 4_000 household_net_income: 10_000_000_000 output: yt_medical_expenses: 1_521 diff --git a/policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml b/policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml deleted file mode 100644 index 47c503777..000000000 --- a/policyengine_canada/tests/gov/provinces/yt/yt_tax_taxable_income.yaml +++ /dev/null @@ -1,40 +0,0 @@ -- name: Tax Income Below 50_197 - period: 2023 - input: - province_code: YT - yt_taxable_income: 0 - output: - yt_tax_taxable_income: 0 - -- name: Tax Income Between 50_197 and 100_392 - period: 2023 - input: - province_code: YT - yt_taxable_income: 60_000 - output: - yt_tax_taxable_income: 4_094.88 - -- name: Tax Income Between 100_392 and 155_625 - period: 2023 - input: - province_code: YT - yt_taxable_income: 110_000 - output: - yt_tax_taxable_income: 8777.432 - -- name: Tax Income Between 155_625 and 500_000 - period: 2023 - input: - province_code: YT - yt_taxable_income: 200_000 - output: - yt_tax_taxable_income: 19_430.56 - -- name: Tax Income Above 500_000 - period: 2023 - input: - province_code: YT - yt_taxable_income: 600_000 - output: - yt_tax_taxable_income: 147_830.56 - diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py index 9ea95b39d..3c79977dc 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py @@ -13,9 +13,7 @@ def formula(household, period, parameters): period ).gov.provinces.yt.tax.income.credits.medical_expenses - claimed_medical_expenses = household( - "household_medical_expenses", period - ) + claimed_medical_expenses = household("medical_expenses", period) net_income = household("household_net_income", period) medical_expenses_rate = p.rate @@ -23,5 +21,4 @@ def formula(household, period, parameters): p.max_amount, net_income * medical_expenses_rate ) - total_amount = claimed_medical_expenses - applicable_amount return max_(claimed_medical_expenses - applicable_amount, 0) diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py b/policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py deleted file mode 100644 index 2c062f25e..000000000 --- a/policyengine_canada/variables/gov/provinces/yt/tax/yt_tax_taxable_income.py +++ /dev/null @@ -1,16 +0,0 @@ -from policyengine_canada.model_api import * - - -class yt_tax_taxable_income(Variable): - value_type = float - entity = Person - label = "Yukon income tax" - unit = CAD - definition_period = YEAR - reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf" - defined_for = ProvinceCode.YT - - def formula(person, period, parameters): - income = person("yt_taxable_income", period) - p = parameters(period).gov.provinces.yt.tax.income.rate - return p.calc(income) From 40787ff8735d730e09e4e988869cf635e4e362ad Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Wed, 30 Aug 2023 22:45:59 +0000 Subject: [PATCH 09/11] Yukon Medical Expenses --- .../max_amount.yaml | 0 .../{medical_expenses => medical_expense}/rate.yaml | 0 .../{medical_expenses => }/yt_medical_expenses.yaml | 11 ++++------- .../yt/tax/income/credits/yt_medical_expenses.py | 6 +++--- 4 files changed, 7 insertions(+), 10 deletions(-) rename policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/{medical_expenses => medical_expense}/max_amount.yaml (100%) rename policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/{medical_expenses => medical_expense}/rate.yaml (100%) rename policyengine_canada/tests/gov/provinces/yt/tax/income/credits/{medical_expenses => }/yt_medical_expenses.yaml (83%) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/max_amount.yaml similarity index 100% rename from policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/max_amount.yaml rename to policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/max_amount.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/rate.yaml similarity index 100% rename from policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expenses/rate.yaml rename to policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/rate.yaml diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_medical_expenses.yaml similarity index 83% rename from policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml rename to policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_medical_expenses.yaml index 87c25be42..6e10fa5e6 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/medical_expenses/yt_medical_expenses.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_medical_expenses.yaml @@ -5,7 +5,7 @@ medical_expenses: 0 household_net_income: 10_000_000_000 output: - yt_medical_expenses: 0 + yt_medical_expense_credit: 0 - name: Zero Medical Expenses of Net Income below Maximum Amount period: 2022 @@ -14,7 +14,7 @@ medical_expenses: 0 household_net_income: 100 output: - yt_medical_expenses: 0 + yt_medical_expense_credit: 0 - name: Medical Expenses of Net Income below Maximum Amount period: 2022 @@ -23,7 +23,7 @@ medical_expenses: 10_000 household_net_income: 100 output: - yt_medical_expenses: 9_997 + yt_medical_expense_credit: 9_997 - name: Medical Expenses of Net Income over Maximum Amount period: 2022 @@ -32,7 +32,4 @@ medical_expenses: 4_000 household_net_income: 10_000_000_000 output: - yt_medical_expenses: 1_521 - - - + yt_medical_expense_credit: 1_521 diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py index 3c79977dc..d2ed2c924 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py @@ -1,17 +1,17 @@ from policyengine_canada.model_api import * -class yt_medical_expenses(Variable): +class yt_medical_expense_credit(Variable): value_type = float entity = Household - label = "Yukon Medical Expenses" + label = "Yukon Medical Expense Credit" definition_period = YEAR defined_for = ProvinceCode.YT def formula(household, period, parameters): p = parameters( period - ).gov.provinces.yt.tax.income.credits.medical_expenses + ).gov.provinces.yt.tax.income.credits.medical_expense claimed_medical_expenses = household("medical_expenses", period) net_income = household("household_net_income", period) From b15500d5c69684236fc089bdfe3d02e1d579fc3a Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Thu, 31 Aug 2023 01:17:02 +0000 Subject: [PATCH 10/11] Yukon Medical Expenses --- .../yt/tax/income/credits/medical_expense/max_amount.yaml | 3 ++- .../provinces/yt/tax/income/credits/medical_expense/rate.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/max_amount.yaml index ec283cfed..7d84437a8 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/max_amount.yaml @@ -3,7 +3,8 @@ values: 2022-01-01: 2_479 metadata: unit: currency-CAD - label: Yukon Medical Expenses + label: Yukon medical expense credit max amount + # Credit is not mentioned in the in Yukon Income Tax Act reference: - title: Yukon Tax-Medical Expenses href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf#page=2 diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/rate.yaml index b95ac2abb..405e88264 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/medical_expense/rate.yaml @@ -1,9 +1,10 @@ -description: Yukon provides the following percentage of the total medical expenses as a tax credit. +description: Yukon multiplies the medical expenses by the following rate under the medical expenses tax credit. values: 2022-01-01: 0.03 metadata: unit: /1 label: Yukon Medical Expenses credit applicable rate + # Credit is not mentioned in the in Yukon Income Tax Act reference: - title: Yukon Tax-Medical Expenses href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-c/5011-c-22e.pdf#page=2 From 4d0c0da371582122bcc9b3ccc3d4f7bfbbf5e327 Mon Sep 17 00:00:00 2001 From: sqw0418 <97478242+sqw0418@users.noreply.github.com> Date: Mon, 4 Sep 2023 22:32:14 +0000 Subject: [PATCH 11/11] Yukon Medical Expenses --- .../yt/tax/income/credits/yt_medical_expenses.yaml | 8 ++++---- .../yt/tax/income/credits/yt_medical_expenses.py | 4 +++- .../expenses/medical/household_medical_expenses.py | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_medical_expenses.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_medical_expenses.yaml index 6e10fa5e6..c3e1cc8e4 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_medical_expenses.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_medical_expenses.yaml @@ -2,7 +2,7 @@ period: 2022 input: province_code: YT - medical_expenses: 0 + household_medical_expenses: 0 household_net_income: 10_000_000_000 output: yt_medical_expense_credit: 0 @@ -11,7 +11,7 @@ period: 2022 input: province_code: YT - medical_expenses: 0 + household_medical_expenses: 0 household_net_income: 100 output: yt_medical_expense_credit: 0 @@ -20,7 +20,7 @@ period: 2022 input: province_code: YT - medical_expenses: 10_000 + household_medical_expenses: 10_000 household_net_income: 100 output: yt_medical_expense_credit: 9_997 @@ -29,7 +29,7 @@ period: 2022 input: province_code: YT - medical_expenses: 4_000 + household_medical_expenses: 4_000 household_net_income: 10_000_000_000 output: yt_medical_expense_credit: 1_521 diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py index d2ed2c924..ef89bbac5 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_medical_expenses.py @@ -13,7 +13,9 @@ def formula(household, period, parameters): period ).gov.provinces.yt.tax.income.credits.medical_expense - claimed_medical_expenses = household("medical_expenses", period) + claimed_medical_expenses = household( + "household_medical_expenses", period + ) net_income = household("household_net_income", period) medical_expenses_rate = p.rate diff --git a/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py index f57c124fe..1c5f1c6cd 100644 --- a/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py +++ b/policyengine_canada/variables/household/expenses/medical/household_medical_expenses.py @@ -1,7 +1,7 @@ from policyengine_canada.model_api import * -class medical_expenses(Variable): +class household_medical_expenses(Variable): value_type = float entity = Household label = "Household medical expenses"