Commit 99490df2 authored by Pedro Henrique's avatar Pedro Henrique

Fix service place

Signed-off-by: Pedro Henrique's avatarPedro Henrique! <pha14@inf.ufpr.br>
parent be29d8f1
......@@ -472,10 +472,11 @@ class ReportsController < ApplicationController
@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.sort_by{|t| t.description}
if !@tipos_atendimento.nil?
@tipos_atendimento = @tipos_atendimento.sort_by{|t| t.description}
end
if not @professionals.nil?
@professionals = @professionals.order('citizens.name ASC').includes(:citizen)
end
......@@ -670,7 +671,7 @@ class ReportsController < ApplicationController
@link = "Relatórios"
@link2 = "Atendimentos"
if !current_citizen.professional.administradorsistema?
if !current_citizen.professional.administradorc3sl?
@serviceplaces = ServicePlace.all.where(:city_hall_id => @currentCityHall.id, :id => @currentProfessionalServicePlace.service_place_id).order('name ASC')
@professionals = Professional.active.hide_c3sl_user.where(service_places: {city_hall_id: @currentCityHall.id}).includes(:service_places)
else
......
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