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

[FYST-1900] Make MD retirement subtraction card consistent with other states' #5691

Merged
Show file tree
Hide file tree
Changes from 11 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 @@ -3,10 +3,6 @@ module Questions
class AzRetirementIncomeSubtractionController < RetirementIncomeSubtractionController
include ReturnToReviewConcern

def self.show?(intake)
Flipper.enabled?(:show_retirement_ui) && intake.eligible_1099rs.present?
end

def followup_class = StateFileAz1099RFollowup
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module StateFile
module Questions
class IdRetirementAndPensionIncomeController < RetirementIncomeSubtractionController
def self.show?(intake)
Flipper.enabled?(:show_retirement_ui) && !intake.filing_status_mfs? && intake.eligible_1099rs.any?
super && !intake.filing_status_mfs?
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ module StateFile
module Questions
class MdRetirementIncomeSubtractionController < RetirementIncomeSubtractionController

def self.show?(intake)
Flipper.enabled?(:show_retirement_ui) && intake.eligible_1099rs.present?
end

def followup_class = StateFileMd1099RFollowup
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialized_update_form
end

def self.show?(intake)
Flipper.enabled?(:show_retirement_ui) && intake.state_file1099_rs.length.positive?
Flipper.enabled?(:show_retirement_ui) && intake.eligible_1099rs.present?
end

private
Expand Down
6 changes: 0 additions & 6 deletions app/models/state_file_az_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,4 @@ def eligible_for_az_subtractions?
wages_salaries_tips = direct_file_data.fed_wages_salaries_tips
wages_salaries_tips.present? && wages_salaries_tips > 0
end

def eligible_1099rs
@eligible_1099rs ||= self.state_file1099_rs.select do |form1099r|
form1099r.taxable_amount&.to_f&.positive?
end
end
end
6 changes: 4 additions & 2 deletions app/models/state_file_base_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ def unsubscribed_from_sms?
end

def eligible_1099rs
state_file1099_rs
@eligible_1099rs ||= self.state_file1099_rs.select do |form1099r|
form1099r.taxable_amount&.to_f&.positive?
end
end
end
end
2 changes: 1 addition & 1 deletion app/models/state_file_id_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def spouse_between_62_and_65_years_old?
end

def eligible_1099rs
state_file1099_rs.select do |form1099r|
@eligible_1099rs ||= state_file1099_rs.select do |form1099r|
form1099r.taxable_amount&.to_f&.positive? && person_qualifies?(form1099r)
end
end
Expand Down
6 changes: 0 additions & 6 deletions app/models/state_file_md_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,6 @@ def has_banking_information_in_financial_resolution?
true
end

def eligible_1099rs
@eligible_1099rs ||= self.state_file1099_rs.select do |form1099r|
form1099r.taxable_amount&.to_f&.positive?
end
end

def filer_disabled?
primary_disabled_yes? || spouse_disabled_yes?
end
Expand Down
38 changes: 0 additions & 38 deletions app/views/state_file/questions/md_review/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,6 @@
<%= render "state_file/questions/shared/review_header" %>

<% if current_intake.state_file1099_rs.length.positive? && Flipper.enabled?(:show_retirement_ui) %>
<section id="retirement-income-source" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-15"><%=t(".retirement_income_deductions") %></h2>

<% current_intake.state_file1099_rs.each_with_index do |state_file1099_r, index| %>
<% followup = state_file1099_r.state_specific_followup %>
<% unless followup.nil? %>
<div id="<%= "retirement-income-source-#{index}" %>" class="spacing-above-15 spacing-below-15">
<p class="spacing-below-0 text--small"><b><%= state_file1099_r.payer_name %></b></p>
<div>
<ul class="list--bulleted spacing-above-0" style="padding-left: 3rem;">
<% if followup.income_source_pension_annuity_endowment? %>
<li class="spacing-below-10"><%= t(".pension_annuity_endowment") %></li>
<% end %>
<% if followup.income_source_other? %>
<li class="spacing-below-10"><%= t(".other") %></li>
<% end %>
<% if followup.service_type_military? %>
<li class="spacing-below-10"><%= t(".military") %></li>
<% end %>
<% if followup.service_type_public_safety? %>
<li class="spacing-below-10"><%= t(".public_safety") %></li>
<% end %>
<% if followup.service_type_none? %>
<li class="spacing-below-10"><%= t(".none") %></li>
<% end %>
</ul>
</div>
<%= link_to StateFile::Questions::MdRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %>
<%= t("general.review_and_edit") %>
<span class="sr-only"><%= t(".retirement_income_deductions") %></span>
<% end %>
</div>
<% end %>
<% end %>
</div>
</section>

<section id="permanently-disabled" class="white-group">
<div class="spacing-below-5">
<p class="text--bold spacing-below-5"><%=t(".disability_status") %></p>
Expand Down
51 changes: 0 additions & 51 deletions app/views/state_file/questions/nc_review/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,6 @@
<% content_for :card do %>
<%= render "state_file/questions/shared/review_header" %>

