Skip to content

Commit fc20df6

Browse files
authored
NJ 79 - add page to select income source for 1099-R retirement income (#5529)
1 parent 864fcc5 commit fc20df6

File tree

20 files changed

+818
-18
lines changed

20 files changed

+818
-18
lines changed

app/assets/stylesheets/_state-file.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,9 @@
546546
line-height: 2.4rem;
547547
}
548548

549-
.review-header {
550-
.with-top-separator {
551-
padding-top: 25px;
552-
border-top: 1px solid $color-state-file-separator;
553-
}
549+
.with-top-separator {
550+
padding-top: 25px;
551+
border-top: 1px solid $color-state-file-separator;
554552
}
555553

556554
.review-section {
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
module StateFile
2+
module Questions
3+
class NjRetirementIncomeSourceController < QuestionsController
4+
include ReturnToReviewConcern
5+
6+
before_action :load_1099r
7+
8+
def load_1099r
9+
@index = params[:index].present? ? params[:index].to_i : 0
10+
@state_file_1099r =
11+
if params[:index].present?
12+
current_intake.state_file1099_rs[params[:index].to_i]
13+
else
14+
current_intake.state_file1099_rs.first
15+
end
16+
17+
@name_1099r = @state_file_1099r.payer_name
18+
@taxpayer_name = @state_file_1099r.recipient_name
19+
@amount = @state_file_1099r.taxable_amount
20+
end
21+
22+
def initialized_edit_form
23+
attribute_keys = Attributes.new(form_class.attribute_names).to_sym
24+
state_specific_followup = retrieve_or_create_state_specific_followup
25+
form_class.new(state_specific_followup, form_class.existing_attributes(state_specific_followup).slice(*attribute_keys))
26+
end
27+
28+
def initialized_update_form
29+
form_class.new(retrieve_or_create_state_specific_followup, form_params)
30+
end
31+
32+
def retrieve_or_create_state_specific_followup
33+
unless @state_file_1099r.state_specific_followup.present?
34+
@state_file_1099r.state_specific_followup = StateFileNj1099RFollowup.create
35+
@state_file_1099r.save
36+
end
37+
38+
@state_file_1099r.state_specific_followup
39+
end
40+
41+
def self.show?(intake)
42+
Flipper.enabled?(:show_retirement_ui) && intake.state_file1099_rs.length.positive?
43+
end
44+
45+
def prev_path
46+
options = {}
47+
options[:return_to_review] = params[:return_to_review] if params[:return_to_review].present?
48+
prev_index = @index - 1
49+
if prev_index.negative?
50+
super
51+
else
52+
options[:index] = prev_index
53+
NjRetirementIncomeSourceController.to_path_helper(options)
54+
end
55+
end
56+
57+
def next_path
58+
options = {}
59+
options[:return_to_review] = params[:return_to_review] if params[:return_to_review].present?
60+
next_index = @index + 1
61+
if next_index >= current_intake.direct_file_data.form1099r_nodes.length
62+
super
63+
else
64+
options[:index] = next_index
65+
NjRetirementIncomeSourceController.to_path_helper(options)
66+
end
67+
end
68+
end
69+
end
70+
end
71+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module StateFile
2+
class NjRetirementIncomeSourceForm < Form
3+
include FormAttributes
4+
5+
set_attributes_for :state_specific_followup,
6+
:income_source
7+
8+
attr_accessor :state_specific_followup
9+
10+
validates :income_source, presence: true
11+
12+
def initialize(state_specific_followup = nil, params = {})
13+
@state_specific_followup = state_specific_followup
14+
super(params)
15+
end
16+
17+
def save
18+
@state_specific_followup.income_source = self.income_source
19+
@state_specific_followup.save
20+
end
21+
end
22+
end

app/lib/navigation/state_file_nj_question_navigation.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def self.show_progress?(controller_class)
4343
Navigation::NavigationStep.new(StateFile::Questions::NjDependentsHealthInsuranceController), # Line 14
4444
]),
4545
Navigation::NavigationSection.new("state_file.navigation.nj.section_3", [
46+
Navigation::NavigationStep.new(StateFile::Questions::NjRetirementIncomeSourceController),
4647
Navigation::NavigationStep.new(StateFile::Questions::NjMedicalExpensesController), # Line 31
4748
Navigation::NavigationStep.new(StateFile::Questions::NjEitcQualifyingChildController), # Line 58, intentionally moved up to be in the context of other credits and deductions, and to ensure there is a consistent page after the property taxes section.
4849
Navigation::NavigationStep.new(StateFile::Questions::NjHouseholdRentOwnController), # Line 40b

app/models/state_file_nj1099_r_followup.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#
33
# Table name: state_file_nj1099_r_followups
44
#
5-
# id :bigint not null, primary key
6-
# created_at :datetime not null
7-
# updated_at :datetime not null
5+
# id :bigint not null, primary key
6+
# income_source :integer default("unfilled"), not null
7+
# created_at :datetime not null
8+
# updated_at :datetime not null
89
#
910
class StateFileNj1099RFollowup < ApplicationRecord
1011

1112
has_one :state_file1099_r, inverse_of: :state_specific_followup
1213

14+
enum income_source: { unfilled: 0, military_pension: 1, military_survivors_benefits: 2, none: 3 }, _prefix: :income_source
1315
end
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<%
2+
title = t(".title" )
3+
content_for :page_title, title
4+
%>
5+
6+
<% content_for :card do %>
7+
<hgroup>
8+
<h1 class="h2"><%= title %></h1>
9+
<p><%= t(".subtitle") %></p>
10+
</hgroup>
11+
<p><%= t(".doc_1099r_label") %> <b><%= @name_1099r %></b></p>
12+
<p><%= t(".taxpayer_name_label") %> <b><%= @taxpayer_name %></b></p>
13+
<p><%= t(".taxable_amount_label") %> <b><%= number_to_currency(@amount, precision: 0) %></b></p>
14+
15+
<%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %>
16+
<div class="white-group">
17+
<%= f.cfa_radio_set(
18+
:income_source,
19+
label_text: t(".label"),
20+
collection: [
21+
{ value: :military_pension, label: t(".option_military_pension") },
22+
{ value: :military_survivors_benefits, label: t(".option_military_survivor_benefit") },
23+
{ value: :none, label: t(".option_none") },
24+
],
25+
) %>
26+
</div>
27+
28+
<div class="reveal">
29+
<button class="reveal__button"><%= t('.helper_heading') %></button>
30+
<div class="reveal__content">
31+
<%= t('.helper_description_html') %>
32+
</div>
33+
</div>
34+
35+
<% if params[:return_to_review].present? %>
36+
<%= hidden_field_tag "return_to_review", params[:return_to_review] %>
37+
<% end %>
38+
<% if params[:index].present? %>
39+
<%= hidden_field_tag "index", params[:index] %>
40+
<% end %>
41+
<%= f.continue %>
42+
<% end %>
43+
<% end %>

app/views/state_file/questions/nj_review/edit.html.erb

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,39 @@
108108
</section>
109109
<% end %>
110110

111-
<%# Dependents %>
111+
<% if current_intake.state_file1099_rs.length.positive? && Flipper.enabled?(:show_retirement_ui) %>
112+
<section id="retirement-income-source" class="white-group">
113+
<div class="spacing-below-5">
114+
<h2 class="text--body text--bold spacing-below-25"><%=t(".retirement_income_source") %></h2>
115+
116+
<% current_intake.state_file1099_rs.each do |state_file1099_r| %>
117+
<% unless state_file1099_r.state_specific_followup.nil? %>
118+
<div class="spacing-below-5 with-top-separator">
119+
<p><%= t(".retirement_income_source_doc_1099r_label") %> <b><%= state_file1099_r.payer_name %></b></p>
120+
<p><%= t(".retirement_income_source_taxpayer_name_label") %> <b><%= state_file1099_r.recipient_name %></b></p>
121+
<p><%= t(".retirement_income_source_taxable_amount_label") %> <b><%= number_to_currency(state_file1099_r.taxable_amount, precision: 0) %></b></p>
122+
<p>
123+
<%= t(".retirement_income_source_label") %>
124+
<b>
125+
<% if state_file1099_r.state_specific_followup.income_source_military_pension? %>
126+
<%= t(".retirement_income_source_military_pension") %>
127+
<% elsif state_file1099_r.state_specific_followup.income_source_military_survivors_benefits? %>
128+
<%= t(".retirement_income_source_military_survivor_benefit") %>
129+
<% else %>
130+
<%= t(".retirement_income_source_none") %>
131+
<% end %>
132+
</b>
133+
</p>
134+
</div>
135+
<% end %>
136+
<% end %>
137+
<%= link_to StateFile::Questions::NjRetirementIncomeSourceController.to_path_helper(return_to_review: "y"), class: "button--small" do %>
138+
<%= t(".review_and_edit") %>
139+
<span class="sr-only"><%= t(".retirement_income_source") %></span>
140+
<% end %>
141+
</div>
142+
</section>
143+
<% end %>
112144

113145
<section id="medical_expenses" class="white-group">
114146
<div class="spacing-below-5">

config/locales/en.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3530,6 +3530,21 @@ en:
35303530
no_id: No driver's license or state ID / Prefer not to share
35313531
subtitle: Details from your state-issued ID, if you have one, will help New Jersey combat stolen-identity tax fraud and protect you and your tax refund.
35323532
title: Confirm Your Identity (Optional)
3533+
nj_retirement_income_source:
3534+
edit:
3535+
doc_1099r_label: '1099-R:'
3536+
helper_description_html: |
3537+
<p>U.S. military pensions result from service in the Army, Navy, Air Force, Marine Corps, or Coast Guard. Generally, qualifying military pensions and military survivor's benefit payments are paid by the U.S. Defense Finance and Accounting Service.</p>
3538+
<p>Civil service pensions and annuities do not count as military pensions, even if they are based on credit for military service. Generally, civil service annuities are paid by the U.S. Office of Personnel Management.</p>
3539+
helper_heading: What counts as a U.S. military pension?
3540+
label: 'Select the source of this income:'
3541+
option_military_pension: U.S. military pension
3542+
option_military_survivor_benefit: U.S. military survivor's benefits
3543+
option_none: None of these apply (Choose this if you have a civil service pension or annuity)
3544+
subtitle: We need more information about this 1099-R.
3545+
taxable_amount_label: 'Taxable Amount:'
3546+
taxpayer_name_label: 'Taxpayer Name:'
3547+
title: Some of your retirement income might not be taxed in New Jersey.
35333548
nj_review:
35343549
edit:
35353550
amount_calculated: Calculated Amount
@@ -3556,6 +3571,14 @@ en:
35563571
property_tax_credit_deduction: New Jersey Property Tax Deduction or Credit
35573572
property_tax_paid: Property taxes paid in %{filing_year}
35583573
rent_paid: Rent paid in %{filing_year}
3574+
retirement_income_source: 1099-R Retirement Income
3575+
retirement_income_source_doc_1099r_label: '1099-R:'
3576+
retirement_income_source_label: 'Source:'
3577+
retirement_income_source_military_pension: U.S. military pension
3578+
retirement_income_source_military_survivor_benefit: U.S. military survivor's benefits
3579+
retirement_income_source_none: Neither U.S. military pension nor U.S. military survivor's benefits
3580+
retirement_income_source_taxable_amount_label: 'Taxable Amount:'
3581+
retirement_income_source_taxpayer_name_label: 'Taxpayer Name:'
35593582
reveal:
35603583
15_wages_salaries_tips: Wages, salaries, tips
35613584
16a_interest_income: Interest income

config/locales/es.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3467,6 +3467,21 @@ es:
34673467
no_id: No tiene licencia de conducir ni identificación estatal/ Prefiere no compartirla
34683468
subtitle: Si tienes una identificación emitida por el estado (state-issued ID), ayudará a New Jersey a combatir el fraude fiscal por robo de identidad y a protegerte a ti y a tu reembolso de impuestos.
34693469
title: Confirma tu Identidad (Opcional)
3470+
nj_retirement_income_source:
3471+
edit:
3472+
doc_1099r_label: '1099-R:'
3473+
helper_description_html: |
3474+
<p>U.S. military pensions result from service in the Army, Navy, Air Force, Marine Corps, or Coast Guard. Generally, qualifying military pensions and military survivor's benefit payments are paid by the U.S. Defense Finance and Accounting Service.</p>
3475+
<p>Civil service pensions and annuities do not count as military pensions, even if they are based on credit for military service. Generally, civil service annuities are paid by the U.S. Office of Personnel Management.</p>
3476+
helper_heading: What counts as a U.S. military pension?
3477+
label: 'Select the source of this income:'
3478+
option_military_pension: U.S. military pension
3479+
option_military_survivor_benefit: U.S. military survivor's benefits
3480+
option_none: None of these apply (Choose this if you have a civil service pension or annuity)
3481+
subtitle: We need more information about this 1099-R.
3482+
taxable_amount_label: 'Taxable Amount:'
3483+
taxpayer_name_label: 'Taxpayer Name:'
3484+
title: Some of your retirement income might not be taxed in New Jersey.
34703485
nj_review:
34713486
edit:
34723487
amount_calculated: Monto calculado
@@ -3493,6 +3508,14 @@ es:
34933508
property_tax_credit_deduction: Deducción o Crédito por Impuestos a la Propiedad
34943509
property_tax_paid: Impuestos sobre la propiedad pagados en %{filing_year}
34953510
rent_paid: Alquiler pagado en %{filing_year}
3511+
retirement_income_source: 1099-R Retirement Income Source
3512+
retirement_income_source_doc_1099r_label: '1099-R:'
3513+
retirement_income_source_label: 'Source:'
3514+
retirement_income_source_military_pension: U.S. military pension
3515+
retirement_income_source_military_survivor_benefit: U.S. military survivor's benefits
3516+
retirement_income_source_none: Neither U.S. military pension nor U.S. military survivor's benefits
3517+
retirement_income_source_taxable_amount_label: 'Taxable Amount:'
3518+
retirement_income_source_taxpayer_name_label: 'Taxpayer Name:'
34963519
reveal:
34973520
15_wages_salaries_tips: Salarios, sueldos, propinas
34983521
16a_interest_income: Ingreso total
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddIncomeSourceToStateFileNj1099RFollowup < ActiveRecord::Migration[7.1]
2+
def change
3+
add_column :state_file_nj1099_r_followups, :income_source, :integer, default: 0, null: false
4+
end
5+
end

0 commit comments

Comments
 (0)