Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
fixed:
- Virginia spouse tax adjustment now correctly calculates eligibility by computing separate VAGI for each person instead of prorating combined VAGI
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- name: VA Spouse Tax Adjustment - elderly head with low income
period: 2024
absolute_error_margin: 1
input:
people:
head:
age: 75
employment_income: 11_752.73
spouse:
age: 40
employment_income: 55_728.48
tax_units:
tax_unit:
members: [head, spouse]
households:
household:
members: [head, spouse]
state_code: VA
output:
va_spouse_tax_adjustment: 0 # Head's VAGI less exemptions <= 0, not eligible
va_income_tax: 1_402.22 # $1,802.22 - $400 rebate - $0 STA
Original file line number Diff line number Diff line change
@@ -1,37 +1,68 @@
- name: Attributing the state adjusted gross income based on federal AGI
# VA AGI for each person is calculated as:
# Federal AGI + VA additions - VA subtractions (including age deduction)
# This is the "Separate Virginia Adjusted Gross Income" used in the
# Spouse Tax Adjustment Worksheet (Form 760 instructions, page 12)

- name: Separate VAGI - two earners without VA subtractions
period: 2021
input:
people:
person1:
age: 40
adjusted_gross_income_person: 10_000
person2:
age: 40
adjusted_gross_income_person: 30_000
tax_units:
tax_unit:
members: [person1, person2]
va_agi: 30_000
households:
household:
members: [person1, person2]
state_code: VA
output:
va_agi_person: [7_500, 22_500]
# Each person's VA AGI = their federal AGI (no additions/subtractions)
va_agi_person: [10_000, 30_000]

- name: One person without income
- name: Separate VAGI - one person without income
period: 2021
input:
people:
person1:
age: 40
adjusted_gross_income_person: 10_000
person2:
age: 40
adjusted_gross_income_person: 0
tax_units:
tax_unit:
members: [person1, person2]
va_agi: 8_000
households:
household:
members: [person1, person2]
state_code: VA
output:
va_agi_person: [8_000, 0]
# Person 1 VA AGI = $10K, Person 2 VA AGI = $0
va_agi_person: [10_000, 0]

- name: Separate VAGI - elderly with age deduction
period: 2021
input:
people:
person1:
age: 75
adjusted_gross_income_person: 20_000
person2:
age: 40
adjusted_gross_income_person: 30_000
tax_units:
tax_unit:
members: [person1, person2]
households:
household:
members: [person1, person2]
state_code: VA
output:
# Person 1: $20K - $12K age deduction = $8K
# Person 2: $30K (no age deduction)
va_agi_person: [8_000, 30_000]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from policyengine_us.model_api import *


class va_additions_person(Variable):
value_type = float
entity = Person
label = (
"Virginia additions to federal adjusted gross income for each person"
)
unit = USD
definition_period = YEAR
reference = (
"https://law.lis.virginia.gov/vacodefull/title58.1/chapter3/article2/",
"https://www.tax.virginia.gov/sites/default/files/vatax-pdf/2022-760-instructions.pdf#page=24",
)
defined_for = StateCode.VA

def formula(person, period, parameters):
# Currently no person-specific additions are implemented
# When additions are added, they should be calculated here
# at the person level
return 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from policyengine_us.model_api import *


class va_age_deduction_person(Variable):
value_type = float
entity = Person
label = "Virginia age deduction for each person"
unit = USD
definition_period = YEAR
reference = "https://www.tax.virginia.gov/sites/default/files/vatax-pdf/2022-760-instructions.pdf#page=16"
defined_for = StateCode.VA

def formula(person, period, parameters):
p = parameters(
period
).gov.states.va.tax.income.subtractions.age_deduction

filing_status = person.tax_unit("filing_status", period)

age = person("age", period)
birth_year = period.start.year - age

agi = person("adjusted_gross_income_person", period)

# Check if person is eligible for an age deduction
eligible = age >= p.age_minimum

# Check if person is eligible for full deduction (no income limit)
eligible_for_full_deduction = (
birth_year < p.birth_year_limit_for_full_amount
)

# Calculate the maximum allowable deduction amount per person
maximum_allowable_deduction = p.amount * eligible

# Calculate the amount that the adjusted federal AGI exceeds the threshold
excess = max_(agi - p.threshold[filing_status], 0)

# Reduce by the entire excess, unless eligible for the full deduction
reduction = excess * where(eligible_for_full_deduction, 0, 1)

return max_(maximum_allowable_deduction - reduction, 0)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from policyengine_us.model_api import *


class va_subtractions_person(Variable):
value_type = float
entity = Person
label = "Virginia subtractions from federal adjusted gross income for each person"
unit = USD
definition_period = YEAR
reference = (
"https://law.lis.virginia.gov/vacodefull/title58.1/chapter3/article2/",
"https://www.tax.virginia.gov/sites/default/files/vatax-pdf/2022-760-instructions.pdf#page=16",
)
defined_for = StateCode.VA

def formula(person, period, parameters):
# Calculate person-specific subtractions
# The main subtraction that varies by person is the age deduction
age_deduction = person("va_age_deduction_person", period)

# Other subtractions (disability, federal employee, military, etc.)
# are calculated at the tax unit level by summing person-level amounts
# For the purpose of calculating separate VAGI per person, we focus on
# the age deduction which is the key subtraction that affects the
# spouse tax adjustment calculation

return age_deduction
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ class va_agi_person(Variable):
defined_for = StateCode.VA

def formula(person, period, parameters):
total_agi = person.tax_unit("va_agi", period)
person_agi = person("adjusted_gross_income_person", period)
total_federal_agi = person.tax_unit.sum(person_agi)
# Calculate separate Virginia AGI for each person
# This follows the VA Form 760 Spouse Tax Adjustment Worksheet
# which shows "Separate Virginia Adjusted Gross Income" calculation
# on page 12 of the instructions

prorate = np.zeros_like(total_agi)
mask = total_federal_agi > 0
prorate[mask] = person_agi[mask] / total_federal_agi[mask]
return total_agi * prorate
# Start with federal AGI for this person
federal_agi = person("adjusted_gross_income_person", period)

# Add Virginia-specific additions for this person
va_additions = person("va_additions_person", period)

# Subtract Virginia-specific subtractions for this person
va_subtractions = person("va_subtractions_person", period)

# Calculate separate VAGI for this person
return federal_agi + va_additions - va_subtractions
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.