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
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
description: New Brunswick provides the following Spouse or Common-law partner base amount.
values:
2023-01-01: 10_741
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
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 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

- name: No spouse income
period: 2023
input:
people:
head:
spouse_income: 0
spouse:
spouse_income: 0
household:
members: [head, spouse]
province_code: NB
output:
ab_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:
ab_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:
ab_spouse_and_common_law_partner_amount_credit: 741

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

SPOUSE_INCOME
- name: One person eligible and one not
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:
spouse_income: [0, 1_000]

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

- name: Ineligible spouse
period: 2023
input:
province_code: NB
is_spouse: false
individual_net_income: 10_000
output:
spouse_income: 0
karenlilr marked this conversation as resolved.
Show resolved Hide resolved


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):
spouse_income = add(household, period, ["spouse_income"])
base_amount = 10_741
max_credit = 9_764
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
result = base_amount - spouse_income
return min(max_credit, max(0, result))

class spouse_income(Variable):
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
value_type = float
entity = Person
label = "Spouse and commonlaw partner income"
definition_period = YEAR

def formula(person, period, parameters):
spouse = person("is_spouse", period)
income = person("individual_net_income", period)
return spouse * income
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
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,10 @@
description: New Brunswick reduces Spouse or Common-law partner amount for households with spouse income above this threshold.
values:
2023-01-01: 1_023
metadata:
unit: currency-CAD
karenlilr marked this conversation as resolved.
Show resolved Hide resolved
period: year
label: New Brunswick Spouse or Common-law Partner Income Cap
reference:
- 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
Loading