Skip to content
2 changes: 1 addition & 1 deletion app/controllers/flows_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def generate_gyr_intake(params)
client = Client.create(
consented_to_service_at: Time.zone.now,
intake_attributes: intake_attributes,
tax_returns_attributes: [{ year: MultiTenantService.new(:gyr).current_tax_year, is_ctc: false }],
tax_returns_attributes: [{ year: MultiTenantService.new(:gyr).current_tax_year(app_time), is_ctc: false }],
)
unless client.valid?
return
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/hub/clients_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ def index
end

def new
@current_year = MultiTenantService.new(:gyr).current_tax_year
@current_year = MultiTenantService.new(:gyr).current_tax_year(app_time)
@form = CreateClientForm.new(gyr_filing_years)
end

def create
@current_year = MultiTenantService.new(:gyr).current_tax_year
@current_year = MultiTenantService.new(:gyr).current_tax_year(app_time)
@form = CreateClientForm.new(gyr_filing_years, create_client_form_params)
assigned_vita_partner = @vita_partners.find_by(id: create_client_form_params["vita_partner_id"])

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/hub/portal_states_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def ready_for_8879_signature?(primary_or_spouse)
end

def year
MultiTenantService.new(:gyr).current_tax_year
MultiTenantService.new(:gyr).current_tax_year(app_time)
end

def documents
Expand Down
8 changes: 7 additions & 1 deletion app/controllers/hub/user_notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ class UserNotificationsController < Hub::BaseController

def index
@page_title = I18n.t("hub.clients.navigation.notifications")
@user_notifications = current_user.notifications.where('created_at >= ?', Date.new(Rails.configuration.product_year)).order(created_at: :desc).page(params[:page])
cutoff = [
app_time - 7.days,
Date.new(Rails.configuration.product_year)
].min
@user_notifications = current_user.notifications
.where('created_at >= ?', cutoff)
.order(created_at: :desc).page(params[:page])
end

def mark_all_notifications_read
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/portal/portal_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def current_state
end

def year
MultiTenantService.new(:gyr).current_tax_year
MultiTenantService.new(:gyr).current_tax_year(app_time)
end

def documents
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/questions/consent_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def after_update_success

# the vita partner the client was routed to has capacity
unless current_intake.client.routing_method_at_capacity?
InitialTaxReturnsService.new(intake: current_intake).create!
InitialTaxReturnsService.new(intake: current_intake, time: app_time).create!
GenerateF13614cPdfJob.perform_later(current_intake.id, "Preliminary 13614-C.pdf")
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/questions/dependents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def next_path

def mixpanel_data(dependent)
{
dependent_age_at_end_of_tax_year: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year).to_s,
dependent_under_6: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year) < 6 ? "yes" : "no",
dependent_age_at_end_of_tax_year: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year(app_time)).to_s,
dependent_under_6: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year(app_time)) < 6 ? "yes" : "no",
dependent_months_in_home: dependent.months_in_home.to_s,
dependent_was_student: dependent.was_student,
dependent_us_citizen: dependent.us_citizen,
Expand Down
2 changes: 1 addition & 1 deletion app/forms/hub/create_client_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def default_intake_attributes
end

def create_tax_return_for_year?(year)
current_year = MultiTenantService.new(:gyr).current_tax_year
current_year = MultiTenantService.new(:gyr).current_tax_year(app_time)
if current_year.to_i == year.to_i
attributes_for(:intake)[:needs_help_current_year] == "yes"
else
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def ctc_current_tax_year
end

def ctc_prior_tax_year
MultiTenantService.new(:ctc).prior_tax_year
MultiTenantService.new(:ctc).current_tax_year - 1
end

