Browse Source

ensure dates for beginning and end of collection year are correct in the crossover period (#2469)

pull/2471/head
Arthur Campbell 7 months ago committed by GitHub
parent
commit
9e99f62e1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      app/views/home/_upcoming_deadlines.html.erb

8
app/views/home/_upcoming_deadlines.html.erb

@ -1,9 +1,9 @@
<h1 class="govuk-heading-l">Upcoming deadlines</h1> <h1 class="govuk-heading-l">Upcoming deadlines</h1>
<% current_lettings_form = FormHandler.instance.in_crossover_period? ? FormHandler.instance.previous_lettings_form : FormHandler.instance.current_lettings_form %> <% open_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)}" %> <% formatted_deadline = "#{open_lettings_form.submission_deadline.strftime('%A')} #{open_lettings_form.submission_deadline.to_formatted_s(:govuk_date)}" %>
<% if FormHandler.instance.in_crossover_period? %> <% if FormHandler.instance.in_crossover_period? %>
<p class="govuk-body govuk-body-m"><strong>End of year deadline - <%= formatted_deadline %>:</strong> 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) %></p> <p class="govuk-body govuk-body-m"><strong>End of year deadline - <%= formatted_deadline %>:</strong> Deadline to submit logs for tenancies starting between <%= open_lettings_form.start_date.to_formatted_s(:govuk_date) %> to <%= collection_end_date(open_lettings_form.start_date).to_formatted_s(:govuk_date) %></p>
<% end %> <% end %>
<% current_quarter = quarter_for_date(date: Time.zone.now) %> <% current_quarter = quarter_for_date(date: Time.zone.now) %>
@ -18,7 +18,7 @@
<% if FormHandler.instance.in_crossover_period? %> <% if FormHandler.instance.in_crossover_period? %>
<% previous_lettings_form = FormHandler.instance.previous_lettings_form %> <% previous_lettings_form = FormHandler.instance.previous_lettings_form %>
<p class="govuk-body govuk-body-m">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.</p> <p class="govuk-body govuk-body-m">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 <%= open_lettings_form.start_date.year %> to <%= open_lettings_form.submission_deadline.year %> logs for this quarter after the quarterly cut-off date.</p>
<% end %> <% end %>
<%= govuk_details(summary_text: "Quarterly cut-off dates for 2023 to 2024") do %> <%= govuk_details(summary_text: "Quarterly cut-off dates for 2023 to 2024") do %>

Loading…
Cancel
Save