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

Saskatchewan Amounts Transferred from your Spouse or Common-law Partner #411

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
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:
- Saskatchewan transferred from spouse or common-law partner credit.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
- name: Amounts transferred from your spouse or common-law partner when spouse or common-law partner will use all of their age amount, senior supplementary amount, pension income amount, disability amount, and child amount.
period: 2023
input:
province_code: SK
sk_age_amount: 5_380
sk_senior_supplementary_credit: 1_421
sk_pension_income_credit: 1_000
sk_disability_amount: 10_405
sk_child_amount: 6_700
is_spouse: True
output:
sk_transferred_from_spouse_or_common_law_partner_credit: 0



- name: Amounts transferred from your spouse or common-law partner when spouse or common-law partner will not use all of their age amount, senior supplementary amount, pension income amount, disability amount, and child amount.
period: 2023
input:
province_code: SK
sk_age_amount: 5_380
sk_senior_supplementary_credit: 1_421
sk_pension_income_credit: 1_000
sk_disability_amount: 10_405
sk_child_amount: 6_700
is_spouse: False
output:
sk_transferred_from_spouse_or_common_law_partner_credit: 24_906



- name: Amounts transferred from your spouse or common-law partner when spouse or common-law partner will not use age amount, senior supplementary amount, and child amount.
period: 2023
input:
province_code: SK
sk_age_amount: 5_380
sk_senior_supplementary_credit: 1_421
sk_pension_income_credit: 0
sk_disability_amount: 0
sk_child_amount: 6_700
is_spouse: False
output:
sk_transferred_from_spouse_or_common_law_partner_credit: 13_501

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from policyengine_canada.model_api import *


class sk_age_amount(Variable):
value_type = float
entity = Person
label = "Saskatchewan age amount credit"
unit = CAD
definition_period = YEAR
reference = (
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf",
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk-ws/td1sk-ws-23e.pdf",
"https://publications.saskatchewan.ca/api/v1/products/583/formats/806/download",
)
defined_for = ProvinceCode.SK
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from policyengine_canada.model_api import *


class sk_child_amount(Variable):
value_type = float
entity = Person
label = "Saskatchewan child amount credit"
unit = CAD
definition_period = YEAR
reference = (
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf",
"https://publications.saskatchewan.ca/api/v1/products/583/formats/806/download",
)
defined_for = ProvinceCode.SK
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from policyengine_canada.model_api import *


class sk_disability_amount(Variable):
value_type = float
entity = Person
label = "Saskatchewan disability amount credit"
unit = CAD
definition_period = YEAR
reference = (
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf",
"https://publications.saskatchewan.ca/api/v1/products/583/formats/806/download",
)
defined_for = ProvinceCode.SK
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from policyengine_canada.model_api import *


class sk_pension_income_credit(Variable):
value_type = float
entity = Person
label = "Saskatchewan pension income credit"
unit = CAD
definition_period = YEAR
reference = (
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf",
"https://publications.saskatchewan.ca/api/v1/products/583/formats/806/download",
)
defined_for = ProvinceCode.SK
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from policyengine_canada.model_api import *


class sk_senior_supplementary_credit(Variable):
value_type = float
entity = Person
label = "Sasktachewan senior supplementary tax credit"
unit = CAD
definition_period = YEAR
reference = (
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf",
"https://publications.saskatchewan.ca/api/v1/products/583/formats/806/download",
)
defined_for = ProvinceCode.SK
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from policyengine_canada.model_api import *


class sk_transferred_from_spouse_or_common_law_partner_credit(Variable):
value_type = float
entity = Person
label = "Saskatchewan transferred from spouse or common-law partner credit"
unit = CAD
definition_period = YEAR
reference = (
"https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1sk/td1sk-23e.pdf",
"https://publications.saskatchewan.ca/api/v1/products/583/formats/806/download",
)
defined_for = ProvinceCode.SK

def formula(person, period, parameters):

age_amount = person("sk_age_amount", period)
senior_supplementary_amount = person(
"sk_senior_supplementary_credit", period
)
pension_income_amount = person("sk_pension_income_credit", period)
disability_amount = person("sk_disability_amount", period)
child_amount = person("sk_child_amount", period)
spouse = person("is_spouse", period)

spouse_used_age_amount = age_amount * (spouse == True)
spouse_used_senior_supplementary_amount = (
senior_supplementary_amount * (spouse == True)
)
spouse_used_pension_income_amount = pension_income_amount * (
spouse == True
)
spouse_used_disability_amount = disability_amount * (spouse == True)
spouse_used_child_amount = child_amount * (spouse == True)
total = (
age_amount
+ senior_supplementary_amount
+ pension_income_amount
+ disability_amount
+ child_amount
)

spouse_used_amount = (
spouse_used_age_amount
+ spouse_used_senior_supplementary_amount
+ spouse_used_pension_income_amount
+ spouse_used_disability_amount
+ spouse_used_child_amount
)

return total - spouse_used_amount