diff --git a/app/controllers/lettings_logs_controller.rb b/app/controllers/lettings_logs_controller.rb index bc606d4c6..bc1508225 100644 --- a/app/controllers/lettings_logs_controller.rb +++ b/app/controllers/lettings_logs_controller.rb @@ -22,7 +22,7 @@ class LettingsLogsController < LogsController @total_count = all_logs.size @unresolved_count = all_logs.unresolved.created_by(current_user).count @filter_type = "lettings_logs" - @duplicate_sets_count = duplicate_sets_count(current_user, nil) + @duplicate_sets_count = current_user.support? ? 0 : duplicate_sets_count(current_user, nil) render "logs/index" end diff --git a/app/controllers/sales_logs_controller.rb b/app/controllers/sales_logs_controller.rb index 7ddc1054d..532b5e1bf 100644 --- a/app/controllers/sales_logs_controller.rb +++ b/app/controllers/sales_logs_controller.rb @@ -24,7 +24,7 @@ class SalesLogsController < LogsController @searched = search_term.presence @total_count = all_logs.size @filter_type = "sales_logs" - @duplicate_sets_count = duplicate_sets_count(current_user, nil) + @duplicate_sets_count = current_user.support? ? 0 : duplicate_sets_count(current_user, nil) render "logs/index" end diff --git a/app/models/lettings_log.rb b/app/models/lettings_log.rb index 35954953c..45f25eca3 100644 --- a/app/models/lettings_log.rb +++ b/app/models/lettings_log.rb @@ -53,6 +53,8 @@ class LettingsLog < Log scope :after_date, ->(date) { where("lettings_logs.startdate >= ?", date) } scope :unresolved, -> { where(unresolved: true) } scope :filter_by_organisation, ->(org, _user = nil) { where(owning_organisation: org).or(where(managing_organisation: org)) } + scope :filter_by_owning_organisation, ->(owning_organisation, _user = nil) { where(owning_organisation:) } + scope :filter_by_managing_organisation, ->(managing_organisation, _user = nil) { where(managing_organisation:) } scope :age1_answered, -> { where.not(age1: nil).or(where(age1_known: 1)) } scope :tcharge_answered, -> { where.not(tcharge: nil).or(where(household_charge: 1)).or(where(is_carehome: 1)) } scope :chcharge_answered, -> { where.not(chcharge: nil).or(where(is_carehome: [nil, 0])) }