From d4d9ab9b25dda311028f6c6f4b9e2e8c27ca07da Mon Sep 17 00:00:00 2001 From: Yiwei Jia Date: Wed, 29 Nov 2023 15:56:10 -0500 Subject: [PATCH 1/4] British Columbia Pension Income Amount Fixes #470 --- changelog_entry.yaml | 4 ++++ .../credits/pension_income_amount/cap.yaml | 11 +++++++++++ .../bc_pension_income_amount.yaml | 15 +++++++++++++++ .../bc_pension_income_amount.py | 18 ++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml create mode 100644 policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml create mode 100644 policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..5718e314a 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - British Columbia pension income amount. diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml new file mode 100644 index 000000000..1908cd63e --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml @@ -0,0 +1,11 @@ +description: British Columbia provides this maximum pension benefit. +values: + 2022-01-01: 1_000 +metadata: + unit: currency-CAD + label: British Columbia pension benefit max amount + reference: + - title: 2023 British Columbia Personal Tax Credits Return, TD1BC + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1bc/td1bc-23e.pdf#page=1 + - title: British Columbia Income Tax Act § 4.32 + href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.32 diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml new file mode 100644 index 000000000..fc4c4d5ba --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml @@ -0,0 +1,15 @@ +- name: Max Pension Benefit + period: 2023 + input: + province_code: BC + pension_and_savings_plan_income: 1_001 + output: + bc_pension_income_amount: 1_000 + +- name: Pension Benefit Below Maximum Amount + period: 2023 + input: + province_code: BC + pension_and_savings_plan_income: 800 + output: + bc_pension_income_amount: 800 diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py new file mode 100644 index 000000000..b48904d42 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py @@ -0,0 +1,18 @@ +from policyengine_canada.model_api import * + + +class bc_pension_income_amount(Variable): + value_type = float + entity = Person + label = "British Columbia pension income amount" + unit = CAD + definition_period = YEAR + defined_for = ProvinceCode.BC + + def formula(person, period, parameters): + pension_income = person("pension_and_savings_plan_income", period) + max_amount = parameters( + period + ).gov.provinces.bc.tax.income.credits.pension_income_amount.cap + # Capped at a certain amount + return min_(max_amount, pension_income) From 50989ca88102aff3570148d6ea53d917248899d5 Mon Sep 17 00:00:00 2001 From: Yiwei Jia Date: Fri, 8 Dec 2023 20:10:59 -0500 Subject: [PATCH 2/4] Rephrased --- .../bc/tax/income/credits/pension_income_amount/cap.yaml | 2 +- .../bc_pension_income_amount/bc_pension_income_amount.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml index 1908cd63e..2840962e3 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml @@ -1,4 +1,4 @@ -description: British Columbia provides this maximum pension benefit. +description: British Columbia provides this max pension benefit for eligible filers. values: 2022-01-01: 1_000 metadata: diff --git a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml index fc4c4d5ba..718a1efba 100644 --- a/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml +++ b/policyengine_canada/tests/gov/provinces/bc/tax/income/credits/bc_pension_income_amount/bc_pension_income_amount.yaml @@ -1,4 +1,4 @@ -- name: Max Pension Benefit +- name: Pension income is larger than the maximum amount period: 2023 input: province_code: BC @@ -6,7 +6,7 @@ output: bc_pension_income_amount: 1_000 -- name: Pension Benefit Below Maximum Amount +- name: Pension income is less than the maximum amount period: 2023 input: province_code: BC From 83f2e87fa43e9c93c861d3fcf6651f7d1d65804c Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Thu, 29 Feb 2024 03:33:28 +0100 Subject: [PATCH 3/4] format --- .../provinces/bc/tax/income/credits/non_refundable.yaml | 1 + .../bc/tax/income/credits/pension_income_amount/cap.yaml | 7 +++++-- .../pension_income_amount/bc_pension_income_amount.py | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) 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..17ab604fe 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_pension_income_amount metadata: unit: program diff --git a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml index 2840962e3..888ea4929 100644 --- a/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml +++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml @@ -1,11 +1,14 @@ -description: British Columbia provides this max pension benefit for eligible filers. +description: British Columbia caps the pension benefit at this amount. values: 2022-01-01: 1_000 metadata: unit: currency-CAD - label: British Columbia pension benefit max amount + period: year + label: British Columbia pension benefit cap reference: - title: 2023 British Columbia Personal Tax Credits Return, TD1BC href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1bc/td1bc-23e.pdf#page=1 - title: British Columbia Income Tax Act § 4.32 href: https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/96215_00_multi#section4.32 + - title: 2022 British Columbia Personal Tax Credits Return, TD1BC + href: https://tsaykeh.com/files/pdf/1650179447_BC%20Tax%20Form.pdf#page=1 diff --git a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py index b48904d42..ad8a42cb1 100644 --- a/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py +++ b/policyengine_canada/variables/gov/provinces/bc/tax/income/credits/pension_income_amount/bc_pension_income_amount.py @@ -11,8 +11,8 @@ class bc_pension_income_amount(Variable): def formula(person, period, parameters): pension_income = person("pension_and_savings_plan_income", period) - max_amount = parameters( + p = parameters( period - ).gov.provinces.bc.tax.income.credits.pension_income_amount.cap + ).gov.provinces.bc.tax.income.credits.pension_income_amount # Capped at a certain amount - return min_(max_amount, pension_income) + return min_(p.cap, pension_income) From 0122edac7b54249446734de0fc2850ac692ff7b0 Mon Sep 17 00:00:00 2001 From: PavelMakarchuk Date: Thu, 29 Feb 2024 04:08:08 +0100 Subject: [PATCH 4/4] formatting --- .../gov/provinces/bc/tax/income/credits/non_refundable.yaml | 1 + 1 file changed, 1 insertion(+) 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 0286b63e5..c1f16fa6e 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 @@ -4,6 +4,7 @@ values: - bc_tax_reduction_credit - bc_age_credit - bc_basic_personal_amount + - bc_pension_income_amount metadata: unit: list