2389 lines
91 KiB
Plaintext
2389 lines
91 KiB
Plaintext
{
|
|
------------------------------------------------------------------------
|
|
PROGRAMA : PRPRRP011
|
|
OBJETIVO : REPORTE MENSUAL PRODUCCION apartir de un ano
|
|
PROGRAMADOR : Juan F. Soto
|
|
FECHA : Noviembre 07, 1994
|
|
------------------------------------------------------------------------
|
|
}
|
|
GLOBALS
|
|
"prprgb000.4gl"
|
|
|
|
DEFINE pilas RECORD LIKE intb00001.*
|
|
DEFINE dia2,dia1 DATE
|
|
DEFINE k_ano SMALLINT
|
|
DEFINE no_semana SMALLINT,
|
|
primera CHAR(1)
|
|
|
|
DEFINE arreglo ARRAY[5,12] OF RECORD
|
|
nombre CHAR(15),
|
|
enero DECIMAL (12,2),
|
|
febrero DECIMAL (12,2),
|
|
marzo DECIMAL (12,2),
|
|
abril DECIMAL (12,2),
|
|
mayo DECIMAL (12,2),
|
|
junio DECIMAL (12,2),
|
|
julio DECIMAL (12,2),
|
|
agosto DECIMAL (12,2),
|
|
septiembre DECIMAL (12,2),
|
|
octubre DECIMAL (12,2),
|
|
noviembre DECIMAL (12,2),
|
|
diciembre DECIMAL (12,2)
|
|
END RECORD
|
|
|
|
FUNCTION prprrp011()
|
|
DEFINE dpto CHAR(13)
|
|
DEFINE p_horas,k_horas DECIMAL(12,2)
|
|
DEFINE cuenta,porcentaje,cuenta_t,cuenta_sem,cuenta_e,id,t_control,num SMALLINT
|
|
DEFINE control CHAR(2)
|
|
DEFINE dias1 DATE,
|
|
primera CHAR(1)
|
|
|
|
OPTIONS
|
|
ERROR LINE 24,
|
|
FORM LINE 8
|
|
|
|
OPEN FORM prfmrp011 FROM "prfmrp011"
|
|
DISPLAY FORM prfmrp011
|
|
CALL pantalla()
|
|
DISPLAY "prprrp011" AT 4,3
|
|
DISPLAY "Resumen Mensual de Produccion" AT 6,25
|
|
LET tipo_papel = 2
|
|
CALL msgrp000(tipo_papel)
|
|
|
|
INPUT BY NAME k_ano
|
|
|
|
# Cancela operacion
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = false
|
|
RETURN
|
|
END IF
|
|
|
|
START REPORT reporte_11 TO "C:\\archivo"
|
|
LET primera = "S"
|
|
DISPLAY "Reporte Generandose... Espere Por Favor" AT 17,14
|
|
LET porcentaje=0
|
|
LET cuenta = 1
|
|
LET primera = "S"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
# Loop para buscar informacion dia1ria de las horas normales
|
|
LET id = 1
|
|
FOR idx =1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
# Busqueda de las k_horas directas de los empleados
|
|
|
|
# Empleados en depto 'A' (Horas normales Directas)
|
|
LET k_horas = 0
|
|
SELECT SUM(a.h_directa) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "A" and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "A"
|
|
LET num = 1
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
|
|
LET porcentaje=3
|
|
LET cuenta = 1
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'B+C' (Horas normales Directas)
|
|
SELECT SUM(a.h_directa) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.departamento != 6114 and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "B+C" and a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "B+C"
|
|
LET num = 1
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
|
|
LET porcentaje=6
|
|
LET cuenta = 2
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'D' (Horas normales Directas)
|
|
SELECT SUM(a.h_directa) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "D" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "D"
|
|
LET num = 1
|
|
LET control = "D1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
|
|
LET porcentaje=9
|
|
LET cuenta = 3
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
#==========================================================================
|
|
# Loop para buscar informacion diaria de las horas normales indirectas
|
|
FOR idx =1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Busqueda de las horas directas de los empleados
|
|
|
|
# Empleados en depto 'A' (HORAS NORMALES INDIRECTAS)
|
|
SELECT SUM(a.h_indirecta) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "A" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "A"
|
|
LET num = 2
|
|
LET control = "A2"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=12
|
|
LET cuenta =4
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'B+C' (HORAS NORMALES INDIRECTAS)
|
|
SELECT SUM(a.h_indirecta) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.departamento != 6114 and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "B+C" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "B+C"
|
|
LET num = 2
|
|
LET control = "B2"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=15
|
|
LET cuenta = 5
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'D' (HORAS NORMALES INDIRECTAS)
|
|
SELECT SUM(a.h_indirecta) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "D" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "D"
|
|
LET num = 2
|
|
LET control = "D2"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=18
|
|
LET cuenta = 6
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
#==========================================================================
|
|
# Loop para buscar informacion dia1ria de las HORAS EXTRAS DIRECTAS
|
|
FOR idx =1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Busqueda de las k_horas directas de los empleados
|
|
|
|
# Empleados en depto 'A' (HORAS EXTRAS)
|
|
SELECT SUM(a.e_directa) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "A" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "A"
|
|
LET num = 3
|
|
LET control = "A3"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=21
|
|
LET cuenta = 7
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'B+C' (HORAS EXTRAS)
|
|
SELECT SUM(a.e_directa) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.departamento != 6114 and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "B+C" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "B+C"
|
|
LET num = 3
|
|
LET control = "B3"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=24
|
|
LET cuenta = 8
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'D' (HORAS EXTRAS)
|
|
SELECT SUM(a.e_directa) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "D" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "D"
|
|
LET num = 3
|
|
LET control = "D3"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=27
|
|
LET cuenta = 9
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
#===========================================================================
|
|
# Loop para buscar informacion diaria de las HORAS EXTRAS INDIRECTAS
|
|
FOR idx =1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Busqueda de las horas indirectas de los empleados
|
|
|
|
# Empleados en depto 'A' (HORAS EXTRAS)
|
|
SELECT SUM(a.e_indirecta) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "A" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "A"
|
|
LET num = 4
|
|
LET control = "A4"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=30
|
|
LET cuenta = 10
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'B+C' (HORAS EXTRAS)
|
|
SELECT SUM(a.e_indirecta) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.departamento != 6114 and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "B+C" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "B+C"
|
|
LET num = 4
|
|
LET control = "B4"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=33
|
|
LET cuenta = 11
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
# Empleados en depto 'D' (HORAS EXTRAS)
|
|
SELECT SUM(a.e_indirecta) INTO k_horas
|
|
FROM cttb00003 a,prtb00004 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
b.tipo = "D" and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "D"
|
|
LET num = 4
|
|
LET control = "D4"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=36
|
|
LET cuenta = 12
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
{
|
|
=============================================================================
|
|
2DA PARTE DEL PROGRAMA PARA BUSCAR LOS DEPARTAMENTOS:
|
|
MANTENIMIENTO,SERV. GENERALES, RECUPERACION, EMP. ESPECIAL
|
|
==============================================================================
|
|
}
|
|
# Busqueda del departamento MANTENIMIENTO
|
|
# HORAS NORMALES
|
|
|
|
# HORAS NORMALES INDIRECTAS
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.hn_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento in (6200,6400) and
|
|
a.departamento = b.departamento and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
b.nivel_emp != 2 and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "MANTENIMIENTO"
|
|
LET num = 10
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje=39
|
|
LET cuenta = 13
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS NORMALES INDIRECTAS SERV. GENERALES
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.hn_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = 6500 and
|
|
a.num_emp= b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
b.nivel_emp != 2 and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "SERV. GENERALES"
|
|
LET num = 10
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 42
|
|
LET cuenta = 14
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS EXTRAS INDIRECTAS
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.he_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento in (6200,6400) and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
b.nivel_emp != 2 and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "MANTENIMIENTO"
|
|
LET num = 11
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 45
|
|
LET cuenta = 15
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS EXTRAS INDIRECTAS
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.he_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = 6500 and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
b.nivel_emp != 2 and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "SERV. GENERALES"
|
|
LET num = 11
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 48
|
|
LET cuenta = 16
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# HORAS NORMALES INDIRECTAS + HORAS EXTRAS INDIRECTAS
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.h_indirecta+a.e_indirecta) INTO k_horas
|
|
FROM cttb00003 a
|
|
WHERE (a.departamento = 6114 and
|
|
a.fecha between dia1 and dia2) and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "RECUPERACION"
|
|
LET num = 8
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 2
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 52
|
|
LET cuenta = 17
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS NORMALES INDIRECTAS EMPAQUE ESPECIAL + HORAS EXTRAS INDIRECTAS
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.h_directa+a.h_indirecta+a.e_directa+a.e_indirecta) INTO k_horas
|
|
FROM cttb00003 a
|
|
WHERE (a.departamento = 6117 and
|
|
a.fecha between dia1 and dia2) and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "EMP. ESPECIAL"
|
|
LET num = 8
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 2
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 55
|
|
LET cuenta = 18
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS NORMALES INDIRECTAS CONTROL CALIDAD
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.hn_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = 6300 and
|
|
a.departamento = b.departamento and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
b.nivel_emp != 1 and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "CONT. CALIDAD"
|
|
LET num = 10
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 58
|
|
LET cuenta = 19
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS EXTRAS INDIRECTAS CONTROL CALIDAD
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.he_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = 6300 and
|
|
a.departamento = b.departamento and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
b.nivel_emp != 1 and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "CONT. CALIDAD"
|
|
LET num = 11
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 61
|
|
LET cuenta = 20
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS NORMALES INDIRECTAS RECUPERACION
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.h_indirecta) INTO k_horas
|
|
FROM cttb00003 a
|
|
WHERE (a.departamento = 6114 and
|
|
a.fecha between dia1 and dia2) and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "RECUPERACION"
|
|
LET num = 10
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 64
|
|
LET cuenta = 21
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# HORAS EXTRAS INDIRECTAS
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.e_indirecta) INTO k_horas
|
|
FROM cttb00003 a
|
|
WHERE (a.departamento = 6114 and
|
|
a.fecha between dia1 and dia2) and
|
|
a.status_t is null
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET dpto = "RECUPERACION"
|
|
LET num = 11
|
|
LET control = "B1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 67
|
|
LET cuenta = 22
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
{
|
|
=============================================================================
|
|
3RA PARTE DEL PROGRAMA PARA BUSCAR LA PRODUCCION DE PILAS:
|
|
D,C Y AA. LOS DEPARTAMENTOS MANTENIMIENTO, SERV. GENERALES, CONTROL
|
|
CALIDAD, RECUPERACION, EMP. ESPECIAL, GERENCIA PLANTA.
|
|
=============================================================================
|
|
}
|
|
LET id = 2
|
|
|
|
# PRODUCCION PILAS D
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.cantidad_2) INTO p_horas
|
|
FROM iptb00006 a
|
|
WHERE (a.cod_grupo = 1) and
|
|
(a.fecha between dia1 and dia2) and
|
|
(a.cod_mov = 20) and
|
|
(a.status_t is null)
|
|
|
|
LET dpto = "D "
|
|
LET num = 7
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 2
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,p_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 70
|
|
LET cuenta = 23
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# PRODUCCION PILAS C
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.cantidad_2) INTO k_horas
|
|
FROM iptb00006 a
|
|
WHERE (a.cod_grupo = 2) and
|
|
(a.fecha between dia1 and dia2) and
|
|
(a.cod_mov = 20) and
|
|
(a.status_t is null)
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "C "
|
|
LET num = 7
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 2
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 73
|
|
LET cuenta = 24
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# PRODUCCION PILAS AA
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.cantidad_2) INTO k_horas
|
|
FROM iptb00006 a
|
|
WHERE (a.cod_grupo = 3) and
|
|
(a.fecha between dia1 and dia2) and
|
|
(a.cod_mov = 20) and
|
|
(a.status_t is null)
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "AA"
|
|
LET num = 7
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 2
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 76
|
|
LET cuenta = 25
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
{
|
|
=============================================================================
|
|
4TA PARTE DEL PROGRAMA PARA BUSCAR LA PRODUCCION DE PILAS:
|
|
D,C Y AA. LOS DEPARTAMENTOS MANTENIMIENTO, SERV. GENERALES, CONTROL
|
|
CALIDAD, RECUPERACION, EMP. ESPECIAL, GERENCIA PLANTA.
|
|
=============================================================================
|
|
}
|
|
LET id = 3
|
|
LET cuenta_t = 0
|
|
# PERSONAL DE PRODUCCION
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
LET cuenta_sem = 0
|
|
LET cuenta_t = 0
|
|
DECLARE busca_s6 CURSOR FOR
|
|
SELECT semana_del,semana_al
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
|
|
FOREACH busca_s6 INTO dia1,dia2
|
|
LET cuenta_sem = cuenta_sem + 1
|
|
LET cuenta_t = cuenta_t + cuenta_e
|
|
LET cuenta_e = 0
|
|
DECLARE busca CURSOR FOR
|
|
SELECT UNIQUE a.emp_no
|
|
FROM cttb00003 a
|
|
WHERE
|
|
(a.fecha between dia1 and dia2)
|
|
FOREACH busca INTO k_horas
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
SELECT UNIQUE cod_n FROM iptb00006
|
|
WHERE (fecha between dia1 and dia2) and
|
|
(cod_mov = 20)
|
|
IF status != notfound THEN
|
|
LET cuenta_e = cuenta_e + 1
|
|
END IF
|
|
DISPLAY idx using "##","-",cuenta_e using "###" at 23,1
|
|
|
|
END FOREACH
|
|
END FOREACH
|
|
LET k_horas = cuenta_t / cuenta_sem
|
|
|
|
LET dpto = "PRODUCCION"
|
|
LET num = 5
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 79
|
|
LET cuenta = 26
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
LET cuenta_t = 0
|
|
# SUPERVISION
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
LET cuenta_sem = 0
|
|
LET cuenta_t = 0
|
|
DECLARE busca_s1 CURSOR FOR
|
|
SELECT semana_del,semana_al INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
DECLARE busca1 CURSOR FOR
|
|
SELECT UNIQUE a.departamento,a.num_emp
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.num_emp= b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
b.nivel_emp = 2 and
|
|
a.status_t is null
|
|
|
|
FOREACH busca_s1
|
|
LET cuenta_sem = cuenta_sem + 1
|
|
LET cuenta_t = cuenta_t + cuenta_e
|
|
LET cuenta_e = 0
|
|
FOREACH busca1 INTO k_horas
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "SUPERVISION"
|
|
LET num = 5
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
|
|
SELECT UNIQUE cod_n FROM iptb00006
|
|
WHERE (fecha between dia1 and dia2) and
|
|
(cod_mov = 20)
|
|
|
|
IF status != notfound THEN
|
|
LET cuenta_e = cuenta_e + 1
|
|
END IF
|
|
|
|
END FOREACH
|
|
END FOREACH
|
|
LET k_horas = cuenta_t / cuenta_sem
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 82
|
|
LET cuenta = 27
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
LET cuenta_t = 0
|
|
# MANTENIMIENTO
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
LET cuenta_sem = 0
|
|
LET cuenta_t = 0
|
|
DECLARE busca_s2 CURSOR FOR
|
|
SELECT semana_del,semana_al INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
DECLARE busca30 CURSOR FOR
|
|
SELECT UNIQUE a.departamento,a.num_emp
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento in (6200,6400) and
|
|
a.departamento = b.departamento and
|
|
a.num_emp= b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
(b.nivel_emp = 2) and
|
|
a.status_t is null
|
|
|
|
FOREACH busca_s2
|
|
LET cuenta_sem = cuenta_sem + 1
|
|
LET cuenta_t = cuenta_t + cuenta_e
|
|
LET cuenta_e = 0
|
|
FOREACH busca30 INTO k_horas
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "MANTENIMIENTO"
|
|
LET num = 5
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
|
|
SELECT UNIQUE cod_n FROM iptb00006
|
|
WHERE (fecha between dia1 and dia2) and
|
|
(cod_mov = 20) and
|
|
status_t is null
|
|
|
|
IF status != notfound THEN
|
|
LET cuenta_e = cuenta_e + 1
|
|
END IF
|
|
|
|
END FOREACH
|
|
END FOREACH
|
|
LET k_horas = cuenta_t / cuenta_sem
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 85
|
|
LET cuenta = 28
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
LET cuenta_t = 0
|
|
# SERV. GENERALES
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
LET cuenta_sem = 0
|
|
LET cuenta_t = 0
|
|
DECLARE busca_s3 CURSOR FOR
|
|
SELECT semana_del,semana_al INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
DECLARE busca10 CURSOR FOR
|
|
SELECT UNIQUE a.departamento,a.num_emp INTO k_horas,k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.departamento = 6500 and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
(b.nivel_emp not in (2)) and
|
|
a.status_t is null
|
|
|
|
FOREACH busca_s3
|
|
LET cuenta_sem = cuenta_sem + 1
|
|
LET cuenta_t = cuenta_t + cuenta_e
|
|
LET cuenta_e = 0
|
|
FOREACH busca10 INTO k_horas
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "SERV. GENERALES"
|
|
LET num = 5
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
|
|
SELECT UNIQUE cod_n FROM iptb00006
|
|
WHERE (fecha between dia1 and dia2) and
|
|
(cod_mov = 20) and
|
|
status_t is null
|
|
|
|
IF status != notfound THEN
|
|
LET cuenta_e = cuenta_e + 1
|
|
END IF
|
|
|
|
END FOREACH
|
|
END FOREACH
|
|
LET k_horas = cuenta_t / cuenta_sem
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 88
|
|
LET cuenta = 29
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
LET cuenta_t = 0
|
|
# GERENCIA PLANTA
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
LET cuenta_sem = 0
|
|
LET cuenta_t = 0
|
|
DECLARE busca_s4 CURSOR FOR
|
|
SELECT semana_del,semana_al INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
DECLARE busca3 CURSOR FOR
|
|
SELECT UNIQUE a.departamento,a.num_emp INTO k_horas,k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.departamento = 6000 and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
(b.nivel_emp not in (2)) and
|
|
a.status_t is null
|
|
|
|
FOREACH busca_s4
|
|
LET cuenta_sem = cuenta_sem + 1
|
|
LET cuenta_t = cuenta_t + cuenta_e
|
|
LET cuenta_e = 0
|
|
FOREACH busca3 INTO k_horas
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "GERENCIA PLANTA"
|
|
LET num = 5
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
|
|
SELECT UNIQUE cod_n FROM iptb00006
|
|
WHERE (fecha between dia1 and dia2) and
|
|
(cod_mov = 20) and
|
|
status_t is null
|
|
|
|
IF status != notfound THEN
|
|
LET cuenta_e = cuenta_e + 1
|
|
END IF
|
|
|
|
END FOREACH
|
|
END FOREACH
|
|
LET k_horas = cuenta_t / cuenta_sem
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 91
|
|
LET cuenta = 30
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
LET cuenta_t = 0
|
|
# CONTROL CALIDAD
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
LET cuenta_sem = 0
|
|
LET cuenta_t = 0
|
|
DECLARE busca_s5 CURSOR FOR
|
|
SELECT semana_del,semana_al INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
DECLARE busca33 CURSOR FOR
|
|
SELECT UNIQUE a.departamento,a.num_emp INTO k_horas,k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.departamento = 6300 and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
(b.nivel_emp = 1) and
|
|
a.status_t is null
|
|
|
|
FOREACH busca_s5
|
|
LET cuenta_sem = cuenta_sem + 1
|
|
LET cuenta_t = cuenta_t + cuenta_e
|
|
LET cuenta_e = 0
|
|
FOREACH busca33 INTO k_horas
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "CONTROL CALIDAD"
|
|
LET num = 5
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
|
|
SELECT UNIQUE cod_n FROM iptb00006
|
|
WHERE fecha between dia1 and dia2 and
|
|
cod_mov = 20 and
|
|
status_t is null
|
|
|
|
IF status != notfound THEN
|
|
LET cuenta_e = cuenta_e + 1
|
|
END IF
|
|
END FOREACH
|
|
END FOREACH
|
|
LET k_horas = cuenta_t / cuenta_sem
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dias1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 94
|
|
LET cuenta = 31
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
# HORAS ADM.
|
|
|
|
LET id = 4
|
|
# GERENCIA DE PLANTA
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
LET k_horas = 0
|
|
SELECT SUM(a.hn_ind+a.he_ind) INTO k_horas
|
|
FROM prtb00003 a
|
|
WHERE (a.departamento = 6000) and
|
|
(a.fecha between dia1 and dia2) and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET k_horas = k_horas
|
|
LET dpto = "GERENCIA PLANTA"
|
|
LET num = 6
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 97
|
|
LET cuenta = 32
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# SUPERVISOR
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
SELECT SUM(a.hn_ind+a.he_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = b.departamento and
|
|
a.num_emp = b.num_emp and
|
|
a.fecha between dia1 and dia2) and
|
|
(b.nivel_emp = 2 ) and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
|
|
LET dpto = "SUPERVISOR"
|
|
LET num = 6
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 99
|
|
LET cuenta = 32
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
# CONTROL CALIDAD
|
|
FOR idx = 1 TO 12
|
|
# Busca la fecha de corte de los meses
|
|
SELECT min(semana_del),max(semana_al) INTO dia1,dia2
|
|
FROM prtb00002
|
|
WHERE mes = idx AND ano = k_ano
|
|
|
|
LET k_horas = 0
|
|
SELECT SUM(a.hn_ind+a.he_ind) INTO k_horas
|
|
FROM prtb00003 a,adtb00003 b
|
|
WHERE (a.departamento = 6300 and
|
|
a.departamento = b.departamento and
|
|
a.fecha between dia1 and dia2) and
|
|
(a.num_emp = b.num_emp) and
|
|
(b.nivel_emp = 1) and
|
|
a.status_t is null
|
|
|
|
IF k_horas is null THEN
|
|
LET k_horas = 0
|
|
END IF
|
|
LET k_horas = k_horas
|
|
LET dpto = "CONT. CALIDAD"
|
|
LET num = 6
|
|
LET control = "A1"
|
|
LET dias1 = idx
|
|
LET t_control = 1
|
|
OUTPUT TO REPORT reporte_11(id,t_control,dias1,dpto,control,num,k_horas)
|
|
LET dia1 = idx + 1
|
|
END FOR
|
|
LET porcentaje= 100
|
|
LET cuenta = 33
|
|
LET primera = "N"
|
|
CALL desplega(porcentaje,cuenta,primera)
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
FINISH REPORT reporte_11
|
|
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
|
|
|
REPORT reporte_11(x_id,k_control,x_dia,x_dpto,x_control,numero,x_horas)
|
|
DEFINE empleados,num_ant,x_id,k_control,numero,p_enero,p_febrero,
|
|
p_marzo,p_abril,p_mayo,p_junio,p_julio,p_agosto,p_septiembre,
|
|
p_octubre,p_noviembre,p_diciembre,dias SMALLINT,
|
|
nombre_prt CHAR(30)
|
|
DEFINE x_dpto CHAR(13)
|
|
DEFINE x_control CHAR(2)
|
|
DEFINE enero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,
|
|
noviembre,diciembre,x_horas,total11,total12,total13,total14,total15,
|
|
total16,total17,total18,total19,total20,total21,total22,total23,t_prod
|
|
DECIMAL(12,2),
|
|
x_dia DATE
|
|
|
|
DEFINE doce_of,comprime,doce_on,negrillas_on,negrillas_off,doce CHAR(2)
|
|
OUTPUT
|
|
LEFT MARGIN 5
|
|
|
|
ORDER BY x_id,k_control,numero,x_dpto DESC ,x_control
|
|
FORMAT
|
|
|
|
PAGE HEADER
|
|
LET doce_on = ASCII 27, ASCII 77
|
|
LET comprime = ASCII 15
|
|
LET doce_of = ASCII 27, ASCII 80
|
|
LET negrillas_on = ASCII 27, ASCII 69
|
|
LET negrillas_off = ASCII 27, ASCII 70
|
|
|
|
PRINT doce,comprime
|
|
PRINT COLUMN 1,negrillas_on,
|
|
COLUMN 1, "prprrp011",
|
|
COLUMN 89, "R A Y .O. V A C D O M I N I C A N A, S. A.",
|
|
COLUMN 220, " PAG. ",pageno using "###"
|
|
PRINT COLUMN 99, "SISTEMA DE PRODUCCION",
|
|
COLUMN 220, TODAY USING "DD/MM/YY"
|
|
PRINT COLUMN 89, "RESUMEN MENSUAL DE PRODUCTIVIDAD ",k_ano,
|
|
COLUMN 220, TIME
|
|
PRINT negrillas_off
|
|
|
|
PRINT
|
|
"=============================================================================",
|
|
"=============================================================================",
|
|
"=========================================================================="
|
|
|
|
PRINT COLUMN 1, "CONCEPTO",
|
|
COLUMN 30, "DEPTO",
|
|
COLUMN 54, "ENERO",
|
|
COLUMN 66, "FEBRERO",
|
|
COLUMN 79, " MARZO ",
|
|
COLUMN 95, " ABRIL",
|
|
COLUMN 108, " MAYO",
|
|
COLUMN 123, " JUNIO",
|
|
COLUMN 135, " JULIO",
|
|
COLUMN 151, "AGOSTO",
|
|
COLUMN 161, "SEPTIEMBRE",
|
|
COLUMN 177, "OCTUBRE",
|
|
COLUMN 190, "NOVIEMBRE",
|
|
COLUMN 204, "DICIEMBRE",
|
|
COLUMN 222, "TOTAL"
|
|
|
|
PRINT
|
|
"=============================================================================",
|
|
"=============================================================================",
|
|
"=========================================================================="
|
|
SKIP 1 LINE
|
|
|
|
BEFORE GROUP OF x_control
|
|
IF num_ant != numero THEN
|
|
LET num_ant = numero
|
|
CASE
|
|
WHEN numero = 1
|
|
LET nombre_prt = "HORAS NORMALES DIRECTAS"
|
|
WHEN numero = 2
|
|
LET nombre_prt = "HORAS NORMALES INDIRECTAS"
|
|
WHEN numero = 3
|
|
LET nombre_prt = "HORAS EXTRAS DIRECTAS"
|
|
WHEN numero = 4
|
|
LET nombre_prt = "HORAS EXTRAS INDIRECTAS"
|
|
WHEN numero = 5
|
|
LET nombre_prt = "PERSONAL DE"
|
|
WHEN numero = 6
|
|
LET nombre_prt = "HORAS ADM."
|
|
WHEN numero = 7
|
|
LET nombre_prt = "PRODUCCION"
|
|
WHEN numero = 8
|
|
LET nombre_prt = "HORAS IND NO PRODUCTIVAS"
|
|
WHEN numero = 10
|
|
LET nombre_prt = "HORAS NORMALES INDIRECTAS"
|
|
WHEN numero = 11
|
|
LET nombre_prt = "HORAS EXTRAS INDIRECTAS"
|
|
END CASE
|
|
PRINT COLUMN 1, nombre_prt clipped," ";
|
|
END IF
|
|
PRINT COLUMN 26, x_dpto ;
|
|
|
|
ON EVERY ROW
|
|
IF x_horas is null THEN
|
|
LET x_horas = 0
|
|
END IF
|
|
IF dia is null THEN
|
|
LET dia = 0
|
|
END IF
|
|
IF empleados is null THEN
|
|
LET empleados = 0
|
|
END IF
|
|
IF x_id != 3 THEN
|
|
PRINT COLUMN 47, x_horas using "#,###,###.##", " ";
|
|
END IF
|
|
IF x_id = 3 THEN
|
|
PRINT COLUMN 47, x_horas using "####,###,##&", " ";
|
|
IF x_dpto = "PRODUCCION" THEN
|
|
LET arreglo[3,8].nombre="PRODUCCION"
|
|
CASE
|
|
WHEN x_dia = 1
|
|
LET arreglo[3,1].enero= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 2
|
|
LET arreglo[3,2].febrero= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 3
|
|
LET arreglo[3,3].marzo= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 4
|
|
LET arreglo[3,4].abril= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 5
|
|
LET arreglo[3,5].mayo= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 6
|
|
LET arreglo[3,6].junio= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 7
|
|
LET arreglo[3,7].julio= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 8
|
|
LET arreglo[3,8].agosto= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 9
|
|
LET arreglo[3,9].septiembre= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 10
|
|
LET arreglo[3,10].octubre= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 11
|
|
LET arreglo[3,11].noviembre= x_horas
|
|
EXIT CASE
|
|
WHEN x_dia = 12
|
|
LET arreglo[3,12].diciembre= x_horas
|
|
EXIT CASE
|
|
END CASE
|
|
|
|
END IF
|
|
IF x_horas != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + x_horas
|
|
END IF
|
|
END IF
|
|
|
|
AFTER GROUP OF x_dpto
|
|
IF x_id != 3 THEN
|
|
PRINT COLUMN 104, GROUP SUM(x_horas) WHERE numero = numero and
|
|
x_dpto = x_dpto
|
|
using "##,###,###.##"
|
|
END IF
|
|
|
|
IF x_id = 3 THEN
|
|
|
|
PRINT COLUMN 104, empleados/dia USING "####,###,##&"
|
|
|
|
END IF
|
|
|
|
AFTER GROUP OF numero
|
|
PRINT negrillas_on
|
|
|
|
IF x_id != 3 THEN
|
|
PRINT "TOTAL: ",
|
|
COLUMN 47, GROUP SUM(x_horas) WHERE x_dia = 1
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 2
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 3
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 4
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 5
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 6
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 7
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 8
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 9
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 10
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 11
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 12
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE numero = numero
|
|
using "##,###,###.##"
|
|
END IF
|
|
|
|
IF x_id = 3 THEN
|
|
LET dia = 0
|
|
LET empleados = 0
|
|
LET p_enero = GROUP SUM(x_horas) WHERE x_dia = 1
|
|
IF p_enero != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_enero
|
|
END IF
|
|
LET p_febrero=GROUP SUM(x_horas) WHERE x_dia = 2
|
|
IF p_febrero != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_febrero
|
|
END IF
|
|
LET p_marzo=GROUP SUM(x_horas) WHERE x_dia = 3
|
|
IF p_marzo != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_marzo
|
|
END IF
|
|
LET p_abril= GROUP SUM(x_horas) WHERE x_dia = 4
|
|
IF p_abril != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_abril
|
|
END IF
|
|
LET p_mayo= GROUP SUM(x_horas) WHERE x_dia = 5
|
|
IF p_mayo != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_mayo
|
|
END IF
|
|
LET p_junio= GROUP SUM(x_horas) WHERE x_dia = 6
|
|
IF p_junio != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_junio
|
|
END IF
|
|
LET p_julio= GROUP SUM(x_horas) WHERE x_dia = 7
|
|
IF p_julio != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_julio
|
|
END IF
|
|
LET p_agosto= GROUP SUM(x_horas) WHERE x_dia = 8
|
|
IF p_agosto != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_agosto
|
|
END IF
|
|
LET p_septiembre= GROUP SUM(x_horas) WHERE x_dia = 9
|
|
IF p_septiembre != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_septiembre
|
|
END IF
|
|
LET p_octubre= GROUP SUM(x_horas) WHERE x_dia = 10
|
|
IF p_octubre != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_octubre
|
|
END IF
|
|
LET p_noviembre= GROUP SUM(x_horas) WHERE x_dia = 11
|
|
IF p_noviembre != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_noviembre
|
|
END IF
|
|
LET p_diciembre= GROUP SUM(x_horas) WHERE x_dia = 12
|
|
IF p_diciembre != 0 THEN
|
|
LET dia = dia + 1
|
|
LET empleados = empleados + p_diciembre
|
|
END IF
|
|
|
|
PRINT "TOTAL: ",
|
|
COLUMN 47, GROUP SUM(x_horas) WHERE x_dia = 1
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 2
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 3
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 4
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 5
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 6
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 7
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 8
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 9
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 10
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 11
|
|
using "####,###,##&"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 12
|
|
using "####,###,##&"," ",
|
|
empleados/dia USING "####,###,###"
|
|
|
|
|
|
PRINT negrillas_off
|
|
|
|
PRINT "HORAS NO PRODUCTIVAS "
|
|
PRINT arreglo[3,8].nombre;
|
|
PRINT COLUMN 47, arreglo[3,1].enero * .5 USING "####,###,##&"," ",
|
|
arreglo[3,2].febrero * .5 USING "####,###,##&"," ",
|
|
arreglo[3,3].marzo * .5 USING "####,###,##&"," ",
|
|
arreglo[3,4].abril * .5 USING "####,###,##&"," ",
|
|
arreglo[3,5].mayo * .5 USING "####,###,##&"," ",
|
|
arreglo[3,6].junio * .5 USING "####,###,##&"," ",
|
|
arreglo[3,7].julio * .5 USING "####,###,##&"," ",
|
|
arreglo[3,8].agosto *.5 USING "####,###,##&"," ",
|
|
arreglo[3,9].septiembre *.5 USING "####,###,##&"," ",
|
|
arreglo[3,10].octubre*.5 USING "####,###,##&"," ",
|
|
arreglo[3,11].noviembre*.5 USING "####,###,##&"," ",
|
|
arreglo[3,12].diciembre*.5 USING "####,###,##&"," ",
|
|
(arreglo[3,1].enero*.5) +(arreglo[3,2].febrero*.5) +
|
|
(arreglo[3,3].marzo*.5)+(arreglo[3,4].abril*.5) +
|
|
(arreglo[3,5].mayo*.5) +(arreglo[3,6].junio*.5) +
|
|
(arreglo[3,7].julio*.5)+
|
|
(arreglo[3,8].agosto *.5)+
|
|
(arreglo[3,9].septiembre *.5)+(arreglo[3,10].octubre *.5)
|
|
+(arreglo[3,11].noviembre*.5)+
|
|
(arreglo[1,12].diciembre*.5) using "####,###,##&"
|
|
END IF
|
|
|
|
PRINT negrillas_off
|
|
|
|
|
|
AFTER GROUP OF k_control
|
|
PRINT negrillas_on
|
|
IF x_id != 3 THEN
|
|
PRINT "TOTAL GENERAL: ",
|
|
COLUMN 47, GROUP SUM(x_horas) WHERE x_dia = 1
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 2
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 3
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 4
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 5
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 6
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 7
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 8
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 9
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 10
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 11
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 12
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) using "##,###,###.##"
|
|
|
|
IF primera = "S" THEN
|
|
PRINT negrillas_off
|
|
LET primera = "N"
|
|
LET total11 = GROUP SUM(x_horas)
|
|
WHERE x_dia = 1 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total12 = GROUP SUM(x_horas)
|
|
WHERE x_dia = 2 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total13 = GROUP SUM(x_horas)
|
|
WHERE x_dia = 3 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total14 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 4 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total15 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 5 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total16 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 6 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total17 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 7 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total18 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 8 and (numero = 2 or
|
|
numero = 4)
|
|
LET total19 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 9 and (numero = 2 or
|
|
numero = 4)
|
|
LET total20 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 10 and (numero = 2 or
|
|
numero = 4)
|
|
LET total21 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 11 and (numero = 2 or
|
|
numero = 4)
|
|
LET total22 = GROUP SUM(x_horas)
|
|
WHERE (x_dia) = 12 and (numero = 2 or
|
|
numero = 4)
|
|
|
|
LET total23 = total11+total12+total13+total14+total15+total16+total17+
|
|
total18+total19+total20+total21+total22
|
|
|
|
PRINT "HORAS IND. NO PRODUCTIVAS",
|
|
COLUMN 47, total11 using "#,###,###.##"," ",
|
|
total12 using "#,###,###.##"," ",
|
|
total13 using "#,###,###.##"," ",
|
|
total14 using "#,###,###.##"," ",
|
|
total15 using "#,###,###.##"," ",
|
|
total16 using "#,###,###.##"," ",
|
|
total17 using "#,###,###.##"," ",
|
|
total18 using "#,###,###.##"," ",
|
|
total19 using "#,###,###.##"," ",
|
|
total20 using "#,###,###.##"," ",
|
|
total21 using "#,###,###.##"," ",
|
|
total22 using "#,###,###.##"," ",
|
|
total23 using "#,###,###.##"
|
|
|
|
END IF
|
|
END IF
|
|
IF x_id = 3 THEN
|
|
|
|
PRINT "TOTAL GENERAL: ",
|
|
COLUMN 47, GROUP COUNT(*) WHERE x_dia = 1
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 2
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 3
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 4
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 5
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 6
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 7
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 8
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 9
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 10
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 11
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) WHERE x_dia = 12
|
|
using "#,###,###.##"," ",
|
|
GROUP COUNT(*) using "##,###,###.##"
|
|
END IF
|
|
|
|
PRINT negrillas_off
|
|
|
|
AFTER GROUP OF x_id
|
|
IF x_id = 1 THEN
|
|
PRINT COLUMN 1, "HORAS NORMALES"," ";
|
|
PRINT COLUMN 47, GROUP SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 1 or
|
|
numero = 2 or numero = 10)
|
|
using "#,###,###.##"," ",
|
|
GROUP SUM(x_horas) WHERE numero = 1 or numero = 2 or
|
|
numero = 10
|
|
using "#,###,###.##"
|
|
|
|
PRINT COLUMN 1, "HORAS EXTRAS "," ";
|
|
PRINT COLUMN 47, GROUP SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 3 or
|
|
numero = 4 or numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE numero = 3 or numero = 4 or
|
|
numero = 11
|
|
using "#,###,###.##"," "
|
|
|
|
PRINT COLUMN 1, "HORAS GENERALES"," ";
|
|
PRINT COLUMN 47, GROUP SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or
|
|
numero = 11) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 10 or numero = 11
|
|
using "#,###,###.##"," "
|
|
|
|
PRINT COLUMN 1, "HORAS DIRECTAS"," ";
|
|
PRINT COLUMN 47, GROUP SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
GROUP SUM(x_horas) WHERE (numero = 3 or
|
|
numero = 1) using "#,###,###.##"
|
|
END IF
|
|
|
|
PRINT "==================================================================",
|
|
"=============================================================================",
|
|
"=============================================================================",
|
|
"====="
|
|
|
|
|
|
ON LAST ROW
|
|
|
|
LET enero = SUM(x_horas) WHERE x_dia = 1 and
|
|
numero = 7
|
|
LET febrero= SUM(x_horas) WHERE x_dia = 2 and
|
|
numero = 7
|
|
LET marzo = SUM(x_horas) WHERE x_dia = 3 and
|
|
numero = 7
|
|
LET abril = SUM(x_horas) WHERE x_dia = 4 and
|
|
numero = 7
|
|
LET mayo = SUM(x_horas) WHERE x_dia = 5 and
|
|
numero = 7
|
|
LET junio = SUM(x_horas) WHERE x_dia = 6 and
|
|
numero = 7
|
|
LET julio = SUM(x_horas) WHERE x_dia = 7 and
|
|
numero = 7
|
|
LET agosto = SUM(x_horas) WHERE x_dia = 8 and
|
|
numero = 7
|
|
LET septiembre = SUM(x_horas) WHERE x_dia = 9 and
|
|
numero = 7
|
|
LET octubre = SUM(x_horas) WHERE x_dia = 10 and
|
|
numero = 7
|
|
LET noviembre = SUM(x_horas) WHERE x_dia = 11 and
|
|
numero = 7
|
|
LET diciembre = SUM(x_horas) WHERE x_dia = 12 and
|
|
numero = 7
|
|
CASE
|
|
WHEN enero is null LET enero = 0 EXIT CASE
|
|
WHEN febrero is null LET febrero = 0 EXIT CASE
|
|
WHEN marzo is null LET marzo = 0 EXIT CASE
|
|
WHEN abril is null LET abril = 0 EXIT CASE
|
|
WHEN mayo is null LET mayo = 0 EXIT CASE
|
|
WHEN junio is null LET junio = 0 EXIT CASE
|
|
WHEN julio is null LET julio = 0 EXIT CASE
|
|
WHEN agosto is null LET agosto = 0 EXIT CASE
|
|
WHEN septiembre is null LET septiembre = 0 EXIT CASE
|
|
WHEN octubre is null LET octubre = 0 EXIT CASE
|
|
WHEN noviembre is null LET noviembre = 0 EXIT CASE
|
|
WHEN diciembre is null LET diciembre = 0 EXIT CASE
|
|
END CASE
|
|
LET t_prod = enero+febrero+marzo+abril+mayo+junio+julio+agosto+
|
|
septiembre+octubre+noviembre+diciembre
|
|
|
|
PRINT "UNIDADES/HORAS DIRECTAS ";
|
|
PRINT COLUMN 47, enero/SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
febrero/SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
marzo/SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
abril/SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
mayo/SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.##",
|
|
" ",
|
|
junio/SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.&&",
|
|
" ",
|
|
julio/SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 3 or
|
|
numero = 1)
|
|
using "#,###,###.&&",
|
|
agosto/SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.&&"," ",
|
|
septiembre/SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.&&"," ",
|
|
octubre/SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.&&"," ",
|
|
noviembre/SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.&&"," ",
|
|
diciembre/SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 3 or
|
|
numero = 1) using "#,###,###.&&"," ",
|
|
t_prod/SUM(x_horas) WHERE numero = 3 or numero = 1
|
|
using "#,###,###.&&"
|
|
|
|
PRINT "UNIDADES/HR. MANTENIMIENTO";
|
|
PRINT COLUMN 47, enero/SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 22 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&", " ",
|
|
febrero/SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&", " ",
|
|
marzo/SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&", " ",
|
|
abril/SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&", " ",
|
|
mayo/SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&", " ",
|
|
junio/SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&", " ",
|
|
julio/SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&"," ",
|
|
agosto/SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&"," ",
|
|
septiembre/SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&"," ",
|
|
octubre/SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&"," ",
|
|
noviembre/SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&"," ",
|
|
diciembre/SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 3 or
|
|
numero = 10 or
|
|
numero = 11 or
|
|
numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&"," ",
|
|
t_prod/SUM(x_horas) WHERE (numero = 3 or numero = 10 or
|
|
numero = 11 or numero = 1) and
|
|
x_dpto = "MANTENIMIENTO"
|
|
using "#,###,###.&&"
|
|
|
|
PRINT "UNIDADES/H. GENERALES";
|
|
PRINT COLUMN 47, enero/SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
febrero/SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
marzo/SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
abril/SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
mayo/SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
junio/SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
julio/SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
agosto/SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
septiembre/SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
octubre/SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
noviembre/SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
diciembre/SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or numero = 10 or
|
|
numero = 11) using "#,###,###.&&"," ",
|
|
t_prod/SUM(x_horas) WHERE numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4
|
|
or numero = 10 or
|
|
numero = 11 using "#,###,###.&&"
|
|
|
|
PRINT "UNIDADES/HORAS PLANTA ";
|
|
PRINT COLUMN 47, enero/SUM(x_horas) WHERE x_dia = 1 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
febrero/SUM(x_horas) WHERE x_dia = 2 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
marzo/SUM(x_horas) WHERE x_dia = 3 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
abril/SUM(x_horas) WHERE x_dia = 4 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
mayo/SUM(x_horas) WHERE x_dia = 5 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
junio/SUM(x_horas) WHERE x_dia = 6 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
julio/SUM(x_horas) WHERE x_dia = 7 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
agosto/SUM(x_horas) WHERE x_dia = 8 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
septiembre/SUM(x_horas) WHERE x_dia = 9 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
octubre/SUM(x_horas) WHERE x_dia = 10 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
noviembre/SUM(x_horas) WHERE x_dia = 11 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&",
|
|
" ",
|
|
diciembre/SUM(x_horas) WHERE x_dia = 12 and
|
|
(numero = 3 or numero = 1 or
|
|
numero = 2 or
|
|
numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or
|
|
numero = 11)
|
|
using "#,###,###.&&"," ",
|
|
t_prod/SUM(x_horas) WHERE numero = 3 or numero = 1 or
|
|
numero = 2 or numero = 4 or
|
|
numero = 6 or
|
|
numero = 10 or numero = 11
|
|
using "#,###,###.&&"
|
|
PRINT doce_of
|
|
|
|
END REPORT
|
|
FUNCTION desplega(porcentaje,cuenta,primera)
|
|
DEFINE cuenta,i,p,porcentaje SMALLINT,
|
|
primera CHAR(1)
|
|
IF primera = "S" THEN
|
|
CALL fgl_drawbox(3,8,19,18)
|
|
CALL fgl_drawbox(3,35,19,26)
|
|
LET primera = "N"
|
|
END IF
|
|
DISPLAY porcentaje using "##&","%" AT 20,19 ATTRIBUTE(BOLD)
|
|
|
|
LET p = 27
|
|
FOR i = 1 TO cuenta
|
|
DISPLAY " " AT 20,p ATTRIBUTE(REVERSE,BOLD)
|
|
#DISPLAY p," ",cuenta using "###" AT 20,28 ATTRIBUTE(REVERSE,BOLD)
|
|
LET p = p + 1
|
|
END FOR
|
|
|
|
|
|
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|