Repository: PolicyEngine/policyengine-canada (language: python)

Issue:
British Columbia Pension Income Amount
Reference: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1bc/td1bc-23e.pdf


Discussion / hints:

Fix patch:
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/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
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..888ea4929
--- /dev/null
+++ b/policyengine_canada/parameters/gov/provinces/bc/tax/income/credits/pension_income_amount/cap.yaml
@@ -0,0 +1,14 @@
+description: British Columbia caps the pension benefit at this amount.
+values:
+  2022-01-01: 1_000
+metadata:
+  unit: currency-CAD
+  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
new file mode 100644
index 000000000..ad8a42cb1
--- /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)
+        p = parameters(
+            period
+        ).gov.provinces.bc.tax.income.credits.pension_income_amount
+        # Capped at a certain amount
+        return min_(p.cap, pension_income)


Test patch:
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..718a1efba
--- /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: Pension income is larger than the maximum amount
+  period: 2023
+  input:
+    province_code: BC
+    pension_and_savings_plan_income: 1_001
+  output:
+    bc_pension_income_amount: 1_000
+
+- name: Pension income is less than the maximum amount
+  period: 2023
+  input:
+    province_code: BC
+    pension_and_savings_plan_income: 800
+  output:
+    bc_pension_income_amount: 800