diff --git a/changelog.d/fix-nj-gross-income.fixed.md b/changelog.d/fix-nj-gross-income.fixed.md new file mode 100644 index 00000000000..c75a641ab2d --- /dev/null +++ b/changelog.d/fix-nj-gross-income.fixed.md @@ -0,0 +1 @@ +Fixed NJ gross income formula that broke API reform calculations by replacing ParameterNode iteration with explicit category references. diff --git a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py index f7317c69622..5751179f13d 100644 --- a/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py +++ b/policyengine_us/variables/gov/states/nj/tax/income/adjusted_gross_income/nj_gross_income.py @@ -19,6 +19,8 @@ def formula(person, period, parameters): # Loss-eligible categories per N.J.S. 54A:5-1: each is # summed within the category then clamped to $0. cats = p.loss_eligible_categories - for cat in cats: - total += max_(add(person, period, cats[cat]), 0) + total += max_(add(person, period, cats.category_b), 0) + total += max_(add(person, period, cats.category_c), 0) + total += max_(add(person, period, cats.category_d), 0) + total += max_(add(person, period, cats.category_k_p), 0) return total