From b7a17cc68727f0551a654db110a6023733ec3d50 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Thu, 25 May 2023 03:08:45 +0000 Subject: [PATCH 01/15] parameters --- .../provinces/yt/tax/income/credits/age_amount/age.yaml | 9 +++++++++ .../yt/tax/income/credits/age_amount/base_amount.yaml | 9 +++++++++ .../income/credits/age_amount/maximum_net_income.yaml | 9 +++++++++ .../yt/tax/income/credits/age_amount/maximun_amount.yaml | 9 +++++++++ .../provinces/yt/tax/income/credits/age_amount/rate.yaml | 9 +++++++++ 5 files changed, 45 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml new file mode 100644 index 000000000..61399adc6 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -0,0 +1,9 @@ +description: The eligible age for getting the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 65 +metadata: + unit: year + label: Yukon age amount eligible age + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml new file mode 100644 index 000000000..ca472e730 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml @@ -0,0 +1,9 @@ +description: Yukon base amount of one's net income for the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 42_335 +metadata: + unit: currency-CAD + label: Yukon base amount + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml new file mode 100644 index 000000000..0b4781317 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml @@ -0,0 +1,9 @@ +description: Yukon maximum net income for one to get the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 98_309 +metadata: + unit: currency-CAD + label: Yukon age amount maximum net income + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml new file mode 100644 index 000000000..b64164b25 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml @@ -0,0 +1,9 @@ +description: Yukon Maximum amount that one can get for the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 8_396 +metadata: + unit: currency-CAD + label: Yukon age amount maximum amount + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml new file mode 100644 index 000000000..ddcca5100 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -0,0 +1,9 @@ +description: Rate of the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 0.15 +metadata: + unit: /1 + label: Yukon age amount applicable rate + 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 \ No newline at end of file From 782a535fdfe17de28fe67c6b931cb242688aa113 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Fri, 26 May 2023 01:54:13 +0000 Subject: [PATCH 02/15] parameters --- changelog_entry.yaml | 4 ++++ .../provinces/yt/tax/income/credits/age_amount/age.yaml | 9 +++++++++ .../yt/tax/income/credits/age_amount/base_amount.yaml | 9 +++++++++ .../yt/tax/income/credits/age_amount/maximum_amount.yaml | 9 +++++++++ .../income/credits/age_amount/maximum_net_income.yaml | 9 +++++++++ .../provinces/yt/tax/income/credits/age_amount/rate.yaml | 9 +++++++++ 6 files changed, 49 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..f522c9805 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Yukon age amount. \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml new file mode 100644 index 000000000..61399adc6 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -0,0 +1,9 @@ +description: The eligible age for getting the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 65 +metadata: + unit: year + label: Yukon age amount eligible age + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml new file mode 100644 index 000000000..ca472e730 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml @@ -0,0 +1,9 @@ +description: Yukon base amount of one's net income for the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 42_335 +metadata: + unit: currency-CAD + label: Yukon base amount + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml new file mode 100644 index 000000000..b64164b25 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -0,0 +1,9 @@ +description: Yukon Maximum amount that one can get for the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 8_396 +metadata: + unit: currency-CAD + label: Yukon age amount maximum amount + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml new file mode 100644 index 000000000..0b4781317 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml @@ -0,0 +1,9 @@ +description: Yukon maximum net income for one to get the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 98_309 +metadata: + unit: currency-CAD + label: Yukon age amount maximum net income + 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 \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml new file mode 100644 index 000000000..ddcca5100 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -0,0 +1,9 @@ +description: Rate of the age amount of Yukon Personal Tax Credits Return. +values: + 2022-01-01: 0.15 +metadata: + unit: /1 + label: Yukon age amount applicable rate + 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 \ No newline at end of file From 7a2ee7d9110dfc8fc15dd3f5c97e106ddc7e1c25 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Fri, 26 May 2023 02:17:47 +0000 Subject: [PATCH 03/15] Yukon Age Amount Fixes #293 --- changelog_entry.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index f522c9805..a547079b3 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,4 +1,5 @@ - bump: minor changes: added: - - Yukon age amount. \ No newline at end of file + - Yukon age amount. + \ No newline at end of file From 16c6f07a056acb11f9f8497e4fe0d9e145886e8e Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Fri, 26 May 2023 02:35:19 +0000 Subject: [PATCH 04/15] test --- changelog_entry.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index a547079b3..f522c9805 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,5 +1,4 @@ - bump: minor changes: added: - - Yukon age amount. - \ No newline at end of file + - Yukon age amount. \ No newline at end of file From 33b11f655c849c21234b2d95cee6e4442dcdd92a Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Fri, 26 May 2023 20:43:38 +0000 Subject: [PATCH 05/15] variables & test --- changelog_entry.yaml | 2 +- .../yt/tax/income/credits/age_amount/age.yaml | 2 +- .../credits/age_amount/base_amount.yaml | 2 +- .../credits/age_amount/maximum_amount.yaml | 2 +- .../age_amount/maximum_net_income.yaml | 2 +- .../credits/age_amount/maximun_amount.yaml | 2 +- .../tax/income/credits/age_amount/rate.yaml | 2 +- .../yt/tax/income/credits/yt_age_amount.yaml | 35 +++++++++++++++++++ .../yt/tax/income/credits/yt_age_amount.py | 22 ++++++++++++ 9 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml create mode 100644 policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index f522c9805..104eaf362 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,4 +1,4 @@ - bump: minor changes: added: - - Yukon age amount. \ No newline at end of file + - Yukon age amount. diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml index 61399adc6..9b89c9331 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -6,4 +6,4 @@ metadata: label: Yukon age amount eligible age 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 \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml index ca472e730..17f6f9ac9 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml @@ -6,4 +6,4 @@ metadata: label: Yukon base amount 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 \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index b64164b25..da74c3edb 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -6,4 +6,4 @@ metadata: label: Yukon age amount maximum amount 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 \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml index 0b4781317..827d37886 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml @@ -6,4 +6,4 @@ metadata: label: Yukon age amount maximum net income 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 \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml index b64164b25..da74c3edb 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml @@ -6,4 +6,4 @@ metadata: label: Yukon age amount maximum amount 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 \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml index ddcca5100..80a280685 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -6,4 +6,4 @@ metadata: label: Yukon age amount applicable rate 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 \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml new file mode 100644 index 000000000..1832aa61f --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml @@ -0,0 +1,35 @@ +- name: Not eligible for age + period: 2022 + input: + province_code: YT + individual_net_income: 10_000 + age: 60 + output: + yt_age_amount: 0 + +- name: Not eligible for net income + period: 2022 + input: + province_code: YT + individual_net_income: 100_000 + age: 70 + output: + yt_age_amount: 0 + +- name: Eligible & maximum age amount (net income < base amount) + period: 2022 + input: + province_code: YT + individual_net_income: 10_000 + age: 70 + output: + yt_age_amount: 8_396 + +- name: Eligible & net income between base amount and maximum amount (8396-(62335-42335)*0.15 = 5396) + period: 2022 + input: + province_code: YT + individual_net_income: 62_335 + age: 70 + output: + yt_age_amount: 5_396 diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py new file mode 100644 index 000000000..02c42b345 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py @@ -0,0 +1,22 @@ +from policyengine_canada.model_api import * + + +class yt_age_amount(Variable): + value_type = float + entity = Person + label = "Yukon age amount" + definition_period = YEAR + defined_for = ProvinceCode.YT + + def formula(person, period, parameters): + income = person("individual_net_income", period) + age = person("age", period) + p = parameters(period).gov.provinces.yt.tax.income.credits.age_amount + reduction = ( + (income > p.base_amount) * (income - p.base_amount) * p.rate + ) + return ( + (age >= p.age) + * (income < p.maximum_net_income) + * (p.maximum_amount - reduction) + ) From 3031edd147479d023d289a7c8078296c064ad727 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Mon, 17 Jul 2023 22:29:42 +0000 Subject: [PATCH 06/15] name --- .../provinces/yt/tax/income/credits/age_amount/base_amount.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml index 17f6f9ac9..2270fd5d5 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml @@ -3,7 +3,7 @@ values: 2022-01-01: 42_335 metadata: unit: currency-CAD - label: Yukon base amount + 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 From 72405440da3bcb52bfa856414ccd5a4936cf8eb2 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:52:08 +0000 Subject: [PATCH 07/15] changes --- .../yt/tax/income/credits/age_amount/age.yaml | 7 +++++-- .../tax/income/credits/age_amount/base_amount.yaml | 6 ++++-- .../income/credits/age_amount/income_threshold.yaml | 12 ++++++++++++ .../income/credits/age_amount/maximum_amount.yaml | 7 ++++--- .../credits/age_amount/maximum_net_income.yaml | 9 --------- .../income/credits/age_amount/maximun_amount.yaml | 9 --------- .../yt/tax/income/credits/age_amount/rate.yaml | 6 ++++-- 7 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml delete mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml delete mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml index 9b89c9331..b5acb254e 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -1,9 +1,12 @@ -description: The eligible age for getting the age amount of Yukon Personal Tax Credits Return. +description: Yukon provides the age amount credit for filers above this age. + values: - 2022-01-01: 65 + 2023-01-01: 65 metadata: unit: year label: Yukon age amount eligible age 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 + - title: Income Tax Act + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml index 2270fd5d5..8af10c890 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml @@ -1,9 +1,11 @@ -description: Yukon base amount of one's net income for the age amount of Yukon Personal Tax Credits Return. +description: Yukon provides this base amount of one's net income under the age amount credit. values: - 2022-01-01: 42_335 + 2023-01-01: 42_335 metadata: unit: currency-CAD 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 + - title: Income Tax Act + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml new file mode 100644 index 000000000..ac0c2d9ec --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml @@ -0,0 +1,12 @@ +description: Yukon provides this maximum net income for one to get under the age amount credit. +values: + 2023-01-01: 98_309 +metadata: + unit: currency-CAD + label: Yukon age amount income 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 + - title: Income Tax Act + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index da74c3edb..cedc99bc9 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -1,9 +1,10 @@ -description: Yukon Maximum amount that one can get for the age amount of Yukon Personal Tax Credits Return. -values: - 2022-01-01: 8_396 +description: Yukon provides this maximum amount that one can get under the age amount credit. + 2023-01-01: 8_396 metadata: unit: currency-CAD label: Yukon age amount maximum amount 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 + - title: Income Tax Act + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml deleted file mode 100644 index 827d37886..000000000 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_net_income.yaml +++ /dev/null @@ -1,9 +0,0 @@ -description: Yukon maximum net income for one to get the age amount of Yukon Personal Tax Credits Return. -values: - 2022-01-01: 98_309 -metadata: - unit: currency-CAD - label: Yukon age amount maximum net income - 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 diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml deleted file mode 100644 index da74c3edb..000000000 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximun_amount.yaml +++ /dev/null @@ -1,9 +0,0 @@ -description: Yukon Maximum amount that one can get for the age amount of Yukon Personal Tax Credits Return. -values: - 2022-01-01: 8_396 -metadata: - unit: currency-CAD - label: Yukon age amount maximum amount - 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 diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml index 80a280685..afda5ad89 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -1,9 +1,11 @@ -description: Rate of the age amount of Yukon Personal Tax Credits Return. +description: Yukon provides this rate under the age amount credit. values: - 2022-01-01: 0.15 + 2023-01-01: 0.15 metadata: unit: /1 label: Yukon age amount applicable rate 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 + - title: Income Tax Act + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf From ec287729e0dac91a8f1c7ed8cf88895388e12ba6 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Mon, 31 Jul 2023 15:01:09 +0000 Subject: [PATCH 08/15] test --- .../yt/tax/income/credits/age_amount/maximum_amount.yaml | 1 + .../provinces/yt/tax/income/credits/yt_age_amount.yaml | 8 ++++---- .../gov/provinces/yt/tax/income/credits/yt_age_amount.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index cedc99bc9..1774034f5 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -1,4 +1,5 @@ description: Yukon provides this maximum amount that one can get under the age amount credit. +values: 2023-01-01: 8_396 metadata: unit: currency-CAD diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml index 1832aa61f..f481eeb5f 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml @@ -1,5 +1,5 @@ - name: Not eligible for age - period: 2022 + period: 2023 input: province_code: YT individual_net_income: 10_000 @@ -8,7 +8,7 @@ yt_age_amount: 0 - name: Not eligible for net income - period: 2022 + period: 2023 input: province_code: YT individual_net_income: 100_000 @@ -17,7 +17,7 @@ yt_age_amount: 0 - name: Eligible & maximum age amount (net income < base amount) - period: 2022 + period: 2023 input: province_code: YT individual_net_income: 10_000 @@ -26,7 +26,7 @@ yt_age_amount: 8_396 - name: Eligible & net income between base amount and maximum amount (8396-(62335-42335)*0.15 = 5396) - period: 2022 + period: 2023 input: province_code: YT individual_net_income: 62_335 diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py index 02c42b345..7414bd29e 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py @@ -17,6 +17,6 @@ def formula(person, period, parameters): ) return ( (age >= p.age) - * (income < p.maximum_net_income) + * (income < p.income_threshold) * (p.maximum_amount - reduction) ) From 01885f17590b8d181697aad76e5789efcf463356 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Mon, 31 Jul 2023 23:08:40 +0000 Subject: [PATCH 09/15] add 2022 --- .../yt/tax/income/credits/age_amount/age.yaml | 2 ++ .../credits/age_amount/base_amount.yaml | 3 +++ .../credits/age_amount/income_threshold.yaml | 3 +++ .../credits/age_amount/maximum_amount.yaml | 3 +++ .../tax/income/credits/age_amount/rate.yaml | 22 ++++++++++++++++--- .../yt/tax/income/credits/yt_age_amount.py | 10 +++++---- 6 files changed, 36 insertions(+), 7 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml index b5acb254e..ee979ce69 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -10,3 +10,5 @@ metadata: href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf - title: Income Tax Act href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Worksheet for the Yukon 2022 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml index 8af10c890..563e98642 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml @@ -1,5 +1,6 @@ description: Yukon provides this base amount of one's net income under the age amount credit. values: + 2022-01-01: 39_826 2023-01-01: 42_335 metadata: unit: currency-CAD @@ -9,3 +10,5 @@ metadata: href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf - title: Income Tax Act href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Worksheet for the Yukon 2022 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml index ac0c2d9ec..fd7bc910b 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml @@ -1,5 +1,6 @@ description: Yukon provides this maximum net income for one to get under the age amount credit. values: + 2022-01-01: 92_480 2023-01-01: 98_309 metadata: unit: currency-CAD @@ -10,3 +11,5 @@ metadata: href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf - title: Income Tax Act href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Worksheet for the Yukon 2022 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index 1774034f5..f85656e06 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -1,5 +1,6 @@ description: Yukon provides this maximum amount that one can get under the age amount credit. values: + 2022-01-01: 7_898 2023-01-01: 8_396 metadata: unit: currency-CAD @@ -9,3 +10,5 @@ metadata: href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf - title: Income Tax Act href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Worksheet for the Yukon 2022 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml index afda5ad89..629e60cec 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -1,11 +1,27 @@ description: Yukon provides this rate under the age amount credit. -values: - 2023-01-01: 0.15 +brackets: + - threshold: + 2022-01-01: 0 + rate: + 2022-01-01: 0 + - threshold: + 2022-01-01: 39_826 + rate: + 2022-01-01: 0.15 + - threshold: + 2023-01-01: 42_335 + rate: + 2023-01-01: 0.15 + metadata: - unit: /1 + type: marginal_rate + threshold_unit: currency-CAD + rate_unit: /1 label: Yukon age amount applicable rate 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 - title: Income Tax Act href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Worksheet for the Yukon 2022 Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py index 7414bd29e..a6f041eec 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py @@ -12,11 +12,13 @@ def formula(person, period, parameters): income = person("individual_net_income", period) age = person("age", period) p = parameters(period).gov.provinces.yt.tax.income.credits.age_amount - reduction = ( - (income > p.base_amount) * (income - p.base_amount) * p.rate - ) + # reduction = ( + # (income > p.base_amount) * (income - p.base_amount) * p.rate + # ) + reduction = income * p.rate + reduced_amount = max_(p.maximum_amount - reduction, 0) return ( (age >= p.age) * (income < p.income_threshold) - * (p.maximum_amount - reduction) + * reduced_amount ) From 1571571f1449594a15edef8dffea38534c43542e Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Mon, 31 Jul 2023 23:11:07 +0000 Subject: [PATCH 10/15] format --- .../gov/provinces/yt/tax/income/credits/yt_age_amount.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py index a6f041eec..e4cb09582 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py @@ -17,8 +17,4 @@ def formula(person, period, parameters): # ) reduction = income * p.rate reduced_amount = max_(p.maximum_amount - reduction, 0) - return ( - (age >= p.age) - * (income < p.income_threshold) - * reduced_amount - ) + return (age >= p.age) * (income < p.income_threshold) * reduced_amount From 141d19fd10bf74c55f7b5c62d1f2670b1429caf9 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Tue, 8 Aug 2023 09:34:21 -0500 Subject: [PATCH 11/15] Update policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml Co-authored-by: Pavel Makarchuk <110687043+PavelMakarchuk@users.noreply.github.com> --- .../yt/tax/income/credits/age_amount/maximum_amount.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index f85656e06..ba9ec18aa 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -1,4 +1,4 @@ -description: Yukon provides this maximum amount that one can get under the age amount credit. +description: Yukon provides this maximum amount under the age amount credit. values: 2022-01-01: 7_898 2023-01-01: 8_396 From 4d258a716075ab3d250855723386879f96cafc4a Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:44:29 +0000 Subject: [PATCH 12/15] Yukon Age Amount Fixes #293 --- .../tax/income/credits/age_amount/base_amount.yaml | 14 -------------- .../income/credits/age_amount/maximum_amount.yaml | 2 +- .../yt/tax/income/credits/age_amount/rate.yaml | 7 ++----- .../yt/tax/income/credits/yt_age_amount.yaml | 6 +++--- .../yt/tax/income/credits/yt_age_amount.py | 10 +++++----- 5 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml deleted file mode 100644 index 563e98642..000000000 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/base_amount.yaml +++ /dev/null @@ -1,14 +0,0 @@ -description: Yukon provides this base amount of one's net income under the age amount credit. -values: - 2022-01-01: 39_826 - 2023-01-01: 42_335 -metadata: - unit: currency-CAD - 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 - - title: Income Tax Act - href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf - - title: Worksheet for the Yukon 2022 Personal Tax Credits Return - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index f85656e06..ba9ec18aa 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -1,4 +1,4 @@ -description: Yukon provides this maximum amount that one can get under the age amount credit. +description: Yukon provides this maximum amount under the age amount credit. values: 2022-01-01: 7_898 2023-01-01: 8_396 diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml index 629e60cec..6c7c8ec73 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -1,4 +1,4 @@ -description: Yukon provides this rate under the age amount credit. +description: Yukon provides this rate under the age amounhttps://ruoqitan-didactic-engine-gvx7v4694ppcp47x.github.dev/t credit. brackets: - threshold: 2022-01-01: 0 @@ -6,12 +6,9 @@ brackets: 2022-01-01: 0 - threshold: 2022-01-01: 39_826 - rate: - 2022-01-01: 0.15 - - threshold: 2023-01-01: 42_335 rate: - 2023-01-01: 0.15 + 2022-01-01: 0.15 metadata: type: marginal_rate diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml index f481eeb5f..7d5df7b11 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml @@ -1,13 +1,13 @@ -- name: Not eligible for age +- name: Not eligible for age amount period: 2023 input: province_code: YT individual_net_income: 10_000 - age: 60 + age: 64 output: yt_age_amount: 0 -- name: Not eligible for net income +- name: Not eligible through net income period: 2023 input: province_code: YT diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py index e4cb09582..c9666d518 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py @@ -12,9 +12,9 @@ def formula(person, period, parameters): income = person("individual_net_income", period) age = person("age", period) p = parameters(period).gov.provinces.yt.tax.income.credits.age_amount - # reduction = ( - # (income > p.base_amount) * (income - p.base_amount) * p.rate - # ) - reduction = income * p.rate + reduction = p.rate.calc(income) reduced_amount = max_(p.maximum_amount - reduction, 0) - return (age >= p.age) * (income < p.income_threshold) * reduced_amount + age_eligible = age >= p.age + income_eligible = income < p.income_threshold + eligible = age_eligible & income_eligible + return eligible * reduced_amount From b5b6940c652453a76ec887e8ef717be4e838be85 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:16:28 +0000 Subject: [PATCH 13/15] Yukon Age Amount Fixes #293 --- .../yt/tax/income/credits/age_amount/age.yaml | 7 ++++--- .../credits/age_amount/income_threshold.yaml | 15 --------------- .../income/credits/age_amount/maximum_amount.yaml | 2 +- .../yt/tax/income/credits/age_amount/rate.yaml | 4 ++-- .../yt/tax/income/credits/yt_age_amount.py | 4 +--- 5 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml index ee979ce69..a0e25230a 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -1,4 +1,5 @@ -description: Yukon provides the age amount credit for filers above this age. +description: Yukon qualifies filer for the age amount credit at or above this age threshold. + values: 2023-01-01: 65 @@ -7,8 +8,8 @@ metadata: label: Yukon age amount eligible age 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 - - title: Income Tax Act + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf#page=1 + - title: Income Tax Act -- Page 8 href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf - title: Worksheet for the Yukon 2022 Personal Tax Credits Return href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml deleted file mode 100644 index fd7bc910b..000000000 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/income_threshold.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: Yukon provides this maximum net income for one to get under the age amount credit. -values: - 2022-01-01: 92_480 - 2023-01-01: 98_309 -metadata: - unit: currency-CAD - label: Yukon age amount income 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 - - title: Income Tax Act - href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf - - title: Worksheet for the Yukon 2022 Personal Tax Credits Return - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index ba9ec18aa..b8112a0fa 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -8,7 +8,7 @@ metadata: 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 - - title: Income Tax Act + - title: Income Tax Act -- Page 8 href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf - title: Worksheet for the Yukon 2022 Personal Tax Credits Return href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml index 6c7c8ec73..d3344fc50 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -1,4 +1,4 @@ -description: Yukon provides this rate under the age amounhttps://ruoqitan-didactic-engine-gvx7v4694ppcp47x.github.dev/t credit. +description: Yukon reduces the age amount credit at this rate. brackets: - threshold: 2022-01-01: 0 @@ -18,7 +18,7 @@ metadata: 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 - - title: Income Tax Act + - title: Income Tax Act -- Page 8 href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf - title: Worksheet for the Yukon 2022 Personal Tax Credits Return href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py index c9666d518..664202d55 100644 --- a/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py +++ b/policyengine_canada/variables/gov/provinces/yt/tax/income/credits/yt_age_amount.py @@ -15,6 +15,4 @@ def formula(person, period, parameters): reduction = p.rate.calc(income) reduced_amount = max_(p.maximum_amount - reduction, 0) age_eligible = age >= p.age - income_eligible = income < p.income_threshold - eligible = age_eligible & income_eligible - return eligible * reduced_amount + return age_eligible * reduced_amount From f0e500ac4166a71717ee5f16aa834ed8ea872e6e Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:24:21 +0000 Subject: [PATCH 14/15] changes --- .../provinces/yt/tax/income/credits/age_amount/age.yaml | 8 +++----- .../yt/tax/income/credits/age_amount/maximum_amount.yaml | 4 ++-- .../provinces/yt/tax/income/credits/age_amount/rate.yaml | 4 ++-- .../provinces/yt/tax/income/credits/yt_age_amount.yaml | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml index a0e25230a..be3e13d6b 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -1,6 +1,4 @@ -description: Yukon qualifies filer for the age amount credit at or above this age threshold. - - +description: Yukon qualifies filers for the age amount credit at or above this age threshold. values: 2023-01-01: 65 metadata: @@ -9,7 +7,7 @@ metadata: 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 - - title: Income Tax Act -- Page 8 - href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Yukon Income Tax Act -- Age Credit + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf#page=8 - title: Worksheet for the Yukon 2022 Personal Tax Credits Return href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index b8112a0fa..62bab948c 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -8,7 +8,7 @@ metadata: 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 - - title: Income Tax Act -- Page 8 - href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Yukon Income Tax Act -- Age Credit + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf#page=8 - title: Worksheet for the Yukon 2022 Personal Tax Credits Return href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml index d3344fc50..b18d17fe1 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -18,7 +18,7 @@ metadata: 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 - - title: Income Tax Act -- Page 8 - href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf + - title: Yukon Income Tax Act -- Age Credit + href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf#page=8 - title: Worksheet for the Yukon 2022 Personal Tax Credits Return href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml index 7d5df7b11..8dc67686b 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/credits/yt_age_amount.yaml @@ -21,7 +21,7 @@ input: province_code: YT individual_net_income: 10_000 - age: 70 + age: 65 output: yt_age_amount: 8_396 From d72d574a9a5f891fc093230f3918c788ec813fa0 Mon Sep 17 00:00:00 2001 From: RuoqiTan <97366958+RuoqiTan@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:29:03 +0000 Subject: [PATCH 15/15] pages --- .../gov/provinces/yt/tax/income/credits/age_amount/age.yaml | 4 ++-- .../yt/tax/income/credits/age_amount/maximum_amount.yaml | 4 ++-- .../gov/provinces/yt/tax/income/credits/age_amount/rate.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml index be3e13d6b..4ea920791 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/age.yaml @@ -1,6 +1,6 @@ description: Yukon qualifies filers for the age amount credit at or above this age threshold. values: - 2023-01-01: 65 + 2022-01-01: 65 metadata: unit: year label: Yukon age amount eligible age @@ -10,4 +10,4 @@ metadata: - title: Yukon Income Tax Act -- Age Credit href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf#page=8 - title: Worksheet for the Yukon 2022 Personal Tax Credits Return - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml index 62bab948c..3db548342 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/maximum_amount.yaml @@ -7,8 +7,8 @@ metadata: label: Yukon age amount maximum amount 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 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf#page=1 - title: Yukon Income Tax Act -- Age Credit href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf#page=8 - title: Worksheet for the Yukon 2022 Personal Tax Credits Return - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml index b18d17fe1..62462a448 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/tax/income/credits/age_amount/rate.yaml @@ -17,8 +17,8 @@ metadata: label: Yukon age amount applicable rate 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 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-23e.pdf#page=1 - title: Yukon Income Tax Act -- Age Credit href: https://laws.yukon.ca/cms/images/LEGISLATION/PRINCIPAL/2002/2002-0118/2002-0118.pdf#page=8 - title: Worksheet for the Yukon 2022 Personal Tax Credits Return - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1yt-ws/td1yt-ws-22e.pdf#page=1