From 3e5641fbc8a79f377cb7acba21895c3758568357 Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Sun, 2 Mar 2025 23:07:37 -0800 Subject: [PATCH 01/10] Make ID/MD/NC/AZ retirement income subtraction controller more similar by utilizing eligible_109rs --- .../questions/az_retirement_income_subtraction_controller.rb | 4 ---- .../questions/id_retirement_and_pension_income_controller.rb | 2 +- .../questions/md_retirement_income_subtraction_controller.rb | 4 ---- .../questions/retirement_income_subtraction_controller.rb | 2 +- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/app/controllers/state_file/questions/az_retirement_income_subtraction_controller.rb b/app/controllers/state_file/questions/az_retirement_income_subtraction_controller.rb index 551e97ba98..56ca7fa13b 100644 --- a/app/controllers/state_file/questions/az_retirement_income_subtraction_controller.rb +++ b/app/controllers/state_file/questions/az_retirement_income_subtraction_controller.rb @@ -2,10 +2,6 @@ module StateFile module Questions class AzRetirementIncomeSubtractionController < RetirementIncomeSubtractionController - def self.show?(intake) - Flipper.enabled?(:show_retirement_ui) && intake.eligible_1099rs.present? - end - def followup_class = StateFileAz1099RFollowup end end diff --git a/app/controllers/state_file/questions/id_retirement_and_pension_income_controller.rb b/app/controllers/state_file/questions/id_retirement_and_pension_income_controller.rb index d90109ff71..ce1e58df61 100644 --- a/app/controllers/state_file/questions/id_retirement_and_pension_income_controller.rb +++ b/app/controllers/state_file/questions/id_retirement_and_pension_income_controller.rb @@ -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 diff --git a/app/controllers/state_file/questions/md_retirement_income_subtraction_controller.rb b/app/controllers/state_file/questions/md_retirement_income_subtraction_controller.rb index 7876e910c0..5870b7566c 100644 --- a/app/controllers/state_file/questions/md_retirement_income_subtraction_controller.rb +++ b/app/controllers/state_file/questions/md_retirement_income_subtraction_controller.rb @@ -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 diff --git a/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb b/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb index 1be622afb7..a3ddbf038a 100644 --- a/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb +++ b/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb @@ -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.length.positive? end private From 5689a0fe5e7c0c728569b491f4a19e6587b64bed Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Sun, 2 Mar 2025 23:29:12 -0800 Subject: [PATCH 02/10] Use present? check instead of length.positive? --- .../questions/retirement_income_subtraction_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb b/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb index a3ddbf038a..021721b6e6 100644 --- a/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb +++ b/app/controllers/state_file/questions/retirement_income_subtraction_controller.rb @@ -16,7 +16,7 @@ def initialized_update_form end def self.show?(intake) - Flipper.enabled?(:show_retirement_ui) && intake.eligible_1099rs.length.positive? + Flipper.enabled?(:show_retirement_ui) && intake.eligible_1099rs.present? end private From 20bad828aba40ea111848100c69a31cc1948d884 Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Tue, 4 Mar 2025 11:24:23 -0800 Subject: [PATCH 03/10] Update eligible_1099r method in base intake - for all states, eligible 1099r is when taxable_income exists --- app/models/state_file_az_intake.rb | 6 ------ app/models/state_file_base_intake.rb | 4 +++- app/models/state_file_md_intake.rb | 6 ------ spec/models/state_file_base_intake_spec.rb | 11 +++++++++++ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/models/state_file_az_intake.rb b/app/models/state_file_az_intake.rb index c18e0c3172..3055a7b895 100644 --- a/app/models/state_file_az_intake.rb +++ b/app/models/state_file_az_intake.rb @@ -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 diff --git a/app/models/state_file_base_intake.rb b/app/models/state_file_base_intake.rb index 0d2433cf3e..5e7f74b7ac 100644 --- a/app/models/state_file_base_intake.rb +++ b/app/models/state_file_base_intake.rb @@ -460,6 +460,8 @@ def unsubscribed_from_sms? end def eligible_1099rs - state_file1099_rs + state_file1099_rs.select do |form1099r| + form1099r.taxable_amount&.to_f&.positive? + end end end diff --git a/app/models/state_file_md_intake.rb b/app/models/state_file_md_intake.rb index 3f9ee39a04..eef20e3e09 100644 --- a/app/models/state_file_md_intake.rb +++ b/app/models/state_file_md_intake.rb @@ -251,10 +251,4 @@ def qualifies_for_pension_exclusion?(filer) 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 end diff --git a/spec/models/state_file_base_intake_spec.rb b/spec/models/state_file_base_intake_spec.rb index 92de61df01..407a268c7a 100644 --- a/spec/models/state_file_base_intake_spec.rb +++ b/spec/models/state_file_base_intake_spec.rb @@ -313,4 +313,15 @@ end end + describe "#eligible_1099rs" do + %w[az md nc nj].each do |state_code| + let(:intake) { create "state_file_#{state_code}_intake".to_sym } + let!(:eligible_1099r) { create(:state_file1099_r, intake: intake, taxable_amount: 200) } + let!(:ineligible_1099r) { create(:state_file1099_r, intake: intake, taxable_amount: 0) } + + it "should only return the 1099R with taxable_amount" do + expect(intake.eligible_1099rs).to contain_exactly(eligible_1099r) + end + end + end end \ No newline at end of file From 24427ecd451b194817e998503c938ecfa8e56f63 Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Tue, 4 Mar 2025 11:56:41 -0800 Subject: [PATCH 04/10] Save eligible_1099rs in instance variable to avoid repeated querying --- app/models/state_file_base_intake.rb | 4 ++-- app/models/state_file_id_intake.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/state_file_base_intake.rb b/app/models/state_file_base_intake.rb index 5e7f74b7ac..65e23a1252 100644 --- a/app/models/state_file_base_intake.rb +++ b/app/models/state_file_base_intake.rb @@ -460,8 +460,8 @@ def unsubscribed_from_sms? end def eligible_1099rs - state_file1099_rs.select do |form1099r| + @eligible_1099rs ||= self.state_file1099_rs.select do |form1099r| form1099r.taxable_amount&.to_f&.positive? end end -end +end \ No newline at end of file diff --git a/app/models/state_file_id_intake.rb b/app/models/state_file_id_intake.rb index 009a0207fe..2d04a6e114 100644 --- a/app/models/state_file_id_intake.rb +++ b/app/models/state_file_id_intake.rb @@ -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 From 93ad0ec45f88afc0b1740bb1dfc2976679e0ab3d Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Thu, 6 Mar 2025 09:31:48 -0800 Subject: [PATCH 05/10] Show only eligible 1099Rs on the review page --- app/views/state_file/questions/nc_review/edit.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/state_file/questions/nc_review/edit.html.erb b/app/views/state_file/questions/nc_review/edit.html.erb index cb7bc03ce4..fe759822d4 100644 --- a/app/views/state_file/questions/nc_review/edit.html.erb +++ b/app/views/state_file/questions/nc_review/edit.html.erb @@ -8,7 +8,7 @@

