From c2f63f7c987d52119f8378c098ab9583829d4327 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Wed, 22 Nov 2023 22:52:17 +0000 Subject: [PATCH 01/20] British Columbia Disability Credit Fixes #464 --- changelog_entry.yaml | 1 + .../additional_amount/eligible_age.yaml | 12 +++++ .../additional_amount/income_threshold.yaml | 12 +++++ .../additional_amount/max_amount_total.yaml | 12 +++++ .../disability/additional_amount/younger.yaml | 12 +++++ .../tax/income/credits/disability/base.yaml | 11 +++++ .../bc_disability_credit.yaml | 47 +++++++++++++++++++ .../bc_disability_credit_eligible.yaml | 15 ++++++ .../bc_disability_credit.py | 32 +++++++++++++ .../bc_disability_credit_eligible.py | 13 +++++ .../household/person/childcare_received.py | 9 ++++ 11 files changed, 176 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml create mode 100644 policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml create mode 100644 policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml create mode 100644 policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py create mode 100644 policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py create mode 100644 policyengine_canada/variables/household/person/childcare_received.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/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml new file mode 100644 index 000000000..8d2d5e99a --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml @@ -0,0 +1,12 @@ +description: British Columbia provides an additional disability credit to filers below this age +values: + 2023-01-01: 18 +metadata: + unit: year + period: year + label: British Columbia disability credit additional amount age eligibility + reference: + - title: B.C. basic personal income tax credits + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml new file mode 100644 index 000000000..9a0f41ec2 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml @@ -0,0 +1,12 @@ +description: British Columbia reduces the additional disability credit amount by the excess of childcare expenses over this threshold. +values: + 2023-01-01: 3_044 +metadata: + unit: currency-CAD + period: year + label: British Columbia disability credit income threshold + reference: + - title: B.C. basic personal income tax credits + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml new file mode 100644 index 000000000..11b3c1469 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml @@ -0,0 +1,12 @@ +description: British Columbia limits the disability credit to this maximum base amount. +values: + 2023-01-01: 14_228 +metadata: + unit: currency-CAD + period: year + label: British Columbia disability credit max amount + reference: + - title: B.C. basic personal income tax credits + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml new file mode 100644 index 000000000..3b68551fc --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml @@ -0,0 +1,12 @@ +description: British Columbia provides this additional disability credit amount for younger filers. +values: + 2023-01-01: 5_242 +metadata: + unit: currency-CAD + period: year + label: British Columbia disability credit younger max amount + reference: + - title: B.C. basic personal income tax credits + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml new file mode 100644 index 000000000..61a901211 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml @@ -0,0 +1,11 @@ +description: British Columbia disability credit base amount. +values: + 2023-01-01: 8_986 +metadata: + unit: currency-CAD + label: British Columbia disability credit base + reference: + - title: B.C. basic personal income tax credits + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml new file mode 100644 index 000000000..d1715b069 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml @@ -0,0 +1,47 @@ +- name: Eligible person over 18 + period: 2023 + input: + province_code: BC + age: 19 + bc_disability_credit_eligible: true + output: + bc_disability_credit: 8_986 + +- name: Eligible person under 18 with childcare_received less than threshold + period: 2023 + input: + province_code: BC + age: 17 + bc_disability_credit_eligible: true + childcare_received: 3_000 + output: + bc_disability_credit: 14_228 + +- name: Eligible person under 18 with childcare_received greater than threshold, less than max_amount_child + period: 2023 + input: + province_code: BC + age: 17 + bc_disability_credit_eligible: true + childcare_received: 3_500 + output: + bc_disability_credit: 13_772 + +- name: Eligible person under 18 with childcare_received greater than max_amount_child + period: 2023 + input: + province_code: BC + age: 17 + bc_disability_credit_eligible: true + childcare_received: 15_000 + output: + bc_disability_credit: 8_986 + +- name: Uneligible person + period: 2023 + input: + province_code: BC + age: 18 + bc_disability_credit_eligible: false + output: + bc_disability_credit: 0 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml new file mode 100644 index 000000000..185a8ebc2 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml @@ -0,0 +1,15 @@ +- name: Eligible person with disability + period: 2023 + input: + is_disabled: true + province_code: BC + output: + bc_disability_credit_eligible: true + +- name: Uneligible person without disability + period: 2023 + input: + is_disabled: false + province_code: BC + output: + bc_disability_credit_eligible: false diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py new file mode 100644 index 000000000..00f79cae0 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -0,0 +1,32 @@ +from policyengine_canada.model_api import * + + +class bc_disability_credit(Variable): + value_type = float + entity = Person + label = "British Columbia disability tax credit" + unit = CAD + definition_period = YEAR + defined_for = "bc_disability_credit_eligible" + + def formula(person, period, parameters): + p = parameters(period).gov.provinces.bc.tax.income.credits.disability + childcare_received = person( + "childcare_received", period + ) # create new variable in household/person? + additional_amount_reduction = max_( + 0, childcare_received - p.additional_amount.income_threshold + ) + additional_amount_eligibile = ( + person("age", period) < p.additional_amount.eligible_age + ) + max_additional_amount = max_( + 0, p.additional_amount.younger - additional_amount_reduction + ) + additional_amount = where( + additional_amount_eligibile, max_additional_amount, 0 + ) + + return min_( + p.additional_amount.max_amount_total, p.base + additional_amount + ) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py new file mode 100644 index 000000000..ebcfeb493 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py @@ -0,0 +1,13 @@ +from policyengine_canada.model_api import * + + +class bc_disability_credit_eligible(Variable): + value_type = bool + entity = Person + label = "Eligible for the British Columbia disability tax credit" + unit = CAD + definition_period = YEAR + defined_for = ProvinceCode.BC + + def formula(person, period): + return person("is_disabled", period) diff --git a/policyengine_canada/variables/household/person/childcare_received.py b/policyengine_canada/variables/household/person/childcare_received.py new file mode 100644 index 000000000..6d430d715 --- /dev/null +++ b/policyengine_canada/variables/household/person/childcare_received.py @@ -0,0 +1,9 @@ +from policyengine_canada.model_api import * + + +class childcare_received(Variable): + value_type = float + entity = Person + label = "Childcare received" + unit = CAD + definition_period = YEAR From d37ef105edb38410a09fb9da85d9d7c08666a089 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Wed, 22 Nov 2023 23:07:21 +0000 Subject: [PATCH 02/20] BC disability credit --- .../income/credits/bc_disability_credit/bc_disability_credit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index 00f79cae0..8ea34350c 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -13,7 +13,7 @@ def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability childcare_received = person( "childcare_received", period - ) # create new variable in household/person? + ) additional_amount_reduction = max_( 0, childcare_received - p.additional_amount.income_threshold ) From b05d4257fc569d1f0f3a2ca4e1f083e1416b71de Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Wed, 22 Nov 2023 23:20:18 +0000 Subject: [PATCH 03/20] Resolve format --- .../credits/bc_disability_credit/bc_disability_credit.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index 8ea34350c..f1a91d3a3 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -11,9 +11,7 @@ class bc_disability_credit(Variable): def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability - childcare_received = person( - "childcare_received", period - ) + childcare_received = person("childcare_received", period) additional_amount_reduction = max_( 0, childcare_received - p.additional_amount.income_threshold ) From 0e744a550f7e49b5c7261a72125961cea4b1af67 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Wed, 22 Nov 2023 23:26:07 +0000 Subject: [PATCH 04/20] Added changelog_entry --- changelog_entry.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 8b1378917..35edb2b13 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1 +1,4 @@ - +- bump: minor + changes: + added: + - British Columbia Disability Credit. From f2fe4f83f66624bb892d6ab45f9a7bbb8b17126a Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Mon, 4 Dec 2023 23:47:18 +0000 Subject: [PATCH 05/20] British Columbia Disability Credit Fixes #464 --- changelog_entry.yaml | 2 +- .../additional_amount/eligible_age.yaml | 2 +- .../additional_amount/income_threshold.yaml | 3 + .../additional_amount/max_amount_total.yaml | 5 +- .../disability/additional_amount/younger.yaml | 5 +- .../tax/income/credits/disability/base.yaml | 5 +- .../bc_disability_credit.yaml | 40 +++++++------ ...c_disability_credit_additional_amount.yaml | 59 +++++++++++++++++++ ...ity_credit_additional_amount_eligible.yaml | 31 ++++++++++ .../bc_disability_credit_eligible.yaml | 20 ++++++- .../bc_disability_credit.py | 16 +---- .../bc_disability_credit_additional_amount.py | 22 +++++++ ...ility_credit_additional_amount_eligible.py | 14 +++++ .../bc_disability_credit_eligible.py | 1 - .../household/person/childcare_received.py | 2 +- 15 files changed, 188 insertions(+), 39 deletions(-) create mode 100644 policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml create mode 100644 policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml create mode 100644 policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py create mode 100644 policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 35edb2b13..5cae0d451 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,4 +1,4 @@ - bump: minor changes: added: - - British Columbia Disability Credit. + - British Columbia disability credit. diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml index 8d2d5e99a..83325a831 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml @@ -4,7 +4,7 @@ values: metadata: unit: year period: year - label: British Columbia disability credit additional amount age eligibility + label: British Columbia additional disability credit eligible age limit reference: - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml index 9a0f41ec2..630907918 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml @@ -1,5 +1,6 @@ description: British Columbia reduces the additional disability credit amount by the excess of childcare expenses over this threshold. values: + 2022-01-01: 2_871 2023-01-01: 3_044 metadata: unit: currency-CAD @@ -10,3 +11,5 @@ metadata: href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 + - title: Worksheet BC428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml index 11b3c1469..a8e8010f0 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml @@ -1,12 +1,15 @@ description: British Columbia limits the disability credit to this maximum base amount. values: + 2022-01-01: 13_423 2023-01-01: 14_228 metadata: unit: currency-CAD period: year - label: British Columbia disability credit max amount + label: British Columbia max disability credit amount reference: - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 + - title: Worksheet BC428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml index 3b68551fc..9039b40ee 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml @@ -1,12 +1,15 @@ description: British Columbia provides this additional disability credit amount for younger filers. values: + 2022-01-01: 4_946 2023-01-01: 5_242 metadata: unit: currency-CAD period: year - label: British Columbia disability credit younger max amount + label: British Columbia max disability credit amount for the younger reference: - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 + - title: Worksheet BC428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml index 61a901211..434ad32d7 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml @@ -1,11 +1,14 @@ description: British Columbia disability credit base amount. values: + 2022-01-01: 8_477 2023-01-01: 8_986 metadata: unit: currency-CAD - label: British Columbia disability credit base + label: British Columbia base disability credit amount reference: - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 + - title: Worksheet BC428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml index d1715b069..21bf173b5 100644 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml @@ -1,47 +1,53 @@ -- name: Eligible person over 18 +- name: Eligible person with disability credit less than limit 2023 period: 2023 input: province_code: BC - age: 19 bc_disability_credit_eligible: true + bc_disability_credit_additional_amount: 0 output: bc_disability_credit: 8_986 -- name: Eligible person under 18 with childcare_received less than threshold +- name: Eligible person with disability credit over limit 2023 period: 2023 input: province_code: BC - age: 17 bc_disability_credit_eligible: true - childcare_received: 3_000 + bc_disability_credit_additional_amount: 5_243 output: bc_disability_credit: 14_228 -- name: Eligible person under 18 with childcare_received greater than threshold, less than max_amount_child +- name: Ineligible person 2023 period: 2023 input: province_code: BC - age: 17 + bc_disability_credit_eligible: false + bc_disability_credit_additional_amount: 5_242 + output: + bc_disability_credit: 0 + +- name: Eligible person with disability credit less than limit 2022 + period: 2022 + input: + province_code: BC bc_disability_credit_eligible: true - childcare_received: 3_500 + bc_disability_credit_additional_amount: 0 output: - bc_disability_credit: 13_772 + bc_disability_credit: 8_477 -- name: Eligible person under 18 with childcare_received greater than max_amount_child - period: 2023 +- name: Eligible person with disability credit over limit 2022 + period: 2022 input: province_code: BC - age: 17 bc_disability_credit_eligible: true - childcare_received: 15_000 + bc_disability_credit_additional_amount: 4_947 output: - bc_disability_credit: 8_986 + bc_disability_credit: 13_423 -- name: Uneligible person - period: 2023 +- name: Ineligible person 2022 + period: 2022 input: province_code: BC - age: 18 bc_disability_credit_eligible: false + bc_disability_credit_additional_amount: 4_946 output: bc_disability_credit: 0 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml new file mode 100644 index 000000000..80f3d3583 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml @@ -0,0 +1,59 @@ +- name: Eligible person under 18 with childcare_received less than threshold 2023 + period: 2023 + input: + province_code: BC + age: 17 + bc_disability_credit_additional_amount_eligible: true + childcare_received: 3_000 + output: + bc_disability_credit_additional_amount: 5_242 + +- name: Eligible person under 18 with childcare_received greater than threshold, less than max_amount_child 2023 + period: 2023 + input: + province_code: BC + age: 17 + bc_disability_credit_additional_amount_eligible: true + childcare_received: 3_500 + output: + bc_disability_credit_additional_amount: 4_786 + +- name: Eligible person under 18 with childcare_received greater than max_amount_child 2023 + period: 2023 + input: + province_code: BC + age: 17 + bc_disability_credit_additional_amount_eligible: true + childcare_received: 15_000 + output: + bc_disability_credit_additional_amount: 0 + +- name: Eligible person under 18 with childcare_received less than threshold 2022 + period: 2022 + input: + province_code: BC + age: 17 + bc_disability_credit_additional_amount_eligible: true + childcare_received: 2_800 + output: + bc_disability_credit_additional_amount: 4_946 + +- name: Eligible person under 18 with childcare_received greater than threshold, less than max_amount_child 2022 + period: 2022 + input: + province_code: BC + age: 17 + bc_disability_credit_additional_amount_eligible: true + childcare_received: 3_000 + output: + bc_disability_credit_additional_amount: 4_817 + +- name: Eligible person under 18 with childcare_received greater than max_amount_child 2022 + period: 2022 + input: + province_code: BC + age: 17 + bc_disability_credit_additional_amount_eligible: true + childcare_received: 15_000 + output: + bc_disability_credit_additional_amount: 0 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml new file mode 100644 index 000000000..40284bf40 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml @@ -0,0 +1,31 @@ +- name: Eligible person for additional disability credit 2023 + period: 2023 + input: + age: 17 + province_code: BC + output: + bc_disability_credit_additional_amount_eligible: true + +- name: Ineligible person for additional disability credit 2023 + period: 2023 + input: + age: 18 + province_code: BC + output: + bc_disability_credit_additional_amount_eligible: false + +- name: Eligible person for additional disability credit 2022 + period: 2022 + input: + age: 16 + province_code: BC + output: + bc_disability_credit_additional_amount_eligible: true + +- name: Ineligible person for additional disability credit 2022 + period: 2022 + input: + age: 19 + province_code: BC + output: + bc_disability_credit_additional_amount_eligible: false diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml index 185a8ebc2..ec29f18fe 100644 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.yaml @@ -1,4 +1,4 @@ -- name: Eligible person with disability +- name: Eligible person with disability 2023 period: 2023 input: is_disabled: true @@ -6,10 +6,26 @@ output: bc_disability_credit_eligible: true -- name: Uneligible person without disability +- name: Ineligible person without disability 2023 period: 2023 input: is_disabled: false province_code: BC output: bc_disability_credit_eligible: false + +- name: Eligible person with disability 2022 + period: 2022 + input: + is_disabled: true + province_code: BC + output: + bc_disability_credit_eligible: true + +- name: Ineligible person without disability 2022 + period: 2022 + input: + is_disabled: false + province_code: BC + output: + bc_disability_credit_eligible: false diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index f1a91d3a3..90c42654b 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -7,24 +7,14 @@ class bc_disability_credit(Variable): label = "British Columbia disability tax credit" unit = CAD definition_period = YEAR + reference = "href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1" defined_for = "bc_disability_credit_eligible" def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability - childcare_received = person("childcare_received", period) - additional_amount_reduction = max_( - 0, childcare_received - p.additional_amount.income_threshold + additional_amount = person( + "bc_disability_credit_additional_amount", period ) - additional_amount_eligibile = ( - person("age", period) < p.additional_amount.eligible_age - ) - max_additional_amount = max_( - 0, p.additional_amount.younger - additional_amount_reduction - ) - additional_amount = where( - additional_amount_eligibile, max_additional_amount, 0 - ) - return min_( p.additional_amount.max_amount_total, p.base + additional_amount ) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py new file mode 100644 index 000000000..6dcc6b277 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -0,0 +1,22 @@ +from policyengine_canada.model_api import * + + +class bc_disability_credit_additional_amount(Variable): + value_type = float + entity = Person + label = "British Columbia additional disability tax credit" + unit = CAD + definition_period = YEAR + reference = "href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1" + defined_for = "bc_disability_credit_additional_amount_eligible" + + def formula(person, period, parameters): + p = parameters(period).gov.provinces.bc.tax.income.credits.disability + childcare_received = person("childcare_received", period) + additional_amount_reduction = max_( + 0, childcare_received - p.additional_amount.income_threshold + ) + additional_amount = max_( + 0, p.additional_amount.younger - additional_amount_reduction + ) + return additional_amount diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py new file mode 100644 index 000000000..ef7a1d651 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py @@ -0,0 +1,14 @@ +from policyengine_canada.model_api import * + + +class bc_disability_credit_additional_amount_eligible(Variable): + value_type = bool + entity = Person + label = ( + "Eligible for the British Columbia additional disability tax credit" + ) + definition_period = YEAR + defined_for = ProvinceCode.BC + + def formula(person, period): + return person("age", period) < 18 diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py index ebcfeb493..ba6199620 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_eligible.py @@ -5,7 +5,6 @@ class bc_disability_credit_eligible(Variable): value_type = bool entity = Person label = "Eligible for the British Columbia disability tax credit" - unit = CAD definition_period = YEAR defined_for = ProvinceCode.BC diff --git a/policyengine_canada/variables/household/person/childcare_received.py b/policyengine_canada/variables/household/person/childcare_received.py index 6d430d715..2c7f5f502 100644 --- a/policyengine_canada/variables/household/person/childcare_received.py +++ b/policyengine_canada/variables/household/person/childcare_received.py @@ -4,6 +4,6 @@ class childcare_received(Variable): value_type = float entity = Person - label = "Childcare received" + label = "Amount of Childcare received which was claimed by another person" unit = CAD definition_period = YEAR From 73954a68342e9b0e7434fe3d0244d4fa79c1e107 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 14 Dec 2023 22:48:19 +0000 Subject: [PATCH 06/20] British Columbia Disability Credit Fixes #464 --- .../disability/additional_amount/age_limit.yaml | 15 +++++++++++++++ .../additional_amount/eligible_age.yaml | 12 ------------ .../additional_amount/income_threshold.yaml | 6 +++--- .../{max_amount_total.yaml => max_amount.yaml} | 8 ++++---- .../disability/additional_amount/younger.yaml | 6 +++--- .../bc/tax/income/credits/disability/base.yaml | 9 +++++---- .../bc_disability_credit/bc_disability_credit.py | 2 +- .../bc_disability_credit_additional_amount.py | 5 +---- ...isability_credit_additional_amount_eligible.py | 5 +++-- 9 files changed, 35 insertions(+), 33 deletions(-) create mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml delete mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml rename policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/{max_amount_total.yaml => max_amount.yaml} (63%) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml new file mode 100644 index 000000000..c579459a1 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml @@ -0,0 +1,15 @@ +description: British Columbia provides an additional disability credit to filers below this age. +values: + 2022-01-01: 18 +metadata: + unit: year + period: year + label: British Columbia additional disability credit age limit + reference: + - title: B.C. basic personal income tax credits 2022 and 2023 parameter values + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: British Columbia Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 + - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 + diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml deleted file mode 100644 index 83325a831..000000000 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/eligible_age.yaml +++ /dev/null @@ -1,12 +0,0 @@ -description: British Columbia provides an additional disability credit to filers below this age -values: - 2023-01-01: 18 -metadata: - unit: year - period: year - label: British Columbia additional disability credit eligible age limit - reference: - - title: B.C. basic personal income tax credits - href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - - title: Income Tax Act (4.51) - href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml index 630907918..39b6a4fea 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml @@ -7,9 +7,9 @@ metadata: period: year label: British Columbia disability credit income threshold reference: - - title: B.C. basic personal income tax credits + - title: B.C. basic personal income tax credits 2022 and 2023 parameter values href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - - title: Income Tax Act (4.51) + - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: Worksheet BC428 + - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml similarity index 63% rename from policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml rename to policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml index a8e8010f0..fec8433e8 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount_total.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml @@ -5,11 +5,11 @@ values: metadata: unit: currency-CAD period: year - label: British Columbia max disability credit amount + label: British Columbia disability credit max amount reference: - - title: B.C. basic personal income tax credits + - title: B.C. basic personal income tax credits 2022 and 2023 parameter values href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - - title: Income Tax Act (4.51) + - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: Worksheet BC428 + - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml index 9039b40ee..c0f980eb7 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml @@ -7,9 +7,9 @@ metadata: period: year label: British Columbia max disability credit amount for the younger reference: - - title: B.C. basic personal income tax credits + - title: B.C. basic personal income tax credits 2022 and 2023 parameter values href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - - title: Income Tax Act (4.51) + - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: Worksheet BC428 + - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml index 434ad32d7..244dd630e 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml @@ -1,14 +1,15 @@ -description: British Columbia disability credit base amount. +description: British Columbia provides this disability credit base amount. values: 2022-01-01: 8_477 2023-01-01: 8_986 metadata: unit: currency-CAD + period: year label: British Columbia base disability credit amount reference: - - title: B.C. basic personal income tax credits + - title: B.C. basic personal income tax credits 2022 and 2023 parameter values href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - - title: Income Tax Act (4.51) + - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: Worksheet BC428 + - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index 90c42654b..6e8cbcf17 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -16,5 +16,5 @@ def formula(person, period, parameters): "bc_disability_credit_additional_amount", period ) return min_( - p.additional_amount.max_amount_total, p.base + additional_amount + p.additional_amount.max_amount, p.base + additional_amount ) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index 6dcc6b277..92c11ba75 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -16,7 +16,4 @@ def formula(person, period, parameters): additional_amount_reduction = max_( 0, childcare_received - p.additional_amount.income_threshold ) - additional_amount = max_( - 0, p.additional_amount.younger - additional_amount_reduction - ) - return additional_amount + return max_(0, p.additional_amount.younger - additional_amount_reduction) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py index ef7a1d651..71d4661b2 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py @@ -10,5 +10,6 @@ class bc_disability_credit_additional_amount_eligible(Variable): definition_period = YEAR defined_for = ProvinceCode.BC - def formula(person, period): - return person("age", period) < 18 + def formula(person, period, parameters): + p = parameters(period).gov.provinces.bc.tax.income.credits.disability + return person("age", period) < p.additional_amount.age_limit From e97be2cf50db39d6c68562db2a115a1ea95cf0ed Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 14 Dec 2023 22:49:24 +0000 Subject: [PATCH 07/20] Added worksheet and labels --- .../credits/bc_disability_credit/bc_disability_credit.py | 4 +--- .../bc_disability_credit_additional_amount.py | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index 6e8cbcf17..ea22de005 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -15,6 +15,4 @@ def formula(person, period, parameters): additional_amount = person( "bc_disability_credit_additional_amount", period ) - return min_( - p.additional_amount.max_amount, p.base + additional_amount - ) + return min_(p.additional_amount.max_amount, p.base + additional_amount) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index 92c11ba75..f8c929345 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -16,4 +16,6 @@ def formula(person, period, parameters): additional_amount_reduction = max_( 0, childcare_received - p.additional_amount.income_threshold ) - return max_(0, p.additional_amount.younger - additional_amount_reduction) + return max_( + 0, p.additional_amount.younger - additional_amount_reduction + ) From 231e009ba7c039d8267c995bb160fefe10296844 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Tue, 19 Dec 2023 00:25:24 +0000 Subject: [PATCH 08/20] Resolve comments --- .../income/credits/disability/additional_amount/age_limit.yaml | 2 +- .../credits/disability/additional_amount/income_threshold.yaml | 2 +- .../income/credits/disability/additional_amount/max_amount.yaml | 2 +- .../income/credits/disability/additional_amount/younger.yaml | 2 +- .../gov/provinces/bc/tax/income/credits/disability/base.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml index c579459a1..9257d691f 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml @@ -10,6 +10,6 @@ metadata: href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet + - title: British Columbia disability amount worksheet 2022 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml index 39b6a4fea..f07646dd7 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml @@ -11,5 +11,5 @@ metadata: href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet + - title: British Columbia disability amount worksheet 2022 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml index fec8433e8..8f3c99414 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml @@ -11,5 +11,5 @@ metadata: href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet + - title: British Columbia disability amount worksheet 2022 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml index c0f980eb7..e408b465d 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml @@ -11,5 +11,5 @@ metadata: href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet + - title: British Columbia disability amount worksheet 2022 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml index 244dd630e..d5919df9f 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml @@ -11,5 +11,5 @@ metadata: href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: British Columbia disability amount worksheet 2022 # Did not find 2023 worksheet + - title: British Columbia disability amount worksheet 2022 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 From d3b375062f3d6c8aade0c6c643c5b99359ee29f2 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 11 Jan 2024 23:34:03 +0000 Subject: [PATCH 09/20] British Columbia Disability Credit Fixes #464 --- ...limit.yaml => additional_amount_base.yaml} | 23 ++++++++---- .../{max_amount.yaml => cap.yaml} | 4 +-- .../additional_amount/income_threshold.yaml | 2 +- .../disability/additional_amount/younger.yaml | 15 -------- .../tax/income/credits/disability/base.yaml | 4 +-- ...c_disability_credit_additional_amount.yaml | 36 ++++++++++++------- ...ity_credit_additional_amount_eligible.yaml | 31 ---------------- .../bc_disability_credit.py | 5 +-- .../bc_disability_credit_additional_amount.py | 18 ++++++---- ...ility_credit_additional_amount_eligible.py | 15 -------- ...are_expenses_claimed_by_another_person.py} | 2 +- 11 files changed, 61 insertions(+), 94 deletions(-) rename policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/{age_limit.yaml => additional_amount_base.yaml} (54%) rename policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/{max_amount.yaml => cap.yaml} (76%) delete mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml delete mode 100644 policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml delete mode 100644 policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py rename policyengine_canada/variables/household/person/{childcare_received.py => childcare_expenses_claimed_by_another_person.py} (77%) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/additional_amount_base.yaml similarity index 54% rename from policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml rename to policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/additional_amount_base.yaml index 9257d691f..396ba0fb0 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/age_limit.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/additional_amount_base.yaml @@ -1,12 +1,23 @@ -description: British Columbia provides an additional disability credit to filers below this age. -values: - 2022-01-01: 18 +description: British Columbia provides an additional disability credit to filers by age. +brackets: + - amount: + 2022-01-01: 4_946 + 2023-01-01: 5_242 + threshold: + 2022-01-01: 0 + - amount: + 2022-01-01: 0 + threshold: + 2022-01-01: 18 metadata: - unit: year + type: single_amount + threshold_unit: year + amount_unit: currency-CAD period: year - label: British Columbia additional disability credit age limit + name: bc_additional_disability_credit + label: British Columbia additional disability credit reference: - - title: B.C. basic personal income tax credits 2022 and 2023 parameter values + - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml similarity index 76% rename from policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml rename to policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml index 8f3c99414..b6eac5291 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/max_amount.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml @@ -1,4 +1,4 @@ -description: British Columbia limits the disability credit to this maximum base amount. +description: British Columbia caps the disability credit at this amount. values: 2022-01-01: 13_423 2023-01-01: 14_228 @@ -7,7 +7,7 @@ metadata: period: year label: British Columbia disability credit max amount reference: - - title: B.C. basic personal income tax credits 2022 and 2023 parameter values + - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml index f07646dd7..28177277e 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml @@ -7,7 +7,7 @@ metadata: period: year label: British Columbia disability credit income threshold reference: - - title: B.C. basic personal income tax credits 2022 and 2023 parameter values + - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml deleted file mode 100644 index e408b465d..000000000 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/younger.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: British Columbia provides this additional disability credit amount for younger filers. -values: - 2022-01-01: 4_946 - 2023-01-01: 5_242 -metadata: - unit: currency-CAD - period: year - label: British Columbia max disability credit amount for the younger - reference: - - title: B.C. basic personal income tax credits 2022 and 2023 parameter values - href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - - title: British Columbia Income Tax Act (4.51) - href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: British Columbia disability amount worksheet 2022 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml index d5919df9f..8087c14e2 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml @@ -5,9 +5,9 @@ values: metadata: unit: currency-CAD period: year - label: British Columbia base disability credit amount + label: British Columbia disability credit base amount reference: - - title: B.C. basic personal income tax credits 2022 and 2023 parameter values + - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - title: British Columbia Income Tax Act (4.51) href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml index 80f3d3583..4e809d07a 100644 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml @@ -3,8 +3,7 @@ input: province_code: BC age: 17 - bc_disability_credit_additional_amount_eligible: true - childcare_received: 3_000 + childcare_expenses_claimed_by_another_person: 3_000 output: bc_disability_credit_additional_amount: 5_242 @@ -13,8 +12,7 @@ input: province_code: BC age: 17 - bc_disability_credit_additional_amount_eligible: true - childcare_received: 3_500 + childcare_expenses_claimed_by_another_person: 3_500 output: bc_disability_credit_additional_amount: 4_786 @@ -23,8 +21,16 @@ input: province_code: BC age: 17 - bc_disability_credit_additional_amount_eligible: true - childcare_received: 15_000 + childcare_expenses_claimed_by_another_person: 15_000 + output: + bc_disability_credit_additional_amount: 0 + +- name: Ineligible person 2023 + period: 2023 + input: + province_code: BC + age: 18 + childcare_expenses_claimed_by_another_person: 15_000 output: bc_disability_credit_additional_amount: 0 @@ -33,8 +39,7 @@ input: province_code: BC age: 17 - bc_disability_credit_additional_amount_eligible: true - childcare_received: 2_800 + childcare_expenses_claimed_by_another_person: 2_800 output: bc_disability_credit_additional_amount: 4_946 @@ -43,8 +48,7 @@ input: province_code: BC age: 17 - bc_disability_credit_additional_amount_eligible: true - childcare_received: 3_000 + childcare_expenses_claimed_by_another_person: 3_000 output: bc_disability_credit_additional_amount: 4_817 @@ -53,7 +57,15 @@ input: province_code: BC age: 17 - bc_disability_credit_additional_amount_eligible: true - childcare_received: 15_000 + childcare_expenses_claimed_by_another_person: 15_000 + output: + bc_disability_credit_additional_amount: 0 + +- name: Ineligible person 2022 + period: 2022 + input: + province_code: BC + age: 18 + childcare_expenses_claimed_by_another_person: 15_000 output: bc_disability_credit_additional_amount: 0 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml deleted file mode 100644 index 40284bf40..000000000 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.yaml +++ /dev/null @@ -1,31 +0,0 @@ -- name: Eligible person for additional disability credit 2023 - period: 2023 - input: - age: 17 - province_code: BC - output: - bc_disability_credit_additional_amount_eligible: true - -- name: Ineligible person for additional disability credit 2023 - period: 2023 - input: - age: 18 - province_code: BC - output: - bc_disability_credit_additional_amount_eligible: false - -- name: Eligible person for additional disability credit 2022 - period: 2022 - input: - age: 16 - province_code: BC - output: - bc_disability_credit_additional_amount_eligible: true - -- name: Ineligible person for additional disability credit 2022 - period: 2022 - input: - age: 19 - province_code: BC - output: - bc_disability_credit_additional_amount_eligible: false diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index ea22de005..0c781303c 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -7,7 +7,7 @@ class bc_disability_credit(Variable): label = "British Columbia disability tax credit" unit = CAD definition_period = YEAR - reference = "href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1" + reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1" defined_for = "bc_disability_credit_eligible" def formula(person, period, parameters): @@ -15,4 +15,5 @@ def formula(person, period, parameters): additional_amount = person( "bc_disability_credit_additional_amount", period ) - return min_(p.additional_amount.max_amount, p.base + additional_amount) + total_credit_amount = p.base + additional_amount + return min_(p.additional_amount.cap, total_credit_amount) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index f8c929345..7890d4d20 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -7,15 +7,19 @@ class bc_disability_credit_additional_amount(Variable): label = "British Columbia additional disability tax credit" unit = CAD definition_period = YEAR - reference = "href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1" - defined_for = "bc_disability_credit_additional_amount_eligible" + reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1" + defined_for = ProvinceCode.BC def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability - childcare_received = person("childcare_received", period) - additional_amount_reduction = max_( - 0, childcare_received - p.additional_amount.income_threshold + childcare_expenses = person( + "childcare_expenses_claimed_by_another_person", period ) - return max_( - 0, p.additional_amount.younger - additional_amount_reduction + reduced_childcare_expenses = max_( + 0, childcare_expenses - p.additional_amount.income_threshold ) + age = person("age", period) + additional_amount_base = ( + p.additional_amount.additional_amount_base.calc(age) + ) + return max_(0, additional_amount_base - reduced_childcare_expenses) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py deleted file mode 100644 index 71d4661b2..000000000 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount_eligible.py +++ /dev/null @@ -1,15 +0,0 @@ -from policyengine_canada.model_api import * - - -class bc_disability_credit_additional_amount_eligible(Variable): - value_type = bool - entity = Person - label = ( - "Eligible for the British Columbia additional disability tax credit" - ) - definition_period = YEAR - defined_for = ProvinceCode.BC - - def formula(person, period, parameters): - p = parameters(period).gov.provinces.bc.tax.income.credits.disability - return person("age", period) < p.additional_amount.age_limit diff --git a/policyengine_canada/variables/household/person/childcare_received.py b/policyengine_canada/variables/household/person/childcare_expenses_claimed_by_another_person.py similarity index 77% rename from policyengine_canada/variables/household/person/childcare_received.py rename to policyengine_canada/variables/household/person/childcare_expenses_claimed_by_another_person.py index 2c7f5f502..c6e9c9145 100644 --- a/policyengine_canada/variables/household/person/childcare_received.py +++ b/policyengine_canada/variables/household/person/childcare_expenses_claimed_by_another_person.py @@ -1,7 +1,7 @@ from policyengine_canada.model_api import * -class childcare_received(Variable): +class childcare_expenses_claimed_by_another_person(Variable): value_type = float entity = Person label = "Amount of Childcare received which was claimed by another person" From bfcc6a69531aec7905fcc2e79556ec11c5d9dce3 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 25 Jan 2024 03:00:11 +0000 Subject: [PATCH 10/20] British Columbia Disability Credit Fixes #464 --- .../{additional_amount_base.yaml => base.yaml} | 17 ++++++++--------- .../disability/additional_amount/cap.yaml | 2 +- ...ld.yaml => childcare_expense_threshold.yaml} | 2 +- .../bc_disability_credit_additional_amount.py | 8 ++++---- 4 files changed, 14 insertions(+), 15 deletions(-) rename policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/{additional_amount_base.yaml => base.yaml} (80%) rename policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/{income_threshold.yaml => childcare_expense_threshold.yaml} (88%) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/additional_amount_base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/base.yaml similarity index 80% rename from policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/additional_amount_base.yaml rename to policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/base.yaml index 396ba0fb0..7881bac3c 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/additional_amount_base.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/base.yaml @@ -1,21 +1,20 @@ -description: British Columbia provides an additional disability credit to filers by age. +description: British Columbia provides an additional disability credit of this amount, based on age. brackets: - - amount: + - threshold: + 2022-01-01: 0 + amount: 2022-01-01: 4_946 2023-01-01: 5_242 - threshold: - 2022-01-01: 0 - - amount: - 2022-01-01: 0 - threshold: + - threshold: 2022-01-01: 18 + amount: + 2022-01-01: 0 metadata: type: single_amount threshold_unit: year amount_unit: currency-CAD period: year - name: bc_additional_disability_credit - label: British Columbia additional disability credit + label: British Columbia disability credit additional amount base reference: - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml index b6eac5291..0d58a5131 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml @@ -5,7 +5,7 @@ values: metadata: unit: currency-CAD period: year - label: British Columbia disability credit max amount + label: British Columbia disability credit cap reference: - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml similarity index 88% rename from policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml rename to policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml index 28177277e..22831beb2 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/income_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml @@ -5,7 +5,7 @@ values: metadata: unit: currency-CAD period: year - label: British Columbia disability credit income threshold + label: British Columbia disability credit additional amount childcare expense threshold reference: - title: B.C. basic personal income tax credits href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index 7890d4d20..6f485ece0 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -16,10 +16,10 @@ def formula(person, period, parameters): "childcare_expenses_claimed_by_another_person", period ) reduced_childcare_expenses = max_( - 0, childcare_expenses - p.additional_amount.income_threshold + 0, + childcare_expenses + - p.additional_amount.childcare_expense_threshold, ) age = person("age", period) - additional_amount_base = ( - p.additional_amount.additional_amount_base.calc(age) - ) + additional_amount_base = p.additional_amount.base.calc(age) return max_(0, additional_amount_base - reduced_childcare_expenses) From 291bf59b47ff3f39a63783dd1bd927048ee1a905 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 25 Jan 2024 03:05:15 +0000 Subject: [PATCH 11/20] Fixes labels --- .../additional_amount/childcare_expense_threshold.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml index 22831beb2..6eb378c6c 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml @@ -3,8 +3,8 @@ values: 2022-01-01: 2_871 2023-01-01: 3_044 metadata: - unit: currency-CAD period: year + unit: currency-CAD label: British Columbia disability credit additional amount childcare expense threshold reference: - title: B.C. basic personal income tax credits From 25c1193e6a32f3e17117a6d81fb0bffd5f2c4343 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 25 Jan 2024 03:17:46 +0000 Subject: [PATCH 12/20] update sphinx version --- .../additional_amount/childcare_expense_threshold.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml index 6eb378c6c..22831beb2 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml @@ -3,8 +3,8 @@ values: 2022-01-01: 2_871 2023-01-01: 3_044 metadata: - period: year unit: currency-CAD + period: year label: British Columbia disability credit additional amount childcare expense threshold reference: - title: B.C. basic personal income tax credits From 28648ebfd8683e7e942e73fa12dc4c9e878eee8a Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 8 Feb 2024 05:29:03 +0000 Subject: [PATCH 13/20] British Columbia Disability Credit Fixes #464 --- .../disability/{additional_amount => }/cap.yaml | 0 .../bc_disability_credit_additional_amount.yaml | 16 ++++++++-------- .../bc_disability_credit/bc_disability_credit.py | 2 +- .../bc_disability_credit_additional_amount.py | 2 +- ...ildcare_expenses_claimed_by_another_person.py | 9 --------- .../household/person/childcare_received.py | 8 ++++++++ 6 files changed, 18 insertions(+), 19 deletions(-) rename policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/{additional_amount => }/cap.yaml (100%) delete mode 100644 policyengine_canada/variables/household/person/childcare_expenses_claimed_by_another_person.py create mode 100644 policyengine_canada/variables/household/person/childcare_received.py diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/cap.yaml similarity index 100% rename from policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/cap.yaml rename to policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/cap.yaml diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml index 4e809d07a..f094e01cb 100644 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml @@ -3,7 +3,7 @@ input: province_code: BC age: 17 - childcare_expenses_claimed_by_another_person: 3_000 + childcare_received: 3_000 output: bc_disability_credit_additional_amount: 5_242 @@ -12,7 +12,7 @@ input: province_code: BC age: 17 - childcare_expenses_claimed_by_another_person: 3_500 + childcare_received: 3_500 output: bc_disability_credit_additional_amount: 4_786 @@ -21,7 +21,7 @@ input: province_code: BC age: 17 - childcare_expenses_claimed_by_another_person: 15_000 + childcare_received: 15_000 output: bc_disability_credit_additional_amount: 0 @@ -30,7 +30,7 @@ input: province_code: BC age: 18 - childcare_expenses_claimed_by_another_person: 15_000 + childcare_received: 15_000 output: bc_disability_credit_additional_amount: 0 @@ -39,7 +39,7 @@ input: province_code: BC age: 17 - childcare_expenses_claimed_by_another_person: 2_800 + childcare_received: 2_800 output: bc_disability_credit_additional_amount: 4_946 @@ -48,7 +48,7 @@ input: province_code: BC age: 17 - childcare_expenses_claimed_by_another_person: 3_000 + childcare_received: 3_000 output: bc_disability_credit_additional_amount: 4_817 @@ -57,7 +57,7 @@ input: province_code: BC age: 17 - childcare_expenses_claimed_by_another_person: 15_000 + childcare_received: 15_000 output: bc_disability_credit_additional_amount: 0 @@ -66,6 +66,6 @@ input: province_code: BC age: 18 - childcare_expenses_claimed_by_another_person: 15_000 + childcare_received: 15_000 output: bc_disability_credit_additional_amount: 0 diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index 0c781303c..e9ef23c7f 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -16,4 +16,4 @@ def formula(person, period, parameters): "bc_disability_credit_additional_amount", period ) total_credit_amount = p.base + additional_amount - return min_(p.additional_amount.cap, total_credit_amount) + return min_(p.cap, total_credit_amount) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index 6f485ece0..85fa49e8b 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -13,7 +13,7 @@ class bc_disability_credit_additional_amount(Variable): def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability childcare_expenses = person( - "childcare_expenses_claimed_by_another_person", period + "childcare_received", period ) reduced_childcare_expenses = max_( 0, diff --git a/policyengine_canada/variables/household/person/childcare_expenses_claimed_by_another_person.py b/policyengine_canada/variables/household/person/childcare_expenses_claimed_by_another_person.py deleted file mode 100644 index c6e9c9145..000000000 --- a/policyengine_canada/variables/household/person/childcare_expenses_claimed_by_another_person.py +++ /dev/null @@ -1,9 +0,0 @@ -from policyengine_canada.model_api import * - - -class childcare_expenses_claimed_by_another_person(Variable): - value_type = float - entity = Person - label = "Amount of Childcare received which was claimed by another person" - unit = CAD - definition_period = YEAR diff --git a/policyengine_canada/variables/household/person/childcare_received.py b/policyengine_canada/variables/household/person/childcare_received.py new file mode 100644 index 000000000..606c7201e --- /dev/null +++ b/policyengine_canada/variables/household/person/childcare_received.py @@ -0,0 +1,8 @@ +from policyengine_canada.model_api import * + +class childcare_received(Variable): + value_type = float + entity = Person + label = "Amount of Childcare received which was claimed by another person" + unit = CAD + definition_period = YEAR \ No newline at end of file From 01c4db9955d5caf1ccb0ce51b47eba1221ab5d98 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Thu, 8 Feb 2024 05:29:40 +0000 Subject: [PATCH 14/20] fix childcare_received --- .../bc_disability_credit_additional_amount.py | 4 +--- .../variables/household/person/childcare_received.py | 11 ++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index 85fa49e8b..66d68a50c 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -12,9 +12,7 @@ class bc_disability_credit_additional_amount(Variable): def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability - childcare_expenses = person( - "childcare_received", period - ) + childcare_expenses = person("childcare_received", period) reduced_childcare_expenses = max_( 0, childcare_expenses diff --git a/policyengine_canada/variables/household/person/childcare_received.py b/policyengine_canada/variables/household/person/childcare_received.py index 606c7201e..2c7f5f502 100644 --- a/policyengine_canada/variables/household/person/childcare_received.py +++ b/policyengine_canada/variables/household/person/childcare_received.py @@ -1,8 +1,9 @@ from policyengine_canada.model_api import * + class childcare_received(Variable): - value_type = float - entity = Person - label = "Amount of Childcare received which was claimed by another person" - unit = CAD - definition_period = YEAR \ No newline at end of file + value_type = float + entity = Person + label = "Amount of Childcare received which was claimed by another person" + unit = CAD + definition_period = YEAR From a9f7c3663f9cc2b77ce29499cdd097b87a195e7d Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Tue, 27 Feb 2024 01:30:48 +0000 Subject: [PATCH 15/20] British Columbia Disability Credit Fixes #464 --- .../bc/tax/income/credits/non_refundable.yaml | 1 + .../bc_disability_credit_additional_amount.yaml | 16 ++++++++-------- .../bc_disability_credit/bc_disability_credit.py | 4 ++-- .../bc_disability_credit_additional_amount.py | 6 +++--- .../household/person/childcare_received.py | 9 --------- 5 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 policyengine_canada/variables/household/person/childcare_received.py diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml index f3d40c64f..6bce91873 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml @@ -3,6 +3,7 @@ values: 2022-01-01: - bc_tax_reduction_credit - bc_age_credit + - bc_disability_credit metadata: unit: program diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml index f094e01cb..f8d500c52 100644 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.yaml @@ -3,7 +3,7 @@ input: province_code: BC age: 17 - childcare_received: 3_000 + care_expenses: 3_000 output: bc_disability_credit_additional_amount: 5_242 @@ -12,7 +12,7 @@ input: province_code: BC age: 17 - childcare_received: 3_500 + care_expenses: 3_500 output: bc_disability_credit_additional_amount: 4_786 @@ -21,7 +21,7 @@ input: province_code: BC age: 17 - childcare_received: 15_000 + care_expenses: 15_000 output: bc_disability_credit_additional_amount: 0 @@ -30,7 +30,7 @@ input: province_code: BC age: 18 - childcare_received: 15_000 + care_expenses: 15_000 output: bc_disability_credit_additional_amount: 0 @@ -39,7 +39,7 @@ input: province_code: BC age: 17 - childcare_received: 2_800 + care_expenses: 2_800 output: bc_disability_credit_additional_amount: 4_946 @@ -48,7 +48,7 @@ input: province_code: BC age: 17 - childcare_received: 3_000 + care_expenses: 3_000 output: bc_disability_credit_additional_amount: 4_817 @@ -57,7 +57,7 @@ input: province_code: BC age: 17 - childcare_received: 15_000 + care_expenses: 15_000 output: bc_disability_credit_additional_amount: 0 @@ -66,6 +66,6 @@ input: province_code: BC age: 18 - childcare_received: 15_000 + care_expenses: 15_000 output: bc_disability_credit_additional_amount: 0 diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index e9ef23c7f..41f7bec91 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -15,5 +15,5 @@ def formula(person, period, parameters): additional_amount = person( "bc_disability_credit_additional_amount", period ) - total_credit_amount = p.base + additional_amount - return min_(p.cap, total_credit_amount) + uncapped_amount = p.base + additional_amount + return min_(p.cap, uncapped_amount) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index 66d68a50c..89bf9ddfa 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -12,12 +12,12 @@ class bc_disability_credit_additional_amount(Variable): def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability - childcare_expenses = person("childcare_received", period) - reduced_childcare_expenses = max_( + childcare_expenses = person("care_expenses", period) + excess_childcare_expenses = max_( 0, childcare_expenses - p.additional_amount.childcare_expense_threshold, ) age = person("age", period) additional_amount_base = p.additional_amount.base.calc(age) - return max_(0, additional_amount_base - reduced_childcare_expenses) + return max_(0, additional_amount_base - excess_childcare_expenses) diff --git a/policyengine_canada/variables/household/person/childcare_received.py b/policyengine_canada/variables/household/person/childcare_received.py deleted file mode 100644 index 2c7f5f502..000000000 --- a/policyengine_canada/variables/household/person/childcare_received.py +++ /dev/null @@ -1,9 +0,0 @@ -from policyengine_canada.model_api import * - - -class childcare_received(Variable): - value_type = float - entity = Person - label = "Amount of Childcare received which was claimed by another person" - unit = CAD - definition_period = YEAR From e72a20bf256a7d3a1e927da60c74cdf3a45df502 Mon Sep 17 00:00:00 2001 From: 7qiwx <49327053+7qiwx@users.noreply.github.com> Date: Tue, 27 Feb 2024 23:46:39 +0000 Subject: [PATCH 16/20] Add reference to non_refundable.yaml --- .../bc/tax/income/credits/non_refundable.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml index 6bce91873..e89bd747e 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml @@ -1,4 +1,4 @@ -description: British Columbia list of non-refundable tax credits. +description: British Columbia provides the following non-refundable tax credits. values: 2022-01-01: - bc_tax_reduction_credit @@ -7,3 +7,12 @@ values: metadata: unit: program + period: year + label: British Columbia non-refundable tax credits + reference: + - title: B.C. basic personal income tax credits + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: British Columbia Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 + - title: British Columbia disability amount worksheet 2022 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 From c64ef495f16885c4c2f55a0f2c17035ebfa0d746 Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Thu, 29 Feb 2024 03:12:56 +0100 Subject: [PATCH 17/20] format --- .../disability/additional_amount/base.yaml | 4 ++-- .../childcare_expense_threshold.yaml | 4 +++- .../bc/tax/income/credits/disability/base.yaml | 3 ++- .../bc/tax/income/credits/disability/cap.yaml | 15 --------------- .../bc_disability_credit.yaml | 18 ------------------ .../bc_disability_credit.py | 3 +-- 6 files changed, 8 insertions(+), 39 deletions(-) delete mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/cap.yaml diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/base.yaml index 7881bac3c..0d7cc5bd3 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/base.yaml @@ -4,7 +4,8 @@ brackets: 2022-01-01: 0 amount: 2022-01-01: 4_946 - 2023-01-01: 5_242 + 2023-01-01: 5_242 + 2024-01-01: 5_505 - threshold: 2022-01-01: 18 amount: @@ -22,4 +23,3 @@ metadata: href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - title: British Columbia disability amount worksheet 2022 href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 - diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml index 22831beb2..6a20e9b5a 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/additional_amount/childcare_expense_threshold.yaml @@ -1,7 +1,9 @@ description: British Columbia reduces the additional disability credit amount by the excess of childcare expenses over this threshold. values: 2022-01-01: 2_871 - 2023-01-01: 3_044 + 2023-01-01: 3_044 + 2024-01-01: 3_196 + metadata: unit: currency-CAD period: year diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml index 8087c14e2..18ca93fad 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/base.yaml @@ -1,7 +1,8 @@ description: British Columbia provides this disability credit base amount. values: 2022-01-01: 8_477 - 2023-01-01: 8_986 + 2023-01-01: 8_986 + 2024-01-01: 9_435 metadata: unit: currency-CAD period: year diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/cap.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/cap.yaml deleted file mode 100644 index 0d58a5131..000000000 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/disability/cap.yaml +++ /dev/null @@ -1,15 +0,0 @@ -description: British Columbia caps the disability credit at this amount. -values: - 2022-01-01: 13_423 - 2023-01-01: 14_228 -metadata: - unit: currency-CAD - period: year - label: British Columbia disability credit cap - reference: - - title: B.C. basic personal income tax credits - href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic - - title: British Columbia Income Tax Act (4.51) - href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 - - title: British Columbia disability amount worksheet 2022 - href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml index 21bf173b5..9991860f2 100644 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.yaml @@ -7,15 +7,6 @@ output: bc_disability_credit: 8_986 -- name: Eligible person with disability credit over limit 2023 - period: 2023 - input: - province_code: BC - bc_disability_credit_eligible: true - bc_disability_credit_additional_amount: 5_243 - output: - bc_disability_credit: 14_228 - - name: Ineligible person 2023 period: 2023 input: @@ -34,15 +25,6 @@ output: bc_disability_credit: 8_477 -- name: Eligible person with disability credit over limit 2022 - period: 2022 - input: - province_code: BC - bc_disability_credit_eligible: true - bc_disability_credit_additional_amount: 4_947 - output: - bc_disability_credit: 13_423 - - name: Ineligible person 2022 period: 2022 input: diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py index 41f7bec91..00444f428 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit.py @@ -15,5 +15,4 @@ def formula(person, period, parameters): additional_amount = person( "bc_disability_credit_additional_amount", period ) - uncapped_amount = p.base + additional_amount - return min_(p.cap, uncapped_amount) + return p.base + additional_amount From d4f12a429d92dcedac833a1a22757938ca85c813 Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Thu, 29 Feb 2024 03:15:47 +0100 Subject: [PATCH 18/20] net income tree --- .../gov/provinces/bc/tax/income/credits/refundable.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/refundable.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/refundable.yaml index e5fb34eec..ce313c801 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/refundable.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/refundable.yaml @@ -1,7 +1,10 @@ -description: British Columbia list of refundable tax credits. +description: British Columbia provides ty of refundable tax credits. values: 2022-01-01: - bc_climate_action_tax_credit + - bc_disability_credit metadata: - unit: program + unit: list + period: year + label: British Columbia refundable tax credits From 1868b6c1c6f4e78dc63d9b4186e65a3b5c107e7f Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Thu, 29 Feb 2024 03:18:22 +0100 Subject: [PATCH 19/20] format --- .../bc_disability_credit_additional_amount.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py index 89bf9ddfa..2393f126e 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/bc_disability_credit/bc_disability_credit_additional_amount.py @@ -13,10 +13,13 @@ class bc_disability_credit_additional_amount(Variable): def formula(person, period, parameters): p = parameters(period).gov.provinces.bc.tax.income.credits.disability childcare_expenses = person("care_expenses", period) + reduced_childcare_expenses = ( + childcare_expenses + - p.additional_amount.childcare_expense_threshold + ) excess_childcare_expenses = max_( 0, - childcare_expenses - - p.additional_amount.childcare_expense_threshold, + reduced_childcare_expenses, ) age = person("age", period) additional_amount_base = p.additional_amount.base.calc(age) From 8219956e468a5acd6dde702872226c210f8727e4 Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Fri, 1 Mar 2024 15:20:18 +0100 Subject: [PATCH 20/20] non ref file --- .../bc/tax/income/credits/non_refundable.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml index c1f16fa6e..c182c5af9 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/non_refundable.yaml @@ -5,8 +5,16 @@ values: - bc_age_credit - bc_basic_personal_amount - bc_pension_income_amount + - bc_disability_credit metadata: - unit: list + unit: program period: year label: British Columbia non-refundable tax credits + reference: + - title: B.C. basic personal income tax credits + href: https://www2.gov.bc.ca/gov/content/taxes/income-taxes/personal/credits/basic + - title: British Columbia Income Tax Act (4.51) + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.51 + - title: British Columbia disability amount worksheet 2022 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5010-d/5010-d-22e.pdf#page=1