Commit 89b472b9 authored by Pedro Henrique's avatar Pedro Henrique

Fix combo box of service type in sschedule report

Signed-off-by: Pedro Henrique's avatarPedro Henrique! <pha14@inf.ufpr.br>
parent dc057617
......@@ -467,13 +467,15 @@ class ReportsController < ApplicationController
@professionals = Professional.active.hide_c3sl_user
end
@tipos_atendimento = ServiceType.active
if !current_citizen.professional.administradorsistema?
@professionals_service_places = current_citizen.professional.professionals_service_places
@tipos_atendimento = @tipos_atendimento.joins(:service_places => :schedules).where(:schedules => {:citizen_id => current_citizen})
@tipos_atendimento_ativos = ServiceTypeServicePlace.where(service_place_id: @currentProfessionalServicePlace.service_place_id, active: true)
@tipos_atendimento = []
@tipos_atendimento_ativos.each { |x| @tipos_atendimento.push(ServiceType.find(x.service_type_id))}
#@tipos_atendimento = @tipos_atendimento.joins(:service_places => :schedules).where(:schedules => {:citizen_id => current_citizen})
end
@tipos_atendimento = @tipos_atendimento.order('description ASC')
@tipos_atendimento = @tipos_atendimento.sort_by{|t| t.description}
if not @professionals.nil?
@professionals = @professionals.order('citizens.name ASC').includes(:citizen)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment