210 lines
6.5 KiB
Plaintext
210 lines
6.5 KiB
Plaintext
{
|
|
--------------------------------------------------------------------------
|
|
PROGRAMA : IPPRMT010
|
|
OBJETIVO : Maestra de Tipos de Productos
|
|
Inventario de Producto Terminados.
|
|
PROGRAMADOR : Ing. Juan Soto.
|
|
FECHA REALIZACION : Octubre 21, 1996.
|
|
--------------------------------------------------------------------------
|
|
}
|
|
GLOBALS "ipprgb000.4gl"
|
|
DEFINE p_iptb24 RECORD LIKE iptb00024.*
|
|
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL ARG_VAL(1) RETURNING usuarios
|
|
CALL ARG_VAL(2) RETURNING clave
|
|
|
|
CONNECT to "smarmotech" USER usuarios USING clave
|
|
|
|
SELECT * INTO p_companias.* FROM companias
|
|
CALL ipprmt010()
|
|
END MAIN
|
|
|
|
FUNCTION ipprmt010()
|
|
CLEAR SCREEN
|
|
OPTIONS
|
|
FORM LINE 9,
|
|
ERROR LINE 23,
|
|
HELP KEY CONTROL-W,
|
|
MESSAGE LINE 24,
|
|
COMMENT LINE 21
|
|
|
|
OPEN FORM ipfmmt010 FROM "ipfmmt010"
|
|
DISPLAY FORM ipfmmt010
|
|
#CALL pantalla()
|
|
|
|
DISPLAY "ipprmt010" AT 4,3
|
|
DISPLAY "Mantenimiento Tipos De Los Productos " at 6,22
|
|
|
|
MENU "OPCIONES"
|
|
COMMAND "Adicionar"
|
|
"<Esc> Adiciona Registro <Delete> Cancela Operacion"
|
|
HELP 5
|
|
LET INT_FLAG = FALSE
|
|
CLEAR FORM
|
|
LET INT_FLAG = FALSE
|
|
CALL ippcad010()
|
|
COMMAND "Consultar-modificar"
|
|
"<Esc> Realiza Busqueda <Delete> Cancela Operacion"
|
|
HELP 6
|
|
CALL ippcmf010()
|
|
COMMAND "Salir" "Retorna Menu Anterior"
|
|
EXIT MENU
|
|
END MENU
|
|
END FUNCTION
|
|
|
|
FUNCTION ippcad010()
|
|
|
|
## Captura los datos que va a contener el registro
|
|
INPUT BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion,p_iptb24.cod_inv
|
|
|
|
AFTER FIELD cod_tipo
|
|
SELECT a.descripcion INTO p_iptb24.descripcion
|
|
FROM iptb00024 a
|
|
WHERE a.cod_tipo = p_iptb24.cod_tipo
|
|
|
|
IF STATUS != NOTFOUND THEN
|
|
LET numero_msg = 12
|
|
CALL msg(numero_msg)
|
|
DISPLAY BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion
|
|
NEXT FIELD cod_tipo
|
|
END IF
|
|
DISPLAY BY NAME p_iptb24.descripcion
|
|
|
|
AFTER INPUT
|
|
EXIT INPUT
|
|
END INPUT
|
|
|
|
IF int_flag THEN
|
|
LET int_flag = FALSE
|
|
LET numero_msg = 1
|
|
CALL msg(numero_msg)
|
|
RETURN
|
|
END IF
|
|
|
|
|
|
INSERT INTO iptb00024 values
|
|
(p_iptb24.cod_tipo,p_iptb24.descripcion,null,SUSER_SNAME(),GETDATE(),null,null,p_iptb24.cod_inv)
|
|
LET numero_msg = 1
|
|
CALL msg(numero_msg)
|
|
|
|
END FUNCTION
|
|
|
|
FUNCTION ippcmf010()
|
|
## Aqui se prepara para la captura del criterio de seleccion
|
|
MESSAGE ""
|
|
CLEAR FORM
|
|
CONSTRUCT criterio ON a.cod_tipo,a.descripcion
|
|
FROM cod_tipo,descripcion
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
RETURN
|
|
END IF
|
|
|
|
LET SELEC = " SELECT UNIQUE a.cod_tipo,a.descripcion,a.cod_inv FROM iptb00024 a WHERE ",
|
|
criterio clipped,
|
|
" ORDER BY a.cod_tipo"
|
|
|
|
PREPARE busca FROM selec
|
|
DECLARE datos SCROLL CURSOR WITH HOLD FOR busca
|
|
OPEN datos
|
|
|
|
FETCH FIRST datos INTO p_iptb24.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 3
|
|
CALL msg(numero_msg)
|
|
RETURN
|
|
END IF
|
|
|
|
DISPLAY BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion,p_iptb24.cod_inv
|
|
|
|
MENU "OPCIONES "
|
|
COMMAND "Siguiente"
|
|
"Presenta en pantalla el proximo registro encontrado"
|
|
FETCH NEXT datos INTO p_iptb24.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 4
|
|
CALL msg(numero_msg)
|
|
END IF
|
|
|
|
DISPLAY BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion,p_iptb24.cod_inv
|
|
|
|
COMMAND "Anterior"
|
|
"Presenta en pantalla el registro anterior encontrado"
|
|
FETCH PREVIOUS datos INTO p_iptb24.*
|
|
IF STATUS = NOTFOUND THEN
|
|
LET numero_msg = 5
|
|
CALL msg(numero_msg)
|
|
END IF
|
|
|
|
DISPLAY BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion,p_iptb24.cod_inv
|
|
|
|
COMMAND "Primero"
|
|
"Presenta en pantalla el primer registro encontrado"
|
|
FETCH FIRST datos INTO p_iptb24.*
|
|
|
|
DISPLAY BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion,p_iptb24.cod_inv
|
|
|
|
LET numero_msg = 5
|
|
CALL msg(numero_msg)
|
|
|
|
COMMAND "Ultimo"
|
|
"Presenta en pantalla el ultimo registro encontrado"
|
|
FETCH LAST datos INTO p_iptb24.*
|
|
|
|
DISPLAY BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion,p_iptb24.cod_inv
|
|
|
|
LET numero_msg = 4
|
|
CALL msg(numero_msg)
|
|
|
|
COMMAND "Escoger"
|
|
"<Esc> Actualiza Registro <Delete> Cancela Operacion"
|
|
|
|
INPUT BY NAME p_iptb24.cod_tipo,p_iptb24.descripcion,p_iptb24.cod_inv
|
|
WITHOUT DEFAULTS
|
|
BEFORE INPUT
|
|
LET p_iptb24.cod_inv=3
|
|
DISPLAY BY NAME p_iptb24.cod_inv
|
|
AFTER INPUT
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
RETURN
|
|
END IF
|
|
|
|
UPDATE iptb00024 SET descripcion = p_iptb24.descripcion,
|
|
us_mod = SUSER_SNAME(),
|
|
fech_mod = GETDATE() ,
|
|
cod_inv= p_iptb24.cod_inv
|
|
WHERE cod_tipo = p_iptb24.cod_tipo
|
|
|
|
LET numero_msg = 13
|
|
CALL msg(numero_msg)
|
|
EXIT INPUT
|
|
END INPUT
|
|
|
|
COMMAND KEY ("L") "eLiminar"
|
|
"Elimina registro que esta en la pantalla"
|
|
|
|
UPDATE iptb00024 SET status_t = "E",
|
|
us_mod = SUSER_SNAME(),
|
|
fech_mod = GETDATE()
|
|
WHERE @cod_tipo = p_iptb24.cod_tipo
|
|
|
|
|
|
LET numero_msg = 39
|
|
CALL msg(numero_msg)
|
|
|
|
COMMAND "Retornar"
|
|
"Retorna al menu anterior"
|
|
CLEAR FORM
|
|
# CALL ayuda()
|
|
EXIT MENU
|
|
END MENU
|
|
END FUNCTION
|