Skip to content

Commit

Permalink
add parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelMakarchuk committed Apr 1, 2024
1 parent a79387f commit 5583ceb
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
description: Virginia sums up the following deductions to compute the itemized deductions reduction amount.
values:
2013-01-01:
- medical_expense_deduction
- salt_deduction
- interest_deduction
- charitable_deduction
- casualty_loss_deduction
metadata:
unit: list
period: year
label: Virginia itemized deductions reduction applicable deduction sources
reference:
- title: 2020 Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2020/schedule-and-instructions-2020.pdf#page=1
- title: 2021 Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/schedule-2021.pdf#page=2
- title: 2022 Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2022/schedule-2022.pdf#page=2
- title: 2019 Instructions for Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/vatax-pdf/2019-schedule-a-instructions.pdf#page=2
- title: 2013 Instruction 1040 Schedule A
href: https://www.irs.gov/pub/irs-prior/i1040sca--2013.pdf#page=14
- title: 2014 Instruction 1040 Schedule A
href: https://www.irs.gov/pub/irs-prior/i1040sca--2014.pdf#page=13
- title: 2015 Instruction 1040 Schedule A
href: https://www.irs.gov/pub/irs-prior/i1040sca--2015.pdf#page=13
- title: 2016 Instructions for Schedule A (Form 1040)
href: https://www.irs.gov/pub/irs-prior/i1040sca--2016.pdf#page=13
- title: 2017 Instructions for Schedule A (Form 1040)
href: https://www.irs.gov/pub/irs-prior/i1040sca--2017.pdf#page=14
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
description: Virginia reduced the applicable itemized deductions by the following deductions to compute the itemized deductions reduction amount.
values:
2013-01-01:
- medical_expense_deduction
- investment_interest_expense
- gambling_losses
- casualty_loss_deduction
metadata:
unit: list
period: year
label: Virginia itemized deductions reduction reducible deduction sources
reference:
- title: 2020 Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2020/schedule-and-instructions-2020.pdf#page=1
- title: 2021 Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2021/schedule-2021.pdf#page=2
- title: 2022 Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/taxforms/individual-income-tax/2022/schedule-2022.pdf#page=2
- title: 2019 Instructions for Virginia Schedule A Itemized Deductions
href: https://www.tax.virginia.gov/sites/default/files/vatax-pdf/2019-schedule-a-instructions.pdf#page=2
- title: 2013 Instruction 1040 Schedule A
href: https://www.irs.gov/pub/irs-prior/i1040sca--2013.pdf#page=14
- title: 2014 Instruction 1040 Schedule A
href: https://www.irs.gov/pub/irs-prior/i1040sca--2014.pdf#page=13
- title: 2015 Instruction 1040 Schedule A
href: https://www.irs.gov/pub/irs-prior/i1040sca--2015.pdf#page=13
- title: 2016 Instructions for Schedule A (Form 1040)
href: https://www.irs.gov/pub/irs-prior/i1040sca--2016.pdf#page=13
- title: 2017 Instructions for Schedule A (Form 1040)
href: https://www.irs.gov/pub/irs-prior/i1040sca--2017.pdf#page=14
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ class va_reduced_itemized_deductions(Variable):
defined_for = StateCode.VA

def formula(tax_unit, period, parameters):
# The federal limitation on itemized deductions does not apply during the TCJA period
# Virginia still applies the limitation
year = period.start.year
if year >= 2018 and year <= 2026:
instant_str = f"2017-01-01"
else:
instant_str = period
p_va = parameters(period).gov.states.va.tax.income.deductions.itemized

uncapped_state_and_local_tax = tax_unit(
Expand All @@ -31,29 +24,25 @@ def formula(tax_unit, period, parameters):
applicable_ded = add(
tax_unit,
period,
[
"medical_expense_deduction",
"salt_deduction",
"interest_deduction",
"charitable_deduction",
"casualty_loss_deduction",
],
p_va.reduction.applicable,
)
# Line 2 medical expense ded., interest ded., casualty loss ded., and gambling losses
reducible_ded = add(
tax_unit,
period,
[
"medical_expense_deduction",
"investment_interest_expense",
"casualty_loss_deduction",
"gambling_losses",
],
p_va.reduction.reducible,
)
# Line 3 - subtract Line 2 from line 1
excess_ded = max_(applicable_ded - reducible_ded, 0)
# If 0 - no reduction
# Line 4 - IRS deduction rate of excess
# The federal limitation on itemized deductions does not apply during the TCJA period
# Virginia still applies the limitation
year = period.start.year
if year >= 2018 and year <= 2026:
instant_str = f"2017-01-01"
else:
instant_str = period
p_irs = parameters(instant_str).gov.irs.deductions.itemized.limitation
excess_ded_fraction = excess_ded * p_irs.itemized_deduction_rate
# Line 5 Federal AGI
Expand Down

0 comments on commit 5583ceb

Please sign in to comment.