<%=t(".retirement_income_deductions") %>

<%= t(".retirement_income_deductions_explanation") %>

- <% current_intake.state_file1099_rs.each_with_index do |state_file1099_r, index| %> + <% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %> <% followup = state_file1099_r.state_specific_followup %> <% unless followup.nil? %>
" class="spacing-above-15 spacing-below-15"> From e7e20db140c0a6f10bcfe0c217188b8c4c6613c8 Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Thu, 6 Mar 2025 10:07:58 -0800 Subject: [PATCH 06/10] Make nc retirement subtractions html consistent --- .../questions/nc_review/edit.html.erb | 51 ---------------- ...t_income_deductions_review_header.html.erb | 59 ++++++++++--------- ...rement_income_deductions_review_header.erb | 50 ++++++++++++++++ config/locales/en.yml | 21 +++---- config/locales/es.yml | 21 +++---- 5 files changed, 102 insertions(+), 100 deletions(-) create mode 100644 app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb diff --git a/app/views/state_file/questions/nc_review/edit.html.erb b/app/views/state_file/questions/nc_review/edit.html.erb index b6fcc4b6b1..e61f7c334f 100644 --- a/app/views/state_file/questions/nc_review/edit.html.erb +++ b/app/views/state_file/questions/nc_review/edit.html.erb @@ -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) %> -
-
-

<%=t(".retirement_income_deductions") %>

-

<%= t(".retirement_income_deductions_explanation") %>

- - <% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %> - <% followup = state_file1099_r.state_specific_followup %> - <% unless followup.nil? %> -
" class="spacing-above-15 spacing-below-15"> -
-

<%= state_file1099_r.payer_name %>

