274 lines
7.8 KiB
Plaintext
274 lines
7.8 KiB
Plaintext
{
|
|
-------------------------------------------------------------------------------
|
|
PROGRAMA : NOPRCS007
|
|
OBJETIVO : Consulta los movimientos de los empleados, por empleado,
|
|
y todos los empleados
|
|
PROGRAMADOR : Ing. Juan Soto
|
|
FECHA REALIZACION : Enero 27, 1993
|
|
-------------------------------------------------------------------------------
|
|
}
|
|
GLOBALS "noprgb000.4gl"
|
|
|
|
DEFINE arr_nuevo ARRAY[100] OF RECORD
|
|
cod_mov LIKE notb00008.cod_mov,
|
|
descrip_mov LIKE notb00002.descrip_mov,
|
|
cantidad LIKE notb00008.cantidad,
|
|
valor LIKE notb00008.valor
|
|
END RECORD
|
|
|
|
DEFINE ingresos RECORD
|
|
num_nomi LIKE notb00008.num_nomi,
|
|
tipo_emp LIKE notb00008.tipo_emp,
|
|
num_emp LIKE notb00008.num_emp,
|
|
departamento LIKE notb00008.departamento,
|
|
nivel_emp LIKE notb00008.nivel_emp,
|
|
cod_puesto LIKE notb00008.cod_puesto,
|
|
nom1_emp LIKE adtb00003.nom1_emp,
|
|
apell1_emp LIKE adtb00003.apell1_emp
|
|
END RECORD
|
|
|
|
DEFINE idx_n SMALLINT
|
|
|
|
FUNCTION noprcs007()
|
|
#WHENEVER ERROR CONTINUE
|
|
CLEAR SCREEN
|
|
OPTIONS
|
|
|
|
FORM LINE 8,
|
|
ERROR LINE 23,
|
|
COMMENT LINE 21
|
|
|
|
OPEN FORM nofmcs007 FROM "nofmcvs007"
|
|
DISPLAY FORM nofmcs007
|
|
CALL PANTALLA()
|
|
DISPLAY "<Esc> Continua Consulta" AT 2,3
|
|
DISPLAY "<CTRL-C> Cancela Operacion" AT 2,50
|
|
DISPLAY "noprcs007" AT 4,3
|
|
DISPLAY "Movimientos Anterior Al Calculo de la Nomina" AT 6,18
|
|
|
|
LABEL vuelve:
|
|
CLEAR FORM
|
|
CONSTRUCT criterio ON b.num_nomi,b.tipo_emp,a.num_emp,a.departamento
|
|
FROM num_nomi,tipo_emp,num_emp,departamento
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
CLEAR FORM
|
|
RETURN
|
|
END IF
|
|
|
|
LET SELEC =
|
|
"SELECT UNIQUE b.num_nomi,a.nomina,a.num_emp,a.departamento, ",
|
|
" a.nivel_emp,a.cod_puesto,a.nom1_emp,a.apell1_emp ",
|
|
"FROM adtb00003 a,outer notb00007 b,outer notb00003 c ",
|
|
"WHERE a.num_emp = b.num_emp and a.nomina = b.tipo_emp and ",
|
|
" (a.status_t is null OR a.status_t = 'I') AND a.num_emp=c.num_emp and ",
|
|
criterio clipped," ORDER BY 1,2,3,4 "
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
CLEAR FORM
|
|
RETURN
|
|
END IF
|
|
|
|
DISPLAY "Buscando Informacion ... Espere Por Favor" AT 21,2
|
|
ATTRIBUTE (YELLOW)
|
|
|
|
PREPARE busca FROM selec
|
|
DECLARE accion SCROLL CURSOR FOR busca
|
|
OPEN accion
|
|
DISPLAY " " AT 21,2
|
|
|
|
LET idx = 1
|
|
FETCH FIRST accion INTO ingresos.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 3
|
|
CALL msg(numero_msg)
|
|
GOTO vuelve
|
|
END IF
|
|
|
|
IF ingresos.tipo_emp = "Q" THEN
|
|
LET descr = "QUINCENAL"
|
|
ELSE
|
|
IF ingresos.tipo_emp = "V" THEN
|
|
LET descr = "VENDEDOR"
|
|
ELSE
|
|
LET descr = "SEMANAL"
|
|
END IF
|
|
END IF
|
|
|
|
LET descrip1 = ingresos.nom1_emp clipped," ",ingresos.apell1_emp clipped
|
|
DISPLAY BY NAME ingresos.num_nomi,ingresos.tipo_emp,descr,ingresos.num_emp,
|
|
ingresos.departamento,ingresos.nivel_emp,
|
|
ingresos.cod_puesto,descrip1
|
|
|
|
MENU "OPCION"
|
|
COMMAND "Siguiente"
|
|
"Presenta en pantalla el registro Siguiente encontrado"
|
|
LET idx = 1
|
|
FETCH NEXT accion INTO ingresos.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 4
|
|
CALL msg(numero_msg)
|
|
END IF
|
|
IF ingresos.tipo_emp = "Q" THEN
|
|
LET descr = "QUINCENAL"
|
|
ELSE
|
|
IF ingresos.tipo_emp = "V" THEN
|
|
LET descr = "VENDEDOR"
|
|
ELSE
|
|
LET descr = "SEMANAL"
|
|
END IF
|
|
END IF
|
|
|
|
LET descrip1 = ingresos.nom1_emp clipped," ",ingresos.apell1_emp clipped
|
|
DISPLAY BY NAME ingresos.num_nomi,ingresos.tipo_emp,descr,
|
|
ingresos.num_emp,ingresos.departamento,ingresos.nivel_emp,
|
|
ingresos.cod_puesto,descrip1
|
|
|
|
COMMAND "Anterior"
|
|
"Presenta en pantalla el registro Anterior encontrado"
|
|
LET idx = 1
|
|
FETCH PREVIOUS accion INTO ingresos.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 5
|
|
CALL msg(numero_msg)
|
|
END IF
|
|
IF ingresos.tipo_emp = "Q" THEN
|
|
LET descr = "QUINCENAL"
|
|
ELSE
|
|
IF ingresos.tipo_emp = "V" THEN
|
|
LET descr = "VENDEDOR"
|
|
ELSE
|
|
LET descr = "SEMANAL"
|
|
END IF
|
|
END IF
|
|
|
|
LET descrip1 = ingresos.nom1_emp clipped," ",ingresos.apell1_emp clipped
|
|
DISPLAY BY NAME ingresos.num_nomi,ingresos.tipo_emp,descr,
|
|
ingresos.num_emp,ingresos.departamento,ingresos.nivel_emp,
|
|
ingresos.cod_puesto,descrip1
|
|
|
|
COMMAND "Primero"
|
|
"Presenta en pantalla el Primer registro encontrado"
|
|
LET idx = 1
|
|
FETCH FIRST accion INTO ingresos.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 5
|
|
CALL msg(numero_msg)
|
|
END IF
|
|
IF ingresos.tipo_emp = "Q" THEN
|
|
LET descr = "QUINCENAL"
|
|
ELSE
|
|
IF ingresos.tipo_emp = "V" THEN
|
|
LET descr = "VENDEDOR"
|
|
ELSE
|
|
LET descr = "SEMANAL"
|
|
END IF
|
|
END IF
|
|
|
|
LET descrip1 = ingresos.nom1_emp clipped," ",ingresos.apell1_emp clipped
|
|
DISPLAY BY NAME ingresos.num_nomi,ingresos.tipo_emp,descr,
|
|
ingresos.num_emp,ingresos.departamento,ingresos.nivel_emp,
|
|
ingresos.cod_puesto,descrip1
|
|
|
|
COMMAND "Ultimo"
|
|
"Presenta en pantalla el Ultimo registro encontrado"
|
|
LET idx = 1
|
|
FETCH LAST accion INTO ingresos.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 4
|
|
CALL msg(numero_msg)
|
|
END IF
|
|
IF ingresos.tipo_emp = "Q" THEN
|
|
LET descr = "QUINCENAL"
|
|
ELSE
|
|
IF ingresos.tipo_emp = "V" THEN
|
|
LET descr = "VENDEDOR"
|
|
ELSE
|
|
LET descr = "SEMANAL"
|
|
END IF
|
|
END IF
|
|
|
|
LET descrip1 = ingresos.nom1_emp clipped," ",ingresos.apell1_emp clipped
|
|
DISPLAY BY NAME ingresos.num_nomi,ingresos.tipo_emp,descr,
|
|
ingresos.num_emp,ingresos.departamento,ingresos.nivel_emp,
|
|
ingresos.cod_puesto,descrip1
|
|
|
|
COMMAND "Ver"
|
|
"Para ver los ingresos de este empleado"
|
|
DISPLAY "Buscando Informacion ... Espere Por Favor" AT 21,2 ATTRIBUTE (BOLD)
|
|
DISPLAY " " AT 21,2
|
|
CALL nomina_antes()
|
|
|
|
COMMAND "Retornar"
|
|
EXIT MENU
|
|
END MENU
|
|
GOTO vuelve
|
|
END FUNCTION
|
|
|
|
FUNCTION nomina_antes()
|
|
DECLARE accion1 CURSOR FOR
|
|
SELECT a.cod_mov,b.descrip_mov,a.cantidad,a.valor
|
|
FROM notb00003 a,notb00002 b
|
|
WHERE a.cod_mov = b.cod_mov and a.num_emp = ingresos.num_emp and
|
|
a.status_t is null
|
|
UNION
|
|
SELECT a.cod_mov,b.descrip_mov,a.cantidad,a.valor
|
|
FROM notb00007 a,notb00002 b
|
|
WHERE a.cod_mov = b.cod_mov and a.num_emp = ingresos.num_emp and
|
|
a.num_nomi = ingresos.num_nomi and a.status_t is null
|
|
ORDER BY 1
|
|
|
|
LET idx_n = 1
|
|
FOREACH accion1 INTO arr_nuevo[idx_n].*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 3
|
|
CALL msg(numero_msg)
|
|
SLEEP 2
|
|
EXIT FOREACH
|
|
END IF
|
|
|
|
CALL integridad()
|
|
IF bandera = 1 THEN
|
|
LET bandera = 0
|
|
RETURN
|
|
END IF
|
|
|
|
LET idx_n = idx_n + 1
|
|
END FOREACH
|
|
|
|
DISPLAY " " AT 21,2
|
|
|
|
IF idx_n = 1 THEN
|
|
LET numero_msg = 3
|
|
CALL msg(numero_msg)
|
|
RETURN
|
|
END IF
|
|
|
|
CALL set_count (idx_n - 1)
|
|
|
|
DISPLAY BY NAME ingresos.num_nomi,ingresos.tipo_emp,descr,ingresos.num_emp,
|
|
ingresos.departamento,ingresos.nivel_emp,ingresos.cod_puesto,
|
|
descrip1
|
|
|
|
DISPLAY ARRAY arr_nuevo TO consart.*
|
|
|
|
## Verifica si el usuario cancelo la operacion
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
CLEAR FORM
|
|
RETURN
|
|
END IF
|
|
|
|
CLEAR FORM
|
|
|
|
END FUNCTION
|
|
|