def request_domain
Expand Down
3 changes: 2 additions & 1 deletion app/helpers/year_selection_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module YearSelectionHelper
# Year selection for separated, divorced and widowed GYR flow questions
def year_options_from_2018_to_current_tax_yr_plus_one
(MultiTenantService.new(:gyr).current_tax_year + 1).downto(2018).map { |year| [year.to_s, year.to_s] } + [[t("general.before_2018"), "before 2018"]]
(MultiTenantService.new(:gyr).current_tax_year(app_time) + 1)
.downto(2018).map { |year| [year.to_s, year.to_s] } + [[t("general.before_2018"), "before 2018"]]
end
end
6 changes: 6 additions & 0 deletions app/lib/standard_deductions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ standard_deductions:
head_of_household: 21900
married_filing_jointly: 29200
qualifying_widow: 29200
2025:
single: 15750
married_filing_separately: 15750
head_of_household: 23625
married_filing_jointly: 31500
qualifying_widow: 31500
base_puerto_rico:
2021:
single: 75000
Expand Down
15 changes: 3 additions & 12 deletions app/models/intake/gyr_intake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -615,20 +615,11 @@ def triaged_intake?
end

def self.current_tax_year
Rails.application.config.gyr_current_tax_year.to_i
MultiTenantService.gyr.current_tax_year.to_i
end

def most_recent_filing_year
filing_years.first || MultiTenantService.new(:gyr).current_tax_year
end

def most_recent_needs_help_or_filing_year
return filing_years.first if filing_years.first.present?
return MultiTenantService.new(:gyr).current_tax_year - 1 if needs_help_previous_year_1_yes?
return MultiTenantService.new(:gyr).current_tax_year - 2 if needs_help_previous_year_2_yes?
return MultiTenantService.new(:gyr).current_tax_year - 3 if needs_help_previous_year_3_yes?

MultiTenantService.new(:gyr).current_tax_year
def most_recent_filing_year(time = DateTime.now)
filing_years.first || MultiTenantService.new(:gyr).current_tax_year(time)
end

def year_before_most_recent_filing_year
Expand Down
5 changes: 0 additions & 5 deletions app/models/state_file_dependent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ class StateFileDependent < ApplicationRecord
message: :blank
}, if: -> { id_has_grocery_credit_ineligible_months == "yes" }, on: :id_grocery_credit_form

def self.senior_cutoff_date
# Deprecated: please use `#senior?` (this method used only in tests)
MultiTenantService.statefile.end_of_current_tax_year.years_ago(65)
end

def full_name
parts = [first_name, middle_initial, last_name]
parts << suffix if suffix.present?
Expand Down
5 changes: 3 additions & 2 deletions app/services/initial_tax_returns_service.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
class InitialTaxReturnsService < BaseService
def initialize(intake:)
def initialize(intake:, time: DateTime.now)
@intake = intake
@time = time
end

def create!
create_year(MultiTenantService.new(:gyr).current_tax_year) if @intake.needs_help_current_year == "yes"
create_year(MultiTenantService.new(:gyr).current_tax_year(@time)) if @intake.needs_help_current_year == "yes"
create_year(MultiTenantService.new(:gyr).backtax_years[0]) if @intake.needs_help_previous_year_1 == "yes"
create_year(MultiTenantService.new(:gyr).backtax_years[1]) if @intake.needs_help_previous_year_2 == "yes"
create_year(MultiTenantService.new(:gyr).backtax_years[2]) if @intake.needs_help_previous_year_3 == "yes"
Expand Down
24 changes: 12 additions & 12 deletions app/services/multi_tenant_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,14 @@ def delivery_method_options
end
end

def current_tax_year
def current_tax_year(time = DateTime.now)
case service_type
when :ctc then Rails.configuration.ctc_current_tax_year
when :gyr then Rails.configuration.gyr_current_tax_year
when :gyr then gyr_current_tax_year(time)
when :statefile then Rails.configuration.statefile_current_tax_year
end
end

def end_of_current_tax_year
DateTime.new(current_tax_year).end_of_year
end

def prior_tax_year
current_tax_year - 1
end

