Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Comment thread
karenlilr marked this conversation as 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: x
Comment thread
karenlilr marked this conversation as resolved.
Outdated
2023-01-01: 10_741
Comment thread
karenlilr marked this conversation as resolved.
2024-01-01: 11_246
metadata:
unit: currency-CAD
Comment thread
karenlilr marked this conversation as resolved.
period: year
label: New Brunswick Spouse or Common-law Partner Base Amount
Comment thread
karenlilr marked this conversation as resolved.
Outdated
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

Comment thread
karenlilr marked this conversation as 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.
Comment thread
karenlilr marked this conversation as resolved.
Outdated
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
Comment thread
karenlilr marked this conversation as resolved.
Outdated
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
Comment thread
karenlilr marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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

p = parameters(period).gov.provinces.nb.tax.income.credits.spouse_or_common_law_partner_amount
Comment thread
karenlilr marked this conversation as resolved.
Outdated
base_amount = p.base_amount
max_credit = p.max_credit

def formula(household, period, parameters):
year = period.start.year
if year == 2022:
base_amount = 10_105
max_credit = 9_186
elif year == 2023:
base_amount = 10_741
max_credit = 9_764
elif year == 2024:
base_amount = 11_246
max_credit = 10_223
else:
raise ValueError(f"Year {year} not supported.")
Comment thread
karenlilr marked this conversation as resolved.
Outdated

spouse_income = add(household, period, ["spouse_income"])
result = base_amount - spouse_income
Comment thread
karenlilr marked this conversation as resolved.
Outdated
return min(max_credit, max(0, result))

Comment thread
karenlilr marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
- 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

- name: Spouse income of $10,000
period: 2023
input:
province_code: NB
spouse_income: 10_000
output:
nb_spouse_and_common_law_partner_amount_credit: 741

- name: Capped at 0
period: 2023
input:
province_code: AB
spouse_income: 40_000
output:
nb_spouse_and_common_law_partner_amount_credit: 0


Copy link
Copy Markdown
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
Copy Markdown
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,39 @@
- name: One person eligible and one not
period: 2022
period: 2023
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:
spouse_income: [0, 1_000]
Comment thread
karenlilr marked this conversation as resolved.
Outdated

- name: Eligible spouse
period: 2022
period: 2023
period: 2024
input:
province_code: NB
is_spouse: true
individual_net_income: 10_000
output:
spouse_income: 10_000

- name: Ineligible spouse
period: 2022
Copy link
Copy Markdown
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

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