Skip to content

Conversation

@MaxGhenis
Copy link
Contributor

Closes #7289

Summary

Arizona income tax now correctly uses loss-limited capital gains instead of raw long-term capital gains when calculating the 25% LTCG subtraction.

Changes

  • Updated az_long_term_capital_gains_subtraction to check if net capital gains are positive before applying the subtraction
  • When net capital gains are negative (a loss), the subtraction is $0 since no LTCG is "included in federal AGI"
  • Added test cases for capital loss scenarios

Technical Details

Per ARS 43-1022(22), the subtraction is for "net long-term capital gain included in federal adjusted gross income". When there's an overall capital loss (STCG losses exceed LTCG), no long-term capital gains make it into federal AGI, so the subtraction should be zero.

Before fix: Person with -$100K STCG and +$50K LTCG would get a $12,500 subtraction (25% of $50K)
After fix: Same person gets $0 subtraction because net capital gains = -$50K (loss)

Test

  • Added integration tests for net capital loss and net capital gain scenarios
  • All 139 AZ income tax tests pass

Closes #7289

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (66ccff2) to head (f990c93).
⚠️ Report is 439 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##             main     #7299       +/-   ##
============================================
+ Coverage   72.72%   100.00%   +27.27%     
============================================
  Files        3757         1     -3756     
  Lines       54115        15    -54100     
  Branches      267         0      -267     
============================================
- Hits        39353        15    -39338     
+ Misses      14742         0    -14742     
+ Partials       20         0       -20     
Flag Coverage Δ
unittests 100.00% <100.00%> (+27.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Revert formatting in variables.py to be compatible with black 26.1.0 used in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AZ income tax incorrectly allows unlimited capital losses to offset income

2 participants