-
    - <% if followup.income_source_bailey_settlement? %> -
  • <%= t(".retirement_income_source_bailey_settlement") %>
  • - <% if followup.bailey_settlement_at_least_five_years_yes? %> -
  • <%= t(".bailey_settlement_at_least_five_years") %>
  • - <% end %> - <% if followup.bailey_settlement_from_retirement_plan_yes? %> -
  • <%= t(".bailey_settlement_from_retirement_plan") %>
  • - <% end %> - <% if !followup.bailey_settlement_from_retirement_plan_yes? && !followup.bailey_settlement_at_least_five_years_yes? %> -
  • <%= t(".none_apply") %>
  • - <% end %> - <% elsif followup.income_source_uniformed_services? %> -
  • <%= t(".retirement_income_source_uniformed_services") %>
  • - <% if followup.uniformed_services_retired_yes? %> -
  • <%= t(".uniformed_twenty_years_medical_retired") %>
  • - <% end %> - <% if followup.uniformed_services_qualifying_plan_yes? %> -
  • <%= t(".uniformed_survivor_benefit_plan") %>
  • - <% end %> - <% if !followup.uniformed_services_retired_yes? && !followup.uniformed_services_qualifying_plan_yes? %> -
  • <%= t(".none_apply") %>
  • - <% end %> - <% else %> -
  • <%= t(".none_apply") %>
  • - <% end %> -
-
- <%= link_to StateFile::Questions::NcRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %> - <%= t("general.review_and_edit") %> - <%= t(".retirement_income_source_review_and_edit", index: index + 1) %> - <% end %> -
- <% end %> - <% end %> -
-
- <% end %> -

<%= t("state_file.questions.review.county", filing_year: current_tax_year) %>

diff --git a/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb b/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb index 31b82cb026..717a3a2268 100644 --- a/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb +++ b/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb @@ -1,33 +1,34 @@ -
-
-

<%=t(".title") %>

-

<%=t(".subtitle") %>

-
+<% if current_intake.eligible_1099rs.length.positive? %> +
+
+

<%=t(".title") %>

+

<%=t(".subtitle") %>

+
-
-
    - <% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %> -

    - <%= state_file1099_r.payer_name %> -

    -
  • - <% 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 %> -
  • +
    +
      + <% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %> +

      + <%= state_file1099_r.payer_name %> +

      +
    • + <% 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 %> +
    • - <%= link_to StateFile::Questions::AzRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %> - <%= t("general.edit") %> - <%= t("general.edit") %> + <%= link_to StateFile::Questions::AzRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %> + <%= t("general.edit") %> + <%= t("general.edit") %> + <% end %> +
      <% end %> -
      - <% end %> -
    +
+
-
- +<% end %> \ No newline at end of file diff --git a/app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb b/app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb new file mode 100644 index 0000000000..b24c99523c --- /dev/null +++ b/app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb @@ -0,0 +1,50 @@ +<% if current_intake.eligible_1099rs.length.positive? %> +
+
+

<%=t(".retirement_income_deductions") %>

+

<%= t(".retirement_income_deductions_explanation") %>

+ + <% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %> + <% followup = state_file1099_r.state_specific_followup %> + <% unless followup.nil? %> +
" class="spacing-above-15 spacing-below-15"> +
+

<%= state_file1099_r.payer_name %>

+
    + <% if followup.income_source_bailey_settlement? %> +
  • <%= t(".retirement_income_source_bailey_settlement") %>
  • + <% if followup.bailey_settlement_at_least_five_years_yes? %> +
  • <%= t(".bailey_settlement_at_least_five_years") %>
  • + <% end %> + <% if followup.bailey_settlement_from_retirement_plan_yes? %> +
  • <%= t(".bailey_settlement_from_retirement_plan") %>
  • + <% end %> + <% if !followup.bailey_settlement_from_retirement_plan_yes? && !followup.bailey_settlement_at_least_five_years_yes? %> +
  • <%= t(".none_apply") %>
  • + <% end %> + <% elsif followup.income_source_uniformed_services? %> +
  • <%= t(".retirement_income_source_uniformed_services") %>
  • + <% if followup.uniformed_services_retired_yes? %> +
  • <%= t(".uniformed_twenty_years_medical_retired") %>
  • + <% end %> + <% if followup.uniformed_services_qualifying_plan_yes? %> +
  • <%= t(".uniformed_survivor_benefit_plan") %>
  • + <% end %> + <% if !followup.uniformed_services_retired_yes? && !followup.uniformed_services_qualifying_plan_yes? %> +
  • <%= t(".none_apply") %>
  • + <% end %> + <% else %> +
  • <%= t(".none_apply") %>
  • + <% end %> +
