From 742c57b8ba8a86b2fbc8705ceb4198e673519716 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 9 Jan 2024 08:42:23 +0000 Subject: [PATCH] Update content --- app/helpers/collection_time_helper.rb | 9 +++--- app/views/home/_upcoming_deadlines.html.erb | 36 ++++++++++++++++----- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/app/helpers/collection_time_helper.rb b/app/helpers/collection_time_helper.rb index 37430bdd7..6f8ef62fc 100644 --- a/app/helpers/collection_time_helper.rb +++ b/app/helpers/collection_time_helper.rb @@ -48,10 +48,10 @@ module CollectionTimeHelper def quarter_for_date(date: Time.zone.now) quarters = [ - { cutoff_date: Time.zone.local(2024, 1, 12), start_date: Time.zone.local(2023, 10, 1), end_date: Time.zone.local(2023, 12, 31) }, - { cutoff_date: Time.zone.local(2024, 7, 12), start_date: Time.zone.local(2024, 4, 1), end_date: Time.zone.local(2024, 6, 30) }, - { cutoff_date: Time.zone.local(2024, 10, 11), start_date: Time.zone.local(2024, 7, 1), end_date: Time.zone.local(2024, 9, 30) }, - { cutoff_date: Time.zone.local(2025, 1, 10), start_date: Time.zone.local(2024, 10, 1), end_date: Time.zone.local(2024, 12, 31) }, + { quarter: "Q3", cutoff_date: Time.zone.local(2024, 1, 12), start_date: Time.zone.local(2023, 10, 1), end_date: Time.zone.local(2023, 12, 31) }, + { quarter: "Q1", cutoff_date: Time.zone.local(2024, 7, 12), start_date: Time.zone.local(2024, 4, 1), end_date: Time.zone.local(2024, 6, 30) }, + { quarter: "Q2", cutoff_date: Time.zone.local(2024, 10, 11), start_date: Time.zone.local(2024, 7, 1), end_date: Time.zone.local(2024, 9, 30) }, + { quarter: "Q3", cutoff_date: Time.zone.local(2025, 1, 10), start_date: Time.zone.local(2024, 10, 1), end_date: Time.zone.local(2024, 12, 31) }, ] quarter = quarters.find { |q| date.between?(q[:start_date], q[:cutoff_date] + 1.day) } @@ -59,6 +59,7 @@ module CollectionTimeHelper return unless quarter OpenStruct.new( + quarter: quarter[:quarter], cutoff_date: quarter[:cutoff_date], quarter_start_date: quarter[:start_date], quarter_end_date: quarter[:end_date], diff --git a/app/views/home/_upcoming_deadlines.html.erb b/app/views/home/_upcoming_deadlines.html.erb index a18503ecc..589d8562e 100644 --- a/app/views/home/_upcoming_deadlines.html.erb +++ b/app/views/home/_upcoming_deadlines.html.erb @@ -1,16 +1,36 @@

Upcoming deadlines

+ +<% current_lettings_form = FormHandler.instance.in_crossover_period? ? FormHandler.instance.previous_lettings_form : FormHandler.instance.current_lettings_form %> +<% formatted_deadline = "#{current_lettings_form.submission_deadline.strftime("%A")} #{current_lettings_form.submission_deadline.to_formatted_s(:govuk_date)}" %> +<% if FormHandler.instance.in_crossover_period? %> +

End of year deadline - <%= formatted_deadline %>: Deadline to submit logs for tenancies starting between <%= collection_start_date(Time.zone.now).to_formatted_s(:govuk_date) %> to <%= collection_end_date(Time.zone.now).to_formatted_s(:govuk_date) %>

+<% end %> + <% current_quarter = quarter_for_date(date: Time.zone.now) %> <% if current_quarter.present? %> -

<%= current_quarter.cutoff_date.to_formatted_s(:govuk_date) %>: Quarterly cut off date for tenancies and sales starting between <%= current_quarter.quarter_start_date.to_formatted_s(:govuk_date) %> and <%= current_quarter.quarter_end_date.to_formatted_s(:govuk_date) %>.

+

<%= "#{current_quarter.quarter} - #{current_quarter.cutoff_date.strftime("%A")} #{current_quarter.cutoff_date.to_formatted_s(:govuk_date)}" %>: Quarterly cut off date for tenancies and sales starting between <%= current_quarter.quarter_start_date.to_formatted_s(:govuk_date) %> and <%= current_quarter.quarter_end_date.to_formatted_s(:govuk_date) %>.

<% end %> -<% current_lettings_form = FormHandler.instance.in_crossover_period? ? FormHandler.instance.previous_lettings_form : FormHandler.instance.current_lettings_form %> -

<%= current_lettings_form.submission_deadline.to_formatted_s(:govuk_date) %>: Deadline to submit logs for tenancies starting between <%= collection_start_date(Time.zone.now).to_formatted_s(:govuk_date) %> to <%= collection_end_date(Time.zone.now).to_formatted_s(:govuk_date) %>

-<%= govuk_details(summary_text: "Quarterly cut-off dates for 2024 to 2025") do %> + +<% if !FormHandler.instance.in_crossover_period? %> +

Try to complete your logs for each quarter by the cut-off date.

+

You can still create logs for a previous quarter after its cut-off date, as long as you complete them by the end-of-year deadline: <%= formatted_deadline %>.

+<% end %> + +<% if FormHandler.instance.in_crossover_period? %> + <% previous_lettings_form = FormHandler.instance.previous_lettings_form %> +

Prioritise completing logs for the closing collection year. You must complete all <%= previous_lettings_form.start_date.year %> to <%= previous_lettings_form.submission_deadline.year %> logs must by the end-of-year deadline. You can still create <%= current_lettings_form.start_date.year %> to <%= current_lettings_form.submission_deadline.year %> logs for this quarter after the quarterly cut-off date.

+<% end %> + +<%= govuk_details(summary_text: "Quarterly cut-off dates for 2023 to 2024") do %> +

The 2023 to 2024 quarterly cut-off dates are:

+

It is important that you meet these cut-off dates because we submit data to the Office for National Statistics quarterly, helping them create essential inflation statistics.

+

Meeting these cut-off dates also gives you more accurate data for your own analysis, and reduces the burden at the end of the year.

+

If you are not able to meet these quarterly dates, submit your logs as soon as you can so that they can be included in the annual data.

<% end %>