def between_deadline_and_end_of_in_progress_intake?(now = DateTime.now)
now.between?(Rails.configuration.tax_deadline, Rails.configuration.end_of_in_progress_intake)
end
Expand All @@ -116,8 +108,8 @@ def filing_years(now = DateTime.now)
end
end

def backtax_years(now = DateTime.now)
filing_years(now).without(current_tax_year)
def backtax_years(time = DateTime.now)
filing_years(time).without(current_tax_year(time))
end

def twilio_creds
Expand Down Expand Up @@ -148,4 +140,12 @@ def statefile
new(:statefile)
end
end

private

def gyr_current_tax_year(time)
Rails.configuration.tax_year_filing_seasons.select do |_year, (open_date, _close_date)|
time > open_date
end.keys.max
end
end
2 changes: 1 addition & 1 deletion app/views/hub/clients/edit_13614c_form_page1.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<div id="marital-status-fields">
<h2>Part II – Marital Status and Household Information</h2>
<hr style="margin-top: 0;"/>
<h3><%= t(".what_was_your_marital_status", current_tax_year: MultiTenantService.new(:gyr).current_tax_year) %></h3>
<h3><%= t(".what_was_your_marital_status", current_tax_year: MultiTenantService.new(:gyr).current_tax_year(app_time)) %></h3>
<div class="hub-form__row">
<%= f.hub_checkbox(:never_married, t(".fields.never_married"), options: { classes: ["checkbox--wide"], checked_value: "yes", unchecked_value: "no" }) %>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/hub/clients/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,11 @@
<div class="client-profile__field-group">
<h2 class="text--bold">Prior Year AGI Amount</h2>
<div class="field-display">
<span class="form-question">Primary Prior Year (<%= MultiTenantService.new(:ctc).prior_tax_year %>) AGI:</span>
<span class="form-question">Primary Prior Year (<%= ctc_prior_tax_year %>) AGI:</span>
<span class="label-value"><%= number_to_currency(@client.intake.primary_prior_year_agi_amount || 0) %></span>
</div>
<div class="field-display">
<span class="form-question">Spouse Prior Year (<%= MultiTenantService.new(:ctc).prior_tax_year %>) AGI:</span>
<span class="form-question">Spouse Prior Year (<%= ctc_prior_tax_year %>) AGI:</span>
<span class="label-value"><%= number_to_currency(@client.intake.spouse_prior_year_agi_amount || 0) %></span>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/questions/backtaxes/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
</p>
<div class="form-card__stacked-checkboxes spacing-above-0">
<% gyr_backtax_years.reverse.each do |backtax_year| %>
<% previous_year_index = MultiTenantService.gyr.current_tax_year - backtax_year %>
<% previous_year_index = MultiTenantService.gyr.current_tax_year(app_time) - backtax_year %>
<%= f.cfa_checkbox("needs_help_previous_year_#{previous_year_index}".to_sym,
backtax_year.to_s,
options: { checked_value: "yes", unchecked_value: "no" }) %>
<% end %>
<%= f.cfa_checkbox("needs_help_current_year".to_sym,
MultiTenantService.gyr.current_tax_year.to_s,
MultiTenantService.gyr.current_tax_year(app_time).to_s,
options: { checked_value: "yes", unchecked_value: "no" }) %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/questions/itemizing/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :form_question, t("views.questions.itemizing.title", year: current_intake.most_recent_filing_year) %>
<% standard_deductions = StandardDeductions.base_deductions(tax_year: MultiTenantService.new(:gyr).current_tax_year) %>
<% standard_deductions = StandardDeductions.base_deductions(tax_year: MultiTenantService.new(:gyr).current_tax_year(app_time)) %>
<% content_for :form_help_text, t("views.questions.itemizing.help_text",
count: current_intake.filer_count,
joint_deduction: number_to_currency(standard_deductions[:married_filing_jointly]),
Expand Down
2 changes: 1 addition & 1 deletion app/views/questions/start_with_current_year/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, t("views.questions.start_with_current_year.title", :year => current_intake.most_recent_filing_year) %>
<% content_for :page_title, t("views.questions.start_with_current_year.title", :year => current_intake.most_recent_filing_year(app_time)) %>

<% content_for :card do %>
<div class="form-card">
Expand Down
2 changes: 1 addition & 1 deletion app/views/questions/triage/_diy_tile.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="bottom-section">
<div>
<ul class="list--bulleted">
<li><%= t('questions.triage.diy_tile.list.file', current_tax_year: MultiTenantService.new(:gyr).current_tax_year) %></li>
<li><%= t('questions.triage.diy_tile.list.file', current_tax_year: MultiTenantService.new(:gyr).current_tax_year(app_time)) %></li>
<li><%= t('questions.triage.diy_tile.list.income') %></li>
</ul>
</div>
Expand Down
10 changes: 5 additions & 5 deletions app/views/shared/_prior_agi.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div id="prior-agi">
<div class="hub-form__card card-small">
<h3>Prior Tax Year Adjusted Gross Income</h3>
<p>If the client filed taxes in <%= MultiTenantService.new(:ctc).prior_tax_year %>, either AGI field(s) or PIN field(s) must have accurate values.</p>
<p>If the client filed taxes in <%= ctc_prior_tax_year %>, either AGI field(s) or PIN field(s) must have accurate values.</p>
<p>If PIN(s) are provided, PIN will be sent on the return. Otherwise, AGI is used.</p>
<%= f.cfa_input_field(:primary_prior_year_agi_amount, "Primary #{MultiTenantService.new(:ctc).prior_tax_year} AGI (Form 1040 8b)") %>
<%= f.cfa_input_field(:spouse_prior_year_agi_amount, "Spouse #{MultiTenantService.new(:ctc).prior_tax_year} AGI (Form 1040b)") %>
<%= f.cfa_input_field(:primary_prior_year_signature_pin, "Primary #{MultiTenantService.new(:ctc).prior_tax_year} Signature PIN") %>
<%= f.cfa_input_field(:spouse_prior_year_signature_pin, "Spouse #{MultiTenantService.new(:ctc).prior_tax_year} Signature PIN") %>
<%= f.cfa_input_field(:primary_prior_year_agi_amount, "Primary #{ctc_prior_tax_year} AGI (Form 1040 8b)") %>
<%= f.cfa_input_field(:spouse_prior_year_agi_amount, "Spouse #{ctc_prior_tax_year} AGI (Form 1040b)") %>
<%= f.cfa_input_field(:primary_prior_year_signature_pin, "Primary #{ctc_prior_tax_year} Signature PIN") %>
<%= f.cfa_input_field(:spouse_prior_year_signature_pin, "Spouse #{ctc_prior_tax_year} Signature PIN") %>
</div>
</div>
6 changes: 3 additions & 3 deletions app/views/shared/_service_comparison.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</h2>
</div>
<div class="service__description">
<%= t("views.shared.service_comparison.services.diy.service_description", year: MultiTenantService.new(:gyr).current_tax_year) %>
<%= t("views.shared.service_comparison.services.diy.service_description", year: MultiTenantService.new(:gyr).current_tax_year(app_time)) %>
</div>
<div class="service__cta">
<%= link_to t("views.shared.service_comparison.services.diy.cta"), Diy::FileYourselfController.to_path_helper, class: "button", "data-track-click": "service-comparison-diy" %>
Expand Down Expand Up @@ -107,11 +107,11 @@
<%= gyr_filing_years.last %>-<%= gyr_filing_years.first %>
</div>
<div class="service diy">
<%= MultiTenantService.new(:gyr).current_tax_year %>
<%= MultiTenantService.new(:gyr).current_tax_year(app_time) %>
</div>
<% if app_time.before?(Rails.configuration.state_file_end_of_in_progress_intakes) %>
<div class="service direct-file">
<%= MultiTenantService.new(:gyr).current_tax_year %>
<%= MultiTenantService.new(:gyr).current_tax_year(app_time) %>
</div>
<% end %>
</div>
Expand Down
23 changes: 12 additions & 11 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,28 @@ class Application < Rails::Application
config.middleware.use Middleware::CleanupMimeTypeHeaders
config.middleware.use Middleware::RejectInvalidParams
config.middleware.use Middleware::RejectBadlyEncodedHeaders
config.gyr_current_tax_year = 2024

config.ctc_current_tax_year = 2021
config.statefile_current_tax_year = 2024
config.product_year = 2025
config.product_year = 2026

pt = Time.find_zone('America/Los_Angeles')
et = Time.find_zone('America/New_York')

# These defaults can be overridden per-environment if needed
# GetYourRefund
config.start_of_unique_links_only_intake = pt.parse('2025-01-24 12:00:00')
config.start_of_open_intake = pt.parse('2025-01-31 09:59:59')
config.tax_deadline = et.parse('2025-04-15 23:59:59')
config.end_of_intake = et.parse('2025-10-01 23:59:59')
config.end_of_docs = et.parse('2025-10-08 23:59:59')
config.doc_submission_deadline = et.parse('2025-04-01 23:59:59')
config.end_of_closing = et.parse('2025-10-15 23:59:59')
config.end_of_in_progress_intake = et.parse('2025-10-15 23:59:59')
config.end_of_login = et.parse('2025-10-23 23:59:00')
config.start_of_unique_links_only_intake = pt.parse('2026-01-24 12:00:00')
config.start_of_open_intake = pt.parse('2026-01-31 09:59:59')
config.tax_deadline = et.parse('2026-04-15 23:59:59')
config.end_of_intake = et.parse('2026-10-01 23:59:59')
config.end_of_docs = et.parse('2026-10-08 23:59:59')
config.doc_submission_deadline = et.parse('2026-04-01 23:59:59')
config.end_of_closing = et.parse('2026-10-15 23:59:59')
config.end_of_in_progress_intake = et.parse('2026-10-15 23:59:59') # is inprogress just for docs or will they have access to these other pages
config.end_of_login = et.parse('2026-10-23 23:59:00')

config.tax_year_filing_seasons = {
2025 => [et.parse("2026-01-29 00:00:00"), et.parse("2026-04-15 23:59:59")],
2024 => [et.parse("2025-01-29 00:00:00"), et.parse("2025-04-15 23:59:59")],
2023 => [et.parse("2024-01-29 00:00:00"), et.parse("2024-04-15 23:59:59")],
2022 => [et.parse("2023-01-23 00:00:00"), et.parse("2023-04-18 23:59:59")],
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/hub/clients_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@
vita_partner_id: vita_partner_id,
tax_returns_attributes: {
"0": {
year: Rails.configuration.gyr_current_tax_year.to_s,
year: MultiTenantService.new(:gyr).current_tax_year.to_s,
is_hsa: true,
certification_level: "advanced"
},
"1": {
year: (Rails.configuration.gyr_current_tax_year - 1).to_s,
year: (MultiTenantService.new(:gyr).current_tax_year - 1).to_s,
is_hsa: false,
certification_level: "basic"
},
"2": {
year: (Rails.configuration.gyr_current_tax_year - 2).to_s,
year: (MultiTenantService.new(:gyr).current_tax_year - 2).to_s,
is_hsa: false,
certification_level: "basic"
},
"3": {
year: (Rails.configuration.gyr_current_tax_year - 3).to_s,
year: (MultiTenantService.new(:gyr).current_tax_year - 3).to_s,
is_hsa: false,
certification_level: "advanced"
},
Expand Down
Loading
Loading