-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
125 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...parameters/gov/territories/pr/tax/income/credits/earned_income/max_investment_income.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...gine_us/parameters/gov/territories/pr/tax/income/credits/earned_income/phase_in_rate.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...e/gov/territories/pr/tax/income/credits/earned_income/pr_earned_income_credit_amount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
- name: Not eligible person, 2024 | ||
period: 2024 | ||
input: | ||
pr_gross_income_person: 10_000 | ||
pr_earned_income_credit_eligible: false | ||
output: | ||
pr_earned_income_credit_amount: 0 | ||
|
||
- name: Eligible person in the highest bracket, 2024 | ||
period: 2024 | ||
input: | ||
pr_gross_income_person: 35_000 | ||
pr_earned_income_credit_eligible: true | ||
output: | ||
pr_earned_income_credit_amount: 100 | ||
|
||
- name: Eligible person in the middle bracket, 2024 | ||
period: 2024 | ||
input: | ||
pr_gross_income_person: 34_000 | ||
pr_earned_income_credit_eligible: true | ||
output: | ||
pr_earned_income_credit_amount: 120 | ||
|
||
- name: Eligible person with max credit, 2024 | ||
period: 2024 | ||
input: | ||
pr_gross_income_person: 10_000 | ||
pr_earned_income_credit_eligible: true | ||
output: | ||
pr_earned_income_credit_amount: 600 | ||
|
||
- name: Eligible person in the lower bracket, 2024 | ||
period: 2024 | ||
input: | ||
pr_gross_income_person: 8_000 | ||
pr_earned_income_credit_eligible: true | ||
output: | ||
pr_earned_income_credit_amount: 480 | ||
|
||
- name: Eligible person in the lower bracket, 2011 | ||
period: 2011 | ||
input: | ||
pr_gross_income_person: 8_000 | ||
pr_earned_income_credit_eligible: true | ||
output: | ||
pr_earned_income_credit_amount: 320 |
23 changes: 23 additions & 0 deletions
23
...gov/territories/pr/tax/income/credits/earned_income/pr_earned_income_credit_eligible.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
- name: Dependent | ||
period: 2024 | ||
input: | ||
is_tax_unit_head_or_spouse: true | ||
pr_earned_income_credit_investment_income: 2_000 | ||
output: | ||
pr_earned_income_credit_eligible: false | ||
|
||
- name: Investment income over the limit | ||
period: 2024 | ||
input: | ||
is_tax_unit_head_or_spouse: false | ||
pr_earned_income_credit_investment_income: 2_201 | ||
output: | ||
pr_earned_income_credit_eligible: false | ||
|
||
- name: Eligible person | ||
period: 2024 | ||
input: | ||
is_tax_unit_head_or_spouse: true | ||
pr_earned_income_credit_investment_income: 2_200 | ||
output: | ||
pr_earned_income_credit_eligible: true |
Empty file.
28 changes: 8 additions & 20 deletions
28
...les/gov/territories/pr/tax/income/credits/earned_income/pr_earned_income_credit_amount.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,22 @@ | ||
from policyengine_us.model_api import * | ||
|
||
class pr_low_income_credit(Variable): | ||
class pr_earned_income_credit_amount(Variable): | ||
value_type = float | ||
entity = Person | ||
label = "Puerto Rico earned income credit" | ||
label = "Puerto Rico earned income credit amount" | ||
unit = USD | ||
definition_period = YEAR | ||
reference = "" | ||
reference = "https://casetext.com/statute/laws-of-puerto-rico/title-thirteen-taxation-and-finance/subtitle-17-internal-revenue-code-of-2011/part-ii-income-taxes/chapter-1007-credits-against-tax/subchapter-b-refundable-credits/30211-earned-income-credit" | ||
defined_for = "pr_earned_income_credit_eligible" | ||
|
||
def formula(tax_unit, period, parameters): | ||
p = parameters( | ||
period | ||
).gov.territories.pr.tax.income.credits.earned_income | ||
|
||
# workflow: | ||
# Calculate credit amount pre phase out | ||
# Income * phase_in_rate capped at max_credit | ||
# Calculate the phase_out | ||
# p.phase_out_rate.calc(income) | ||
# Calculate final value | ||
# credit - phase_out | ||
earned_gross_income = 10_000 # PLACEHOLDER for earned gross income, person level | ||
gross_income = person("pr_gross_income_person", period) | ||
# if in the lower bracket: gross_income * rate. if higher, use max credit | ||
phase_in = min(gross_income * p.phase_in_rate, p.max_amount) | ||
phase_out = p.phase_out_rate.calc(gross_income) | ||
|
||
# calculate phase in | ||
# what does p.phase_out_amount.threshold return? which threshold? | ||
upper_threshold = p.phase_out_amount.threshold[] | ||
# if gross income > upper threshold, calculate [bottom threshold * phase_in] - [(upper - bottom threshold) * phase_out] | ||
# if gross income > lower threshold, calculate [bottom threshold (i.e. 10k) * phase_in] - [(income - bottom threshold) * phase_out] | ||
# ELSE, calculate income * phase_in_rate | ||
|
||
|
||
return False | ||
return phase_in - phase_out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ritories/pr/tax/income/credits/earned_income/pr_earned_income_credit_investment_income.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from policyengine_us.model_api import * | ||
|
||
class pr_earned_income_credit_investment_income(Variable): | ||
value_type = float | ||
entity = Person | ||
label = "Puerto Rico earned income credit investment income" | ||
definition_period = YEAR | ||
reference = "https://casetext.com/statute/laws-of-puerto-rico/title-thirteen-taxation-and-finance/subtitle-17-internal-revenue-code-of-2011/part-ii-income-taxes/chapter-1007-credits-against-tax/subchapter-b-refundable-credits/30211-earned-income-credit" | ||
|
||
def formula(person, period, parameters): | ||
p = parameters( | ||
period | ||
).gov.territories.pr.tax.income.credits.earned_income | ||
# sum up all defined categories for investment income | ||
adds = "gov.territories.pr.tax.income.credits.earned_income.ineligible_income_categories" | ||
return adds |
10 changes: 10 additions & 0 deletions
10
policyengine_us/variables/gov/territories/pr/tax/income/pr_gross_income_person_level.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from policyengine_us.model_api import * | ||
|
||
|
||
class pr_gross_income(Variable): | ||
value_type = float | ||
entity = Person | ||
label = "Puerto Rico gross income person level" | ||
unit = USD | ||
definition_period = YEAR | ||
reference = "https://casetext.com/statute/laws-of-puerto-rico/title-thirteen-taxation-and-finance/subtitle-17-internal-revenue-code-of-2011/part-ii-income-taxes/chapter-1005-computation-of-taxable-income/subchapter-a-determination-of-net-income-general-concepts/30101-gross-income" |