From bc264d3ccf14f1d391f47352b0b71304554afcbd Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Thu, 29 Jun 2023 21:26:46 +0000 Subject: [PATCH 01/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../credits/basic_personal_amount/base.yaml | 10 ++++++++ .../credits/pension_credit/max_amount.yaml | 9 ++++++++ .../tax/income/nt_basic_personal_amount.yaml | 6 +++++ .../nt/tax/income/nt_pension_credit.yaml | 23 +++++++++++++++++++ .../nt_basic_personal_amount.py | 14 +++++++++++ .../pension_credit/nt_pension_credit.py | 15 ++++++++++++ 6 files changed, 77 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml create mode 100644 policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml create mode 100644 policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml create mode 100644 policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py create mode 100644 policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml new file mode 100644 index 000000000..6be661995 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml @@ -0,0 +1,10 @@ +description: Northwest Territories Basic Personal Amount. +values: + 2023-01-01: 16_593 +metadata: + unit: currency-CAD + period: year + label: Basic personal amount + reference: + - title: Northwest Territories Personal Tax Credits Return - Basic Personal amount + href: chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf \ No newline at end of file diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml new file mode 100644 index 000000000..b5a279521 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml @@ -0,0 +1,9 @@ +description: Maximum amount for the Northwest Territories pension credit. +values: + 2021-01-01: 1_000 +metadata: + unit: currency-CAD + label: Northwest Territories Pension Credit Maximum Reduction Amount + reference: + - title: Income Tax Act - Age Credit page 29 + href: https://www.justice.gov.nt.ca/en/files/legislation/income-tax/income-tax.a.pdf \ No newline at end of file diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml new file mode 100644 index 000000000..f9727ca53 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml @@ -0,0 +1,6 @@ +- name: Northwest Territories Personal Tax Credits Return - Basic Personal Amount + period: 2023 + input: + province_code: NT + output: + nt_basic_personal_amount: 16_593 \ No newline at end of file diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml new file mode 100644 index 000000000..59a1e6827 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml @@ -0,0 +1,23 @@ +- name: Under maximum amount + period: 2022 + input: + province_code: NT + nt_taxable_income: 999 + output: + nt_age_credit: 999 + + - name: Maximum amount + period: 2022 + input: + province_code: NT + nt_taxable_income: 1_000 + output: + nt_age_credit: 0 + + - name: Above maximum amount + period: 2022 + input: + province_code: NT + nt_taxable_income: 1_001 + output: + nt_age_credit: 0 \ No newline at end of file diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py new file mode 100644 index 000000000..75b009f3a --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py @@ -0,0 +1,14 @@ +from policyengine_canada.model_api import * + +class nt_basic_personal_amount(Variable): + value_type = float + entity = Person + label = "Northwest Territories basic personal amount" + unit = CAD + definition_period = YEAR + defined_for = ProvinceCode.NT + reference = "chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" + + def formula(person, period, parameters): + p = parameters(period).gov.provinces.nt.tax.income.credits.basic_personal_amount + return p.base \ No newline at end of file diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py new file mode 100644 index 000000000..bdbb0f80e --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py @@ -0,0 +1,15 @@ +from policyengine_canada.model_api import * + +class nt_pension_credit(Variable): + value_type = float + entity = Person + label = "Northwest Territories pension credit" + unit = CAD + definition_period = YEAR + defined_for = ProvinceCode.NT + reference = "https://www.justice.gov.nt.ca/en/files/legislation/income-tax/income-tax.a.pdf" + + def formula(person, period, parameters): + p = parameters(period).gov.provinces.nt.tax.income.credits.pension_credit + federal_pension = person("pension_and_savings_plan_income", period) + return min_(p.max_amount, federal_pension) From 32644ee37092d26c69129eedd120eb8dc7637e8a Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Thu, 29 Jun 2023 21:31:57 +0000 Subject: [PATCH 02/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../credits/pension_credit/max_amount.yaml | 9 -------- .../nt/tax/income/nt_pension_credit.yaml | 23 ------------------- .../pension_credit/nt_pension_credit.py | 15 ------------ 3 files changed, 47 deletions(-) delete mode 100644 policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml delete mode 100644 policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml delete mode 100644 policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml deleted file mode 100644 index b5a279521..000000000 --- a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/pension_credit/max_amount.yaml +++ /dev/null @@ -1,9 +0,0 @@ -description: Maximum amount for the Northwest Territories pension credit. -values: - 2021-01-01: 1_000 -metadata: - unit: currency-CAD - label: Northwest Territories Pension Credit Maximum Reduction Amount - reference: - - title: Income Tax Act - Age Credit page 29 - href: https://www.justice.gov.nt.ca/en/files/legislation/income-tax/income-tax.a.pdf \ No newline at end of file diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml deleted file mode 100644 index 59a1e6827..000000000 --- a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_pension_credit.yaml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Under maximum amount - period: 2022 - input: - province_code: NT - nt_taxable_income: 999 - output: - nt_age_credit: 999 - - - name: Maximum amount - period: 2022 - input: - province_code: NT - nt_taxable_income: 1_000 - output: - nt_age_credit: 0 - - - name: Above maximum amount - period: 2022 - input: - province_code: NT - nt_taxable_income: 1_001 - output: - nt_age_credit: 0 \ No newline at end of file diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py deleted file mode 100644 index bdbb0f80e..000000000 --- a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/pension_credit/nt_pension_credit.py +++ /dev/null @@ -1,15 +0,0 @@ -from policyengine_canada.model_api import * - -class nt_pension_credit(Variable): - value_type = float - entity = Person - label = "Northwest Territories pension credit" - unit = CAD - definition_period = YEAR - defined_for = ProvinceCode.NT - reference = "https://www.justice.gov.nt.ca/en/files/legislation/income-tax/income-tax.a.pdf" - - def formula(person, period, parameters): - p = parameters(period).gov.provinces.nt.tax.income.credits.pension_credit - federal_pension = person("pension_and_savings_plan_income", period) - return min_(p.max_amount, federal_pension) From f0ed1553b73f75233ad9463f4542cd00d2737693 Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Thu, 29 Jun 2023 21:42:21 +0000 Subject: [PATCH 03/11] Co-authored-by: Pavel Makarchuk --- changelog_entry.yaml | 4 ++++ .../nt/tax/income/credits/basic_personal_amount/base.yaml | 8 +++++--- .../gov/provinces/yt/benefits/child_benefit/base.yaml | 2 +- .../child_benefit/multiple_children/reduction_rate.yaml | 2 +- .../benefits/child_benefit/one_child/reduction_rate.yaml | 2 +- .../provinces/nt/tax/income/nt_basic_personal_amount.yaml | 6 ------ .../yt/tax/income/benefits/yt_child_benefit.yaml | 2 +- .../income/benefits/yt_child_benefit_eligible_child.yaml | 2 +- .../basic_personal_amount/nt_basic_personal_amount.py | 7 +++---- 9 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..77f1cf513 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Northwest Territories basic personal amount. diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml index 6be661995..d4c4e5254 100644 --- a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml @@ -1,10 +1,12 @@ -description: Northwest Territories Basic Personal Amount. +description: Northwest Territories provides the following Basic Personal Amount. values: 2023-01-01: 16_593 metadata: unit: currency-CAD period: year - label: Basic personal amount + label: Northwest Territories Basic Personal Amount reference: - title: Northwest Territories Personal Tax Credits Return - Basic Personal amount - href: chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf \ No newline at end of file + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf + - title: + href: https://www.justice.gov.nt.ca/en/files/legislation/income-tax/income-tax.a.pdf diff --git a/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/base.yaml b/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/base.yaml index 0ac099068..9d4d41622 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/base.yaml @@ -6,4 +6,4 @@ metadata: label: Yukon child benefit base reference: - title: Yukon-specific income tax measures - href: https://yukon.ca/en/yukon-income-tax \ No newline at end of file + href: https://yukon.ca/en/yukon-income-tax diff --git a/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/multiple_children/reduction_rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/multiple_children/reduction_rate.yaml index f13c4dd68..9e8e87245 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/multiple_children/reduction_rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/multiple_children/reduction_rate.yaml @@ -15,4 +15,4 @@ brackets: - threshold: 2015-01-01: 35_000 rate: - 2015-01-01: 0.05 \ No newline at end of file + 2015-01-01: 0.05 diff --git a/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/one_child/reduction_rate.yaml b/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/one_child/reduction_rate.yaml index 6fda501ba..95084d36b 100644 --- a/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/one_child/reduction_rate.yaml +++ b/policyengine_canada/parameters/gov/provinces/yt/benefits/child_benefit/one_child/reduction_rate.yaml @@ -15,4 +15,4 @@ brackets: - threshold: 2015-01-01: 35_000 rate: - 2015-01-01: 0.025 \ No newline at end of file + 2015-01-01: 0.025 diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml deleted file mode 100644 index f9727ca53..000000000 --- a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- name: Northwest Territories Personal Tax Credits Return - Basic Personal Amount - period: 2023 - input: - province_code: NT - output: - nt_basic_personal_amount: 16_593 \ No newline at end of file diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit.yaml index c4a7a80fb..8014e30ea 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit.yaml @@ -37,4 +37,4 @@ yt_child_benefit_base: 1_000 output: yt_child_benefit: 0 - \ No newline at end of file + diff --git a/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit_eligible_child.yaml b/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit_eligible_child.yaml index e1887c1d0..2fb8626c3 100644 --- a/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit_eligible_child.yaml +++ b/policyengine_canada/tests/gov/provinces/yt/tax/income/benefits/yt_child_benefit_eligible_child.yaml @@ -20,4 +20,4 @@ province_code: YT age: 17 output: - yt_child_benefit_eligible_child: true \ No newline at end of file + yt_child_benefit_eligible_child: true diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py index 75b009f3a..2bac3372d 100644 --- a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py @@ -1,5 +1,6 @@ from policyengine_canada.model_api import * + class nt_basic_personal_amount(Variable): value_type = float entity = Person @@ -7,8 +8,6 @@ class nt_basic_personal_amount(Variable): unit = CAD definition_period = YEAR defined_for = ProvinceCode.NT - reference = "chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" + reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" - def formula(person, period, parameters): - p = parameters(period).gov.provinces.nt.tax.income.credits.basic_personal_amount - return p.base \ No newline at end of file + adds = "gov.provinces.nt.tax.income.credits.basic_personal_amount.base" From 5d1dbb420935589e49ef7e1a0a796d1b186bb7ed Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Thu, 20 Jul 2023 21:24:03 +0000 Subject: [PATCH 04/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../nt/tax/income/credits/basic_personal_amount/base.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml index d4c4e5254..9ff57a27c 100644 --- a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml @@ -6,7 +6,7 @@ metadata: period: year label: Northwest Territories Basic Personal Amount reference: - - title: Northwest Territories Personal Tax Credits Return - Basic Personal amount + - title: Northwest Territories Personal Tax Credits Return - Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf + - title: 2023 Northwest Territories Personal Tax Credits Return - Basic Personal Amount href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf - - title: - href: https://www.justice.gov.nt.ca/en/files/legislation/income-tax/income-tax.a.pdf From 19df044df8569b0414dedba9d049d37e72187f71 Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:37:13 +0000 Subject: [PATCH 05/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../provinces/nt/tax/income/nt_basic_personal_amout.yaml | 6 ++++++ .../basic_personal_amount/nt_basic_personal_amount.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml new file mode 100644 index 000000000..2d17e7cda --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml @@ -0,0 +1,6 @@ +- name: NT basic personal amount + period: 2023 + input: + province_code: NT + output: + nt_basic_personal_amount: 16_593 \ No newline at end of file diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py index 2bac3372d..e83c84491 100644 --- a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py @@ -10,4 +10,5 @@ class nt_basic_personal_amount(Variable): defined_for = ProvinceCode.NT reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" - adds = "gov.provinces.nt.tax.income.credits.basic_personal_amount.base" + def formula(person, period, parameters): + return parameters(period).gov.provinces.nt.tax.income.credits.basic_personal_amount.base From 6d5290a57c9926285a633978bf52f05417baf93d Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:39:09 +0000 Subject: [PATCH 06/11] fixes Northwest Territories Basic Personal Amount #373 --- .../ab/tax/income/credits/pension/ab_pension_credit.yaml | 2 +- .../gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml | 2 +- .../credits/basic_personal_amount/nt_basic_personal_amount.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml b/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml index e3c23fabd..a9faa8c92 100644 --- a/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml +++ b/policyengine_canada/tests/gov/provinces/ab/tax/income/credits/pension/ab_pension_credit.yaml @@ -20,4 +20,4 @@ pension_and_savings_plan_income: 0 province_code: AB output: - ab_pension_credit: 0 \ No newline at end of file + ab_pension_credit: 0 diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml index 2d17e7cda..a74f4f14f 100644 --- a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml +++ b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml @@ -3,4 +3,4 @@ input: province_code: NT output: - nt_basic_personal_amount: 16_593 \ No newline at end of file + nt_basic_personal_amount: 16_593 diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py index e83c84491..dd0af75e6 100644 --- a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py @@ -11,4 +11,6 @@ class nt_basic_personal_amount(Variable): reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" def formula(person, period, parameters): - return parameters(period).gov.provinces.nt.tax.income.credits.basic_personal_amount.base + return parameters( + period + ).gov.provinces.nt.tax.income.credits.basic_personal_amount.base From 399db0dc4804a4642bb60d4c4cfe6f00f21e8db0 Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Fri, 18 Aug 2023 00:38:02 +0000 Subject: [PATCH 07/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../provinces/nt/tax/income/nt_basic_personal_amout.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml index a74f4f14f..a37b1ea4c 100644 --- a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml +++ b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml @@ -4,3 +4,10 @@ province_code: NT output: nt_basic_personal_amount: 16_593 + +- name: NT basic personal amount; wrong provience + period: 2023 + input: + province_code: AB + output: + nt_basic_personal_amount: 0 \ No newline at end of file From 05b3e3a08ddb69373ae3635b5e45dd50010eb05c Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Tue, 22 Aug 2023 21:56:08 +0000 Subject: [PATCH 08/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../credits/basic_personal_amount/base.yaml | 7 ++++--- .../tax/income/nt_basic_personal_amout.yaml | 20 ++++++++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml index 9ff57a27c..66602ddd4 100644 --- a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml @@ -1,12 +1,13 @@ description: Northwest Territories provides the following Basic Personal Amount. values: + 2022-01-01: 15_609 2023-01-01: 16_593 metadata: unit: currency-CAD period: year label: Northwest Territories Basic Personal Amount reference: - - title: Northwest Territories Personal Tax Credits Return - Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf + - title: 2022 Northwest Territories Personal Tax Credits Return - Basic Personal Amount + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5012-c/5012-c-22e.pdf #page=1 - title: 2023 Northwest Territories Personal Tax Credits Return - Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf #page=1 diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml index a37b1ea4c..e77dcde89 100644 --- a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml +++ b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml @@ -1,13 +1,27 @@ -- name: NT basic personal amount +- name: 2022 NT basic personal amount + period: 2022 + input: + province_code: NT + output: + nt_basic_personal_amount: 15_609 + +- name: 2022 NT basic personal amount; wrong provience + period: 2022 + input: + province_code: AB + output: + nt_basic_personal_amount: 0 + +- name: 2023 NT basic personal amount period: 2023 input: province_code: NT output: nt_basic_personal_amount: 16_593 -- name: NT basic personal amount; wrong provience +- name: 2023 NT basic personal amount; wrong provience period: 2023 input: province_code: AB output: - nt_basic_personal_amount: 0 \ No newline at end of file + nt_basic_personal_amount: 0 From dcc735eca73bcffa4acd5c7e3d1f9a985df5dc60 Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Tue, 22 Aug 2023 22:11:55 +0000 Subject: [PATCH 09/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../nt/tax/income/credits/basic_personal_amount/base.yaml | 4 ++-- .../gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml | 4 ++-- .../credits/basic_personal_amount/nt_basic_personal_amount.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml index 66602ddd4..2eb067764 100644 --- a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml @@ -8,6 +8,6 @@ metadata: label: Northwest Territories Basic Personal Amount reference: - title: 2022 Northwest Territories Personal Tax Credits Return - Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5012-c/5012-c-22e.pdf #page=1 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5012-c/5012-c-22e.pdf#page=1 - title: 2023 Northwest Territories Personal Tax Credits Return - Basic Personal Amount - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf #page=1 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf#page=1 diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml index e77dcde89..700575b3d 100644 --- a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml +++ b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml @@ -5,7 +5,7 @@ output: nt_basic_personal_amount: 15_609 -- name: 2022 NT basic personal amount; wrong provience +- name: 2022 NT basic personal amount; wrong province period: 2022 input: province_code: AB @@ -19,7 +19,7 @@ output: nt_basic_personal_amount: 16_593 -- name: 2023 NT basic personal amount; wrong provience +- name: 2023 NT basic personal amount; wrong province period: 2023 input: province_code: AB diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py index dd0af75e6..a2f612a33 100644 --- a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py @@ -8,7 +8,7 @@ class nt_basic_personal_amount(Variable): unit = CAD definition_period = YEAR defined_for = ProvinceCode.NT - reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" + reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" # page=1 def formula(person, period, parameters): return parameters( From 35fadd6550168d49cd6fcde9b576a84b7dda0c13 Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Thu, 24 Aug 2023 21:29:29 +0000 Subject: [PATCH 10/11] Northwest Territories Basic Personal Amount Fixes #373 --- .../nt/tax/income/credits/basic_personal_amount/base.yaml | 2 ++ .../credits/basic_personal_amount/nt_basic_personal_amount.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml index 2eb067764..e8843151e 100644 --- a/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/nt/tax/income/credits/basic_personal_amount/base.yaml @@ -7,6 +7,8 @@ metadata: period: year label: Northwest Territories Basic Personal Amount reference: + - title: Income Tax Act - Section 2.16 Single Status Credit + href: https://www.justice.gov.nt.ca/en/files/legislation/income-tax/income-tax.a.pdf#page=29 - title: 2022 Northwest Territories Personal Tax Credits Return - Basic Personal Amount href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5012-c/5012-c-22e.pdf#page=1 - title: 2023 Northwest Territories Personal Tax Credits Return - Basic Personal Amount diff --git a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py index a2f612a33..d31617659 100644 --- a/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py +++ b/policyengine_canada/variables/gov/provinces/nt/tax/income/credits/basic_personal_amount/nt_basic_personal_amount.py @@ -8,7 +8,7 @@ class nt_basic_personal_amount(Variable): unit = CAD definition_period = YEAR defined_for = ProvinceCode.NT - reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf" # page=1 + reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nt/td1nt-23e.pdf#page=1" def formula(person, period, parameters): return parameters( From 4b13e7cc67c1e6084ec5cbbadb1ed006e0c6bdfa Mon Sep 17 00:00:00 2001 From: Ziyu Wang <70183694+zqw5219@users.noreply.github.com> Date: Tue, 5 Sep 2023 23:36:37 +0000 Subject: [PATCH 11/11] Northwest Territories Basic Personal Amount Fixes #373 --- ...nt_basic_personal_amout.yaml => nt_basic_personal_amount.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename policyengine_canada/tests/gov/provinces/nt/tax/income/{nt_basic_personal_amout.yaml => nt_basic_personal_amount.yaml} (100%) diff --git a/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml b/policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml similarity index 100% rename from policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amout.yaml rename to policyengine_canada/tests/gov/provinces/nt/tax/income/nt_basic_personal_amount.yaml