+
+ <%= link_to StateFile::Questions::NcRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %> + <%= t("general.review_and_edit") %> + <%= t(".retirement_income_source_review_and_edit", index: index + 1) %> + <% end %> +
+ <% end %> + <% end %> +
+
+<% end %> \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 5d4f6c2b31..4bcfcf7f7c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3378,25 +3378,15 @@ en: nc_review: edit: amount_earned: Amount earned - bailey_settlement_at_least_five_years: At least five years of creditable service by August 12, 1989 - bailey_settlement_from_retirement_plan: Received retirement benefits from NC’s 401(k) or 457 plan, and contributed to the plan before August 12, 1989 benefits_vested_pensions: Subtraction for retirement benefits by vested qualifying government pensions child_deduction: Child deduction interest_us_bonds: Interest income from U.S. bonds (not taxable in North Carolina) - none_apply: None apply primary_veteran: United States Armed Forces veteran status - retirement_income_deductions: North Carolina retirement income deductions - retirement_income_deductions_explanation: These allow people to deduct all or a portion of their retirement income from their taxes. - retirement_income_source_bailey_settlement: Retirement benefits as part of the Bailey Settlement - retirement_income_source_review_and_edit: Review and edit 1099-R %{index} - retirement_income_source_uniformed_services: Retirement benefits from the Uniformed Services service_members: Subtraction for retirement benefits received by service members social_security_benefits: Social Security benefits (not taxable in North Carolina) spouse_veteran: Your spouse's United States Armed Forces veteran status state_credit: Enrolled member of a federally recognized Indian Tribe, and received income from a source within a reservation subtraction_indian_tribe: Subtraction for income of a member of an Indian tribe - uniformed_survivor_benefit_plan: Payments from a qualifying Survivor Benefit Plan to a beneficiary of a retired member who served at least 20 years or who was medically retired from the Uniformed Services - uniformed_twenty_years_medical_retired: Retired member who served at least 20 years or were medically retired from the Uniformed Services use_tax_amount: Amount of use tax use_tax_applied: Out-of-state purchases in %{filing_year} without paying sales tax nc_sales_use_tax: @@ -4097,6 +4087,17 @@ en: qualified_disabled_retirement_benefits: Qualified disabled retirement benefits qualified_retirement_benefits_deduction: Qualified Retirement Benefits Deduction qualified_retirement_benefits_deduction_explain: These allow people to deduct all or a portion of their retirement income from their taxes. + nc_retirement_income_deductions_review_header: + bailey_settlement_at_least_five_years: At least five years of creditable service by August 12, 1989 + bailey_settlement_from_retirement_plan: Received retirement benefits from NC’s 401(k) or 457 plan, and contributed to the plan before August 12, 1989 + none_apply: None apply + retirement_income_deductions: North Carolina retirement income deductions + retirement_income_deductions_explanation: These allow people to deduct all or a portion of their retirement income from their taxes. + retirement_income_source_bailey_settlement: Retirement benefits as part of the Bailey Settlement + retirement_income_source_review_and_edit: Review and edit 1099-R %{index} + retirement_income_source_uniformed_services: Retirement benefits from the Uniformed Services + uniformed_survivor_benefit_plan: Payments from a qualifying Survivor Benefit Plan to a beneficiary of a retired member who served at least 20 years or who was medically retired from the Uniformed Services + uniformed_twenty_years_medical_retired: Retired member who served at least 20 years or were medically retired from the Uniformed Services review_header: income_details: Income Details income_forms_collected: 'Income form(s) collected:' diff --git a/config/locales/es.yml b/config/locales/es.yml index 6dd4849ec6..642f6b98c9 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -3348,25 +3348,15 @@ es: nc_review: edit: amount_earned: Amount earned - bailey_settlement_at_least_five_years: Al menos cinco años de servicio acreditable antes del 12 de agosto de 1989 - bailey_settlement_from_retirement_plan: Recibiste beneficios de jubilación del plan 401(k) o 457 de NC y contribuiste al plan antes del 12 de agosto de 1989 benefits_vested_pensions: Resta por beneficios de jubilación de pensiones gubernamentales calificadas child_deduction: Deducción por hijos interest_us_bonds: Ingresos por intereses de bonos de los Estados Unidos (no son sujetos a impuestos en Carolina del Norte) - none_apply: No aplica ninguno primary_veteran: Estado de veterano de las Fuerzas Armadas de los Estados Unidos - retirement_income_deductions: Deducciones por ingresos de jubilación en Carolina del Norte - retirement_income_deductions_explanation: Estas permiten a las personas deducir de sus impuestos todo o parte de sus ingresos de jubilación. - retirement_income_source_bailey_settlement: Beneficios de jubilación como parte del Acuerdo Bailey - retirement_income_source_review_and_edit: Revisar y editar 1099-R %{index} - retirement_income_source_uniformed_services: Beneficios de jubilación de los Servicios Uniformados service_members: Resta por beneficios de jubilación recibidos por miembros del servicio social_security_benefits: Beneficios del Seguro Social (no sujetos a impuestos en Carolina del Norte) spouse_veteran: Estado de veterano de las Fuerzas Armadas de los Estados Unidos de tu cónyuge state_credit: Miembro inscrito de una tribu indígena reconocida por el gobierno federal y recibiste ingresos de una fuente dentro de una reserva subtraction_indian_tribe: Resta por ingresos de un miembro de una tribu india - uniformed_survivor_benefit_plan: Pagos de un Plan de Beneficios para Sobrevivientes calificado a un beneficiario de un miembro retirado que prestó servicio al menos 20 años o que fue retirado por razones médicas de los Servicios Uniformados - uniformed_twenty_years_medical_retired: Miembro retirado que prestó servicio al menos 20 años o fue retirado por razones médicas de los Servicios Uniformados use_tax_amount: Cantidad del impuesto sobre uso use_tax_applied: Compras fuera del estado en %{filing_year} sin pagar impuesto sobre ventas nc_sales_use_tax: @@ -4083,6 +4073,17 @@ es: qualified_disabled_retirement_benefits: Beneficios calificados de jubilación para personas con discapacidad qualified_retirement_benefits_deduction: Deducción por Beneficios Calificados de Jubilación qualified_retirement_benefits_deduction_explain: Estos permiten a las personas deducir de sus impuestos la totalidad o una parte de sus ingresos por jubilación. + nc_retirement_income_deductions_review_header: + bailey_settlement_at_least_five_years: Al menos cinco años de servicio acreditable antes del 12 de agosto de 1989 + bailey_settlement_from_retirement_plan: Recibiste beneficios de jubilación del plan 401(k) o 457 de NC y contribuiste al plan antes del 12 de agosto de 1989 + none_apply: No aplica ninguno + retirement_income_deductions: Deducciones por ingresos de jubilación en Carolina del Norte + retirement_income_deductions_explanation: Estas permiten a las personas deducir de sus impuestos todo o parte de sus ingresos de jubilación. + retirement_income_source_bailey_settlement: Beneficios de jubilación como parte del Acuerdo Bailey + retirement_income_source_review_and_edit: Revisar y editar 1099-R %{index} + retirement_income_source_uniformed_services: Beneficios de jubilación de los Servicios Uniformados + uniformed_survivor_benefit_plan: Pagos de un Plan de Beneficios para Sobrevivientes calificado a un beneficiario de un miembro retirado que prestó servicio al menos 20 años o que fue retirado por razones médicas de los Servicios Uniformados + uniformed_twenty_years_medical_retired: Miembro retirado que prestó servicio al menos 20 años o fue retirado por razones médicas de los Servicios Uniformados review_header: income_details: Detalles de ingresos income_forms_collected: 'Formulario(s) de ingresos recogidos:' From 80e94767614ff9229ff55cc257b0f817c10f282e Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Thu, 6 Mar 2025 10:32:51 -0800 Subject: [PATCH 07/10] Add specs to guard against ineligible 1099r during review --- spec/features/state_file/review_page_spec.rb | 34 +++++++++++--------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/spec/features/state_file/review_page_spec.rb b/spec/features/state_file/review_page_spec.rb index 531e632cee..7994225cd8 100644 --- a/spec/features/state_file/review_page_spec.rb +++ b/spec/features/state_file/review_page_spec.rb @@ -195,55 +195,59 @@ intake = StateFile::StateInformationService.intake_class(state_code).last # First 1099R already created in set_up_intake_and_associated_records second_1099r = create(:state_file1099_r, intake: intake, payer_name: "The People's Free Food Emporium") - third_1099r = create(:state_file1099_r, intake: intake, payer_name: "Boone Community Garden") + # Creating a third 1099r that is ineligible to make sure it does not show up on review & doesn't cause issues with review navigation + create(:state_file1099_r, intake: intake, payer_name: "Not Eligible Place", taxable_amount: 0) + fourth_1099r = create(:state_file1099_r, intake: intake, payer_name: "Boone Community Garden") StateFileNc1099RFollowup.create(state_file1099_r: intake.state_file1099_rs.first, income_source: "bailey_settlement", bailey_settlement_at_least_five_years: "yes") StateFileNc1099RFollowup.create(state_file1099_r: second_1099r, income_source: "uniformed_services", uniformed_services_retired: "no", uniformed_services_qualifying_plan: "no") - StateFileNc1099RFollowup.create(state_file1099_r: third_1099r, income_source: "other") + StateFileNc1099RFollowup.create(state_file1099_r: fourth_1099r, income_source: "other") visit "/questions/#{state_code}-review" end it "allows user to view and edit their 1099R followup information" do + expect(page).not_to have_text "Not Eligible Place" + within "#retirement-income-source-0" do expect(page).to have_text "Dorothy Red" - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.retirement_income_source_bailey_settlement") - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.bailey_settlement_at_least_five_years") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.retirement_income_source_bailey_settlement") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.bailey_settlement_at_least_five_years") end within "#retirement-income-source-1" do expect(page).to have_text "The People's Free Food Emporium" - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.retirement_income_source_uniformed_services") - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.none_apply") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.retirement_income_source_uniformed_services") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.none_apply") end within "#retirement-income-source-2" do expect(page).to have_text "Boone Community Garden" - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.none_apply") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.none_apply") end - within "#retirement-income-source-0" do + within "#retirement-income-source-1" do click_on I18n.t("general.review_and_edit") end - check I18n.t("state_file.questions.nc_retirement_income_subtraction.edit.bailey_settlement_from_retirement_plan") + check I18n.t("state_file.questions.nc_retirement_income_subtraction.edit.uniformed_services_retired") click_on I18n.t("general.continue") within "#retirement-income-source-0" do expect(page).to have_text "Dorothy Red" - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.retirement_income_source_bailey_settlement") - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.bailey_settlement_at_least_five_years") - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.bailey_settlement_from_retirement_plan") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.retirement_income_source_bailey_settlement") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.bailey_settlement_at_least_five_years") end within "#retirement-income-source-1" do expect(page).to have_text "The People's Free Food Emporium" - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.retirement_income_source_uniformed_services") - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.none_apply") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.retirement_income_source_uniformed_services") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.uniformed_twenty_years_medical_retired") + expect(page).not_to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.none_apply") end within "#retirement-income-source-2" do expect(page).to have_text "Boone Community Garden" - expect(page).to have_text I18n.t("state_file.questions.nc_review.edit.none_apply") + expect(page).to have_text I18n.t("state_file.questions.shared.nc_retirement_income_deductions_review_header.none_apply") end end end From 9b4a030576afef9ea184091d81a880488804d80b Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Thu, 6 Mar 2025 11:34:08 -0800 Subject: [PATCH 08/10] Use section instead of div --- .../_az_retirement_income_deductions_review_header.html.erb | 4 ++-- .../_id_retirement_income_deductions_review_header.html.erb | 4 ++-- .../shared/_nc_retirement_income_deductions_review_header.erb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb b/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb index 717a3a2268..3e0180dc0d 100644 --- a/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb +++ b/app/views/state_file/questions/shared/_az_retirement_income_deductions_review_header.html.erb @@ -1,5 +1,5 @@ <% if current_intake.eligible_1099rs.length.positive? %> -
+

