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-996 add two income sub md #4963

Merged
merged 24 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 21 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
@@ -0,0 +1,16 @@
module StateFile
module Questions
class MdTwoIncomeSubtractionsController < QuestionsController

def self.show?(intake)
intake.filing_status_mfj? && intake.direct_file_data.fed_student_loan_interest.present?
end

def edit
super
@total_deduction = current_intake.direct_file_data.fed_student_loan_interest || 0
end
private
end
end
end
24 changes: 24 additions & 0 deletions app/forms/state_file/md_two_income_subtractions_form.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module StateFile
class MdTwoIncomeSubtractionsForm < QuestionsForm
set_attributes_for :intake, :primary_student_loan_interest_ded_amount, :spouse_student_loan_interest_ded_amount

validate :valid_amounts

def save
@intake.update(attributes_for(:intake))
end

private

def valid_amounts
if @intake.direct_file_data.fed_student_loan_interest.present?
if (primary_student_loan_interest_ded_amount.to_f + spouse_student_loan_interest_ded_amount.to_f).to_round != @intake.direct_file_data.fed_student_loan_interest.to_f.to_round
errors.add(
:primary_student_loan_interest_ded_amount,
I18n.t("state_file.questions.md_two_income_subtractions.edit.sum_form_error", total_deduction: @intake.direct_file_data.fed_student_loan_interest)
)
end
end
end
end
end
1 change: 1 addition & 0 deletions app/lib/navigation/state_file_md_question_navigation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class StateFileMdQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio
Navigation::NavigationStep.new(StateFile::Questions::DataTransferOffboardingController, false),
Navigation::NavigationStep.new(StateFile::Questions::IncomeReviewController),
Navigation::NavigationStep.new(StateFile::Questions::UnemploymentController),
Navigation::NavigationStep.new(StateFile::Questions::MdTwoIncomeSubtractionsController),
Navigation::NavigationStep.new(StateFile::Questions::PrimaryStateIdController),
Navigation::NavigationStep.new(StateFile::Questions::SpouseStateIdController),
Navigation::NavigationStep.new(StateFile::Questions::MdReviewController),
Expand Down
2 changes: 1 addition & 1 deletion app/models/direct_file_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def primary_earned_income_amount=(value)
def spouse_earned_income_amount=(value)
write_df_xml_value(__method__, value)
end

