diff --git a/app/components/sales_log_summary_component.html.erb b/app/components/sales_log_summary_component.html.erb index e78659863..09181fc72 100644 --- a/app/components/sales_log_summary_component.html.erb +++ b/app/components/sales_log_summary_component.html.erb @@ -4,40 +4,35 @@

<%= govuk_link_to sales_log_path(log) do %> - Log <%= log.id %> + Log <%= log.id %> <% end %>

<% if log.purchaser_code %> - + <% end %>

<% if log.ownership_scheme %> - <%= case log.ownership_scheme - when "shared ownership" then "Shared ownership" - when "discounted ownership" then "Discounted ownership" - when "outright sale" then "Outright or other sale" - end %> -
+ <%= log.ownership_scheme(uppercase: true) %>
<% end %> <% if log.saledate %> - Sale completed + Sale completed <% end %>

<% if current_user.support? || current_user.organisation.has_managing_agents? %> -
- <% if log.owning_organisation %> -
- - -
- <% end %> -
+
+ <% if log.owning_organisation %> +
+ + +
+ <% end %> +
<% end %> diff --git a/app/models/sales_log.rb b/app/models/sales_log.rb index 953ed83e9..ad3a3d90f 100644 --- a/app/models/sales_log.rb +++ b/app/models/sales_log.rb @@ -383,12 +383,13 @@ class SalesLog < Log beds.nil? ? nil : [beds, LaSaleRange::MAX_BEDS].min end - def ownership_scheme - case ownershipsch - when 1 then "shared ownership" - when 2 then "discounted ownership" - when 3 then "outright sale" - end + def ownership_scheme(uppercase: false) + owner_scheme = case ownershipsch + when 1 then "shared ownership" + when 2 then "discounted ownership" + when 3 then "outright or other sale" + end + uppercase ? owner_scheme.capitalize : owner_scheme end def combined_income