Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert NJ 287 - commit 90c1bd7acd3bf6ff32b5193de5e092104b2e87ac #5625

Merged
merged 1 commit into from
Feb 21, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def get_detailed_return_info
{ text_key: '16a_interest_income', value: line_or_zero(:NJ1040_LINE_16A) },
{ text_key: '20a_retirement_income', value: line_or_zero(:NJ1040_LINE_20A) },
{ text_key: '27_total_income', value: line_or_zero(:NJ1040_LINE_27) },
{ text_key: '28c_retirement_excluded_from_taxation', value: line_or_zero(:NJ1040_LINE_28C) },
# { text_key: '28c_retirement_excluded_from_taxation', value: line_or_zero(:NJ1040_LINE_28C) },
{ text_key: '29_nj_gross_income', value: line_or_zero(:NJ1040_LINE_29) },
{ text_key: '30_exemptions', value: line_or_zero(:NJ1040_LINE_13) }, # same value for 13 and 30
{ text_key: '31_medical', value: line_or_zero(:NJ1040_LINE_31) },
Expand Down
6 changes: 0 additions & 6 deletions app/lib/efile/line_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -896,12 +896,6 @@ NJ1040_LINE_20B:
label: '20b Excludable pension, annuity, and IRA distributions/withdrawals (See instr)'
NJ1040_LINE_27:
label: '27 Total Income (Add lines 15, 16a, and 20a)'
NJ1040_LINE_28A:
label: '28a Pension/Retirement Exclusion (See instructions)'
NJ1040_LINE_28B:
label: '28b Retirement Income Exclusion (See Worksheet D and instructions pages 20–21)'
NJ1040_LINE_28C:
label: '28c Total Exclusion Amount (Add lines 28a and 28b)'
NJ1040_LINE_29:
label: "29 New Jersey Gross Income (Subtract line 28c from line 27) (See instructions)"
NJ1040_LINE_31:
Expand Down
25 changes: 1 addition & 24 deletions app/lib/efile/nj/nj1040_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def initialize(year:, intake:, include_source: false)
intake: @intake,
primary_or_spouse: :spouse
)
@nj_retirement_income_helper = Efile::Nj::NjRetirementIncomeHelper.new(@intake)
end

def calculate
Expand All @@ -42,9 +41,6 @@ def calculate
set_line(:NJ1040_LINE_20A, :calculate_line_20a)
set_line(:NJ1040_LINE_20B, :calculate_line_20b)
set_line(:NJ1040_LINE_27, :calculate_line_27)
set_line(:NJ1040_LINE_28A, :calculate_line_28a)
set_line(:NJ1040_LINE_28B, :calculate_line_28b)
set_line(:NJ1040_LINE_28C, :calculate_line_28c)
set_line(:NJ1040_LINE_29, :calculate_line_29)
set_line(:NJ1040_LINE_31, :calculate_line_31)
set_line(:NJ1040_LINE_38, :calculate_line_38)
Expand Down Expand Up @@ -335,27 +331,8 @@ def calculate_line_27
line_or_zero(:NJ1040_LINE_15) + line_or_zero(:NJ1040_LINE_16A) + line_or_zero(:NJ1040_LINE_20A)
end

def calculate_line_28a
0
end

def calculate_line_28b
return 0 unless @nj_retirement_income_helper.retirement_exclusion_eligible?(
line_or_zero(:NJ1040_LINE_15),
line_or_zero(:NJ1040_LINE_27),
line_or_zero(:NJ1040_LINE_28A))

total_income = line_or_zero(:NJ1040_LINE_27)
[@nj_retirement_income_helper.calculate_maximum_exclusion(total_income) - line_or_zero(:NJ1040_LINE_28A),
@nj_retirement_income_helper.total_eligible_nonretirement_income].min
end

def calculate_line_28c
line_or_zero(:NJ1040_LINE_28A) + line_or_zero(:NJ1040_LINE_28B)
end

