diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..9f6c88bdb 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - New Brunswick tuition and education amount. diff --git a/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/eligible_age.yaml b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/eligible_age.yaml new file mode 100644 index 000000000..611f1e493 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/eligible_age.yaml @@ -0,0 +1,10 @@ +description: New Brunswick qualifies filers for the tuition credit above this age. +values: + 2022-01-01: 16 +metadata: + unit: year + label: New Brunswick tuition credit age eligibility + reference: + # The credit is not mentioned in the New Brunswick income tax act + - title: Students and income tax + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pub/p105/p105-22e.pdf#page=11 diff --git a/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/phase_out_rate.yaml b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/phase_out_rate.yaml new file mode 100644 index 000000000..6cdd1ded5 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/phase_out_rate.yaml @@ -0,0 +1,34 @@ +description: New Brunswick phases taxable income out for tuition amount at this rate, based on taxable income. +brackets: + - threshold: + 2022-01-01: 0 + rate: + 2022-01-01: 0.094 + - threshold: + 2022-01-01: 44_887 + rate: + 2022-01-01: 0.1482 + - threshold: + 2022-01-01: 89_775 + rate: + 2022-01-01: 0.1652 + - threshold: + 2022-01-01: 145_955 + rate: + 2022-01-01: 0.1784 + - threshold: + 2022-01-01: 166_280 + rate: + 2022-01-01: 0.203 + +metadata: + type: marginal_rate + threshold_unit: currency-CAD + rate_unit: /1 + label: New Brunswick tuition credit phase out rate + reference: + # The credit is not mentioned in the New Brunswick income tax act + - title: New Brunswick tuition and education amounts + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-s11/5004-s11-22e.pdf#page=1 + - title: New Brunswick tax and credits + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-c/5004-c-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/rate.yaml b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/rate.yaml new file mode 100644 index 000000000..b16a458fe --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/rate.yaml @@ -0,0 +1,10 @@ +description: New Brunswick divides the phased out taxable income by this rate to calculate the tuition credit. +values: + 2022-01-01: 0.094 +metadata: + unit: currency-CAD + label: New Brunswick phased out taxable income rate + reference: + # The tuition credit amount is not mentioned in the NB income tax act + - title: New Brunswick tuition and education amounts + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-s11/5004-s11-22e.pdf#page=1 diff --git a/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/tuition_threshold.yaml b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/tuition_threshold.yaml new file mode 100644 index 000000000..65994f66a --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/tuition_threshold.yaml @@ -0,0 +1,11 @@ +description: New Brunswick qualifies filers for the tuition tax credit with income above this rate. +values: + 2022-01-01: 100 +metadata: + unit: currency-CAD + period: year + label: New Brunswick tuition credit tuition threshold + reference: + # The tuition credit amount is not mentioned in the NB income tax act + - title: 2023 New Brunswick Personal Tax Credits Return + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb/td1nb-23e.pdf#page=1 diff --git a/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit.yaml b/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit.yaml new file mode 100644 index 000000000..e010454fe --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit.yaml @@ -0,0 +1,49 @@ +- name: Lowest tax on taxable income threshold + period: 2023 + absolute_error_margin: 0.01 + input: + nb_taxable_income: 44_887 + nb_tuition_credit_amount_income: 20_000 + tuition_expenses: 10_000 + output: + nb_tuition_credit: 10_000 + +- name: Second tax on taxable income threshold + period: 2023 + absolute_error_margin: 0.01 + input: + nb_taxable_income: 54_887 + nb_tuition_credit_amount_income: 20_000 + tuition_expenses: 10_000 + output: + nb_tuition_credit: 10_000 + +- name: Third tax on taxable income threshold + period: 2023 + absolute_error_margin: 0.01 + input: + nb_taxable_income: 139_775 + nb_tuition_credit_amount_income: 20_000 + tuition_expenses: 50_000 + output: + nb_tuition_credit: 50_000 + +- name: Fourth tax on taxable income threshold + period: 2023 + absolute_error_margin: 0.01 + input: + nb_taxable_income: 145_965 + nb_tuition_credit_amount_income: 100_000 + tuition_expenses: 150_000 + output: + nb_tuition_credit: 114_409.57 + +- name: Highest tax on taxable income threshold + period: 2023 + absolute_error_margin: 0.01 + input: + nb_taxable_income: 167_280 + nb_tuition_credit_amount_income: 100_000 + tuition_expenses: 160_000 + output: + nb_tuition_credit: 155_124.42 diff --git a/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_eligibility.yaml b/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_eligibility.yaml new file mode 100644 index 000000000..513910642 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_eligibility.yaml @@ -0,0 +1,35 @@ +- name: Age eligible and tuition ineligible + period: 2023 + input: + province_code: NB + age: 17 + tuition_expenses: 50 + output: + nb_tuition_credit_eligibility: false + +- name: Age eligible and tuition eligible + period: 2023 + input: + province_code: NB + age: 16 + tuition_expenses: 101 + output: + nb_tuition_credit_eligibility: true + +- name: Age ineligible and tuition eligible + period: 2023 + input: + province_code: NB + age: 10 + tuition_expenses: 200 + output: + nb_tuition_credit_eligibility: false + +- name: Age ineligible and tuition ineligible + period: 2023 + input: + province_code: NB + age: 10 + tuition_expenses: 30 + output: + nb_tuition_credit_eligibility: false diff --git a/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit.py b/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit.py new file mode 100644 index 000000000..5963742da --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit.py @@ -0,0 +1,40 @@ +from policyengine_canada.model_api import * + + +class nb_tuition_credit(Variable): + value_type = float + entity = Person + label = "New Brunswick tuition credit" + definition_period = YEAR + defined_for: "nb_tuition_credit_eligibility" + reference = ( + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-s11/5004-s11-22e.pdf#page=1", # Line 10 + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-c/5004-c-22e.pdf#page=1", # Line 8 + ) + + def formula(person, period, parameters): + age = person("age", period) + tuition = person("tuition_expenses", period) # line 2 + taxable_income = person("nb_taxable_income", period) # line 4 + tuition_income = person( + "nb_tuition_credit_amount_income", period + ) # line 5 + p = parameters( + period + ).gov.provinces.nb.tax.income.credits.tuition_amount + reduced_taxable_income = max_(taxable_income - tuition_income, 0) + phased_out_income = p.phase_out_rate.calc(taxable_income) + reduced_tax_on_taxable_income = max_( + (phased_out_income / p.rate) - tuition_income, + 0, + ) + return select( + [ + taxable_income <= p.phase_out_rate.thresholds[1], + taxable_income > p.phase_out_rate.thresholds[1], + ], + [ + min_(reduced_taxable_income, tuition), + min_(reduced_tax_on_taxable_income, tuition), + ], + ) diff --git a/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_amount_income.py b/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_amount_income.py new file mode 100644 index 000000000..b4a75c34b --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_amount_income.py @@ -0,0 +1,14 @@ +from policyengine_canada.model_api import * + + +class nb_tuition_credit_amount_income(Variable): + value_type = float + entity = Person + label = "New Brunswick income pre tax income for tuition credit amount" + unit = CAD + definition_period = YEAR + reference = ( + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-c/5004-c-22e.pdf#page=2", # Line 31 + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-s11/5004-s11-22e.pdf#page=1", # Line 5 + ) + defined_for = ProvinceCode.NB diff --git a/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_eligibility.py b/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_eligibility.py new file mode 100644 index 000000000..dd8bff44f --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_credit_eligibility.py @@ -0,0 +1,21 @@ +from policyengine_canada.model_api import * + + +class nb_tuition_credit_eligibility(Variable): + value_type = bool + entity = Person + label = "Eligible for the New Brunswick tuition credit" + definition_period = YEAR + reference = ( + "https://www.canada.ca/content/dam/cra-arc/formspubs/pub/p105/p105-22e.pdf#page=11", # Tuition Amount + "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/td1nb/td1nb-23e.pdf#page=1", # Line 4 + ) + defined_for = ProvinceCode.NB + + def formula(person, period, parameters): + p = parameters( + period + ).gov.provinces.nb.tax.income.credits.tuition_amount + age = person("age", period) + tuition = person("tuition_expenses", period) + return (age >= p.eligible_age) & (tuition >= p.tuition_threshold)