-
Notifications
You must be signed in to change notification settings - Fork 201
Puerto Rico regular tax before credits #6633
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
Open
llennemann
wants to merge
7
commits into
PolicyEngine:master
Choose a base branch
from
llennemann:regularTaxPreCredit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5457ce3
Gradual adjustment calculation and tests
llennemann 64dd824
Format and changelog
llennemann 0ad625a
Regular tax before credits computation
llennemann 48886de
Merge gradual adjustment into tax pre credit
llennemann 812c183
Combined with gradual adjustment, language changes
llennemann 72ded8f
Add legal reference to percentage parameter
llennemann 28dbaac
Variable change and format
llennemann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,4 @@ | ||
| - bump: minor | ||
| changes: | ||
| added: | ||
| - Puerto Rico regular tax before credits and gradual adjustment. |
12 changes: 12 additions & 0 deletions
12
...s/parameters/gov/territories/pr/tax/income/gradual_adjustment/adjustment_limit_basis.yaml
This file contains hidden or 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,12 @@ | ||
| description: Puerto Rico provides the following basis amount for the gradual adjustment limit. | ||
| values: | ||
| 2024-01-01: 8_895 | ||
| metadata: | ||
| unit: currency-USD | ||
| period: year | ||
| label: Puerto Rico gradual adjustment limit basis | ||
| reference: | ||
| - title: Gov. of Puerto Rico Form 482.0 2024 | ||
| href: https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=52 | ||
| - title: P.R. Laws tit. 13, § 30061 (b)(5)(e) | ||
| href: https://bvirtualogp.pr.gov/ogp/Bvirtual/leyesreferencia/PDF/2-ingles/1-2011.pdf#page=32 |
13 changes: 13 additions & 0 deletions
13
...engine_us/parameters/gov/territories/pr/tax/income/gradual_adjustment/exemption_rate.yaml
This file contains hidden or 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,13 @@ | ||
| description: Puerto Rico provides the following rate to reduce the total exemptions when calculating the gradual adjustment limit. | ||
| values: | ||
| 2024-01-01: 0.33 | ||
| metadata: | ||
| unit: /1 | ||
| period: year | ||
| label: Puerto Rico gradual adjustment rate for exemptions | ||
| # discrepancy between legal form and tax form for the exemptions rate | ||
| reference: | ||
| - title: Gov. of Puerto Rico Form 482.0 2024 | ||
| href: https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=52 | ||
| - title: P.R. Laws tit. 13, § 30061 (b)(5)(c) | ||
| href: https://law.justia.com/codes/puerto-rico/title-thirteen/subtitle-17/part-ii/chapter-1004/subchapter-a/30061/ |
12 changes: 12 additions & 0 deletions
12
policyengine_us/parameters/gov/territories/pr/tax/income/gradual_adjustment/rate.yaml
This file contains hidden or 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,12 @@ | ||
| description: Puerto Rico provides the following rate to reduce the taxable net income when calculating gradual adjustment. | ||
| values: | ||
| 2024-01-01: 0.05 | ||
| metadata: | ||
| unit: /1 | ||
| period: year | ||
| label: Puerto Rico gradual adjustment rate for taxable net income | ||
| reference: | ||
| - title: Gov. of Puerto Rico Form 482.0 2024 | ||
| href: https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=52 | ||
| - title: P.R. Laws tit. 13, § 30061 (b)(1)-(4) | ||
| href: https://law.justia.com/codes/puerto-rico/title-thirteen/subtitle-17/part-ii/chapter-1004/subchapter-a/30061/ |
13 changes: 13 additions & 0 deletions
13
policyengine_us/parameters/gov/territories/pr/tax/income/gradual_adjustment/threshold.yaml
This file contains hidden or 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,13 @@ | ||
| description: Puerto Rico provides the following income amount as a threshold for the gradual adjustment amount. | ||
| values: | ||
| 2024-01-01: 500_000 | ||
| metadata: | ||
| unit: currency-USD | ||
| period: year | ||
| label: Puerto Rico gradual adjustment amount income threshold | ||
| # discrepancy between legal form and tax form for the income threshold | ||
| reference: | ||
| - title: Gov. of Puerto Rico Form 482.0 2024 | ||
| href: https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=52 | ||
| - title: P.R. Laws tit. 13, § 30061 (b)(4)) | ||
| href: https://law.justia.com/codes/puerto-rico/title-thirteen/subtitle-17/part-ii/chapter-1004/subchapter-a/30061/ |
21 changes: 21 additions & 0 deletions
21
policyengine_us/parameters/gov/territories/pr/tax/income/regular_tax/percentage.yaml
This file contains hidden or 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,21 @@ | ||
| description: Puerto Rico taxes this percentage of total normal taxes, based on gross income. | ||
| brackets: | ||
| - threshold: | ||
| 2024-01-01: 0 | ||
| amount: | ||
| 2024-01-01: 0.92 | ||
| - threshold: | ||
| 2024-01-01: 100_001 | ||
| amount: | ||
| 2024-01-01: 0.95 | ||
| metadata: | ||
| amount_unit: /1 | ||
| threshold_unit: currency-USD | ||
| type: single_amount | ||
| label: Puerto Rico regular tax percentage | ||
| period: year | ||
| reference: | ||
| - title: Gov. of Puerto Rico Form 482.0 2024 | ||
| href: https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=3 | ||
| - title: P.R. Laws tit. 13, § 30061 (c) | ||
| href: https://bvirtualogp.pr.gov/ogp/Bvirtual/leyesreferencia/PDF/2-ingles/1-2011.pdf#page=33 |
29 changes: 29 additions & 0 deletions
29
...seline/gov/territories/pr/tax/income/gradual_adjustment/pr_gradual_adjustment_amount.yaml
This file contains hidden or 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,29 @@ | ||
| - name: Not eligible, income below threshold | ||
| period: 2024 | ||
| input: | ||
| pr_gradual_adjustment_eligibility: False | ||
| pr_net_taxable_income: 70_000 | ||
| pr_exemptions: 4_000 | ||
| state_code: PR | ||
| output: | ||
| pr_gradual_adjustment_amount: 0 | ||
|
|
||
| - name: Amount lower than limit | ||
| period: 2024 | ||
| input: | ||
| pr_gradual_adjustment_eligibility: True | ||
| pr_net_taxable_income: 501_000 | ||
| pr_exemptions: 1_300 | ||
| state_code: PR | ||
| output: | ||
| pr_gradual_adjustment_amount: 50 | ||
|
|
||
| - name: Limit lower than amount | ||
| period: 2024 | ||
| input: | ||
| pr_gradual_adjustment_eligibility: True | ||
| pr_net_taxable_income: 700_000 | ||
| pr_exemptions: 1_000 | ||
| state_code: PR | ||
| output: | ||
| pr_gradual_adjustment_amount: 9_225 |
15 changes: 15 additions & 0 deletions
15
...e/gov/territories/pr/tax/income/gradual_adjustment/pr_gradual_adjustment_eligibility.yaml
This file contains hidden or 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,15 @@ | ||
| - name: Not eligible | ||
| period: 2024 | ||
| input: | ||
| pr_net_taxable_income: 500_000 | ||
| state_code: PR | ||
| output: | ||
| pr_gradual_adjustment_eligibility: False | ||
|
|
||
| - name: Eligible | ||
| period: 2024 | ||
| input: | ||
| pr_net_taxable_income: 500_001 | ||
| state_code: PR | ||
| output: | ||
| pr_gradual_adjustment_eligibility: True |
19 changes: 19 additions & 0 deletions
19
...yengine_us/tests/policy/baseline/gov/territories/pr/tax/income/pr_tax_before_credits.yaml
This file contains hidden or 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,19 @@ | ||
| - name: Lower bracket | ||
| period: 2024 | ||
| input: | ||
| state_code: PR | ||
| pr_gross_income: 100_000 | ||
| pr_normal_tax: 2_000 | ||
| pr_gradual_adjustment_amount: 0 | ||
| output: | ||
| pr_regular_tax_before_credits: 1_840 | ||
|
|
||
| - name: Upper bracket | ||
| period: 2024 | ||
| input: | ||
| state_code: PR | ||
| pr_gross_income: 100_001 | ||
| pr_normal_tax: 1_000 | ||
| pr_gradual_adjustment_amount: 500 | ||
| output: | ||
| pr_regular_tax_before_credits: 1_425 |
23 changes: 23 additions & 0 deletions
23
...ariables/gov/territories/pr/tax/income/gradual_adjustment/pr_gradual_adjustment_amount.py
This file contains hidden or 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 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class pr_gradual_adjustment_amount(Variable): | ||
| value_type = float | ||
| entity = TaxUnit | ||
| label = "Puerto Rico gradual adjustment amount" | ||
| documentation = ( | ||
| "An additional amount added to tax amount for high income filers." | ||
| ) | ||
| unit = USD | ||
| definition_period = YEAR | ||
| defined_for = "pr_gradual_adjustment_eligibility" | ||
| reference = "https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=3" | ||
|
|
||
| def formula(tax_unit, period, parameters): | ||
| p = parameters(period).gov.territories.pr.tax.income.gradual_adjustment | ||
| net_taxable_income = tax_unit("pr_net_taxable_income", period) | ||
| amount = (net_taxable_income - p.threshold) * p.rate | ||
| exemptions = tax_unit("pr_exemptions", period) | ||
| limit = p.adjustment_limit_basis + p.exemption_rate * exemptions | ||
|
|
||
| return min_(amount, limit) |
17 changes: 17 additions & 0 deletions
17
...les/gov/territories/pr/tax/income/gradual_adjustment/pr_gradual_adjustment_eligibility.py
This file contains hidden or 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,17 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class pr_gradual_adjustment_eligibility(Variable): | ||
| value_type = float | ||
| entity = TaxUnit | ||
| label = "Puerto Rico gradual adjustment eligibility" | ||
| unit = USD | ||
| definition_period = YEAR | ||
| defined_for = StateCode.PR | ||
| reference = "https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=3" | ||
|
|
||
| def formula(tax_unit, period, parameters): | ||
| p = parameters(period).gov.territories.pr.tax.income.gradual_adjustment | ||
| net_taxable_income = tax_unit("pr_net_taxable_income", period) | ||
|
|
||
| return net_taxable_income > p.threshold |
11 changes: 11 additions & 0 deletions
11
policyengine_us/variables/gov/territories/pr/tax/income/pr_normal_tax.py
hua7450 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,11 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class pr_normal_tax(Variable): | ||
| value_type = float | ||
| entity = TaxUnit | ||
| label = "Puerto Rico normal tax" | ||
| unit = USD | ||
| definition_period = YEAR | ||
| defined_for = StateCode.PR | ||
| reference = "https://law.justia.com/codes/puerto-rico/title-thirteen/subtitle-17/part-ii/chapter-1004/subchapter-a/30061/" |
20 changes: 20 additions & 0 deletions
20
policyengine_us/variables/gov/territories/pr/tax/income/pr_regular_tax_before_credits.py
This file contains hidden or 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,20 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class pr_regular_tax_before_credits(Variable): | ||
| value_type = float | ||
| entity = TaxUnit | ||
| label = "Puerto Rico regular tax before credits" | ||
| unit = USD | ||
| definition_period = YEAR | ||
| defined_for = StateCode.PR | ||
| reference = "https://hacienda.pr.gov/sites/default/files/inst_individuals_2023.pdf#page=19" | ||
|
|
||
| def formula(tax_unit, period, parameters): | ||
| p = parameters(period).gov.territories.pr.tax.income.regular_tax | ||
| gross_income = tax_unit("pr_gross_income", period) | ||
| total_normal_tax = add( | ||
| tax_unit, period, ["pr_normal_tax", "pr_gradual_adjustment_amount"] | ||
| ) | ||
|
|
||
| return total_normal_tax * p.percentage.calc(gross_income) |
12 changes: 12 additions & 0 deletions
12
...ine_us/variables/gov/territories/pr/tax/income/taxable_income/exemptions/pr_exemptions.py
This file contains hidden or 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,12 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class pr_exemptions(Variable): | ||
| value_type = float | ||
| entity = TaxUnit | ||
| label = "Puerto Rico exemptions" | ||
| definition_period = YEAR | ||
| unit = USD | ||
| reference = "https://law.justia.com/codes/puerto-rico/title-thirteen/subtitle-17/part-ii/chapter-1005/subchapter-c/30138/" | ||
|
|
||
| adds = "gov.territories.pr.tax.income.taxable_income.exemptions.sources" |
10 changes: 10 additions & 0 deletions
10
...engine_us/variables/gov/territories/pr/tax/income/taxable_income/pr_net_taxable_income.py
This file contains hidden or 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_net_taxable_income(Variable): | ||
| value_type = float | ||
| entity = TaxUnit | ||
| label = "Puerto Rico net taxable income" | ||
| reference = "https://hacienda.pr.gov/sites/default/files/individuals_2024_rev._jul_12_24_9-30-24_informative.pdf#page=2" | ||
| unit = USD | ||
| definition_period = YEAR |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.