From dcb6081aadcba8178369364e09ce406c65fec372 Mon Sep 17 00:00:00 2001 From: ireneluo95 <130390806+ireneluo95@users.noreply.github.com> Date: Thu, 15 Jun 2023 21:52:32 +0000 Subject: [PATCH] Fixes #340 Co-authored-by: Kingsley Yang --- changelog_entry.yaml | 4 ++++ .../base.yaml | 10 ++++++++ ..._and_common_law_partner_amount_credit.yaml | 23 +++++++++++++++++++ ...se_and_common_law_partner_amount_credit.py | 17 ++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/base.yaml create mode 100644 policyengine_canada/tests/gov/provinces/mb/tax/income/credits/mb_spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.yaml create mode 100644 policyengine_canada/variables/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..4ef0fa71f 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Manitoba spouse and common-law partner amount. diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/base.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/base.yaml new file mode 100644 index 000000000..c2a809d65 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/base.yaml @@ -0,0 +1,10 @@ +description: Manitoba provides this spouse and common-law partner amount, which is equivalent to the spouses basic personal amount. +values: + 2023-01-01: 9_134 +metadata: + unit: currency-CAD + period: year + label: Manitoba spouse and commonlaw partner amount credit. + reference: + - title: Government of Canada - Manitoba spouse and commonlaw partner amount credit + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1mb/td1mb-23e.pdf diff --git a/policyengine_canada/tests/gov/provinces/mb/tax/income/credits/mb_spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.yaml b/policyengine_canada/tests/gov/provinces/mb/tax/income/credits/mb_spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.yaml new file mode 100644 index 000000000..ec2ceac06 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/mb/tax/income/credits/mb_spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.yaml @@ -0,0 +1,23 @@ +- name: No spouse income + period: 2023 + input: + province_code: MB + spouse_income: 0 + output: + mb_spouse_and_common_law_partner_amount_credit: 9_134 + +- name: Spouse income of $5,000 + period: 2023 + input: + province_code: MB + spouse_income: 5_000 + output: + mb_spouse_and_common_law_partner_amount_credit: 4_134 + +- name: Capped at 0 + period: 2023 + input: + province_code: MB + spouse_income: 40_000 + output: + mb_spouse_and_common_law_partner_amount_credit: 0 diff --git a/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.py b/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.py new file mode 100644 index 000000000..6ebbcd834 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/spouse_and_common_law_partner_amount/mb_spouse_and_common_law_partner_amount_credit.py @@ -0,0 +1,17 @@ +from policyengine_canada.model_api import * + + +class mb_spouse_and_common_law_partner_amount_credit(Variable): + value_type = float + entity = Person + label = "Manitoba spouse and commonlaw partner amount credit" + definition_period = YEAR + defined_for = ProvinceCode.MB + + def formula(person, period, parameters): + + spouse_income = person("spouse_income", period) + p = parameters( + period + ).gov.provinces.mb.tax.income.credits.spouse_and_common_law_partner_amount + return max_(0, (p.base - spouse_income))