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

w2 validations for wages amt #4348

Merged
merged 1 commit into from
Mar 12, 2024
Merged
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
1 change: 1 addition & 0 deletions app/controllers/state_file/questions/ny_w2_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def self.invalid_w2?(intake, w2)
return true if w2.EmployerStateIdNum.present? && w2.StateAbbreviationCd.blank?
return true if w2.StateIncomeTaxAmt > w2.StateWagesAmt
return true if w2.LocalIncomeTaxAmt > w2.LocalWagesAndTipsAmt
return true if w2.StateIncomeTaxAmt + w2.LocalIncomeTaxAmt > w2.WagesAmt
false
end
end
Expand Down
4 changes: 4 additions & 0 deletions app/models/state_file_w2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ def validate_tax_amts
if local_wages_and_tips_amt.present? && local_wages_and_tips_amt > w2.WagesAmt
errors.add(:local_wages_and_tips_amt, I18n.t("errors.messages.less_than_or_equal_to", count: w2.WagesAmt))
end
if state_income_tax_amt.present? && local_income_tax_amt.present? && (state_income_tax_amt + local_income_tax_amt > w2.WagesAmt)
errors.add(:local_income_tax_amt, I18n.t("state_file.questions.ny_w2.edit.wages_amt_error", wages_amount: w2.WagesAmt))
errors.add(:state_income_tax_amt, I18n.t("state_file.questions.ny_w2.edit.wages_amt_error", wages_amount: w2.WagesAmt))
end
end
end

Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2390,6 +2390,7 @@ en:
state_income_tax_amt_error: Cannot be greater than State wages and tips.
state_wages_amt_error: Please enter State wages and tips
w2s_error: Update W-2s before continuing.
wages_amt_error: Total income tax cannot be greater than $%{wages_amount}
index:
title: Please provide state tax information for the following W-2s. Do not worry if you have multiple W-2s and not all of them are listed below.
updated: You've updated this W-2
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2390,6 +2390,7 @@ es:
state_income_tax_amt_error: No puede ser mayor que los salarios y propinas estatales.
state_wages_amt_error: Por favor ingrese los salarios y propinas estatales.
w2s_error: Actualice los formularios W-2 antes de continuar.
wages_amt_error: El impuesto sobre la renta total no puede ser mayor que $%{wages_amount}
index:
title: Proporcione información fiscal estatal para los siguientes formularios W-2. No se preocupe si tiene varios W-2 y no todos se enumeran a continuación.
updated: Has actualizado este W-2
Expand Down
Loading