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 1837 md update 1099 r disability page #5640

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
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 @@ -2,15 +2,10 @@ module StateFile
module Questions
class MdPermanentlyDisabledController < QuestionsController
include ReturnToReviewConcern

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

private

def form_params
params.require(:state_file_md_permanently_disabled_form).permit(:mfj_disability, :primary_disabled, :spouse_disabled, :proof_of_disability_submitted)
end
end
end
end
59 changes: 35 additions & 24 deletions app/forms/state_file/md_permanently_disabled_form.rb
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
module StateFile
class MdPermanentlyDisabledForm < QuestionsForm
set_attributes_for :intake, :primary_disabled, :spouse_disabled, :proof_of_disability_submitted
set_attributes_for :intake, :mfj_disability, :primary_disabled, :spouse_disabled, :primary_proof_of_disability_submitted, :spouse_proof_of_disability_submitted

attr_accessor :mfj_disability
validates_presence_of :mfj_disability, if: -> { intake.filing_status_mfj?}
validates_presence_of :mfj_disability, if: -> { intake.filing_status_mfj? }
validates :primary_disabled, inclusion: { in: %w[yes no], message: :blank }, unless: -> { intake.filing_status_mfj? }
validates :proof_of_disability_submitted, inclusion: { in: %w[yes no], message: :blank }, if: :disability_selected?

validates :primary_proof_of_disability_submitted, inclusion: { in: %w[yes no], message: :blank }, if: :primary_requires_proof?
validates :spouse_proof_of_disability_submitted, inclusion: { in: %w[yes no], message: :blank }, if: :spouse_requires_proof?

def save
attributes_to_save = attributes_for(:intake).except(:mfj_disability)
if mfj_disability.present?
attributes_to_save = case mfj_disability
when "primary"
attributes_to_save.merge(primary_disabled: "yes", spouse_disabled: "no")
when "spouse"
attributes_to_save.merge(primary_disabled: "no", spouse_disabled: "yes")
when "both"
attributes_to_save.merge(primary_disabled: "yes", spouse_disabled: "yes")
when "none"
attributes_to_save.merge(primary_disabled: "no", spouse_disabled: "no")
end
end

@intake.update(attributes_to_save)
end

private

def proof_not_required?
if intake.filing_status_mfj?
case mfj_disability
when "me"
@intake.update(primary_disabled: "yes", spouse_disabled: "no", proof_of_disability_submitted: proof_of_disability_submitted)
when "spouse"
@intake.update(primary_disabled: "no", spouse_disabled: "yes", proof_of_disability_submitted: proof_of_disability_submitted)
when "both"
@intake.update(primary_disabled: "yes", spouse_disabled: "yes", proof_of_disability_submitted: proof_of_disability_submitted)
when "none"
@intake.update(primary_disabled: "no", spouse_disabled: "no", proof_of_disability_submitted: nil)
end
elsif primary_disabled == "no"
@intake.update(
primary_disabled: "no",
proof_of_disability_submitted: nil
)
intake.primary_senior? && intake.spouse_senior?
else
@intake.update(attributes_for(:intake))
intake.primary_senior?
end
end

private
def primary_requires_proof?
return false if proof_not_required?

mfj_disability.in?(%w[primary both]) || primary_disabled == "yes"
end

def spouse_requires_proof?
return false if proof_not_required?