<% if current_intake.state_file1099_rs.length.positive? && Flipper.enabled?(:show_retirement_ui) %>
<section id="retirement-income-source" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-5"><%=t(".retirement_income_deductions") %></h2>
<p class="text--small"><%= t(".retirement_income_deductions_explanation") %></p>

<% current_intake.state_file1099_rs.each_with_index do |state_file1099_r, index| %>
<% followup = state_file1099_r.state_specific_followup %>
<% unless followup.nil? %>
<div id="<%= "retirement-income-source-#{index}" %>" class="spacing-above-15 spacing-below-15">
<div>
<p class="spacing-below-0 text--small"><b><%= state_file1099_r.payer_name %></b></p>
<ul class="list--bulleted spacing-above-0">
<% if followup.income_source_bailey_settlement? %>
<li><%= t(".retirement_income_source_bailey_settlement") %></li>
<% if followup.bailey_settlement_at_least_five_years_yes? %>
<li><%= t(".bailey_settlement_at_least_five_years") %></li>
<% end %>
<% if followup.bailey_settlement_from_retirement_plan_yes? %>
<li><%= t(".bailey_settlement_from_retirement_plan") %></li>
<% end %>
<% if !followup.bailey_settlement_from_retirement_plan_yes? && !followup.bailey_settlement_at_least_five_years_yes? %>
<li><%= t(".none_apply") %></li>
<% end %>
<% elsif followup.income_source_uniformed_services? %>
<li><%= t(".retirement_income_source_uniformed_services") %></li>
<% if followup.uniformed_services_retired_yes? %>
<li><%= t(".uniformed_twenty_years_medical_retired") %></li>
<% end %>
<% if followup.uniformed_services_qualifying_plan_yes? %>
<li><%= t(".uniformed_survivor_benefit_plan") %></li>
<% end %>
<% if !followup.uniformed_services_retired_yes? && !followup.uniformed_services_qualifying_plan_yes? %>
<li><%= t(".none_apply") %></li>
<% end %>
<% else %>
<li><%= t(".none_apply") %></li>
<% end %>
</ul>
</div>
<%= link_to StateFile::Questions::NcRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %>
<%= t("general.review_and_edit") %>
<span class="sr-only"><%= t(".retirement_income_source_review_and_edit", index: index + 1) %></span>
<% end %>
</div>
<% end %>
<% end %>
</div>
</section>
<% end %>

<div id="nc-county" class="white-group">
<div class="spacing-below-5">
<p class="text--bold spacing-below-5"><%= t("state_file.questions.review.county", filing_year: current_tax_year) %></p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
<div class="white-group" id="retirement-income-subtractions">
<div class="spacing-below-25">
<h2 class="text--body text--bold spacing-below-5"><%=t(".title") %></h2>
<p><%=t(".subtitle") %></p>
</div>
<% if current_intake.eligible_1099rs.length.positive? %>
<section class="white-group" id="retirement-income-subtractions">
<div class="spacing-below-25">
<h2 class="text--body text--bold spacing-below-5"><%=t(".title") %></h2>
<p><%=t(".subtitle") %></p>
</div>

<div class="spacing-below-5">
<ul class="list--bulleted">
<% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %>
<p class="text--bold spacing-below-5">
<%= state_file1099_r.payer_name %>
</p>
<li style="margin-left: 1rem;">
<% case state_file1099_r&.state_specific_followup&.income_source %>
<% when "uniformed_services" %>
<%= t(".uniformed_services") %>
<% when "pension_plan" %>
<%= t(".government_pension") %>
<% else %>
<%= t(".none_apply") %>
<% end %>
</li>
<div class="spacing-below-5">
<ul class="list--bulleted">
<% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %>
<p class="text--bold spacing-below-5">
<%= state_file1099_r.payer_name %>
</p>
<li style="margin-left: 1rem;">
<% case state_file1099_r&.state_specific_followup&.income_source %>
<% when "uniformed_services" %>
<%= t(".uniformed_services") %>
<% when "pension_plan" %>
<%= t(".government_pension") %>
<% else %>
<%= t(".none_apply") %>
<% end %>
</li>

<%= link_to StateFile::Questions::AzRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %>
<%= t("general.edit") %>
<span class="sr-only"><%= t("general.edit") %></span>
<%= link_to StateFile::Questions::AzRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %>
<%= t("general.edit") %>
<span class="sr-only"><%= t("general.edit") %></span>
<% end %>
<br />
<% end %>
<br />
<% end %>
</ul>
</div>
</div>

