Skip to content

Commit b6058af

Browse files
committed
Fix filing years logic
1 parent 9c80e19 commit b6058af

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

app/services/multi_tenant_service.rb

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,9 @@ def filing_years(now = DateTime.now)
9999
if service_type == :ctc || service_type == :state_file
100100
[current_tax_year]
101101
else
102-
years = Rails.configuration.tax_year_filing_seasons.select do |_, (season_start, deadline)|
103-
deadline > now - 3.years && season_start <= now
104-
end.keys.freeze
105-
106-
years += [years.last - 1] if between_deadline_and_end_of_in_progress_intake?(now)
107-
years
102+
Rails.configuration.tax_year_filing_seasons.select do |_, (season_start, _)|
103+
now > season_start - 3.months
104+
end.keys.sort.reverse.take(3).reverse.freeze
108105
end
109106
end
110107

@@ -145,7 +142,7 @@ def statefile
145142

146143
def gyr_current_tax_year(time)
147144
Rails.configuration.tax_year_filing_seasons.select do |_year, (open_date, _close_date)|
148-
time > open_date
145+
time > open_date - 3.months
149146
end.keys.max
150147
end
151148
end

0 commit comments

Comments
 (0)