def calculate_line_29
line_or_zero(:NJ1040_LINE_27) - line_or_zero(:NJ1040_LINE_28C)
line_or_zero(:NJ1040_LINE_27)
end

def calculate_line_31
Expand Down
91 changes: 0 additions & 91 deletions app/lib/efile/nj/nj_retirement_income_helper.rb

This file was deleted.

88 changes: 21 additions & 67 deletions app/lib/pdf_filler/nj1040_pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -273,36 +273,35 @@ def hash_for_pdf
if @xml_document.at("PensAnnuitAndIraWithdraw")
taxable_retirement_income = @xml_document.at("PensAnnuitAndIraWithdraw").text.to_i
answers.merge!(insert_digits_into_fields(taxable_retirement_income, [
"141",
"140",
"139",
"138",
"137",
"136",
"undefined_56",
"undefined_55",
"undefined_54",
"20a"
]))
"141",
"140",
"139",
"138",
"137",
"136",
"undefined_56",
"undefined_55",
"undefined_54",
"20a"
]))
end

# line 20b
if @xml_document.at("TaxExemptPensAnnuit")
excludable_retirement_income = @xml_document.at("TaxExemptPensAnnuit").text.to_i
answers.merge!(insert_digits_into_fields(excludable_retirement_income, [
"146",
"undefined_59",
"145",
"144",
"undefined_58",
"143",
"142",
"undefined_57",
"20b"
]))
"146",
"undefined_59",
"145",
"144",
"undefined_58",
"143",
"142",
"undefined_57",
"20b"
]))
end

# line 27
if @xml_document.at("TotalIncome").present?
total_income = @xml_document.at("TotalIncome").text.to_i
answers.merge!(insert_digits_into_fields(total_income, [
Expand All @@ -320,51 +319,6 @@ def hash_for_pdf
]))
end

# line 28a
if @xml_document.at("PensionExclusion").present?
other_retirement_income_exclusion = @xml_document.at("PensionExclusion").text.to_i
answers.merge!(insert_digits_into_fields(other_retirement_income_exclusion, [
"193",
"undefined_82",
"192",
"191",
"undefined_81",
"190",
"189",
"28a"
]))
end

# line 28b
if @xml_document.at("OtherRetireIncomeExclus").present?
other_retirement_income_exclusion = @xml_document.at("OtherRetireIncomeExclus").text.to_i
answers.merge!(insert_digits_into_fields(other_retirement_income_exclusion, [
"198",
"undefined_84",
"197",
"196",
"undefined_83",
"195",
"194",
"28b"
]))
end

# line 28c
if @xml_document.at("TotalExclusionAmount").present?
other_retirement_income_exclusion = @xml_document.at("TotalExclusionAmount").text.to_i
answers.merge!(insert_digits_into_fields(other_retirement_income_exclusion, [
"203",
"undefined_86",
"202",
"201",
"undefined_85",
"200",
"199",
"28c"
]))
end