class DfW2 < DfW2Accessor
def w2_box12
@node.css('EmployersUseGrp').map do |node|
Expand Down
158 changes: 80 additions & 78 deletions app/models/state_file_md_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,86 @@
#
# Table name: state_file_md_intakes
#
# id :bigint not null, primary key
# account_holder_name :string
# account_number :string
# account_type :integer default("unfilled"), not null
# bank_name :string
# city :string
# confirmed_permanent_address :integer default("unfilled"), not null
# consented_to_terms_and_conditions :integer default("unfilled"), not null
# contact_preference :integer default("unfilled"), not null
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# current_step :string
# date_electronic_withdrawal :date
# df_data_import_failed_at :datetime
# df_data_imported_at :datetime
# eligibility_filing_status_mfj :integer default("unfilled"), not null
# eligibility_home_different_areas :integer default("unfilled"), not null
# eligibility_homebuyer_withdrawal :integer default("unfilled"), not null
# eligibility_homebuyer_withdrawal_mfj :integer default("unfilled"), not null
# eligibility_lived_in_state :integer default("unfilled"), not null
# eligibility_out_of_state_income :integer default("unfilled"), not null
# email_address :citext
# email_address_verified_at :datetime
# failed_attempts :integer default(0), not null
# federal_return_status :string
# hashed_ssn :string
# last_sign_in_at :datetime
# last_sign_in_ip :inet
# locale :string default("en")
# locked_at :datetime
# message_tracker :jsonb
# payment_or_deposit_type :integer default("unfilled"), not null
# permanent_address_outside_md :integer default("unfilled"), not null
# permanent_apartment :string
# permanent_city :string
# permanent_street :string
# permanent_zip :string
# phone_number :string
# phone_number_verified_at :datetime
# political_subdivision :string
# primary_birth_date :date
# primary_esigned :integer default("unfilled"), not null
# primary_esigned_at :datetime
# primary_first_name :string
# primary_last_name :string
# primary_middle_initial :string
# primary_signature :string
# primary_signature_pin :text
# primary_ssn :string
# primary_suffix :string
# raw_direct_file_data :text
# raw_direct_file_intake_data :jsonb
# referrer :string
# residence_county :string
# routing_number :string
# sign_in_count :integer default(0), not null
# source :string
# spouse_birth_date :date
# spouse_esigned :integer default("unfilled"), not null
# spouse_esigned_at :datetime
# spouse_first_name :string
# spouse_last_name :string
# spouse_middle_initial :string
# spouse_signature_pin :text
# spouse_ssn :string
# spouse_suffix :string
# street_address :string
# subdivision_code :string
# unfinished_intake_ids :text default([]), is an Array
# unsubscribed_from_email :boolean default(FALSE), not null
# withdraw_amount :decimal(12, 2)
# zip_code :string
# created_at :datetime not null
# updated_at :datetime not null
# federal_submission_id :string
# primary_state_id_id :bigint
# spouse_state_id_id :bigint
# visitor_id :string
# id :bigint not null, primary key
# account_holder_name :string
# account_number :string
# account_type :integer default("unfilled"), not null
# bank_name :string
# city :string
# confirmed_permanent_address :integer default("unfilled"), not null
# consented_to_terms_and_conditions :integer default("unfilled"), not null
# contact_preference :integer default("unfilled"), not null
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# current_step :string
# date_electronic_withdrawal :date
# df_data_import_failed_at :datetime
# df_data_imported_at :datetime
# eligibility_filing_status_mfj :integer default("unfilled"), not null
# eligibility_home_different_areas :integer default("unfilled"), not null
# eligibility_homebuyer_withdrawal :integer default("unfilled"), not null
# eligibility_homebuyer_withdrawal_mfj :integer default("unfilled"), not null
# eligibility_lived_in_state :integer default("unfilled"), not null
# eligibility_out_of_state_income :integer default("unfilled"), not null
# email_address :citext
# email_address_verified_at :datetime
# failed_attempts :integer default(0), not null
# federal_return_status :string
# hashed_ssn :string
# last_sign_in_at :datetime
# last_sign_in_ip :inet
# locale :string default("en")
# locked_at :datetime
# message_tracker :jsonb
# payment_or_deposit_type :integer default("unfilled"), not null
# permanent_address_outside_md :integer default("unfilled"), not null
# permanent_apartment :string
# permanent_city :string
# permanent_street :string
# permanent_zip :string
# phone_number :string
# phone_number_verified_at :datetime
# political_subdivision :string
# primary_birth_date :date
# primary_esigned :integer default("unfilled"), not null
# primary_esigned_at :datetime
# primary_first_name :string
# primary_last_name :string
# primary_middle_initial :string
# primary_signature :string
# primary_signature_pin :text
# primary_ssn :string
# primary_student_loan_interest_ded_amount :decimal(12, 2) default(0.0), not null
# primary_suffix :string
# raw_direct_file_data :text
# raw_direct_file_intake_data :jsonb
# referrer :string
# residence_county :string
# routing_number :string
# sign_in_count :integer default(0), not null
# source :string
# spouse_birth_date :date
# spouse_esigned :integer default("unfilled"), not null
# spouse_esigned_at :datetime
# spouse_first_name :string
# spouse_last_name :string
# spouse_middle_initial :string
# spouse_signature_pin :text
# spouse_ssn :string
# spouse_student_loan_interest_ded_amount :decimal(12, 2) default(0.0), not null
# spouse_suffix :string
# street_address :string
# subdivision_code :string
# unfinished_intake_ids :text default([]), is an Array
# unsubscribed_from_email :boolean default(FALSE), not null
# withdraw_amount :decimal(12, 2)
# zip_code :string
# created_at :datetime not null
# updated_at :datetime not null
# federal_submission_id :string
# primary_state_id_id :bigint
# spouse_state_id_id :bigint
# visitor_id :string
#
# Indexes
#
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<% content_for :title, t(".title") %>

<% content_for :card do %>
<h1 class="h2"><%= t(".title") %></h1>
<p class="spacing-below-5"><%= t(".description") %></p>

<%= form_with model: @form, url: { action: :update }, local: true, method: "put", builder: VitaMinFormBuilder do |f| %>
<div class="white-group">
<p class="spacing-below-5"><%= t(".subtitle") %></p>
<p class="text--small spacing-below-5"><%= t(".total", total_deduction: number_to_currency(@total_deduction)) %></p>
<div class="form-question spacing-below-25">
<%= f.vita_min_money_field(:primary_student_loan_interest_ded_amount, "Your portion of the student loan interest deduction", classes: ["form-width--long"]) %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the label text have to be translated?

</div>

<div class="form-question spacing-below-25">
<%= f.vita_min_money_field(:spouse_student_loan_interest_ded_amount, "Your spouse's portion of the student loan interest deduction", classes: ["form-width--long"]) %>
Copy link
Contributor

Choose a reason for hiding this comment

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

and translations here as well!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good points, added 👍

</div>
</div>

<div class="reveal">
<p><a href="#" class="reveal__button"><%= t('.student_loan_deduction_heading') %></a></p>
<div class="reveal__content">
<p><%= t('.student_loan_deduction_copy') %></p>
<p><%= t('.student_loan_deduction_copy2') %></p>
</div>
</div>

<%= f.button :submit, class: "button button--wide button--primary" do %>
<%= t("general.continue") %>
<% end %>
<% end %>

<% end %>

