Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
2024-04-12 Last release of tax season 2024

* Send reject resolution message on 4/13 and 4/22 for clients that have been notified of rejection and not yet been accepted (#4479)
* Update GYR banner for closing season (#4473)
* Always showing download button after April 25 #187355990  (#4481)
* Post-Deadline notification (#4475)
* Pre-Deadline notification (#4469)
* truncate 3rd party designee name (#4462)
* Change logic for Reminder notification (#4447)
* Close fyst #187355990 (#4472)
* Fix submission and skip flaky tests #187278919 (#4468)
* Refine AZ excise credit #186927846 (#4418)
* pre-populate w2 info (#4457)
* Center content on desktop #186632607 (#4444)
  • Loading branch information
jenny-heath committed Apr 12, 2024
2 parents e95aae3 + 6dc7994 commit df822e8
Show file tree
Hide file tree
Showing 84 changed files with 1,567 additions and 480 deletions.
72 changes: 67 additions & 5 deletions app/assets/stylesheets/_state-file.scss
Expand Up @@ -426,11 +426,6 @@
}
}

.landing-page-content {
padding-left: 1rem;
padding-right: 1rem;
}

.partner-logo-wrapper {
display: flex;
align-items: center;
Expand Down Expand Up @@ -627,6 +622,73 @@
text-decoration: none;
}

@media screen and (min-width: $tablet-up) {
.question-layout .question-wrapper {
margin: 0 auto;
max-width: 658px;

.checkbox {
width: 100%;
}

.button {
display: block;
min-width: 15rem;
max-width: 25rem;
margin: 0 auto;
}
}

.options-wrapper .yes-no-buttons {
display: flex;
justify-content: center;

.button {
margin: 0 2rem;
display: block;
min-width: 25rem;
max-width: 25rem;
}
}

.question-layout.landing-page-outer .question-wrapper {
max-width: none;

main {
display: flex;
justify-content: space-between;
.landing-page-content {
max-width: 570px;
}
.fyst-home-image {
width: 273px;
height: 250px;
}
}
}

.initiate-data-transfer-outer .question-wrapper a.button {
width: 100%;
min-width: 100%;
max-width: 100%;
}

.question-layout .question-wrapper .button--primary.button--wide {
min-width: 40rem;
max-width: 40rem;
width: 40rem;
}

.esign-declaration-outer .text--error {
margin: 0 auto;
text-align: center;
}
}
@media screen and (max-width: $tablet-up) {
.landing-page-container .fyst-home-image {
display: none
}
}
}

$state-colors: (
Expand Down
7 changes: 5 additions & 2 deletions app/controllers/application_controller.rb
Expand Up @@ -337,7 +337,10 @@ def homepage_banner
if app_time <= Rails.configuration.tax_deadline && open_for_gyr_intake?
# after open intake, before tax_deadline
:open_intake
elsif app_time.between?(Rails.configuration.tax_deadline, Rails.configuration.end_of_in_progress_intake)
elsif app_time.between?(Rails.configuration.tax_deadline, Rails.configuration.end_of_intake)
# after tax_deadline, before end_of_intake
:open_intake_post_tax_deadline
elsif app_time.between?(Rails.configuration.end_of_intake, Rails.configuration.end_of_in_progress_intake)
# after tax_deadline, before end_of_in_progress_intake
:in_progress_intake_only
elsif app_time.between?(Rails.configuration.end_of_in_progress_intake, Rails.configuration.end_of_login)
Expand Down Expand Up @@ -401,7 +404,7 @@ def open_for_ctc_read_write?
helper_method :open_for_ctc_read_write?

def open_for_state_file_intake?
app_time.between?(Rails.configuration.state_file_start_of_open_intake, Rails.configuration.state_file_end_of_intake)
app_time.between?(Rails.configuration.state_file_start_of_open_intake, Rails.configuration.state_file_end_of_in_progress_intakes)
end
helper_method :open_for_state_file_intake?

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/flows_controller.rb
Expand Up @@ -654,9 +654,9 @@ def self.az_attributes(first_name: 'Testuser', last_name: 'Testuser')
prior_last_names: "Jordan, Pippen, Rodman",
tribal_member: "yes",
tribal_wages: 100,
was_incarcerated: "no",
primary_was_incarcerated: "no",
spouse_was_incarcerated: "no",
was_incarcerated: "no", # TODO: remove when column is ignored
household_excise_credit_claimed: "no",
ssn_no_employment: "no",
message_tracker: {},
Expand Down
Expand Up @@ -16,6 +16,7 @@ def messages_preview
[StateFile::AutomatedMessage::IssueResolved, {}],
[StateFile::AutomatedMessage::StillProcessing, {}],
[StateFile::AutomatedMessage::SuccessfulSubmission, {}],
[StateFile::AutomatedMessage::RejectResolutionReminder, {}],
]

automated_messages_and_mailers = automated_messages.map do |m|
Expand Down
Expand Up @@ -5,13 +5,11 @@ class EfileSubmissionsController < Hub::StateFile::BaseController
before_action :load_efile_submissions, only: [:index]

def index

join_sql = StateFileBaseIntake::STATE_CODES.map do |state_code|
"SELECT state_file_#{state_code}_intakes.id as intake_id, 'StateFile#{state_code.to_s.titleize}Intake' as ds_type, '#{state_code}' as data_source_state_code, state_file_#{state_code}_intakes.email_address FROM state_file_#{state_code}_intakes"
end
join_sql = "INNER JOIN (#{join_sql.join(" UNION ")}) data_source ON efile_submissions.id = data_source.intake_id and efile_submissions.data_source_type = data_source.ds_type"
join_sql = "INNER JOIN (#{join_sql.join(" UNION ")}) data_source ON efile_submissions.data_source_id = data_source.intake_id and efile_submissions.data_source_type = data_source.ds_type"
@efile_submissions = EfileSubmission.joins(join_sql).select("efile_submissions.*, data_source.*")

search = params[:search]
if search.present?
query = "email_address LIKE ? OR irs_submission_id LIKE ?"
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/mailgun_webhooks_controller.rb
@@ -1,7 +1,7 @@
class MailgunWebhooksController < ActionController::Base
skip_before_action :verify_authenticity_token
before_action :authenticate_mailgun_request
# This work is ongoing for https://www.pivotaltracker.com/story/show/187187633
# Disabling this until https://www.pivotaltracker.com/n/projects/2409240/stories/187407168 is completed
# before_action :re_optin_when_client_replies, only: :create_incoming_email

REGEX_FROM_ENVELOPE = /.*\<(?<address>(.*))>/.freeze
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/questions/final_info_controller.rb
Expand Up @@ -24,11 +24,13 @@ def tracking_data

def send_confirmation_message
@client = current_intake.client
doc_date = app_time.before?(Rails.configuration.tax_deadline) ? DateTime.parse('2024-04-01') : Rails.configuration.end_of_docs.to_date

ClientMessagingService.send_system_message_to_all_opted_in_contact_methods(
client: current_intake.client,
message: AutomatedMessage::SuccessfulSubmissionOnlineIntake,
locale: I18n.locale
locale: I18n.locale,
body_args: { end_of_docs_date: I18n.l(doc_date, format: :medium, locale: I18n.locale, default: "%B %-d") }
)
end
end
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/session_toggles_controller.rb
Expand Up @@ -23,7 +23,8 @@ def index
service_url: url_for(host: MultiTenantService.new(:statefile).host, controller: :session_toggles),
times: [
SessionToggleTime.new(name: 'Start of open intake', property: :state_file_start_of_open_intake),
SessionToggleTime.new(name: 'End of intake', property: :state_file_end_of_intake),
SessionToggleTime.new(name: 'End of New intake', property: :state_file_end_of_new_intakes),
SessionToggleTime.new(name: 'End of In Progress Intakes', property: :state_file_end_of_in_progress_intakes),
]
},
{
Expand Down
Expand Up @@ -4,7 +4,16 @@ class AzExciseCreditController < AuthenticatedQuestionsController
include ReturnToReviewConcern

def self.show?(intake)
intake.ask_whether_incarcerated?
!intake.disqualified_from_excise_credit_df?
end

def update
if params["state_file_az_excise_credit_form"]["was_incarcerated"].present?
flash[:notice] = I18n.t("state_file.questions.az_excise_credit.update.page_changed_notice")
render :edit
else
super
end
end
end
end
Expand Down
Expand Up @@ -3,9 +3,11 @@ module Questions
class LandingPageController < QuestionsController
skip_before_action :redirect_if_no_intake
skip_before_action :set_current_step
skip_before_action :redirect_if_in_progress_intakes_ended

def edit
@state_name = StateFileBaseIntake::STATE_CODE_AND_NAMES[params[:us_state]]
@closed = app_time.after?(Rails.configuration.state_file_end_of_in_progress_intakes)
if current_intake.present?
if current_intake.primary_first_name.present?
@user_name = current_intake.primary_first_name
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/state_file/questions/questions_controller.rb
Expand Up @@ -3,6 +3,7 @@ module Questions
class QuestionsController < ::Questions::QuestionsController
include StateFile::StateFileControllerConcern
before_action :redirect_if_no_intake
before_action :redirect_if_in_progress_intakes_ended
helper_method :card_postscript

# default layout for all state file questions
Expand Down Expand Up @@ -51,6 +52,16 @@ def redirect_if_no_intake
end
end

def redirect_if_in_progress_intakes_ended
if app_time.after?(Rails.configuration.state_file_end_of_in_progress_intakes)
if current_intake.efile_submissions.empty?
redirect_to root_path
else
redirect_to StateFile::Questions::ReturnStatusController.to_path_helper(action: :edit, us_state: state_code)
end
end
end

def next_step
form_navigation.next
end
Expand Down
@@ -1,8 +1,10 @@
module StateFile
module Questions
class ReturnStatusController < AuthenticatedQuestionsController
include StateFile::SurveyLinksConcern
before_action :redirect_if_from_efile
before_action :redirect_if_no_submission
skip_before_action :redirect_if_in_progress_intakes_ended

def edit
@error = submission_error
Expand All @@ -12,6 +14,7 @@ def edit
@download_form_name = download_form_name
@mail_voucher_address = mail_voucher_address
@voucher_path = voucher_path
@survey_link = survey_link(current_intake)
end

def prev_path
Expand Down
@@ -1,6 +1,8 @@
module StateFile
module Questions
class SubmissionPdfsController < QuestionsController
skip_before_action :redirect_if_in_progress_intakes_ended

def show
@submission = current_intake.efile_submissions.find_by(id: params[:id])
error_redirect and return unless @submission.present?
Expand Down
15 changes: 14 additions & 1 deletion app/controllers/state_file/questions/w2_controller.rb
Expand Up @@ -86,7 +86,20 @@ def self.w2s_for_intake(intake)
(intake.direct_file_data.w2s.each_with_index.map do |df_w2, index|
if intake.invalid_df_w2?(df_w2)
existing_record = intake.state_file_w2s.find { |intake_w2| intake_w2.w2_index == index }
existing_record.present? ? existing_record : StateFileW2.new(state_file_intake: intake, w2_index: index)
if existing_record.present?
existing_record
else
StateFileW2.new(
state_file_intake: intake,
w2_index: index,
employer_state_id_num: df_w2.EmployerStateIdNum,
state_wages_amt: df_w2.StateWagesAmt,
state_income_tax_amt: df_w2.StateIncomeTaxAmt,
local_wages_and_tips_amt: df_w2.LocalWagesAndTipsAmt,
local_income_tax_amt: df_w2.LocalIncomeTaxAmt,
locality_nm: df_w2.LocalityNm
)
end
end
end).compact
end
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/state_file/state_file_pages_controller.rb
Expand Up @@ -32,7 +32,9 @@ def clear_session
redirect_to action: :about_page
end

def login_options; end
def login_options
@sign_in_closed = app_time.after?(Rails.configuration.state_file_end_of_in_progress_intakes)
end

private

Expand Down
18 changes: 15 additions & 3 deletions app/forms/state_file/az_excise_credit_form.rb
@@ -1,13 +1,25 @@
module StateFile
class AzExciseCreditForm < QuestionsForm
set_attributes_for :intake, :was_incarcerated, :ssn_no_employment, :household_excise_credit_claimed
set_attributes_for :intake,
:primary_was_incarcerated,
:spouse_was_incarcerated,
:ssn_no_employment,
:household_excise_credit_claimed,
:household_excise_credit_claimed_amt

validates :was_incarcerated, inclusion: { in: %w[yes no], message: :blank }
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_amt, if: -> { household_excise_credit_claimed == "yes" }
validates :household_excise_credit_claimed_amt, numericality: { only_integer: true, greater_than: 0, message: ->(_object, _data) { I18n.t('validators.must_enter_amount') } }, allow_blank: true

def save
@intake.update(attributes_for(:intake))
attributes = attributes_for(:intake)
if household_excise_credit_claimed == "no"
attributes = attributes.merge(household_excise_credit_claimed_amt: nil)
end
@intake.update(attributes)
end
end
end
34 changes: 34 additions & 0 deletions app/jobs/send_reject_resolution_reminder_notification_job.rb
@@ -0,0 +1,34 @@
class SendRejectResolutionReminderNotificationJob < ApplicationJob
def perform(intake)
return unless notified_of_rejected_and_not_accepted(intake)

StateFile::MessagingService.new(
intake: intake,
message: StateFile::AutomatedMessage::RejectResolutionReminder,
body_args: { return_status_link: return_status_link(intake) }
).send_message
end

def priority
PRIORITY_LOW
end

private

def return_status_link(intake)
locale = intake.locale || "en"
Rails.application.routes.url_helpers.url_for(host: MultiTenantService.new(:statefile).host, controller: "state_file/questions/return_status", action: "edit", us_state: intake.state_code, locale: locale)
end

def notified_of_rejected_and_not_accepted(intake)
transition_states = intake.efile_submissions.flat_map do |submission|
submission.efile_submission_transitions.map(&:to_state)
end.uniq

last_state = intake.efile_submissions.last.current_state
in_progress_states = ["preparing", "bundling", "queued", "transmitted", "ready_for_ack"]
return false if transition_states.include?("accepted") || in_progress_states.include?(last_state)

transition_states.include?("notified_of_rejection")
end
end
22 changes: 11 additions & 11 deletions app/lib/efile/az/az140.rb
Expand Up @@ -234,19 +234,19 @@ def calculate_line_53


def calculate_line_56
if !@direct_file_data.claimed_as_dependent? && @intake.qualified_for_excise_credit? && @intake.ask_whether_incarcerated?
# todo question: if they are filing with us does that automatically mean no AZ-140PTC?
if filing_status_mfj? || filing_status_hoh?
return 0 unless line_or_zero(:AZ140_LINE_12) <= 25000
elsif filing_status_single? || filing_status_mfs?
return 0 unless line_or_zero(:AZ140_LINE_12) <= 12500
end
wrksht_line_2 = filing_status_mfj? ? 2 : 1
if @intake.disqualified_from_excise_credit_df? || @intake.disqualified_from_excise_credit_fyst?
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
wrksht_line_4 = (@dependent_count + wrksht_line_2) * 25
return [wrksht_line_4, 100].min
end

0
max_credit = 100
max_credit -= @intake.household_excise_credit_claimed_amt if @intake.household_excise_credit_claimed_yes? && @intake.household_excise_credit_claimed_amt.is_a?(Integer)

[wrksht_line_4, max_credit].min
end
end

def calculate_line_59
Expand Down
Expand Up @@ -79,7 +79,7 @@ def document
add_non_zero_claimed_value(xml, :RFND_B4_EDU_AMT, :IT201_LINE_78)
add_non_zero_claimed_value(xml, :RFND_AMT, :IT201_LINE_78B)
if @submission.data_source.confirmed_third_party_designee_yes?
xml.THRD_PRTY_NAME claimed: intake.direct_file_data.third_party_designee_name.strip.gsub(/\s+/, ' ') if @submission.data_source.direct_file_data.third_party_designee_name.present?
xml.THRD_PRTY_NAME claimed: truncate(intake.direct_file_data.third_party_designee_name, 29) if @submission.data_source.direct_file_data.third_party_designee_name.present?
xml.THRD_PRTY_PH_NMBR claimed: intake.direct_file_data.third_party_designee_phone_number.strip.gsub(/\s+/, ' ') if @submission.data_source.direct_file_data.third_party_designee_phone_number.present?
end
xml.PR_SGN_IND claimed: 1
Expand Down

0 comments on commit df822e8

Please sign in to comment.