<%=t(".title") %>

<%=t(".subtitle") %>

@@ -30,5 +30,5 @@ <% end %>
-
+ <% end %> \ No newline at end of file diff --git a/app/views/state_file/questions/shared/_id_retirement_income_deductions_review_header.html.erb b/app/views/state_file/questions/shared/_id_retirement_income_deductions_review_header.html.erb index eae9681ecc..274977f635 100644 --- a/app/views/state_file/questions/shared/_id_retirement_income_deductions_review_header.html.erb +++ b/app/views/state_file/questions/shared/_id_retirement_income_deductions_review_header.html.erb @@ -1,5 +1,5 @@ <% if current_intake.calculator.line_or_zero(:ID39R_B_LINE_8e).positive? %> -
+

<%= t(".qualified_retirement_benefits_deduction") %>

<%= t(".qualified_retirement_benefits_deduction_explain") %>

@@ -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" %>
-
+ <% end %> diff --git a/app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb b/app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb index b24c99523c..65f48e55e4 100644 --- a/app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb +++ b/app/views/state_file/questions/shared/_nc_retirement_income_deductions_review_header.erb @@ -1,5 +1,5 @@ <% if current_intake.eligible_1099rs.length.positive? %> -
+

<%=t(".retirement_income_deductions") %>

<%= t(".retirement_income_deductions_explanation") %>

