-
Couldn't load subscription status.
- Fork 201
Fix Mississippi taxable income #4329
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9dce694
fix Mississippi taxable income
Shinuing 19edca9
fix taxable income var
PavelMakarchuk 3378e22
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
Shinuing 07534bf
fix taxable income indiv
Shinuing b0e216d
fix taxable income indiv
Shinuing f2cf995
Merge branch 'MD-integration' of https://github.com/Shinuing/policyen…
Shinuing e6d3c09
Merge branch 'MD-integration' of https://github.com/Shinuing/policyen…
Shinuing f6d91c8
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
Shinuing 865dae9
separate head and spouse for ms_taxable income joint
Shinuing ceef4ff
Merge branch 'MD-integration' of https://github.com/Shinuing/policyen…
Shinuing 65e7d99
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
Shinuing 373c74b
formatting
Shinuing b7b9c61
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
Shinuing 54bb6bf
formatting
Shinuing 1e6626c
formatting
PavelMakarchuk 7e83e8f
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
PavelMakarchuk 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: | ||
| fixes: | ||
| - Mississippi taxable income. |
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
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
59 changes: 32 additions & 27 deletions
59
policyengine_us/tests/policy/baseline/gov/states/ms/tax/income/ms_taxable_income_joint.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 |
|---|---|---|
| @@ -1,40 +1,45 @@ | ||
| - name: Calculation | ||
| - name: Both head and spouse have positive taxable income | ||
| period: 2023 | ||
| input: | ||
| state_code: MS | ||
| ms_agi: 2_000 | ||
| ms_deductions_joint: 200 | ||
| ms_total_exemptions: 300 | ||
| people: | ||
| head: | ||
| ms_unadjusted_taxable_income_joint: 500 | ||
| is_tax_unit_head: true | ||
| spouse: | ||
| ms_unadjusted_taxable_income_joint: 300 | ||
| is_tax_unit_head: false | ||
| tax_units: | ||
| tax_unit: | ||
| members: [head,spouse] | ||
| spm_units: | ||
| spm_unit: | ||
| members: [head,spouse] | ||
| households: | ||
| household: | ||
| members: [head,spouse] | ||
| state_code: MS | ||
| output: | ||
| ms_taxable_income_joint: 1_500 | ||
| ms_taxable_income_joint: [500,300] | ||
|
|
||
| - name: Capped at 0 | ||
| - name: Only one of head or spouse has positive taxable income | ||
| period: 2023 | ||
| input: | ||
| state_code: MS | ||
| ms_agi: 100 | ||
| ms_deductions_joint: 200 | ||
| ms_total_exemptions: 300 | ||
| output: | ||
| ms_taxable_income_joint: 0 | ||
|
|
||
| - name: MS prorate fraction unit test 1 | ||
| period: 2021 | ||
| input: | ||
| people: | ||
| person1: | ||
| head: | ||
| ms_unadjusted_taxable_income_joint: -100 | ||
| is_tax_unit_head: true | ||
| ms_agi: 5_000 | ||
| ms_deductions_joint: 1_000 | ||
| ms_total_exemptions_joint: 1_500 | ||
| person2: | ||
| spouse: | ||
| ms_unadjusted_taxable_income_joint: 300 | ||
| is_tax_unit_head: false | ||
| ms_agi: 3_000 | ||
| ms_deductions_joint: 0 | ||
| ms_total_exemptions_joint: 0 | ||
| tax_units: | ||
| tax_unit: | ||
| members: [head,spouse] | ||
| spm_units: | ||
| spm_unit: | ||
| members: [head,spouse] | ||
| households: | ||
| household: | ||
| members: [person1, person2] | ||
| members: [head,spouse] | ||
| state_code: MS | ||
| output: | ||
| ms_taxable_income_joint: [5_500, 0] | ||
| ms_taxable_income_joint: [200,0] |
19 changes: 19 additions & 0 deletions
19
...us/tests/policy/baseline/gov/states/ms/tax/income/ms_unadjusted_taxable_income_joint.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: Positive taxable income for head or spouse | ||
| period: 2023 | ||
| input: | ||
| state_code: MS | ||
| ms_agi: 2_000 | ||
| ms_deductions_joint: 200 | ||
| ms_total_exemptions_joint: 300 | ||
| output: | ||
| ms_unadjusted_taxable_income_joint: 1_500 #2000-(200+300) | ||
|
|
||
| - name: Negative taxable income for head or spouse | ||
| period: 2023 | ||
| input: | ||
| state_code: MS | ||
| ms_agi: 100 | ||
| ms_deductions_joint: 200 | ||
| ms_total_exemptions_joint: 300 | ||
| output: | ||
| ms_unadjusted_taxable_income_joint: -400 #100-(200+300) |
File renamed without changes.
38 changes: 38 additions & 0 deletions
38
policyengine_us/variables/gov/states/ms/tax/income/taxable_income/ms_taxable_income_joint.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,38 @@ | ||
| from policyengine_us.model_api import * | ||
|
|
||
|
|
||
| class ms_taxable_income_joint(Variable): | ||
| value_type = float | ||
| entity = Person | ||
| label = "Mississippi taxable income when married couple file jointly" | ||
| unit = USD | ||
| definition_period = YEAR | ||
| reference = ( | ||
| "https://www.dor.ms.gov/sites/default/files/Forms/Individual/80100221.pdf#page=13", | ||
| "https://www.dor.ms.gov/sites/default/files/Forms/Individual/80105228.pdf", # Line 38 - 49, | ||
| ) | ||
| defined_for = StateCode.MS | ||
|
|
||
| def formula(person, period, parameters): | ||
| # MS allowes negative taxable income when married couple file jointly | ||
| ms_unadjusted_taxable_income_joint = person( | ||
| "ms_unadjusted_taxable_income_joint", period | ||
| ) | ||
| any_spouse_negative_income = person.tax_unit.any( | ||
| ms_unadjusted_taxable_income_joint < 0 | ||
| ) | ||
|
|
||
| # 1. both head and spouse have positive taxable income (includes 0) | ||
|
|
||
| # 2. at least one head or spouse has negative taxable income | ||
| # assign total net_income to tax unit head | ||
| is_head = person("is_tax_unit_head", period) | ||
|
|
||
| total_taxable_income_attributed_to_head = ( | ||
| person.tax_unit.sum(ms_unadjusted_taxable_income_joint) * is_head | ||
| ) | ||
| return where( | ||
| any_spouse_negative_income, | ||
| total_taxable_income_attributed_to_head, | ||
| ms_unadjusted_taxable_income_joint, | ||
| ) |
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
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.