def disability_selected?
mfj_disability.in?(%w[me spouse both]) || primary_disabled == "yes"
mfj_disability.in?(%w[spouse both])
end
end
end
12 changes: 5 additions & 7 deletions app/models/state_file_md_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@
# primary_first_name :string
# primary_last_name :string
# primary_middle_initial :string
# primary_proof_of_disability_submitted :integer default("unfilled"), not null
# primary_signature :string
# primary_signature_pin :text
# primary_ssb_amount :decimal(12, 2) default(0.0), not null
# primary_ssn :string
# primary_student_loan_interest_ded_amount :decimal(12, 2) default(0.0), not null
# primary_suffix :string
# proof_of_disability_submitted :integer default("unfilled"), not null
# raw_direct_file_data :text
# raw_direct_file_intake_data :jsonb
# referrer :string
Expand All @@ -85,6 +85,7 @@
# spouse_first_name :string
# spouse_last_name :string
# spouse_middle_initial :string
# spouse_proof_of_disability_submitted :integer default("unfilled"), not null
# spouse_signature_pin :text
# spouse_ssb_amount :decimal(12, 2) default(0.0), not null
# spouse_ssn :string
Expand Down Expand Up @@ -130,7 +131,8 @@ class StateFileMdIntake < StateFileBaseIntake
enum has_joint_account_holder: { unfilled: 0, yes: 1, no: 2 }, _prefix: :has_joint_account_holder
enum primary_disabled: { unfilled: 0, yes: 1, no: 2 }, _prefix: :primary_disabled
enum spouse_disabled: { unfilled: 0, yes: 1, no: 2 }, _prefix: :spouse_disabled
enum proof_of_disability_submitted: { unfilled: 0, yes: 1, no: 2 }, _prefix: :proof_of_disability_submitted
enum primary_proof_of_disability_submitted: { unfilled: 0, yes: 1, no: 2 }, _prefix: :primary_proof_of_disability_submitted
enum spouse_proof_of_disability_submitted: { unfilled: 0, yes: 1, no: 2 }, _prefix: :spouse_proof_of_disability_submitted

def disqualifying_df_data_reason
w2_states = direct_file_data.parsed_xml.css('W2StateLocalTaxGrp W2StateTaxGrp StateAbbreviationCd')
Expand Down Expand Up @@ -239,11 +241,7 @@ def allows_refund_amount_in_xml?
end

def at_least_one_disabled_filer_with_proof?
if filing_status_mfj?
(primary_disabled_yes? || spouse_disabled_yes?) && proof_of_disability_submitted_yes?
else
primary_disabled_yes? && proof_of_disability_submitted_yes?
end
primary_proof_of_disability_submitted_yes? || spouse_proof_of_disability_submitted_yes?
end