@@ -46,5 +46,5 @@ <% end %> <% end %>
-
+ <% end %> \ No newline at end of file From 566d63d6e0b3ea634087509fc730dc1fcde77344 Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Thu, 6 Mar 2025 11:39:47 -0800 Subject: [PATCH 09/10] Move MD retirement subtraction followups into partial like the other states --- .../questions/md_review/edit.html.erb | 38 ------------------ ...rement_income_deductions_review_header.erb | 39 +++++++++++++++++++ config/locales/en.yml | 13 ++++--- config/locales/es.yml | 13 ++++--- 4 files changed, 53 insertions(+), 50 deletions(-) create mode 100644 app/views/state_file/questions/shared/_md_retirement_income_deductions_review_header.erb diff --git a/app/views/state_file/questions/md_review/edit.html.erb b/app/views/state_file/questions/md_review/edit.html.erb index 0bb5da0426..c7532d9b6a 100644 --- a/app/views/state_file/questions/md_review/edit.html.erb +++ b/app/views/state_file/questions/md_review/edit.html.erb @@ -24,44 +24,6 @@ <%= render "state_file/questions/shared/review_header" %> <% if current_intake.state_file1099_rs.length.positive? && Flipper.enabled?(:show_retirement_ui) %> -
-
-

<%=t(".retirement_income_deductions") %>

