Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into FYST-1304-auth-header
Browse files Browse the repository at this point in the history
  • Loading branch information
mpidcock committed Jan 6, 2025
2 parents 49b5283 + 9473314 commit 57cf3e3
Show file tree
Hide file tree
Showing 57 changed files with 796 additions and 418 deletions.
13 changes: 0 additions & 13 deletions app/assets/stylesheets/_state-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,6 @@
font-size: 1.3rem;
line-height: 1.9rem;
}

&.grey-group {
margin: 0 auto;
padding: 2rem;
margin-bottom: 2rem;
background: $color-grey-light;
border: 2px solid $color-grey-medium-light;
border-radius: 6px;

.checkbox.is-selected {
background: inherit;
}
}
}

.form1099__label {
Expand Down
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module StateFile
module Questions
class NjDependentsHealthInsuranceController < QuestionsController

before_action -> { @filing_year = Rails.configuration.statefile_current_tax_year }

def self.show?(intake)
return false unless intake.dependents.any?
intake.has_health_insurance_requirement_exception? || intake.eligibility_all_members_health_insurance_no?
end

def form_params
params
.fetch(:state_file_nj_dependents_health_insurance_form, {})
.permit([
{
dependents_attributes: [
:id,
:nj_did_not_have_health_insurance,
]
}
])
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ class NjEligibilityHealthInsuranceController < QuestionsController

before_action -> { @filing_year = Rails.configuration.statefile_current_tax_year }

def self.show?(intake)
!intake.has_health_insurance_requirement_exception?
end

def form_params
params
.fetch(:state_file_nj_eligibility_health_insurance_form, {})
.permit([
:eligibility_all_members_health_insurance,
{
dependents_attributes: [
:id,
:nj_did_not_have_health_insurance,
]
}
])
.permit([:eligibility_all_members_health_insurance])
end

end
end
end
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: 10 additions & 0 deletions app/forms/state_file/nj_dependents_health_insurance_form.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module StateFile
class NjDependentsHealthInsuranceForm < QuestionsForm
attr_accessor :dependents_attributes
delegate :dependents, to: :intake

def save
@intake.update!(dependents_attributes: dependents_attributes.to_h)
end
end
end
10 changes: 0 additions & 10 deletions app/forms/state_file/nj_eligibility_health_insurance_form.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
module StateFile
class NjEligibilityHealthInsuranceForm < QuestionsForm
set_attributes_for :intake, :eligibility_all_members_health_insurance
attr_accessor :dependents_attributes
delegate :dependents, to: :intake

validates :eligibility_all_members_health_insurance, presence: true

def save
@intake.update(attributes_for(:intake))
if @intake.eligibility_all_members_health_insurance_no?
@intake.update!(dependents_attributes: dependents_attributes.to_h)
else
attributes_array = intake.dependents.map do |dependent|
{ id: dependent.id, nj_did_not_have_health_insurance: 'no' }
end
@intake.update!(dependents_attributes: attributes_array)
end
end
end
end
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
6 changes: 3 additions & 3 deletions app/lib/efile/nj/nj1040_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def calculate_line_9
end

def calculate_line_10_count
@intake.direct_file_json_data.dependents.count do |dependent|
@intake.dependents.count do |dependent|
dependent.qualifying_child
end
end
Expand All @@ -233,7 +233,7 @@ def calculate_line_10_exemption
end

def calculate_line_11_count
@intake.direct_file_json_data.dependents.count do |dependent|
@intake.dependents.count do |dependent|
!dependent.qualifying_child
end
end
Expand Down Expand Up @@ -336,7 +336,7 @@ def is_ineligible_or_unsupported_for_property_tax_credit
StateFile::NjTenantEligibilityHelper.determine_eligibility(@intake) == StateFile::NjTenantEligibilityHelper::INELIGIBLE &&
StateFile::NjHomeownerEligibilityHelper.determine_eligibility(@intake) == StateFile::NjHomeownerEligibilityHelper::INELIGIBLE
else
nil
true
end
end

Expand Down
1 change: 1 addition & 0 deletions app/lib/navigation/state_file_nj_question_navigation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class StateFileNjQuestionNavigation < Navigation::StateFileBaseQuestionNavigatio
Navigation::NavigationStep.new(StateFile::Questions::NjDisabledExemptionController),
Navigation::NavigationStep.new(StateFile::Questions::NjVeteransExemptionController),
Navigation::NavigationStep.new(StateFile::Questions::NjCollegeDependentsExemptionController),
Navigation::NavigationStep.new(StateFile::Questions::NjDependentsHealthInsuranceController),
Navigation::NavigationStep.new(StateFile::Questions::NjMedicalExpensesController),
Navigation::NavigationStep.new(StateFile::Questions::NjHouseholdRentOwnController),
Navigation::NavigationStep.new(StateFile::Questions::NjHomeownerEligibilityController),
Expand Down
Binary file modified app/lib/pdfs/nj1040-TY2024.pdf
Binary file not shown.
Binary file modified app/lib/pdfs/nj2450-TY2024.pdf
Binary file not shown.
Binary file modified app/lib/pdfs/nj_additional_dependents.pdf
Binary file not shown.
Binary file modified app/lib/pdfs/schedule-njhcc.pdf
Binary file not shown.
10 changes: 7 additions & 3 deletions app/lib/submission_builder/return_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ class ReturnHeader < SubmissionBuilder::Document
include SubmissionBuilder::FormattingMethods
include SubmissionBuilder::BusinessLogicMethods

def state_submission_builder
StateFile::StateInformationService.submission_builder_class(@submission.data_source.state_code)
end

def document
build_xml_doc("ReturnHeaderState") do |xml|
xml.Jurisdiction "#{@submission.data_source.state_code.upcase}ST"
Expand All @@ -12,10 +16,10 @@ def document
xml.TaxPeriodEndDt date_type(Date.new(@submission.data_source.tax_return_year, 12, 31))
end
xml.TaxYr @submission.data_source.tax_return_year
if @submission.data_source.state_code.upcase == "NJ"
if state_submission_builder.ptin.present? && state_submission_builder.preparer_person_name.present?
xml.PaidPreparerInformationGrp do
xml.PTIN "P99999999"
xml.PreparerPersonNm "Self Prepared"
xml.PTIN state_submission_builder.ptin
xml.PreparerPersonNm state_submission_builder.preparer_person_name
end
end
xml.DisasterReliefTxt @intake.disaster_relief_county if @intake.respond_to?(:disaster_relief_county)
Expand Down
16 changes: 11 additions & 5 deletions app/lib/submission_builder/state_return.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
module SubmissionBuilder
class StateReturn < SubmissionBuilder::Document
def document
@document = state_schema_version.present? ?
build_xml_doc(build_xml_doc_tag, stateSchemaVersion: state_schema_version) :
@document = if state_schema_version.present?
build_xml_doc(build_xml_doc_tag, stateSchemaVersion: state_schema_version)
else
build_xml_doc(build_xml_doc_tag)
end
build_headers
build_main_document
build_documents
build_state_specific_tags(@document)
@document
end

def pdf_documents
included_documents.map { |item| item if item.pdf }.compact
included_documents.select { |item| item.pdf }
end

def build_headers
Expand Down Expand Up @@ -50,7 +52,7 @@ def attached_documents
end

def xml_documents
included_documents.map { |item| item if item.xml }.compact
included_documents.select { |item| item.xml }
end

def included_documents
Expand Down Expand Up @@ -128,5 +130,9 @@ def state_schema_version; end
def build_state_specific_tags(_); end

def documents_wrapper; end

def self.preparer_person_name; end

def self.ptin; end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def schema_file
SchemaFileLoader.load_file("us_states", "unpacked", "NJIndividual2024V0.1", "NJIndividual", "NJForms", "FormNJ1040.xsd")
end

def document
def document
build_xml_doc("FormNJ1040") do |xml|
xml.Header do
xml.FilingStatus do
Expand Down
8 changes: 8 additions & 0 deletions app/lib/submission_builder/ty2024/states/nj/nj_return_xml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ def w2_class

private

def self.ptin
"P99999999"
end

def self.preparer_person_name
"Self Prepared"
end

def attached_documents_parent_tag
# Line 29 in ReturnDataNj1040.xsd
'ReturnDataState'
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
12 changes: 7 additions & 5 deletions app/models/state_file_nj_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,15 @@ def eligibility_made_less_than_threshold?
nj_gross_income <= threshold
end

def has_health_insurance_requirement_exception?
self.eligibility_made_less_than_threshold? || self.eligibility_claimed_as_dependent?
end

def health_insurance_eligibility
if self.eligibility_all_members_health_insurance_no?
has_exception = self.eligibility_made_less_than_threshold? || self.eligibility_claimed_as_dependent?
has_exception ? "eligible" : "ineligible"
else
"eligible"
if self.eligibility_all_members_health_insurance_no? && !self.has_health_insurance_requirement_exception?
return "ineligible"
end
"eligible"
end

def disqualifying_eligibility_rules
Expand Down
1 change: 1 addition & 0 deletions app/services/state_file/submission_id_lookup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ nc_pork_e_qss_no_1099r: 7812652024340jb3296n
nc_wylie_mfs: 10164220243274vip4ag
nc_zeus_mfj_deps: 1016422024327ahu7xl7
nj_blackburn_mfj: 10164220243470bd1hef
nj_bon_jovi_health_exempt_deps: 78126520250034nzlizg
nj_david_mfj: 1016422024344s4n9nnq
nj_devito_single: 78126520243462cdhtih
nj_houston_single_under18: 7812652024352z8gbjs2
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
Loading

0 comments on commit 57cf3e3

Please sign in to comment.