13 changes: 13 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,9 @@ en:
ineligible_reason:
eligibility_529_for_non_qual_expense: withdrew money from a 529 college savings account and used it for a non-qualifying expense in 2023
eligibility_emergency_rental_assistance: received emergency rental assistance in 2024
eligibility_home_different_areas: or your spouse had your permanent homes in two different counties, cities, towns, or taxing areas on the last day the tax year
eligibility_homebuyer_withdrawal: withdrew money from a first-time homebuyer account and used it for anything other than purchasing a home
eligibility_homebuyer_withdrawal_mfj: or your spouse withdrew money from a first-time homebuyer account and used it for anything other than purchasing a home
eligibility_lived_in_state: did not live in %{state} for all of 2023
eligibility_married_filing_separately: are filing “married filing separately”
eligibility_out_of_state_income: earned income in another state in 2023
Expand Down Expand Up @@ -2690,6 +2693,16 @@ en:
md_tax_refund:
md_bank_details:
account_holder_name: Account Holder Name
md_two_income_subtractions:
edit:
description: In order to know if you qualify and calculate the subtraction, we need more information about the student loan interest deduction you took on your federal tax return.
student_loan_deduction_copy: This amount is based on interest paid on student loans and is limited to $2,500 per tax return.
student_loan_deduction_copy2: See Form(s) 1098-E for more information.
student_loan_deduction_heading: What is the federal student loan interest deduction?
subtitle: Enter the portions of the federal student loan interest deduction allocated between you and your spouse.
sum_form_error: The total of you and/or your spouse's student loan interest deduction must equal %{total_deduction}
title: You might qualify for the Maryland two-income subtraction
total: The total student loan interest deduction for you and your spouse's federal return is %{total_deduction}.
name_dob:
edit:
dependent_months_lived_label: Number of months they lived with you in %{year}
Expand Down
13 changes: 13 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,9 @@ es:
ineligible_reason:
eligibility_529_for_non_qual_expense: retiraste dinero de una cuenta de ahorro universitario 529 y lo utilizaste para un gasto no calificado en el 2023
eligibility_emergency_rental_assistance: recibió asistencia de alquiler de emergencia en 2024
eligibility_home_different_areas: o su cónyuge tenían sus residencias permanentes en dos condados, ciudades, pueblos o áreas impositivas diferentes el último día del año fiscal.
eligibility_homebuyer_withdrawal: retiraron dinero de una cuenta para compradores de vivienda por primera vez y lo usaron para algo que no era comprar una vivienda.
eligibility_homebuyer_withdrawal_mfj: o su cónyuge retiraron dinero de una cuenta para compradores de vivienda por primera vez y lo usaron para algo que no era comprar una vivienda.
eligibility_lived_in_state: no viviste en %{state} durante todo el 2023
eligibility_married_filing_separately: estás presentando una declaración de impuestos "casado, presentando por separado"
eligibility_out_of_state_income: recibiste ingresos en otro estado en el 2023
Expand Down Expand Up @@ -2662,6 +2665,16 @@ es:
md_tax_refund:
md_bank_details:
account_holder_name: Nombre del titular de la cuenta
md_two_income_subtractions:
edit:
description: Para saber si califica y calcular la deducción, necesitamos más información sobre la deducción de intereses de préstamos estudiantiles que tomó en su declaración de impuestos federales.
student_loan_deduction_copy: Esta cantidad se basa en los intereses pagados por préstamos estudiantiles y está limitada a $2,500 por declaración de impuestos.
student_loan_deduction_copy2: Consulte el formulario 1098-E para obtener más información.
student_loan_deduction_heading: "¿Qué es la deducción de intereses de préstamos federales para estudiantes?"
subtitle: Ingrese las porciones de la deducción de intereses de préstamos estudiantiles federales asignadas entre usted y su cónyuge.
sum_form_error: El total de la deducción de intereses de préstamos estudiantiles de usted y/o su cónyuge debe ser igual al %{total_deduction}
title: Es posible que califique para la deducción por dos ingresos de Maryland
total: La deducción total de intereses de préstamos estudiantiles para su declaración federal y la de su cónyuge es %{total_deduction}.
name_dob:
edit:
dependent_months_lived_label: Número de meses que vivió contigo en %{year}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddStudentLoanInterestDedAmountToStateFileMdIntakes < ActiveRecord::Migration[7.1]
def change
add_column :state_file_md_intakes, :primary_student_loan_interest_ded_amount, :decimal, precision: 12, scale: 2, null: false, default: 0
add_column :state_file_md_intakes, :spouse_student_loan_interest_ded_amount, :decimal, precision: 12, scale: 2, null: false, default: 0
end
end
2 changes: 2 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,7 @@
t.text "primary_signature_pin"
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.text "raw_direct_file_data"
t.jsonb "raw_direct_file_intake_data"
Expand All @@ -1954,6 +1955,7 @@
t.text "spouse_signature_pin"
t.string "spouse_ssn"
t.bigint "spouse_state_id_id"
t.decimal "spouse_student_loan_interest_ded_amount", precision: 12, scale: 2, default: "0.0", null: false
t.string "spouse_suffix"
t.string "street_address"
t.string "subdivision_code"
Expand Down
Loading
Loading