if @xml_document.at("GrossIncome").present?
gross_income = @xml_document.at("GrossIncome").text.to_i
answers.merge!(insert_digits_into_fields(gross_income, [
Expand Down
12 changes: 0 additions & 12 deletions app/lib/submission_builder/ty2024/states/nj/documents/nj1040.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,6 @@ def document
xml.TotalIncome calculated_fields.fetch(:NJ1040_LINE_27)
end

if calculated_fields.fetch(:NJ1040_LINE_28A).positive?
xml.PensionExclusion calculated_fields.fetch(:NJ1040_LINE_28A)
end

if calculated_fields.fetch(:NJ1040_LINE_28B).positive?
xml.OtherRetireIncomeExclus calculated_fields.fetch(:NJ1040_LINE_28B)
end

if calculated_fields.fetch(:NJ1040_LINE_28C).positive?
xml.TotalExclusionAmount calculated_fields.fetch(:NJ1040_LINE_28C)
end

if calculated_fields.fetch(:NJ1040_LINE_29).positive?
xml.GrossIncome calculated_fields.fetch(:NJ1040_LINE_29)
end
Expand Down
1 change: 0 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3689,7 +3689,6 @@ en:
16a_interest_income: Interest income
20a_retirement_income: Retirement income
27_total_income: Total income
28c_retirement_excluded_from_taxation: Retirement income excluded from Taxation
29_nj_gross_income: New Jersey Gross Income
30_exemptions: Exemptions (based on the size of your family, disability status, veteran status)
31_medical: Medical expenses deducted
Expand Down
1 change: 0 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3661,7 +3661,6 @@ es:
16a_interest_income: Ingreso total
20a_retirement_income: Retirement income
27_total_income: Ingreso total
28c_retirement_excluded_from_taxation: Ingresos de jubilación excluidos del impuesto
29_nj_gross_income: Ingreso Bruto de New Jersey
30_exemptions: Exenciones (según el tamaño de tu familia, estado de discapacidad, estado de veterano/a de guerra)
31_medical: Gastos médicos deducidos
Expand Down
14 changes: 0 additions & 14 deletions spec/factories/state_file_nj_intakes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,20 +330,6 @@
primary_birth_date { Date.new(1900, 1, 1) }
end

trait :primary_over_62 do
primary_birth_date { Date.new(MultiTenantService.new(:statefile).current_tax_year - 62, 12, 31) }
end

trait :primary_under_62 do
primary_birth_date { Date.new(MultiTenantService.new(:statefile).current_tax_year - 61, 1, 1) }
end

trait :mfj_spouse_over_62 do
filing_status { "married_filing_jointly" }
spouse_birth_date { Date.new(MultiTenantService.new(:statefile).current_tax_year - 62, 12, 31) }
spouse_ssn { "123456789" }
end

trait :mfj_spouse_over_65 do
filing_status { "married_filing_jointly" }
spouse_birth_date { Date.new(1900, 1, 1) }
Expand Down
12 changes: 6 additions & 6 deletions spec/features/state_file/nj/complete_intake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def check_xml_results

click_on I18n.t("state_file.questions.nj_review.edit.reveal.header")
amounts_in_calculation_details = page.all(:xpath, '//*[contains(@class,"main-content-inner")]/section[last()]//p[contains(text(),"$")]')
expect(amounts_in_calculation_details.count).to eq(21)
expect(amounts_in_calculation_details.count).to eq(20)
expect(page).to be_axe_clean
continue

Expand Down Expand Up @@ -570,7 +570,7 @@ def expect_municipality_question_hidden
expect_municipality_question_exists

# unselect county
within find_by_id('county-question') do
within find('#county-question') do
select I18n.t('general.select_prompt')
end
expect_county_question_exists
Expand All @@ -581,7 +581,7 @@ def expect_municipality_question_hidden
advance_to_start_of_intake("Minimal", expect_income_review: false)

select "Atlantic"
within find_by_id('municipality-question') do
within find('#municipality-question') do
expect(page.all("option").length).to eq(24) # 23 municipalities + 1 "- Select -"
expect(page).to have_text "Absecon City"
expect(page).to have_text "Atlantic City"
Expand All @@ -590,7 +590,7 @@ def expect_municipality_question_hidden
end

select "Mercer"
within find_by_id('municipality-question') do
within find('#municipality-question') do
expect(page.all("option").length).to eq(13) # 12 municipalities + 1 "- Select -"
expect(page).to have_text "East Windsor Township"
expect(page).to have_text "Hopewell Township"
Expand All @@ -603,10 +603,10 @@ def expect_municipality_question_hidden

select "Atlantic"
select "Absecon City"
expect(find_by_id('state_file_nj_county_municipality_form_municipality_code').value).to eq("0101")
expect(find("#state_file_nj_county_municipality_form_municipality_code").value).to eq("0101")

select "Mercer"
expect(find_by_id('state_file_nj_county_municipality_form_municipality_code').value).to eq("")
expect(find("#state_file_nj_county_municipality_form_municipality_code").value).to eq("")
end

end
Expand Down
Loading
Loading