Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Brunswick Spouse or Common-law partner amount #492

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- New Brunswick Spouse or Common-law Partner base amount for the years 2022, 2023, and 2024; nb_spouse_and_common_law_partner_amount_credit to calculate the credit dynamically based on parameters; test cases; parameter configurations for base_amount and max_credit in the parameters file.
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
description: New Brunswick provides the following Spouse or Common-law partner base amount.
values:
2022-01-01: 10_105
2023-01-01: 10_741
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
2024-01-01: 11_246
metadata:
unit: currency-CAD
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
period: year
label: New Brunswick Spouse or Common-law Partner Base Amount
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
reference:
- title: Worksheet for the 2022 New Brunswick Personal Tax Credits Return
href: https://www.cchwebsites.com/content/pdf/tax_forms/ca/en/td1nbws_en.pdf#page=1
- title: 2022 New Brunswick Personal Tax Credits Return
href: https://www.vitalitenb.ca/sites/default/files/documents/employes/td1nb_nb_personal_tax_credits_return.pdf#page=1
- title: Worksheet for the 2023 New Brunswick Personal Tax Credits Return
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb-ws/td1nb-ws-23e.pdf#page=1
- title: 2023 New Brunswick Personal Tax Credits Return
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb-ws/td1nb-ws-23e.pdf#page=1
- title: 2024 New Brunswick Personal Tax Credits Return
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb/td1nb-24e.pdf#page=1
- title: Worksheet for the 2024 New Brunswick Personal Tax Credits Return
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb-ws/td1nb-ws-24e.pdf#page=1

karenlilr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
description: The New Brunswick spouse or common-law partner amount credit is calculated by taking into account the spouse's net income and comparing it to a base amount. The maximum credit is the highest amount that can be claimed as a credit.
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
values:
2022-01-01: 9_186
2023-01-01: 9_764
2024-01-01: 10_223
metadata:
unit: currency-CAD
period: year
label: New Brunswick Spouse or Common-law Partner Max Credit
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
reference:
- title: Worksheet for the 2022 New Brunswick Personal Tax Credits Return
href: https://www.cchwebsites.com/content/pdf/tax_forms/ca/en/td1nbws_en.pdf#page=1
- title: Worksheet for the 2023 New Brunswick Personal Tax Credits Return
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb-ws/td1nb-ws-23e.pdf#page=1
- title: Worksheet for the 2024 New Brunswick Personal Tax Credits Return
href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb-ws/td1nb-ws-24e.pdf#page=1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still delete this

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
- name: One person eligible and one not
period: 2022
input:
people:
head:
is_spouse: false
individual_net_income: 10_000
spouse:
is_spouse: true
individual_net_income: 1_000
household:
members: [head, spouse]
province_code: NB
output:
nb_spouse_and_common_law_partner_amount_credit: 9_105

period: 2023
input:
people:
head:
is_spouse: false
individual_net_income: 10_000
spouse:
is_spouse: true
individual_net_income: 1_000
household:
members: [head, spouse]
province_code: NB
output:
nb_spouse_and_common_law_partner_amount_credit: 9_741

period: 2024
input:
people:
head:
is_spouse: false
individual_net_income: 10_000
spouse:
is_spouse: true
individual_net_income: 1_000
household:
members: [head, spouse]
province_code: NB
output:
nb_spouse_and_common_law_partner_amount_credit: 10_223

- name: Eligible spouse
period: 2022
input:
province_code: NB
is_spouse: true
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 105

period: 2023
input:
province_code: NB
is_spouse: true
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 741

period: 2024
input:
province_code: NB
is_spouse: true
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 1_246

- name: Ineligible spouse
period: 2022
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one period per test

input:
province_code: NB
is_spouse: false
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 0

period: 2023
input:
province_code: NB
is_spouse: false
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 0

period: 2024
input:
province_code: NB
is_spouse: false
individual_net_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
- name: No spouse income in 2022
period: 2022
input:
people:
head:
spouse_income: 0
spouse:
spouse_income: 0
household:
members: [head, spouse]
province_code: NB
output:
nb_spouse_and_common_law_partner_amount_credit: 9_186

- name: Spouse income of $1,000 in 2022
period: 2022
input:
province_code: NB
spouse_income: 1_000
output:
nb_spouse_and_common_law_partner_amount_credit: 9_105

- name: Spouse income of $10,000 in 2022
period: 2022
input:
province_code: NB
spouse_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 105

- name: Capped at 0 in 2022
period: 2022
input:
province_code: NB
spouse_income: 40_000
output:
nb_spouse_and_common_law_partner_amount_credit: 0


- name: No spouse income
period: 2023
input:
people:
head:
spouse_income: 0
spouse:
spouse_income: 0
household:
members: [head, spouse]
province_code: NB
output:
nb_spouse_and_common_law_partner_amount_credit: 9_764

- name: Spouse income of $1,000
period: 2023
input:
province_code: NB
spouse_income: 1_000
output:
nb_spouse_and_common_law_partner_amount_credit: 9_741


parameters:
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
gov:
provinces:
nb:
tax:
income:
credits:
spouse_or_common_law_partner_amount:
base_amount:
2022-01-01: 10_105
2023-01-01: 10_741
2024-01-01: 11_246
max_credit:
2022-01-01: 9_186
2023-01-01: 9_764
2024-01-01: 10_223

karenlilr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from policyengine_canada.model_api import *

class nb_spouse_and_common_law_partner_amount_credit(Variable):
value_type = float
entity = Household
label = "New Brunswick spouse and common-law partner amount credit"
definition_period = YEAR
defined_for = ProvinceCode.NB


def formula(household, period, parameters):
p = parameters(period).gov.provinces.nb.tax.income.credits.spouse_or_common_law_partner_amount
base_amount = p.base_amount
max_credit = p.max_credit

spouse_income = add(household, period, ["spouse_income"])
reduced_amount = max_(base_amount - spouse_income, 0)
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
return min(max_credit, reduced_amount)
karenlilr marked this conversation as resolved.
Show resolved Hide resolved