- - <% current_intake.state_file1099_rs.each_with_index do |state_file1099_r, index| %> - <% followup = state_file1099_r.state_specific_followup %> - <% unless followup.nil? %> -
" class="spacing-above-15 spacing-below-15"> -

<%= state_file1099_r.payer_name %>

-
-
    - <% if followup.income_source_pension_annuity_endowment? %> -
  • <%= t(".pension_annuity_endowment") %>
  • - <% end %> - <% if followup.income_source_other? %> -
  • <%= t(".other") %>
  • - <% end %> - <% if followup.service_type_military? %> -
  • <%= t(".military") %>
  • - <% end %> - <% if followup.service_type_public_safety? %> -
  • <%= t(".public_safety") %>
  • - <% end %> - <% if followup.service_type_none? %> -
  • <%= t(".none") %>
  • - <% end %> -
-
- <%= link_to StateFile::Questions::MdRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %> - <%= t("general.review_and_edit") %> - <%= t(".retirement_income_deductions") %> - <% end %> -
- <% end %> - <% end %> -
-
-

<%=t(".disability_status") %>

diff --git a/app/views/state_file/questions/shared/_md_retirement_income_deductions_review_header.erb b/app/views/state_file/questions/shared/_md_retirement_income_deductions_review_header.erb new file mode 100644 index 0000000000..4a15b27ad6 --- /dev/null +++ b/app/views/state_file/questions/shared/_md_retirement_income_deductions_review_header.erb @@ -0,0 +1,39 @@ +<% if current_intake.eligible_1099rs.length.positive? %> +
+
+

<%=t(".retirement_income_deductions") %>

+ + <% current_intake.eligible_1099rs.each_with_index do |state_file1099_r, index| %> + <% followup = state_file1099_r.state_specific_followup %> + <% unless followup.nil? %> +
" class="spacing-above-15 spacing-below-15"> +

<%= state_file1099_r.payer_name %>

+
+
    + <% if followup.income_source_pension_annuity_endowment? %> +
  • <%= t(".pension_annuity_endowment") %>
  • + <% end %> + <% if followup.income_source_other? %> +
  • <%= t(".other") %>
  • + <% end %> + <% if followup.service_type_military? %> +
  • <%= t(".military") %>
  • + <% end %> + <% if followup.service_type_public_safety? %> +
  • <%= t(".public_safety") %>
  • + <% end %> + <% if followup.service_type_none? %> +
  • <%= t(".none") %>
  • + <% end %> +
