From d957dd7b2392e60e5ef6d76997243dce0f091447 Mon Sep 17 00:00:00 2001 From: laviniawo <132245041+laviniawo@users.noreply.github.com> Date: Mon, 7 Aug 2023 03:07:11 +0000 Subject: [PATCH] Manitoba Education Property Tax Credit Fixes #418 tests sessions to be modified --- changelog_entry.yaml | 4 ++ .../age_amount.yaml | 9 ++++ .../applicable_percentage.yaml | 9 ++++ .../basic_credit_age_eligible.yaml | 9 ++++ .../basic_credit_age_ineligible.yaml | 9 ++++ .../family_income_applicable_rate.yaml | 9 ++++ .../time_amount.yaml | 9 ++++ ..._education_property_tax_credit_amount.yaml | 23 ++++++++ .../education_property_tax_credit_amount.py | 54 +++++++++++++++++++ ...umber_of_days_owning_education_property.py | 9 ++++ ...education_property_tax_credit_ received.py | 9 ++++ .../household/expenses/tax/net_school_tax.py | 9 ++++ 12 files changed, 162 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/age_amount.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/applicable_percentage.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_eligible.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_ineligible.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/family_income_applicable_rate.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/time_amount.yaml create mode 100644 policyengine_canada/tests/gov/provinces/mb/tax/income/credits/education_property_tax_credit/mb_education_property_tax_credit_amount.yaml create mode 100644 policyengine_canada/variables/gov/provinces/mb/tax/income/credits/education_property_tax_credit/education_property_tax_credit_amount.py create mode 100644 policyengine_canada/variables/household/expenses/housing/number_of_days_owning_education_property.py create mode 100644 policyengine_canada/variables/household/expenses/tax/education_property_tax_credit_ received.py create mode 100644 policyengine_canada/variables/household/expenses/tax/net_school_tax.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..81805a4df 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Manitoba education property tax credit amount. diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/age_amount.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/age_amount.yaml new file mode 100644 index 000000000..1b1f1c1d6 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_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=2 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/applicable_percentage.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/applicable_percentage.yaml new file mode 100644 index 000000000..72acee11d --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/applicable_percentage.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides this specific percentage rate to education property tax credit. +values: + 2022-01-01: 0.625 +metadata: + unit: currency-CAD + label: Manitoba education property 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=2 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_eligible.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_eligible.yaml new file mode 100644 index 000000000..12298cd28 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_eligible.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: 687.5 +metadata: + unit: currency-CAD + label: Manitoba basic credit amount of education property tax 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=2 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_ineligible.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_ineligible.yaml new file mode 100644 index 000000000..4468639db --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/basic_credit_age_ineligible.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides this basic credit amount for both head and spouse having age of younger than 65. +values: + 2022-01-01: 437.5 +metadata: + unit: currency-CAD + label: Manitoba basic credit amount of education property tax for both head and spouse having ineligible 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=2 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/family_income_applicable_rate.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/family_income_applicable_rate.yaml new file mode 100644 index 000000000..6afb558ca --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/family_income_applicable_rate.yaml @@ -0,0 +1,9 @@ +description: Manitoba provides this specific percentage rate to family income. +values: + 2022-01-01: 0.00625 +metadata: + unit: currency-CAD + label: Manitoba family income rate percentage + 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=1 & page=2 diff --git a/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/time_amount.yaml b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/time_amount.yaml new file mode 100644 index 000000000..3a512c003 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/mb/tax/income/credits/education_property_tax_credit/time_amount.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=2 diff --git a/policyengine_canada/tests/gov/provinces/mb/tax/income/credits/education_property_tax_credit/mb_education_property_tax_credit_amount.yaml b/policyengine_canada/tests/gov/provinces/mb/tax/income/credits/education_property_tax_credit/mb_education_property_tax_credit_amount.yaml new file mode 100644 index 000000000..f9f49b3aa --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/mb/tax/income/credits/education_property_tax_credit/mb_education_property_tax_credit_amount.yaml @@ -0,0 +1,23 @@ +- name: Education property tax credit with eligible age amount + period: 2022 + input: + province_code: MB + education_property_tax_received: 2_000 + net_school_tax: 3_000 + age: 70 + adjusted_family_net_income: 100_000 + days_owning_education_property: 1_825 + output: + mb_education_property_tax_credit_amount: 187.5 + +- name: Education property tax credit with ineligible age amount + period: 2022 + input: + province_code: MB + education_property_tax_received: 2_000 + net_school_tax: 3_000 + age: 60 + adjusted_family_net_income: 100_000 + days_owning_education_property: 365 + output: + mb_education_property_tax_credit_amount: 187.5 diff --git a/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/education_property_tax_credit/education_property_tax_credit_amount.py b/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/education_property_tax_credit/education_property_tax_credit_amount.py new file mode 100644 index 000000000..2ba913b5d --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/mb/tax/income/credits/education_property_tax_credit/education_property_tax_credit_amount.py @@ -0,0 +1,54 @@ +from policyengine_canada.model_api import * + + +class mb_education_property_tax_credit_amount(Variable): + value_type = float + entity = Person + label = "Manitoba education property 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.education_property_tax_credit + + property_tax = p.applicable_percentage * ( + person("education_property_tax_received", period) + + person("net_school_tax", period) + ) + + age = person("age", period) + age_eligible = age >= p.age_amount + age_ineligible = age < p.age_amount + + # household net income + net_income = person("adjusted_family_net_income", period) + + eligible_age_credit = age_eligible * ( + p.basic_credit_age_eligible + - p.family_income_applicable_rate * net_income + ) + eligible_age_credit_max = max_( + eligible_age_credit, p.basic_credit_age_ineligible + ) + + ineligible_age_credit = age_ineligible * p.basic_credit_age_ineligible + + time_at_education_property = ( + person("days_owning_education_property", period) / p.time_amount + ) + + education_property_tax_credit_amount = max_( + 0, + ( + min_( + ineligible_age_credit * time_at_education_property, + property_tax, + ) + ) + - person("education_property_tax_received", period), + ) + + return education_property_tax_credit_amount diff --git a/policyengine_canada/variables/household/expenses/housing/number_of_days_owning_education_property.py b/policyengine_canada/variables/household/expenses/housing/number_of_days_owning_education_property.py new file mode 100644 index 000000000..d1c3aa672 --- /dev/null +++ b/policyengine_canada/variables/household/expenses/housing/number_of_days_owning_education_property.py @@ -0,0 +1,9 @@ +from policyengine_canada.model_api import * + + +class days_owning_education_property(Variable): + value_type = float + entity = Person + label = "Number of days at addresses of education property owned" + unit = CAD + definition_period = YEAR diff --git a/policyengine_canada/variables/household/expenses/tax/education_property_tax_credit_ received.py b/policyengine_canada/variables/household/expenses/tax/education_property_tax_credit_ received.py new file mode 100644 index 000000000..c39446a39 --- /dev/null +++ b/policyengine_canada/variables/household/expenses/tax/education_property_tax_credit_ received.py @@ -0,0 +1,9 @@ +from policyengine_canada.model_api import * + + +class education_property_tax_received(Variable): + value_type = float + entity = Person + label = "Education property taxes received" + unit = CAD + definition_period = YEAR diff --git a/policyengine_canada/variables/household/expenses/tax/net_school_tax.py b/policyengine_canada/variables/household/expenses/tax/net_school_tax.py new file mode 100644 index 000000000..697d82130 --- /dev/null +++ b/policyengine_canada/variables/household/expenses/tax/net_school_tax.py @@ -0,0 +1,9 @@ +from policyengine_canada.model_api import * + + +class net_school_tax(Variable): + value_type = float + entity = Person + label = "Net school tax paid" + unit = CAD + definition_period = YEAR