ViniciusConsultor / controlhoras

Automatically exported from code.google.com/p/controlhoras
1 stars 0 forks source link

Nuevo Listado: Detalle deactividad del funcionario en un rango de fechas dado #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Modulo que cambia:
Nuevo Listado

Requerimiento:
Tener un listado que dado un rango de fechas y un funcionario, despliegue dia 
por dia cual fue el estado del funcionario. 
Con estado me refiero a Trabajando (Cliente/Servicio - Hs), Descanso, u Algun 
evento en el Historial del Empleado.

Original issue reported on code.google.com by juanga...@gmail.com on 21 May 2011 at 2:17

GoogleCodeExporter commented 8 years ago
Consulta que resuelve el pedido:

select FechaCorrespondiente as Fecha, CAST( concat_ws(',',emp.NroEmpleado, 
emp.Apellido, emp.Nombre) as CHAR) as empleado, 
CAST(if(hge.Descanso=0,concat(NumeroCliente,'-', NumeroServicio),'Descanso') as 
CHAR) as observacion from horasgeneradasescalafon hge, empleados emp where 
hge.FechaCorrespondiente between 'FECHADESDE' and 'FECHAHASTA' and 
hge.NroEmpleado=NROEMPLEADO and hge.NroEmpleado=emp.NroEmpleado UNION select 
FechaInicio as Fecha, CAST(concat_ws(' ',emp.NroEmpleado, emp.Apellido, 
emp.Nombre) as CHAR) as empleado, CAST(concat(ehe.FechaInicio,' a 
',ehe.FechaFin,': ', ehe.Descripcion) as CHAR) as observacion from 
EventosHistorialEmpleado ehe, Empleados emp, TiposEventoHistorial teh where 
ehe.IdEmpleado=emp.NroEmpleado and ehe.IdTipoEvento = teh.IdTipoEventoHistorial 
and ( ehe.FechaInicio <= 'FECHAHASTA' and ehe.FechaFin >= 'FECHADESDE') and 
IdEmpleado=NROEMPLEADO UNION select FechaCorresponde as Fecha, CAST(concat_ws(' 
',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as empleado, 
CAST(mcd.Observaciones as CHAR) as observacion from motivoscambiosdiarios mcd, 
empleados emp where mcd.FechaCorresponde between 'FECHADESDE' and 'FECHAHASTA' 
and mcd.NroEmpleado=NROEMPLEADO and mcd.NroEmpleado=emp.NroEmpleado ORDER BY 1

1:30 hs

Original comment by juanga...@gmail.com on 30 May 2011 at 5:30

GoogleCodeExporter commented 8 years ago
Se agrega control de que no haya ningun funcionario Activo no Asignado.
Para esto se crea la operacion  int 
obtenerCantidadFuncionariosActivosSinAsignar(DateTime Fecha) en 
ControladorDatos.

Ademas, se cambia la consultaclientes de ID 7, Personal Activo sin asignar para 
una fecha dada.
Se agrega el he.TipoDia != 1, ya que sino cuenta los tipos EnOtroServicio como 
un dia de labor.

Original comment by juanga...@gmail.com on 30 May 2011 at 10:55

GoogleCodeExporter commented 8 years ago
INSERT INTO CONSULTASEMPLEADOS VALUES (0,"ACTIVIDAD DE UN FUNCIONARIO EN 
DIAS","Devuelve la actividad del funcionario en todos los dias dentro del rango 
dado.","select FechaCorrespondiente as Fecha, CAST( 
concat_ws(',',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as empleado, 
'ESCALAFON',CAST(if(hge.Descanso=0,concat(NumeroCliente,'-', 
NumeroServicio),'Descanso') as CHAR) as observacion from 
horasgeneradasescalafon hge, empleados emp where hge.FechaCorrespondiente 
between 'FECHADESDE' and 'FECHAHASTA' and hge.NroEmpleado=NROEMPLEADO and 
hge.NroEmpleado=emp.NroEmpleado UNION select FechaInicio as Fecha, 
CAST(concat_ws(' ',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as 
empleado,'HISTORIAL FUNCIONARIO', CAST(concat(ehe.FechaInicio,' a 
',ehe.FechaFin,': ', ehe.Descripcion) as CHAR) as observacion from 
EventosHistorialEmpleado ehe, Empleados emp, TiposEventoHistorial teh where 
ehe.IdEmpleado=emp.NroEmpleado and ehe.IdTipoEvento = teh.IdTipoEventoHistorial 
and ( ehe.FechaInicio <= 'FECHAHASTA' and ehe.FechaFin >= 'FECHADESDE') and 
IdEmpleado=NROEMPLEADO UNION select FechaCorresponde as Fecha, CAST(concat_ws(' 
',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as empleado,'MOTIVO 
CAMBIO DIARIO', CAST(mcd.Observaciones as CHAR) as observacion from 
motivoscambiosdiarios mcd, empleados emp where mcd.FechaCorresponde between 
'FECHADESDE' and 'FECHAHASTA' and mcd.NroEmpleado=NROEMPLEADO and 
mcd.NroEmpleado=emp.NroEmpleado ORDER BY 1",1);

Original comment by juanga...@gmail.com on 30 May 2011 at 11:23