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 1387 remove employment question from excise credit page #5257

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
1 change: 0 additions & 1 deletion app/controllers/flows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,6 @@ def self.az_attributes(first_name: 'Testuser', last_name: 'Testuser', filing_sta
spouse_was_incarcerated: "no",
was_incarcerated: "no", # TODO: remove when column is ignored
household_excise_credit_claimed: "no",
ssn_no_employment: "no",
message_tracker: {},
locale: 'en',
unfinished_intake_ids: [],
Expand Down
2 changes: 0 additions & 2 deletions app/forms/state_file/az_excise_credit_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ class AzExciseCreditForm < QuestionsForm
set_attributes_for :intake,
:primary_was_incarcerated,
:spouse_was_incarcerated,
:ssn_no_employment,
:household_excise_credit_claimed,
:household_excise_credit_claimed_amount

validates :primary_was_incarcerated, inclusion: { in: %w[yes no], message: :blank }
validates :spouse_was_incarcerated, inclusion: { in: %w[yes no], message: :blank }, if: -> { intake.filing_status_mfj? }
validates :ssn_no_employment, inclusion: { in: %w[yes no], message: :blank }
validates :household_excise_credit_claimed, inclusion: { in: %w[yes no], message: :blank }
validates_presence_of :household_excise_credit_claimed_amount, if: -> { household_excise_credit_claimed == "yes" }
validates :household_excise_credit_claimed_amount, numericality: { greater_than: 0, message: ->(_object, _data) { I18n.t('validators.must_enter_amount') } }, allow_blank: true
Expand Down
10 changes: 8 additions & 2 deletions app/lib/efile/az/az140_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,14 @@ def calculate_line_56
0
else
# TODO question: if they are filing with us does that automatically mean no AZ-140PTC?
number_of_filers = filing_status_mfj? ? 2 : 1
wrksht_line_2 = number_of_filers - @intake.incarcerated_filer_count
number_of_eligible_filers =
if filing_status_mfj?
[@intake.direct_file_json_data.primary_filer.ssn_not_valid_for_employment,
@intake.direct_file_json_data.spouse_filer.ssn_not_valid_for_employment].count(&:blank?)
else
1
end
wrksht_line_2 = number_of_eligible_filers - @intake.incarcerated_filer_count
wrksht_line_4 = (@dependent_count + wrksht_line_2) * 25

max_credit = 100
Expand Down
15 changes: 10 additions & 5 deletions app/models/state_file_az_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
# spouse_middle_initial :string
# spouse_suffix :string
# spouse_was_incarcerated :integer default("unfilled"), not null
# ssn_no_employment :integer default("unfilled"), not null
# tribal_member :integer default("unfilled"), not null
# tribal_wages_amount :decimal(12, 2)
# unfinished_intake_ids :text default([]), is an Array
Expand Down Expand Up @@ -97,7 +96,6 @@ class StateFileAzIntake < StateFileBaseIntake
enum was_incarcerated: { unfilled: 0, yes: 1, no: 2 }, _prefix: :was_incarcerated
enum primary_was_incarcerated: { unfilled: 0, yes: 1, no: 2 }, _prefix: :primary_was_incarcerated
enum spouse_was_incarcerated: { unfilled: 0, yes: 1, no: 2 }, _prefix: :spouse_was_incarcerated
enum ssn_no_employment: { unfilled: 0, yes: 1, no: 2 }, _prefix: :ssn_no_employment
enum household_excise_credit_claimed: { unfilled: 0, yes: 1, no: 2 }, _prefix: :household_excise_credit_claimed
enum tribal_member: { unfilled: 0, yes: 1, no: 2 }, _prefix: :tribal_member
enum armed_forces_member: { unfilled: 0, yes: 1, no: 2 }, _prefix: :armed_forces_member
Expand Down Expand Up @@ -153,8 +151,15 @@ def disqualified_from_excise_credit_df?
end
agi_over_limit = direct_file_data.fed_agi > agi_limit
lacks_valid_ssn = primary.ssn.blank? || primary.has_itin?

agi_over_limit || lacks_valid_ssn
all_filers_ssn_not_valid_for_employment =
if filing_status_mfj?
direct_file_json_data.primary_filer.ssn_not_valid_for_employment &&
direct_file_json_data.spouse_filer.ssn_not_valid_for_employment
else
direct_file_json_data.primary_filer.ssn_not_valid_for_employment
end

agi_over_limit || lacks_valid_ssn || all_filers_ssn_not_valid_for_employment
end

def incarcerated_filer_count
Expand All @@ -177,7 +182,7 @@ def use_old_incarcerated_column?
def disqualified_from_excise_credit_fyst?
all_filers_incarcerated = was_incarcerated_yes? || (primary_was_incarcerated_yes? && spouse_was_incarcerated_yes?)
whole_credit_already_claimed = use_old_incarcerated_column? && household_excise_credit_claimed_yes?
all_filers_incarcerated || whole_credit_already_claimed || ssn_no_employment_yes? || direct_file_data.claimed_as_dependent?
all_filers_incarcerated || whole_credit_already_claimed || direct_file_data.claimed_as_dependent?
end

def filing_status
Expand Down
7 changes: 0 additions & 7 deletions app/views/state_file/questions/az_excise_credit/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
</div>
<% end %>

<div class="white-group">
<%= f.cfa_radio_set(:ssn_no_employment, label_text: t(".ssn_no_employment_html.label"), collection: [
{ value: "yes", label: t("general.affirmative") },
{ value: "no", label: t("general.negative") },
]) %>
</div>

<div class="white-group">
<div class="question-with-follow-up">
<div class="question-with-follow-up__question">
Expand Down
3 changes: 0 additions & 3 deletions app/views/state_file/questions/az_review/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@
<p class="text--bold spacing-below-5"><%=t(".was_incarcerated", filing_year: current_tax_year) %></p>
<p><%=current_intake.primary_was_incarcerated_yes? || current_intake.spouse_was_incarcerated_yes? ? t("general.affirmative") : t("general.negative") %></p>

<p class="text--bold spacing-below-5"><%=t(".ssn_no_employment") %></p>
<p><%=current_intake.ssn_no_employment_yes? ? t("general.affirmative") : t("general.negative") %></p>

<p class="text--bold spacing-below-5"><%=t(".household_excise_credit_claimed") %></p>
<p><%=current_intake.household_excise_credit_claimed_yes? ? t("general.affirmative") : t("general.negative") %></p>
<%= link_to t("general.edit"), StateFile::Questions::AzExciseCreditController.to_path_helper(return_to_review: "y"), class: "button--small" %>
Expand Down
3 changes: 0 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2249,8 +2249,6 @@ en:
household_excise_credit_html: Did anyone in your household file a tax return separately from you and claim the Arizona Increased Excise Tax Credit? <br><br> (Your household is everyone that you lived with, even if they aren’t listed on your return.)
primary_was_incarcerated: Were you incarcerated in a county, state, or federal prison for at least 60 days in %{tax_year}?
spouse_was_incarcerated: Was your spouse incarcerated in a county, state, or federal prison for at least 60 days in %{tax_year}?
ssn_no_employment_html:
label: Do you have <b>'not valid for employment'</b> written on your Social Security card? (This is rare.)
title: You might be eligible for the Increased Excise Tax Credit.
az_prior_last_names:
edit:
Expand Down Expand Up @@ -2355,7 +2353,6 @@ en:
made_az321_contributions: Made contributions to qualifying charitable organizations
made_az322_contributions: Made contributions to public schools
public_school_credit: Public School Credit
ssn_no_employment: "‘Not valid for employment’ is written on your Social Security Card"
ssn_not_taxed: Social Security benefits not taxed in Arizona
subtraction_for_indian_res: Subtraction for income earned on an American Indian reservation
subtraction_for_military_pay: Subtraction for active duty military pay
Expand Down
3 changes: 0 additions & 3 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2201,8 +2201,6 @@ es:
household_excise_credit_html: "¿Alguien en tu hogar presentó una declaración de impuestos por separado de la tuya y reclamó el Crédito por Aumento de Impuestos Especiales de Arizona?<br><br> (Tu hogar incluye a todas las personas con las que viviste, incluso si no están incluidas en tu declaración.)"
primary_was_incarcerated: "¿Estuviste encarcelado en una cárcel del condado, estatal o federal durante al menos 60 días en%{tax_year}?"
spouse_was_incarcerated: "¿Tu cónyuge estuvieron encarcelados en una cárcel del condado, estatal o federal durante al menos 60 días en %{tax_year}?"
ssn_no_employment_html:
label: "¿Tienes la frase <b>'not valid for employment'</b> escrita en tu tarjeta de Seguro Social? (Esto es poco común.)"
title: Es posible que seas elegible para el Crédito tributario por Aumento de Impuestos Especiales.
az_prior_last_names:
edit:
Expand Down Expand Up @@ -2306,7 +2304,6 @@ es:
made_az321_contributions: Hizo contribuciones a organizaciones benéficas calificadas
made_az322_contributions: Hizo contribuciones a las escuelas públicas
public_school_credit: Crédito de escuela pública
ssn_no_employment: '"Not valid for employment" escrita en tu tarjeta de Seguro Social'
ssn_not_taxed: Los beneficios del Seguro Social no están sujetos a impuestos en Arizona
subtraction_for_indian_res: Resta de los ingresos obtenidos en una reserva de indios americanos
subtraction_for_military_pay: Resta del pago militar en servicio activo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveSsnNoEmploymentFromStateFileAzIntakes < ActiveRecord::Migration[7.1]
def change
safety_assured { remove_column :state_file_az_intakes, :ssn_no_employment }
end
end
1 change: 0 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,6 @@
t.bigint "spouse_state_id_id"
t.string "spouse_suffix"
t.integer "spouse_was_incarcerated", default: 0, null: false
t.integer "ssn_no_employment", default: 0, null: false
t.integer "tribal_member", default: 0, null: false
t.decimal "tribal_wages_amount", precision: 12, scale: 2
t.text "unfinished_intake_ids", default: [], array: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

get :edit
expect(response.body).not_to include I18n.t("state_file.questions.az_review.edit.was_incarcerated", filing_year: Rails.configuration.statefile_current_tax_year)
expect(response.body).not_to include I18n.t("state_file.questions.az_review.edit.ssn_no_employment")
expect(response.body).not_to include I18n.t("state_file.questions.az_review.edit.household_excise_credit_claimed")
end
end
Expand Down
1 change: 0 additions & 1 deletion spec/factories/state_file_az_intakes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
# spouse_middle_initial :string
# spouse_suffix :string
# spouse_was_incarcerated :integer default("unfilled"), not null
# ssn_no_employment :integer default("unfilled"), not null
# tribal_member :integer default("unfilled"), not null
# tribal_wages_amount :decimal(12, 2)
# unfinished_intake_ids :text default([]), is an Array
Expand Down
1 change: 1 addition & 0 deletions spec/features/state_file/review_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def set_up_intake_and_associated_records(state_code)
intake = StateFile::StateInformationService.intake_class(state_code).last
intake.update(
raw_direct_file_data: StateFile::DirectFileApiResponseSampleService.new.read_xml("test_df_complete_sample"),
raw_direct_file_intake_data: StateFile::DirectFileApiResponseSampleService.new.read_json("test_df_complete_sample"),
primary_first_name: "Deedee",
primary_last_name: "Doodoo",
primary_birth_date: Date.new((MultiTenantService.statefile.current_tax_year - 65), 12, 1),
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/state_file/fed_return_jsons/az/claus_mfj.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"form1099GsTotal": "0.00",
"suffix": null,
"isPrimaryFiler": false,
"ssnNotValidForEmployment": null,
"ssnNotValidForEmployment": true,
"hsaTotalDeductibleAmount": null
},
{
Expand All @@ -26,7 +26,7 @@
"suffix": null,
"form1099GsTotal": "0.00",
"isPrimaryFiler": true,
"ssnNotValidForEmployment": null,
"ssnNotValidForEmployment": true,
"hsaTotalDeductibleAmount": null
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"familyAndHousehold": [
{
"monthsLivedWithTPInUS": "twelve",
"lastName": "Rose",
"isClaimedDependent": true,
"hohQualifyingPerson": true,
"qualifyingChild": true,
"scheduleEicLine4bYes": false,
"scheduleEicLine4aYes": false,
"dateOfBirth": "2010-02-02",
"suffix": null,
"residencyDuration": "allYear",
"firstName": "Axel",
"middleInitial": null,
"scheduleEicLine4aNo": false,
"tin": "300-00-0009",
"eligibleDependent": true,
"relationship": "sibling",
"ssnNotValidForEmployment": false
}
],
"filers": [
{
"lastName": "Rose",
"firstName": "Alexis",
"middleInitial": null,
"tin": "400-00-0003",
"dateOfBirth": "1990-01-01",
"suffix": null,
"isPrimaryFiler": true,
"ssnNotValidForEmployment": null
}
],
"interestReports": []
}
10 changes: 0 additions & 10 deletions spec/forms/state_file/az_excise_credit_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
let(:single_filer_params) {
{
primary_was_incarcerated: "yes",
ssn_no_employment: "yes",
household_excise_credit_claimed: "no"
}
}
let(:mfj_params) {
{
primary_was_incarcerated: "no",
spouse_was_incarcerated: "yes",
ssn_no_employment: "yes",
household_excise_credit_claimed: "no"
}
}
Expand All @@ -25,7 +23,6 @@
it "only needs field for primary" do
form = described_class.new(intake, {
primary_was_incarcerated: nil,
ssn_no_employment: "yes",
household_excise_credit_claimed: "no"
})
expect(form).not_to be_valid
Expand Down Expand Up @@ -60,7 +57,6 @@
it "requires credit amount when credit claimed" do
invalid_params = {
primary_was_incarcerated: "no",
ssn_no_employment: "yes",
household_excise_credit_claimed: "yes"
}
form = described_class.new(intake, invalid_params)
Expand All @@ -69,7 +65,6 @@

valid_params = {
primary_was_incarcerated: "no",
ssn_no_employment: "yes",
household_excise_credit_claimed: "yes",
household_excise_credit_claimed_amount: 1000
}
Expand All @@ -81,7 +76,6 @@
it "requires credit amount to be a positive number" do
invalid_params_zero = {
primary_was_incarcerated: "no",
ssn_no_employment: "yes",
household_excise_credit_claimed: "yes",
household_excise_credit_claimed_amount: 0
}
Expand All @@ -97,7 +91,6 @@
it "saves values" do
form = described_class.new(intake, {
primary_was_incarcerated: "yes",
ssn_no_employment: "yes",
household_excise_credit_claimed: "yes",
household_excise_credit_claimed_amount: 1000
})
Expand All @@ -106,7 +99,6 @@

intake.reload
expect(intake.primary_was_incarcerated_yes?).to eq true
expect(intake.ssn_no_employment_yes?).to eq true
expect(intake.household_excise_credit_claimed_yes?).to eq true
expect(intake.household_excise_credit_claimed_amount).to eq 1000
end
Expand All @@ -116,7 +108,6 @@

form = described_class.new(intake, {
primary_was_incarcerated: "yes",
ssn_no_employment: "yes",
household_excise_credit_claimed: "no",
household_excise_credit_claimed_amount: 1000
})
Expand All @@ -125,7 +116,6 @@

intake.reload
expect(intake.primary_was_incarcerated_yes?).to eq true
expect(intake.ssn_no_employment_yes?).to eq true
expect(intake.household_excise_credit_claimed_no?).to eq true
expect(intake.household_excise_credit_claimed_amount).to be_nil
end
Expand Down
29 changes: 26 additions & 3 deletions spec/lib/efile/az/az140_calculator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,39 @@
end

context "mfj filer with one dependent" do
let (:intake) { create :state_file_az_intake, :with_spouse }

it "sets the credit to the correct amount" do
create :state_file_dependent, intake: intake, dob: 7.years.ago
intake.direct_file_data.filing_status = 2 # mfj
intake.direct_file_data.fed_agi = 25_000 # qualifying agi

instance.calculate
expect(instance.lines[:AZ140_LINE_56].value).to eq(75) # (2 filers + 1 dependent) * 25
end
end

context "mfj when one filer has an SSN which is not valid for employment" do
let (:intake) { create :state_file_az_intake, :with_spouse }

it "sets the credit to the correct amount when primary has ssn_not_valid_for_employment" do
create :state_file_dependent, intake: intake, dob: 7.years.ago
intake.direct_file_data.fed_agi = 25_000 # qualifying agi
intake.direct_file_json_data.primary_filer.ssn_not_valid_for_employment = true

instance.calculate
expect(instance.lines[:AZ140_LINE_56].value).to eq(50) # (1 filers + 1 dependent) * 25
end

it "sets the credit to the correct amount when spouse has ssn_not_valid_for_employment" do
create :state_file_dependent, intake: intake, dob: 7.years.ago
intake.direct_file_data.fed_agi = 25_000 # qualifying agi
intake.direct_file_json_data.spouse_filer.ssn_not_valid_for_employment = true

instance.calculate
expect(instance.lines[:AZ140_LINE_56].value).to eq(50) # (1 filers + 1 dependent) * 25
end
end

context "hoh filer with one dependent" do
it "sets the credit to the correct amount" do
create :state_file_dependent, intake: intake, dob: 7.years.ago
Expand All @@ -384,16 +407,16 @@
end

context "mfj filer, one incarcerated, no dependents" do
let (:intake) { create :state_file_az_intake, :with_spouse }

it "calculates the credit without incarcerated filer" do
intake.direct_file_data.filing_status = 2 # mfj
intake.direct_file_data.fed_agi = 12_500 # qualifying agi
intake.update(primary_was_incarcerated: "no", spouse_was_incarcerated: "yes")
instance.calculate
expect(instance.lines[:AZ140_LINE_56].value).to eq(25) # (1 filer) * 25 = 25
end

it "handles the old column for now" do
intake.direct_file_data.filing_status = 2 # mfj
intake.direct_file_data.fed_agi = 12_500 # qualifying agi
intake.update(was_incarcerated: "no")
instance.calculate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
end

context "when there is a refund with banking info" do
let(:intake) { create(:state_file_az_refund_intake, was_incarcerated: "no", ssn_no_employment: "no", household_excise_credit_claimed: "no") }
let(:intake) { create(:state_file_az_refund_intake, was_incarcerated: "no", household_excise_credit_claimed: "no") }

before do
allow_any_instance_of(Efile::Az::Az140Calculator).to receive(:calculate_line_79).and_return 500
Expand Down
Loading
Loading