</ul>
</div>
</section>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if current_intake.calculator.line_or_zero(:ID39R_B_LINE_8e).positive? %>
<div id="qualified-retirement-benefits-deduction" class="white-group">
<section id="qualified-retirement-benefits-deduction" class="white-group">
<div class="spacing-below-5">
<p class="text--bold spacing-below-5"><%= t(".qualified_retirement_benefits_deduction") %></p>
<p class="text spacing-below-2"><%= t(".qualified_retirement_benefits_deduction_explain") %></p>
Expand All @@ -9,6 +9,6 @@
<% id_disability_or_retirement_link = current_intake.has_filer_between_62_and_65_years_old? ? StateFile::Questions::IdDisabilityController.to_path_helper(return_to_review: "y") : StateFile::Questions::IdRetirementAndPensionIncomeController.to_path_helper(return_to_review: "y", index: 0) %>
<%= link_to t("general.review_and_edit"), id_disability_or_retirement_link, class: "button--small" %>
</div>
</div>
</section>
<% end %>

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<% if current_intake.eligible_1099rs.length.positive? %>
<section id="retirement-income-source" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-15"><%=t(".retirement_income_deductions") %></h2>

<% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %>
Copy link
Contributor Author

@arinchoi03 arinchoi03 Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that we're changing to eligible_1099rs instead of state_file1099_rs here -- could have problems navigating back to a specific 1099R unless we have the same indices as we are using in the subtraction controllers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact, we do have a problem. I used frank rollover & tried to navigate to the 2nd retirement deduction shown -- it takes me to oops page (on demo; fixed on this PR)

<% followup = state_file1099_r.state_specific_followup %>
<% unless followup.nil? %>
<div id="<%= "retirement-income-source-#{index}" %>" class="spacing-above-15 spacing-below-15">
<p class="spacing-below-0 text--small"><b><%= state_file1099_r.payer_name %></b></p>
<div>
<ul class="list--bulleted spacing-above-0" style="padding-left: 3rem;">
<% if followup.income_source_pension_annuity_endowment? %>
<li class="spacing-below-10"><%= t(".pension_annuity_endowment") %></li>
<% end %>
<% if followup.income_source_other? %>
<li class="spacing-below-10"><%= t(".other") %></li>
<% end %>
<% if followup.service_type_military? %>
<li class="spacing-below-10"><%= t(".military") %></li>
<% end %>
<% if followup.service_type_public_safety? %>
<li class="spacing-below-10"><%= t(".public_safety") %></li>
<% end %>
<% if followup.service_type_none? %>
<li class="spacing-below-10"><%= t(".none") %></li>
<% end %>
</ul>
</div>
<%= link_to StateFile::Questions::MdRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %>
<%= t("general.review_and_edit") %>
<span class="sr-only"><%= t(".retirement_income_deductions") %></span>
<% end %>
</div>
<% end %>
<% end %>
</div>
</section>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<% if current_intake.eligible_1099rs.length.positive? %>
<section id="retirement-income-source" class="white-group">
<div class="spacing-below-5">
<h2 class="text--body text--bold spacing-below-5"><%=t(".retirement_income_deductions") %></h2>
<p class="text--small"><%= t(".retirement_income_deductions_explanation") %></p>

<% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %>
<% followup = state_file1099_r.state_specific_followup %>
<% unless followup.nil? %>
<div id="<%= "retirement-income-source-#{index}" %>" class="spacing-above-15 spacing-below-15">
<div>
<p class="spacing-below-0 text--small"><b><%= state_file1099_r.payer_name %></b></p>
<ul class="list--bulleted spacing-above-0">
<% if followup.income_source_bailey_settlement? %>
<li><%= t(".retirement_income_source_bailey_settlement") %></li>
<% if followup.bailey_settlement_at_least_five_years_yes? %>
<li><%= t(".bailey_settlement_at_least_five_years") %></li>
<% end %>
<% if followup.bailey_settlement_from_retirement_plan_yes? %>
<li><%= t(".bailey_settlement_from_retirement_plan") %></li>
<% end %>
<% if !followup.bailey_settlement_from_retirement_plan_yes? && !followup.bailey_settlement_at_least_five_years_yes? %>
<li><%= t(".none_apply") %></li>
<% end %>
<% elsif followup.income_source_uniformed_services? %>
<li><%= t(".retirement_income_source_uniformed_services") %></li>
<% if followup.uniformed_services_retired_yes? %>
<li><%= t(".uniformed_twenty_years_medical_retired") %></li>
<% end %>
<% if followup.uniformed_services_qualifying_plan_yes? %>
<li><%= t(".uniformed_survivor_benefit_plan") %></li>
<% end %>
<% if !followup.uniformed_services_retired_yes? && !followup.uniformed_services_qualifying_plan_yes? %>
<li><%= t(".none_apply") %></li>
<% end %>
<% else %>
<li><%= t(".none_apply") %></li>
<% end %>
</ul>
</div>
<%= link_to StateFile::Questions::NcRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %>
<%= t("general.review_and_edit") %>
<span class="sr-only"><%= t(".retirement_income_source_review_and_edit", index: index + 1) %></span>
<% end %>
</div>
<% end %>
<% end %>
</div>
</section>
<% end %>
Loading