def qualifies_for_pension_exclusion?(filer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,55 @@
<div class="question-with-follow-up__question">
<div class="white-group">
<% if current_intake.filing_status_mfj? %>
<% are_filers_under_65 = !(current_intake.primary_senior? && current_intake.spouse_senior?) %>
<% primary_data_followup = are_filers_under_65 ? "#primary-disability-proof" : nil %>
<% spouse_data_followup = are_filers_under_65 ? "#spouse-disability-proof" : nil %>
<% both_data_followup = are_filers_under_65 ? "#both-disability-proof" : nil %>

<%= f.cfa_radio_set(:mfj_disability, collection: [
{ value: "me", label: t(".yes_me"), input_html: { "data-follow-up": "#disability-proof" } },
{ value: "spouse", label: t(".yes_spouse"), input_html: { "data-follow-up": "#disability-proof" } },
{ value: "both", label: t(".yes_both"), input_html: { "data-follow-up": "#disability-proof" } },
{ value: "primary", label: t(".yes_me"), input_html: { "data-follow-up": primary_data_followup } },
{ value: "spouse", label: t(".yes_spouse"), input_html: { "data-follow-up": spouse_data_followup } },
{ value: "both", label: t(".yes_both"), input_html: { "data-follow-up": both_data_followup } },
{ value: "none", label: t(".no_neither") }
]) %>
<% else %>
<% primary_data_followup = !current_intake.primary_senior? ? "#primary-disability-proof" : nil %>
<%= f.cfa_radio_set(:primary_disabled, collection: [
{ value: "yes", label: t("general.affirmative"), input_html: { "data-follow-up": "#disability-proof" } },
{ value: "yes", label: t("general.affirmative"), input_html: { "data-follow-up": primary_data_followup } },
{ value: "no", label: t("general.negative") }
], legend_class: "sr-only") %>
<% end %>
</div>
</div>

<div class="question-with-follow-up__follow-up" id="disability-proof">
<div class="question-with-follow-up__follow-up" id="primary-disability-proof">
<div class="white-group">
<%= f.cfa_radio_set(:primary_proof_of_disability_submitted, label_text: t(".primary_proof_question_html"), collection: [
{ value: "yes", label: t("general.affirmative") },
{ value: "no", label: t("general.negative") },
]) %>
</div>
</div>

<div class="question-with-follow-up__follow-up" id="spouse-disability-proof">
<div class="white-group">
<%= f.cfa_radio_set(:spouse_proof_of_disability_submitted, label_text: t(".spouse_proof_question_html"), collection: [
{ value: "yes", label: t("general.affirmative") },
{ value: "no", label: t("general.negative") },
]) %>
</div>
</div>

<div class="question-with-follow-up__follow-up" id="both-disability-proof">
<div class="white-group">
<%= f.cfa_radio_set(:proof_of_disability_submitted, label_text: t(".proof_question"), collection: [
<%= f.cfa_radio_set(:primary_proof_of_disability_submitted, label_text: t(".primary_proof_question_html"), collection: [
{ value: "yes", label: t("general.affirmative") },
{ value: "no", label: t("general.negative") },
]) %>
</div>

<div class="white-group">
<%= f.cfa_radio_set(:spouse_proof_of_disability_submitted, label_text: t(".spouse_proof_question_html"), collection: [
{ value: "yes", label: t("general.affirmative") },
{ value: "no", label: t("general.negative") },
]) %>
Expand All @@ -49,4 +80,4 @@
<% end %>
<%= f.continue %>
<% end %>
<% end %>
<% end %>
10 changes: 7 additions & 3 deletions app/views/state_file/questions/md_review/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@
<% else %>
<p><%=current_intake.primary_disabled_yes? ? t("general.affirmative") : t("general.negative") %></p>
<% end %>
<% unless current_intake.proof_of_disability_submitted_unfilled? %>
<p class="text--bold spacing-below-5"><%=t(".proof_of_disability") %></p>
<p><%=current_intake.proof_of_disability_submitted_yes? ? t("general.affirmative") : t("general.negative") %></p>
<% unless current_intake.primary_proof_of_disability_submitted_unfilled? %>
<p class="text--bold spacing-below-5"><%=t(".primary_proof_of_disability") %></p>
<p><%=current_intake.primary_proof_of_disability_submitted_yes? ? t("general.affirmative") : t("general.negative") %></p>
<% end %>
<% unless current_intake.spouse_proof_of_disability_submitted_unfilled? %>
<p class="text--bold spacing-below-5"><%=t(".spouse_proof_of_disability") %></p>
<p><%=current_intake.spouse_proof_of_disability_submitted_yes? ? t("general.affirmative") : t("general.negative") %></p>
<% end %>
<%= link_to t("general.review_and_edit"), StateFile::Questions::MdPermanentlyDisabledController.to_path_helper(return_to_review: "y"), class: "button--small" %>
<span class="sr-only"><%= t(".disability_status") %></span>
Expand Down
6 changes: 4 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3181,7 +3181,8 @@ en:
help_text_html: You are considered totally disabled if you have a mental or physical condition that stops you from working and earning a living. <br><br>This condition is expected to last a long time, for an indefinite period, or to result in your death. If you are under 65 and want to claim the pension exclusion, you must have attached a certification from a qualified physician stating the nature of your impairment and that you are totally disabled to a previously filed tax return.
help_title: What is considered totally and permanently disabled?
no_neither: No, neither of us is
proof_question: Have you provided proof of your disability to Maryland for the pension exclusion in previous tax years?
primary_proof_question_html: Have <strong>you</strong> provided proof of your disability for the <a href="https://www.marylandtaxes.gov/individual/income/filing/pension-exclusion.php">Maryland Pension Exclusion</a>in the previous tax years?
spouse_proof_question_html: Has <strong>your spouse</strong> provided proof of your disability for the <a href="https://www.marylandtaxes.gov/individual/income/filing/pension-exclusion.php">Maryland Pension Exclusion</a> in the previous tax years?
title: Are you totally and permanently disabled?
title_spouse: Are you or your spouse totally and permanently disabled?
yes_both: Yes, we both are
Expand Down Expand Up @@ -3247,9 +3248,10 @@ en:
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: "<strong>Political subdivision lived in on December 31, %{filing_year}</strong>"
proof_of_disability: Proof provided of disability for the pension exclusion in past tax years
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_social_security_benefits:
edit:
Expand Down
6 changes: 4 additions & 2 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3151,7 +3151,8 @@ es:
help_text_html: Se considera que estás totalmente discapacitado si tienes una condición mental o física que te impide trabajar y recibir ingresos. <br><br>Se espera que esta condición dure mucho tiempo, por un período indefinido o que resulte en tu muerte. Si tienes menos de 65 años y deseas reclamar la exclusión de pensión, debes haber adjuntado una certificación de un médico calificado que indique la naturaleza de tu discapacidad y que estás totalmente incapacitado a una declaración de impuestos presentada anteriormente.
help_title: "¿Qué se considera total y permanentemente discapacitado?"
no_neither: No, ninguno de los dos lo está
proof_question: "¿Has presentado prueba de tu discapacidad para obtener la exclusión de pensión en años fiscales anteriores?"
primary_proof_question_html: ¿Has presentado prueba de <strong>tu</strong> discapacidad para <a href="https://www.marylandtaxes.gov/individual/income/filing/pension-exclusion.php"> la Exclusión de Pensiones de Maryland </a> en años fiscales anteriores?
spouse_proof_question_html: ¿Ha presentado prueba de <strong>tu cónyuge</strong> discapacidad para <a href="https://www.marylandtaxes.gov/individual/income/filing/pension-exclusion.php">la Exclusión de Pensiones de Maryland </a> en años fiscales anteriores?
title: "¿Estás total y permanentemente discapacitado?"
title_spouse: "¿Tú o tu cónyuge están total y permanentemente discapacitados?"
yes_both: Sí, ambos lo estamos
Expand Down Expand Up @@ -3217,9 +3218,10 @@ es:
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: "<strong>Subdivisión política donde vivías el 31 de diciembre de %{filing_year}</strong>"
proof_of_disability: Presentaste pruebas de una discapacidad para la exclusión de pensiones en años fiscales anteriores.
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: Su cónyuge presentó pruebas de una discapacidad para la exclusión de pensiones en años fiscales anteriores.
your_address: Dirección donde vivías el 31 de diciembre del %{filing_year}
md_social_security_benefits:
edit:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class SeparateColumnsForProofOfDisabled < ActiveRecord::Migration[7.1]
def change
safety_assured do
remove_column :state_file_md_intakes, :proof_of_disability_submitted, :integer, default: 0, null: false
end
add_column :state_file_md_intakes, :primary_proof_of_disability_submitted, :integer, default: 0, null: false
add_column :state_file_md_intakes, :spouse_proof_of_disability_submitted, :integer, default: 0, null: false
end
end
5 changes: 3 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2025_02_14_234544) do
ActiveRecord::Schema[7.1].define(version: 2025_02_21_220547) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "plpgsql"
Expand Down Expand Up @@ -2110,14 +2110,14 @@
t.string "primary_first_name"
t.string "primary_last_name"
t.string "primary_middle_initial"
t.integer "primary_proof_of_disability_submitted", default: 0, null: false
t.string "primary_signature"
t.text "primary_signature_pin"
t.decimal "primary_ssb_amount", precision: 12, scale: 2, default: "0.0", null: false
t.string "primary_ssn"
t.bigint "primary_state_id_id"
t.decimal "primary_student_loan_interest_ded_amount", precision: 12, scale: 2, default: "0.0", null: false
t.string "primary_suffix"
t.integer "proof_of_disability_submitted", default: 0, null: false
t.text "raw_direct_file_data"
t.jsonb "raw_direct_file_intake_data"
t.string "referrer"
Expand All @@ -2134,6 +2134,7 @@
t.string "spouse_first_name"
t.string "spouse_last_name"
t.string "spouse_middle_initial"
t.integer "spouse_proof_of_disability_submitted", default: 0, null: false
t.text "spouse_signature_pin"
t.decimal "spouse_ssb_amount", precision: 12, scale: 2, default: "0.0", null: false
t.string "spouse_ssn"
Expand Down
Loading
Loading