From a0e6b3946066a0c506e23ef44dbf015dd7e079ac Mon Sep 17 00:00:00 2001 From: okeyiii <96802936+okeyiii@users.noreply.github.com> Date: Sun, 15 Oct 2023 18:26:49 +0000 Subject: [PATCH] Nova Scotia Age amount supplement Add new files Fixes #455 --- changelog_entry.yaml | 1 + .../credits/age/age_supplement/base.yaml | 13 ++++++ .../age/age_supplement/phase_out_rate.yaml | 24 ++++++++++ .../credits/age/ns_age_amount_supplement.yaml | 44 +++++++++++++++++++ .../credits/age/ns_age_amount_supplement.py | 32 ++++++++++++++ 5 files changed, 114 insertions(+) create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/base.yaml create mode 100644 policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/phase_out_rate.yaml create mode 100644 policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml create mode 100644 policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..8b1378917 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1 @@ + diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/base.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/base.yaml new file mode 100644 index 000000000..fa9316611 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/base.yaml @@ -0,0 +1,13 @@ +description: Nova Scotia adds this additional amount to the basic personal amount. +values: + 2022-01-01: 1_465 +metadata: + unit: currency-CAD + label: Nova Scotia basic personal amount additional base + reference: + - title: 2022 Nova Scotia Personal Tax Credits Return + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 + - title: 2022 Worksheet NS428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 + - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada + href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/phase_out_rate.yaml b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/phase_out_rate.yaml new file mode 100644 index 000000000..851cc7eaf --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/ns/tax/income/credits/age/age_supplement/phase_out_rate.yaml @@ -0,0 +1,24 @@ +description: Nova Scotia phases its age amount supplement out at this rate. +brackets: + - threshold: + 2022-01-01: 0 + rate: + 2022-01-01: 0 + - threshold: + 2022-01-01: 25_000 + rate: + 2022-01-01: 0.0293 + +metadata: + type: marginal_rate + rate_unit: /1 + threshold_unit: currency-CAD + period: year + label: Nova Scotia basic personal amount phase out rate + reference: + - title: 2022 Nova Scotia Personal Tax Credits Return + href: https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1 + - title: 2022 Worksheet NS428 + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1 + - title: Nova Scotia income tax act - subdivision c - Deduction for employment out of Canada + href: https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24 diff --git a/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml new file mode 100644 index 000000000..3d2951df7 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.yaml @@ -0,0 +1,44 @@ +- name: Nova Scotia Age amonut supplement; eligible age with eligible taxable income below 25_000 + period: 2023 + input: + province_code: NS + age: 65 + ns_taxable_income: 24_999 + output: + ns_age_tax_credit: 1_465 + +- name: Nova Scotia Age amonut supplement; eligible age with eligible taxable income between 25_000 and 75_000 + period: 2023 + input: + province_code: NS + age: 65 + ns_taxable_income: 65_000 + output: + ns_age_tax_credit: 295 + +- name: Nova Scotia Age tax credit; eligible age with ineligible taxable income more than 75_000 + period: 2023 + input: + province_code: NS + age: 65 + ns_taxable_income: 75_001 + output: + ns_age_tax_credit: 0 + +- name: Nova Scotia Age tax credit; ineligible age with eligible taxable income + period: 2023 + input: + province_code: NS + age: 64 + ns_taxable_income: 24_999 + output: + ns_age_tax_credit: 0 + +- name: Nova Scotia Age tax credit; ineligible age with ineligible taxable income + period: 2023 + input: + province_code: NS + age: 64 + ns_taxable_income: 75_001 + output: + ns_age_tax_credit: 0 diff --git a/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py new file mode 100644 index 000000000..cd0cda386 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/ns/tax/income/credits/age/ns_age_amount_supplement.py @@ -0,0 +1,32 @@ +from policyengine_canada.model_api import * + + +class ns_age_amount_supplement(Variable): + value_type = float + entity = Person + label = "Nova Scotia Basic Personal Amount" + unit = CAD + definition_period = YEAR + defined_for = ProvinceCode.NS + reference = ( + "https://hr.acadiau.ca/files/sites/hr/Payroll/Pensions%20&%20Benefits/NS_TD1_2022.pdf#page=1", + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5003-d/5003-d-22e.pdf#page=1", + "https://nslegislature.ca/sites/default/files/legc/statutes/income%20tax.pdf#page=24", + ) + + def formula(person, period, parameters): + p = parameters(period).gov.provinces.ns.tax.income.credits.age + age = person("age", period) + taxable_income = person("ns_taxable_income", period) + + # is eligible for age amount supplement + eligibility = age >= p.age_eligibility + + # Calculate additional amount added to base amount + reduced_additional_amount = max_( + 0, + p.age_supplement.base + - p.age_supplement.phase_out_rate.calc(taxable_income), + ) + + return reduced_additional_amount