Skip to content

Commit ea03217

Browse files
embarnardmrotondo
andcommitted
Changed current tax year to grab from filing seasons
Co-authored-by: Mike Rotondo <[email protected]>
1 parent 494b71b commit ea03217

File tree

17 files changed

+46
-23
lines changed

17 files changed

+46
-23
lines changed

app/controllers/flows_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def generate_gyr_intake(params)
320320
client = Client.create(
321321
consented_to_service_at: Time.zone.now,
322322
intake_attributes: intake_attributes,
323-
tax_returns_attributes: [{ year: MultiTenantService.new(:gyr).current_tax_year, is_ctc: false }],
323+
tax_returns_attributes: [{ year: MultiTenantService.new(:gyr).current_tax_year(app_time), is_ctc: false }],
324324
)
325325
unless client.valid?
326326
return

app/controllers/hub/clients_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ def index
2020
end
2121

2222
def new
23-
@current_year = MultiTenantService.new(:gyr).current_tax_year
23+
@current_year = MultiTenantService.new(:gyr).current_tax_year(app_time)
2424
@form = CreateClientForm.new(gyr_filing_years)
2525
end
2626

2727
def create
28-
@current_year = MultiTenantService.new(:gyr).current_tax_year
28+
@current_year = MultiTenantService.new(:gyr).current_tax_year(app_time)
2929
@form = CreateClientForm.new(gyr_filing_years, create_client_form_params)
3030
assigned_vita_partner = @vita_partners.find_by(id: create_client_form_params["vita_partner_id"])
3131

app/controllers/hub/portal_states_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def ready_for_8879_signature?(primary_or_spouse)
4949
end
5050

5151
def year
52-
MultiTenantService.new(:gyr).current_tax_year
52+
MultiTenantService.new(:gyr).current_tax_year(app_time)
5353
end
5454

5555
def documents

app/controllers/portal/portal_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def current_state
3030
end
3131

3232
def year
33-
MultiTenantService.new(:gyr).current_tax_year
33+
MultiTenantService.new(:gyr).current_tax_year(app_time)
3434
end
3535

3636
def documents

app/controllers/questions/consent_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def after_update_success
2828

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

app/controllers/questions/dependents_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def next_path
7777

7878
def mixpanel_data(dependent)
7979
{
80-
dependent_age_at_end_of_tax_year: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year).to_s,
81-
dependent_under_6: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year) < 6 ? "yes" : "no",
80+
dependent_age_at_end_of_tax_year: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year(app_time)).to_s,
81+
dependent_under_6: dependent.age_during(MultiTenantService.new(:gyr).current_tax_year(app_time)) < 6 ? "yes" : "no",
8282
dependent_months_in_home: dependent.months_in_home.to_s,
8383
dependent_was_student: dependent.was_student,
8484
dependent_us_citizen: dependent.us_citizen,

app/forms/hub/create_client_form.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def default_intake_attributes
132132
end
133133

134134
def create_tax_return_for_year?(year)
135-
current_year = MultiTenantService.new(:gyr).current_tax_year
135+
current_year = MultiTenantService.new(:gyr).current_tax_year(app_time)
136136
if current_year.to_i == year.to_i
137137
attributes_for(:intake)[:needs_help_current_year] == "yes"
138138
else
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module YearSelectionHelper
22
# Year selection for separated, divorced and widowed GYR flow questions
33
def year_options_from_2018_to_current_tax_yr_plus_one
4+
#investigate
45
(MultiTenantService.new(:gyr).current_tax_year + 1).downto(2018).map { |year| [year.to_s, year.to_s] } + [[t("general.before_2018"), "before 2018"]]
56
end
67
end

app/models/intake/gyr_intake.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def triaged_intake?
615615
end
616616

617617
def self.current_tax_year
618-
Rails.application.config.gyr_current_tax_year.to_i
618+
MultiTenantService.gyr.current_tax_year.to_i
619619
end
620620

621621
def most_recent_filing_year

app/services/initial_tax_returns_service.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
class InitialTaxReturnsService < BaseService
2-
def initialize(intake:)
2+
def initialize(intake:, time: DateTime.now)
33
@intake = intake
4+
@time = time
45
end
56

67
def create!
7-
create_year(MultiTenantService.new(:gyr).current_tax_year) if @intake.needs_help_current_year == "yes"
8+
create_year(MultiTenantService.new(:gyr).current_tax_year(@time)) if @intake.needs_help_current_year == "yes"
89
create_year(MultiTenantService.new(:gyr).backtax_years[0]) if @intake.needs_help_previous_year_1 == "yes"
910
create_year(MultiTenantService.new(:gyr).backtax_years[1]) if @intake.needs_help_previous_year_2 == "yes"
1011
create_year(MultiTenantService.new(:gyr).backtax_years[2]) if @intake.needs_help_previous_year_3 == "yes"

0 commit comments

Comments
 (0)