diff --git a/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/reduction_rate.yaml b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/reduction_rate.yaml new file mode 100644 index 000000000..739caaa13 --- /dev/null +++ b/policyengine_canada/parameters/gov/provinces/nb/tax/income/credits/tuition_amount/reduction_rate.yaml @@ -0,0 +1,45 @@ +description: New Brunswick reduces the tuition amount by this rate. +brackets: + - threshold: + 2022-01-01: 0 + rate: + 2022-01-01: 0 + - threshold: + 2022-01-01: 44_887 + rate: + 2022-01-01: 0.094 + +metadata: + type: marginal_rate + threshold_unit: currency-CAD + rate_unit: /1 + label: New Brunswick tuition amount reduction rate + reference: + - title: New Brunswick Tuition and Education Amounts + href: https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-s11/5004-s11-22e.pdf + + +# 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 + +# 1 unused_amont +# 2 amount from line 9 of federal s 11 +# 3 1+2 +# 4 if value<=44887 line 26000(tax income) +# else (line 8 of From NB428)/0.094 +# 5 line 31 from form NB428 +# 6 max(0, (4)-(5)) +# 7 min((1),(6)) +# 8 (6)-(7) +# 9 min((2),(8)) +# 10 (7+9) +# 11 (3) +# 12 (10) +# 13 (11-12) +# if transfer: +# 14 min(5000,(2)) +# 15 (9) +# 16 max(0,(14)-(15)) +# 17 input the provincial amount +# 18 (13)-(17) +# else: +# 18 (13) diff --git a/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_amount.yaml b/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_amount.yaml new file mode 100644 index 000000000..9c966ccd0 --- /dev/null +++ b/policyengine_canada/tests/gov/provinces/nb/tax/income/credits/tuition_amount/nb_tuition_amount.yaml @@ -0,0 +1,7 @@ +- name: Over reduction amount # + period: 2022 + input: + province_code: NB + nb_taxable_income: + output: + nb_tuition_amount: \ No newline at end of file diff --git a/policyengine_canada/variables/gov/provinces/nb/tuition/nb_tuition.py b/policyengine_canada/variables/gov/provinces/nb/tuition/nb_tuition.py deleted file mode 100644 index a5c13ece8..000000000 --- a/policyengine_canada/variables/gov/provinces/nb/tuition/nb_tuition.py +++ /dev/null @@ -1,39 +0,0 @@ -from policyengine_canada.model_api import * - -# 1 2 3 4 5 6 7 8 9 10 -# 1 unused_amont -# 2 amount from line 9 of federal s 11 -# 3 1+2 -# 4 if value<=44887 line 26000 -# else (line8 in From NB428)/0.094 -# 5 line 31 from form NB428 -# 6 max(0, 4-5) -# 7 min((1),(6)) -# 8 (6-7) -# 9 min(2,8) -# 10 (7+9) -# 11 (3) -# 12 (10) -# 13 (11-12) -# if transfer: -# 14 min(5000,(2)) -# 15 (9) -# 16 max(0,(14)-(15)) -# 17 input the provincial amount -# 18 (13)-(17) -# else: -# 18 (13) - -class nb_tuition(Variable): - value_type = float - entity = Tution - label = "New Brunswick tuition amounts" - unit = CAD - definition_period = YEAR - reference = "https://www.canada.ca/en/revenue-agency/services/tax/individuals/frequently-asked-questions-individuals/canadian-income-tax-rates-individuals-current-previous-years.html" - defined_for = ProvinceCode.NB - - def formula(person, period, parameters): - income = person("nb_taxable_income", period) - p = parameters(period).gov.provinces.nb.tax.income.rate - return p.calc(income) diff --git a/policyengine_canada/variables/gov/provinces/nb/tuition_amount/nb_tuition_amount.py b/policyengine_canada/variables/gov/provinces/nb/tuition_amount/nb_tuition_amount.py new file mode 100644 index 000000000..de8b6aba5 --- /dev/null +++ b/policyengine_canada/variables/gov/provinces/nb/tuition_amount/nb_tuition_amount.py @@ -0,0 +1,15 @@ +from policyengine_canada.model_api import * + +class nb_tuition_amount(Variable): + value_type = float + entity = Person + label = "New Brunswick tuition amount" + unit = CAD + definition_period = YEAR + reference = "https://www.canada.ca/content/dam/cra-arc/formspubs/pbg/5004-s11/5004-s11-22e.pdf" + defined_for = ProvinceCode.NB + + def formula(person, period, parameters): + income = person("nb_taxable_income", period) + p = parameters(period).gov.provinces.nb.tax.income.rate + return p.calc(income)