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

Issue:
Canada Employment Amount
reference: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-31260-canada-employment-amount.html

https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5011-r/5011-r-22e.pdf


Discussion / hints:

Fix patch:
diff --git a/changelog_entry.yaml b/changelog_entry.yaml
index e69de29bb..21ce6bc48 100644
--- a/changelog_entry.yaml
+++ b/changelog_entry.yaml
@@ -0,0 +1,4 @@
+- bump: minor
+  changes:
+    added:
+    - Canada employment amount.
diff --git a/policyengine_canada/parameters/gov/cra/tax/income/credits/canada_employment_amount/income_sources.yaml b/policyengine_canada/parameters/gov/cra/tax/income/credits/canada_employment_amount/income_sources.yaml
new file mode 100644
index 000000000..3be12985c
--- /dev/null
+++ b/policyengine_canada/parameters/gov/cra/tax/income/credits/canada_employment_amount/income_sources.yaml
@@ -0,0 +1,12 @@
+description: Canada considers the following income sources when computing the employment amount credit.
+values:
+  2022-01-01:
+    - employment_income
+    - other_employment_income
+metadata:
+  unit: list
+  reference:
+  - title: Government of Canada, Line 31260 – Canada employment amount
+    href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-31260-canada-employment-amount.html
+  - title: Canada Income Tax Act, 118 (10) - Canada employment credit
+    href: https://laws-lois.justice.gc.ca/eng/acts/I-3.3/section-118.html
diff --git a/policyengine_canada/parameters/gov/cra/tax/income/credits/canada_employment_amount/max_amount.yaml b/policyengine_canada/parameters/gov/cra/tax/income/credits/canada_employment_amount/max_amount.yaml
new file mode 100644
index 000000000..f6463e4d9
--- /dev/null
+++ b/policyengine_canada/parameters/gov/cra/tax/income/credits/canada_employment_amount/max_amount.yaml
@@ -0,0 +1,12 @@
+description: Canada provides the following maximum amount under the Canada employment amount. 
+values:
+  2022-01-01: 1_287
+metadata:
+  unit: currency-CAD
+  label: Canada Employment Amount max amount
+  reference:
+  - title: Government of Canada, Line 31260 – Canada employment amount
+    href: https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-31260-canada-employment-amount.html
+    # The law specifies $1,000.
+  - title: Canada Income Tax Act, 118 (10) - Canada employment credit
+    href: https://laws-lois.justice.gc.ca/eng/acts/I-3.3/section-118.html
diff --git a/policyengine_canada/variables/gov/cra/tax/income/credits/canada_employment_amount.py b/policyengine_canada/variables/gov/cra/tax/income/credits/canada_employment_amount.py
new file mode 100644
index 000000000..cc7470b42
--- /dev/null
+++ b/policyengine_canada/variables/gov/cra/tax/income/credits/canada_employment_amount.py
@@ -0,0 +1,19 @@
+from policyengine_canada.model_api import *
+
+
+class canada_employment_amount(Variable):
+    value_type = float
+    entity = Person
+    label = "Canada Employment Amount"
+    unit = CAD
+    definition_period = YEAR
+    reference = "https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/deductions-credits-expenses/line-31260-canada-employment-amount.html"
+
+    def formula(person, period, parameters):
+        p = parameters(
+            period
+        ).gov.cra.tax.income.credits.canada_employment_amount
+        # While the government website states that the Canada Employment Amount is designed
+        # to support workers with work-related expenses, those expenses are not part of the formula.
+        countable_income = add(person, period, p.income_sources)
+        return min_(countable_income, p.max_amount)
diff --git a/policyengine_canada/variables/household/income/individual/other_employment_income.py b/policyengine_canada/variables/household/income/individual/other_employment_income.py
new file mode 100644
index 000000000..8b6bc57cb
--- /dev/null
+++ b/policyengine_canada/variables/household/income/individual/other_employment_income.py
@@ -0,0 +1,11 @@
+from policyengine_canada.model_api import *
+
+
+class other_employment_income(Variable):
+    value_type = float
+    entity = Person
+    label = "Other employment income"
+    unit = CAD
+    documentation = "Employment income reported on Line 10400 of the personal income tax return"
+    definition_period = YEAR
+    reference = "https://www.canada.ca/en/revenue-agency/services/tax/individuals/topics/about-your-tax-return/tax-return/completing-a-tax-return/personal-income/line-10400-other-employment-income.html"


Test patch:
diff --git a/policyengine_canada/tests/gov/cra/tax/income/credits/canada_employment_amount.yaml b/policyengine_canada/tests/gov/cra/tax/income/credits/canada_employment_amount.yaml
new file mode 100644
index 000000000..0af78f3d8
--- /dev/null
+++ b/policyengine_canada/tests/gov/cra/tax/income/credits/canada_employment_amount.yaml
@@ -0,0 +1,23 @@
+- name: Capped at 1,287
+  period: 2022
+  input:
+    employment_income: 1_100
+    other_employment_income: 200
+  output:
+    canada_employment_amount: 1_287
+
+- name: No income
+  period: 2022
+  input:
+    employment_income: 0
+    other_employment_income: 0
+  output:
+    canada_employment_amount: 0
+
+- name: Below cap
+  period: 2022
+  input:
+    employment_income: 1_000
+    other_employment_income: 200
+  output:
+    canada_employment_amount: 1_200