+
+ <%= link_to StateFile::Questions::MdRetirementIncomeSubtractionController.to_path_helper(return_to_review: "y", index: index), class: "button--small" do %> + <%= t("general.review_and_edit") %> + <%= t(".retirement_income_deductions") %> + <% end %> +
+ <% end %> + <% end %> +
+
+<% end %> \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 4bcfcf7f7c..08799c445f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3275,14 +3275,8 @@ en: edit: county_html: " County lived in on December 31, %{filing_year}" disability_status: Totally and permanently disabled status - military: Benefits from your military service or benefits received for the military service of your deceased spouse or ex-spouse - none: None apply - other: Other retirement income (For example, a Keogh plan) - pension_annuity_endowment: Money from a pension, annuity, or other retirement plan from your job political_subdivision_html: "Political subdivision lived in on December 31, %{filing_year}" primary_proof_of_disability: Proof provided of disability for the pension exclusion in past tax years - public_safety: Your service as a public safety employee - retirement_income_deductions: Maryland retirement income details spouse_proof_of_disability: Spouse's proof provided of disability for the pension exclusion in past tax years your_address: Address lived at on December 31, %{filing_year} md_spouse_state_id: @@ -4087,6 +4081,13 @@ en: qualified_disabled_retirement_benefits: Qualified disabled retirement benefits qualified_retirement_benefits_deduction: Qualified Retirement Benefits Deduction qualified_retirement_benefits_deduction_explain: These allow people to deduct all or a portion of their retirement income from their taxes. + md_retirement_income_deductions_review_header: + military: Benefits from your military service or benefits received for the military service of your deceased spouse or ex-spouse + none: None apply + other: Other retirement income (For example, a Keogh plan) + pension_annuity_endowment: Money from a pension, annuity, or other retirement plan from your job + public_safety: Your service as a public safety employee + retirement_income_deductions: Maryland retirement income details nc_retirement_income_deductions_review_header: bailey_settlement_at_least_five_years: At least five years of creditable service by August 12, 1989 bailey_settlement_from_retirement_plan: Received retirement benefits from NC’s 401(k) or 457 plan, and contributed to the plan before August 12, 1989 diff --git a/config/locales/es.yml b/config/locales/es.yml index 642f6b98c9..ea6f7ffdcb 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -3245,14 +3245,8 @@ es: edit: county_html: "Condado donde vivías el 31 de diciembre de %{filing_year}" disability_status: Estado de discapacidad total y permanente - military: Tu servicio en el ejército o los beneficios por fallecimiento militar recibidos en nombre de un cónyuge o ex-cónyuge - none: Ninguno aplica. - other: Otros ingresos de jubilación (por ejemplo, un plan Keogh) - pension_annuity_endowment: Una pensión, renta vitalicia o dotación de un “sistema de jubilación para empleados” political_subdivision_html: "Subdivisión política donde vivías el 31 de diciembre de %{filing_year}" primary_proof_of_disability: Presentaste pruebas de una discapacidad para la exclusión de pensiones en años fiscales anteriores. - public_safety: Tu servicio como empleado de seguridad pública. - retirement_income_deductions: Detalles sobre los ingresos de jubilación de Maryland spouse_proof_of_disability: Prueba de discapacidad del cónyuge para la exclusión de pensión en años fiscales anteriores presentada. your_address: Dirección donde vivías el 31 de diciembre del %{filing_year} md_spouse_state_id: @@ -4073,6 +4067,13 @@ es: qualified_disabled_retirement_benefits: Beneficios calificados de jubilación para personas con discapacidad qualified_retirement_benefits_deduction: Deducción por Beneficios Calificados de Jubilación qualified_retirement_benefits_deduction_explain: Estos permiten a las personas deducir de sus impuestos la totalidad o una parte de sus ingresos por jubilación. + md_retirement_income_deductions_review_header: + military: Tu servicio en el ejército o los beneficios por fallecimiento militar recibidos en nombre de un cónyuge o ex-cónyuge + none: Ninguno aplica. + other: Otros ingresos de jubilación (por ejemplo, un plan Keogh) + pension_annuity_endowment: Una pensión, renta vitalicia o dotación de un “sistema de jubilación para empleados” + public_safety: Tu servicio como empleado de seguridad pública. + retirement_income_deductions: Detalles sobre los ingresos de jubilación de Maryland nc_retirement_income_deductions_review_header: bailey_settlement_at_least_five_years: Al menos cinco años de servicio acreditable antes del 12 de agosto de 1989 bailey_settlement_from_retirement_plan: Recibiste beneficios de jubilación del plan 401(k) o 457 de NC y contribuiste al plan antes del 12 de agosto de 1989 From a5447087e071ee5db51f5b606cab02c73fe3ce4f Mon Sep 17 00:00:00 2001 From: Arin Choi Date: Thu, 6 Mar 2025 12:13:55 -0800 Subject: [PATCH 10/10] Fix up references to yaml keys --- spec/features/state_file/review_page_spec.rb | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/features/state_file/review_page_spec.rb b/spec/features/state_file/review_page_spec.rb index 7994225cd8..91cb93c6d2 100644 --- a/spec/features/state_file/review_page_spec.rb +++ b/spec/features/state_file/review_page_spec.rb @@ -275,19 +275,19 @@ it "allows user to view and edit their 1099R followup information" do within "#retirement-income-source-0" do expect(page).to have_text "Dorothy Red" - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.pension_annuity_endowment") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.pension_annuity_endowment") end within "#retirement-income-source-1" do expect(page).to have_text "Maryland State Retirement" - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.other") - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.military") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.other") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.military") end within "#retirement-income-source-2" do expect(page).to have_text "Baltimore County Pension" - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.other") - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.public_safety") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.other") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.public_safety") end within "#retirement-income-source-0" do @@ -300,20 +300,20 @@ within "#retirement-income-source-0" do expect(page).to have_text "Dorothy Red" - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.other") - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.military") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.other") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.military") end within "#retirement-income-source-1" do expect(page).to have_text "Maryland State Retirement" - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.other") - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.military") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.other") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.military") end within "#retirement-income-source-2" do expect(page).to have_text "Baltimore County Pension" - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.other") - expect(page).to have_text I18n.t("state_file.questions.md_review.edit.public_safety") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.other") + expect(page).to have_text I18n.t("state_file.questions.shared.md_retirement_income_deductions_review_header.public_safety") end end