Skip to content

Commit

Permalink
Merge pull request #61 from taxpat/salt
Browse files Browse the repository at this point in the history
Merging
  • Loading branch information
rickecon authored Oct 13, 2023
2 parents 4a96442 + fea2bdb commit 66c48e7
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 64 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.3] - 2023-10-13 16:00:00

### Added

- added three files `prior_year_state_income_tax_paid.py`, `prior_year_local_income_tax_paid.py`, and `sales_or_prior_year_state_and_local_income_tax.py`
- adjusted `salt_deduction.py` to calculate based on the added variables above

## [0.2.2] - 2023-10-13 03:30:00

### Added
Expand Down Expand Up @@ -164,6 +171,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- First prototype version based off of openfisca-us and tax-calculator.


[0.2.3]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.2...v0.2.3
[0.2.2]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.1...v0.2.2
[0.2.1]: https://github.com/TheCGO/fiscalsim-us/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/TheCGO/fiscalsim-us/compare/v0.1.5...v0.2.0
Expand Down
6 changes: 6 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,9 @@
added:
- Updates files from PolicyEngine-US v0.500.0 (e4a95733baafca0a7bec9ae79e96797416a4d237)
date: 2023-10-13 03:30:00
- bump: patch
changes:
added:
- adjusted `salt_deduction.py` to calculate based on the added variables
- Adds three files `prior_year_state_income_tax_paid.py`, `prior_year_local_income_tax_paid.py`, and `sales_or_prior_year_state_and_local_income_tax.py`
date: 2023-10-13 16:00:00
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ values:
- qualified_business_income_deduction
metadata:
unit: variable
name: taxable_income_deductions_if_itemizing
label: Taxable income deductions if itemizing
name: taxable_income_deductions_if_not_itemizing
label: Taxable income deductions if not itemizing
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
state_income_tax: 4_576.44
adjusted_gross_income: 100_000
taxable_income_deductions_if_not_itemizing: 12_550
taxable_income_deductions_if_itemizing: 8_000 + 10_000
taxable_income_deductions_if_itemizing: 8_000 + 6_000
tax_unit_itemizes: true
taxable_income: 100_000 - 18_000
taxable_income: 100_000 - 14_000
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
tax_unit:
members: [person1, person2]
interest_deduction: 17_000
state_and_local_sales_or_income_tax: 8_000
statelocal_sales_or_prior_inctax: 8_000
households:
household:
members: [person1, person2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
tax_unit:
members: [person1, person2]
interest_deduction: 17_000
state_and_local_sales_or_income_tax: 8_000
statelocal_sales_or_prior_inctax: 8_000
households:
household:
members: [person1, person2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
tax_unit:
members: [person1, person2]
interest_deduction: 17_000
state_and_local_sales_or_income_tax: 8_000
statelocal_sales_or_prior_inctax: 8_000
households:
household:
members: [person1, person2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
input:
filing_status: SINGLE
tax_unit_itemizes: True
state_and_local_sales_or_income_tax: 5_000
statelocal_sales_or_prior_inctax: 5_000
real_estate_taxes: 7_500
standard_deduction: 5_000
state_code: NM
Expand All @@ -17,7 +17,7 @@
input:
filing_status: SINGLE
tax_unit_itemizes: True
state_and_local_sales_or_income_tax: 5_000
statelocal_sales_or_prior_inctax: 5_000
real_estate_taxes: 0
standard_deduction: 2_000
state_code: NM
Expand All @@ -30,7 +30,7 @@
input:
filing_status: SEPARATE
tax_unit_itemizes: True
state_and_local_sales_or_income_tax: 7_500
statelocal_sales_or_prior_inctax: 7_500
real_estate_taxes: 0
standard_deduction: 2_000
state_code: NM
Expand All @@ -43,7 +43,7 @@
input:
filing_status: SINGLE
tax_unit_itemizes: True
state_and_local_sales_or_income_tax: 0
statelocal_sales_or_prior_inctax: 0
real_estate_taxes: 0
standard_deduction: 2_000
state_code: NM
Expand All @@ -56,7 +56,7 @@
input:
filing_status: SINGLE
tax_unit_itemizes: False
state_and_local_sales_or_income_tax: 7_500
statelocal_sales_or_prior_inctax: 7_500
real_estate_taxes: 0
standard_deduction: 2_000
state_code: NM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
casualty_loss_deduction: 0
standard_deduction: 4_000
real_estate_taxes: 3_000
state_and_local_sales_or_income_tax: 1_000
statelocal_sales_or_prior_inctax: 1_000
state_code: SC
output:
sc_state_tax_addback: 1_000
# line 3 = 2000 - 0 = 2000
# line 4 = 1000
# line 5 = 5000 - 3000 = 2000

- name: Test case 2 #salt has a cap of 10000 for JOINT
period: 2021
input:
Expand All @@ -28,11 +28,11 @@
casualty_loss_deduction: 0
standard_deduction: 4_000
real_estate_taxes: 3_000
state_and_local_sales_or_income_tax: 1_000
statelocal_sales_or_prior_inctax: 1_000
state_code: SC
output:
sc_state_tax_addback: 0
# line 3 = 2000 - 4000 = 0
# line 3 = 2000 - 4000 = 0
# line 4 = 1000
# line 5 = 10000 - 3000 = 7000

Expand All @@ -47,14 +47,14 @@
casualty_loss_deduction: 0
standard_deduction: 1_000
real_estate_taxes: 8_000
state_and_local_sales_or_income_tax: 6_000
statelocal_sales_or_prior_inctax: 6_000
state_code: SC
output:
sc_state_tax_addback: 2_000
# line 3 = 4000 - 1000 = 3000
# line 3 = 4000 - 1000 = 3000
# line 4 = 6000
# line 5 = 10000 - 8000 = 2000

- name: Test case 4 #salt has a cap of 10000 for JOINT
period: 2021
input:
Expand All @@ -66,11 +66,11 @@
casualty_loss_deduction: 0
standard_deduction: 4_000
real_estate_taxes: 3_000
state_and_local_sales_or_income_tax: 1_000
statelocal_sales_or_prior_inctax: 1_000
state_code: SC
output:
sc_state_tax_addback: 0
# line 3 = 2000 - 4000 = 0
# line 3 = 2000 - 4000 = 0
# line 4 = 1000
# line 5 = 10000 - 3000 = 7000

Expand All @@ -85,7 +85,7 @@
casualty_loss_deduction: 0
standard_deduction: 1_000
real_estate_taxes: 8_000
state_and_local_sales_or_income_tax: 6_000
statelocal_sales_or_prior_inctax: 6_000
state_code: SC
output:
sc_state_tax_addback: 0
Expand Down
9 changes: 9 additions & 0 deletions fiscalsim_us/variables/gov/irs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# IRS

## State and local tax (SALT) Deduction

The SALT deduction previously created a circularity with some states' tax logic because itemizing federal filers can deduct current-year prepayments of state and local income tax liability (if greater than state and local sales tax liability) in the state and local tax deduction on the federal form. However, that current state and local income tax liability is simultaneously calculated and in some states requires the value of federal taxable income, which includes (subtracts) the SALT deduction. This creates a circularity in the tax logic that FiscalSim-US is not able to handle at this point.

To be clear, the tax logic correctly includes this circularity. However, our solution is to write the code in the way that most filers use the SALT deduction, excluding the case in which filers deduct current-year state and local income tax liability. We created two new variables--`prior_year_state_income_tax_paid` and `prior_year_local_income_tax_paid`--and used those variables in the calculation of `statelocal_sales_or_prior_inctax`, which in turn goes into the `salt_deduction` variable calculation. In other words, the SALT deduction calculation in FiscalSim-US only allows for deducting prior year state and local income taxes.

There is a workaround for capturing the effect of those who include their current-year paid state and local income taxes in their SALT deduction. Because the variables `prior_year_state_income_tax_paid` and `prior_year_local_income_tax_paid` are just household tax unit variables, a user can just increase those amounts to whatever level of total state and local income taxes paid go into the SALT deduction calculation.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ class salt_deduction(Variable):
entity = TaxUnit
label = "SALT deduction"
unit = USD
documentation = "State and local taxes plus real estate tax deduction from taxable income."
documentation = "State and local taxes paid plus real estate tax deduction from taxable income."
definition_period = YEAR
reference = "https://www.law.cornell.edu/uscode/text/26/164"

def formula(tax_unit, period, parameters):
salt_amount = add(
tax_unit,
period,
["state_and_local_sales_or_income_tax", "real_estate_taxes"],
[
"statelocal_sales_or_prior_inctax",
"real_estate_taxes",
],
)
salt = parameters(
period
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def formula(tax_unit, period, parameters):

# tax/income, federal Schedule A, line 5a. 1
salt_sales_or_income = tax_unit(
"state_and_local_sales_or_income_tax", period
"statelocal_sales_or_prior_inctax", period
)
# state_and_local_tax, line 5d. 2
total_salt = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def formula(tax_unit, period, parameters):
0, federal_itemized_deduction - federal_standard_deduction
)
# line 4
salt = tax_unit("state_and_local_sales_or_income_tax", period)
salt = tax_unit("statelocal_sales_or_prior_inctax", period)
# line 5
real_estate_and_property_taxes = add(
tax_unit, period, ["real_estate_taxes"]
Expand Down
26 changes: 13 additions & 13 deletions fiscalsim_us/variables/gov/states/tax/income/state_income_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@ class state_income_tax(Variable):
# state income tax variables listed in alphabetical order:
"ca_income_tax",
# "co_income_tax", --- activating will cause circular logic errors
# "dc_income_tax", --- activating will cause circular logic errors
# "ia_income_tax", --- activating will cause circular logic errors
"dc_income_tax",
"ia_income_tax",
"il_income_tax",
"in_income_tax",
"ks_income_tax",
"ky_income_tax",
# "la_income_tax", --- activating will cause circular logic errors
# "ma_income_tax", --- activating will cause circular logic errors
# "md_income_tax", --- activating will cause circular logic errors
# "me_income_tax", --- activating will cause circular logic errors
"la_income_tax",
"ma_income_tax",
"md_income_tax",
"me_income_tax",
"mn_income_tax",
"mt_income_tax",
# "mo_income_tax", --- activating will cause circular logic errors
"nc_income_tax",
# "nd_income_tax", --- activating will cause circular logic errors
# "ne_income_tax", --- activating will cause circular logic errors
"nd_income_tax",
"ne_income_tax",
"nh_income_tax",
"nj_income_tax",
# "nm_income_tax", --- activating will cause circular logic errors
# "ny_income_tax", --- activating will cause circular logic errors
# "ok_income_tax", --- activating will cause circular logic errors
# "or_income_tax", --- activating will cause circular logic errors
"nm_income_tax",
"ny_income_tax",
"ok_income_tax",
"or_income_tax",
"pa_income_tax",
"ri_income_tax",
# "va_income_tax", --- temporarily deactivated until change if to where
# "ut_income_tax", --- temporarily deactivated until change if to where
"ut_income_tax",
"wa_income_tax",
"wi_income_tax",
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from fiscalsim_us.model_api import *


class prior_year_local_income_tax_paid(Variable):
value_type = float
entity = Person
label = "Prior year local income taxes paid"
unit = USD
definition_period = YEAR
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from fiscalsim_us.model_api import *


class prior_year_state_income_tax_paid(Variable):
value_type = float
entity = Person
label = "Prior year state income taxes paid"
unit = USD
definition_period = YEAR
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from fiscalsim_us.model_api import *


class statelocal_sales_or_prior_inctax(Variable):
value_type = float
entity = TaxUnit
definition_period = YEAR
label = "Prior year state and local income taxes paid or state and local sales taxes paid"
unit = USD

def formula(tax_unit, period, parameters):
# Only sales or income tax can be itemized, but not both.
prior_year_statelocal_inctax = add(
tax_unit,
period,
[
"prior_year_state_income_tax_paid",
"prior_year_local_income_tax_paid",
],
)
sales_tax = add(
tax_unit, period, ["state_sales_tax", "local_sales_tax"]
)
return max_(prior_year_statelocal_inctax, sales_tax)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="fiscalsim-us",
version="0.2.2",
version="0.2.3",
author="Center for Growth and Opportunity at Utah State University (CGO)",
author_email="fiscalsim@thecgo.org",
long_description=readme,
Expand Down

0 comments on commit 66c48e7

Please sign in to comment.