From af7a4fb3872ad5fb4276f8cc13f0793ec950f2d6 Mon Sep 17 00:00:00 2001 From: laviniawo <132245041+laviniawo@users.noreply.github.com> Date: Mon, 7 Aug 2023 05:31:22 +0000 Subject: [PATCH] Manitoba Renters Tax Credit Fixes #419 Tests to be done --- changelog_entry.yaml | 4 ++ .../renters_tax_credit/age_amount.yaml | 9 ++++ .../applicable_percentage.yaml | 9 ++++ .../renters_tax_credit/base_amount.yaml | 9 ++++ .../renters_tax_credit/credit_value.yaml | 9 ++++ .../credits/renters_tax_credit/max_value.yaml | 9 ++++ .../renters_tax_credit/months_in_year.yaml | 9 ++++ .../mb_renters_tax_credit.py | 50 +++++++++++++++++++ .../housing/months_living_in_rentals.py | 9 ++++ 9 files changed, 117 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/age_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/applicable_percentage.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/base_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/credit_value.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/max_value.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/months_in_year.yaml create mode 100644 policyengine_canada/variables/gov/provinces/mb/tax/income/credits/renters_tax_credit/mb_renters_tax_credit.py create mode 100644 policyengine_canada/variables/household/expenses/housing/months_living_in_rentals.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..c3ecbbf32 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Manitoba renters tax credit amount. diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/age_amount.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/age_amount.yaml new file mode 100644 index 000000000..ed8a04314 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/age_amount.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides different tax credits according to different age groups. +values: + 2022-01-01: 65 +metadata: + unit: year + label: Manitoba tax credit diference with people with different ages + reference: + - title: Manitoba Information Guide Manitoba Credits Form MB479 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5007-tc/5007-tc-22e.pdf # page=3 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/applicable_percentage.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/applicable_percentage.yaml new file mode 100644 index 000000000..8fabb56cb --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/applicable_percentage.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides this specific percentage rate to renters tax credit. +values: + 2022-01-01: 0.0075 +metadata: + unit: currency-CAD + label: Manitoba renters tax credit rate + reference: + - title: Manitoba Information Guide Manitoba Credits Form MB479 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5007-tc/5007-tc-22e.pdf #page=3 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/base_amount.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/base_amount.yaml new file mode 100644 index 000000000..414123892 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/base_amount.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides this basic credit amount for either the head or the spouse having age of older than or equal to 65. +values: + 2022-01-01: 825 +metadata: + unit: currency-CAD + label: Manitoba basic credit amount of renters tax credit for either the head or the spouse having eligible age + reference: + - title: Manitoba Information Guide Manitoba Credits Form MB479 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5007-tc/5007-tc-22e.pdf #page=3 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/credit_value.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/credit_value.yaml new file mode 100644 index 000000000..9923b36df --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/credit_value.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides this credit value for renters tax credit calculation. +values: + 2022-01-01: 43.75 +metadata: + unit: currency-CAD + label: Manitoba credit value of renters tax credit + reference: + - title: Manitoba Information Guide Manitoba Credits Form MB479 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5007-tc/5007-tc-22e.pdf #page=3 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/max_value.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/max_value.yaml new file mode 100644 index 000000000..518481266 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/max_value.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides this maximum value for renters tax credit calculation. +values: + 2022-01-01: 300 +metadata: + unit: currency-CAD + label: Manitoba maximum value of renters tax credit in calculation + reference: + - title: Manitoba Information Guide Manitoba Credits Form MB479 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5007-tc/5007-tc-22e.pdf #page=3 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/months_in_year.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/months_in_year.yaml new file mode 100644 index 000000000..14c890339 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/renters_tax_credit/months_in_year.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides the certain time amount for education property tax credit calculations. +values: + 2022-01-01: 365 +metadata: + unit: year + label: Manitoba time amount for education property tax credit calculations + reference: + - title: Manitoba Information Guide Manitoba Credits Form MB479 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5007-tc/5007-tc-22e.pdf # page=3 diff --git a/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/renters_tax_credit/mb_renters_tax_credit.py b/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/renters_tax_credit/mb_renters_tax_credit.py new file mode 100644 index 000000000..2288f5764 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/renters_tax_credit/mb_renters_tax_credit.py @@ -0,0 +1,50 @@ +from policyengine_canada.model_api import * + + +class mb_renters_tax_credit(Variable): + value_type = float + entity = Person + label = "Manitoba renters tax credit" + unit = CAD + definition_period = YEAR + defined_for = ProvinceCode.MB + + def formula(person, period, parameters): + p = parameters( + period + ).gov.provinces.mb.tax.income.credits.renters_tax_credit + + age = person("age", period) + age_eligible = age >= p.age_amount + + # household net income + net_income = person("adjusted_family_net_income", period) + + # rent + rent = person("rent", period) + + # education property tax credit + ### waiting for issue418 to use this variable + education_property_tax_credit = person( + "mb_education_property_tax_credit_amount", period + ) + + max_amount_allowed = min_( + p.max_value, net_income * p.applicable_percentage + ) + + age_eligible_credit = age_eligible * ( + (p.base_amount - max_amount_allowed) / p.months_in_year + ) + max_tax_credit = max_(age_eligible_credit, p.credit_value) + + number_of_months_in_rentals = person( + "months_living_in_rentals", period + ) + + renters_tax_credit_amount = ( + min_(max_tax_credit * number_of_months_in_rentals, rent) + + education_property_tax_credit + ) + + return renters_tax_credit_amount diff --git a/policyengine_canada/variables/household/expenses/housing/months_living_in_rentals.py b/policyengine_canada/variables/household/expenses/housing/months_living_in_rentals.py new file mode 100644 index 000000000..16bc4e42b --- /dev/null +++ b/policyengine_canada/variables/household/expenses/housing/months_living_in_rentals.py @@ -0,0 +1,9 @@ +from policyengine_canada.model_api import * + + +class months_living_in_rentals(Variable): + value_type = int + entity = Person + label = "Time Livining in Rentals" + documentation = "Total number of months living in rental places" + definition_period = YEAR