Reorganiza MATERIA PRIMA a PROYECTO y avanza inprmt002/005/013/046
- Mueve todo el contenido de PROYECTOS/indir y varias funciones compartidas de PROYECTOS/otrodir hacia PROYECTO, siguiendo instruccion de Johnny (PROYECTOS se va a eliminar). - inprmt002: agrega campo Desglose faltante, corrige typo "eLiminar". - inprmt005: agrega formulario y 3 campos faltantes (Consumo, Requiere Autorizacion, Requisiciones), corrige typo "eLiminar". - inprmt013: agrega formulario, titulo, corrige typo "eLiminar". - inprmt046: agrega formulario y varias funciones/dependencias faltantes (cincodmov, clasf_bloque, medidas, defecto, buscaEmp, consultaTransportista, busca_departamento); corrige nombres de campo desalineados con el codigo (depto_a, bodega) y los convierte a ComboBox donde el codigo lo requiere. - Corrige dependencia faltante de FORMULARIOS_IN a la libreria Database (bloqueaba todo el modulo de MATERIA PRIMA).
This commit is contained in:
@@ -0,0 +1,341 @@
|
||||
{
|
||||
------------------------------------------------------------------
|
||||
PROGRAMA : INPRMT022
|
||||
OBJETIVO : Capturar, Modificar, Eliminar registros de la
|
||||
Tabla Catalogo de Bienes y Servicios (Ley 69)
|
||||
PROGRAMADOR : Tadeo A. Ferreras
|
||||
FECHA REALIZACION : Agosto 31, 1992.
|
||||
------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS "inprgb000.4gl"
|
||||
|
||||
FUNCTION inprmt022()
|
||||
#WHENEVER ERROR CONTINUE
|
||||
CLEAR SCREEN
|
||||
OPTIONS
|
||||
FORM LINE 9,
|
||||
ERROR LINE 23,
|
||||
COMMENT LINE 21
|
||||
|
||||
OPEN FORM infmmt022 FROM "infmmt022"
|
||||
DISPLAY FORM infmmt022
|
||||
|
||||
CALL pantalla()
|
||||
DISPLAY "inprmt022" AT 4,3
|
||||
DISPLAY "Catalogo Bienes y Servicios (Ley-69)" AT 6,21
|
||||
|
||||
MENU "OPCIONES"
|
||||
COMMAND "Adicionar"
|
||||
"<Esc> Adiciona Registro <Supr> Cancela Operacion"
|
||||
LET int_flag = FALSE
|
||||
CLEAR FORM
|
||||
CALL inpcad022()
|
||||
COMMAND "Consultar-modificar"
|
||||
"<Esc> Realiza Busqueda <Supr> Cancela Operacion"
|
||||
LET INT_FLAG = FALSE
|
||||
CALL inpcmf022()
|
||||
COMMAND "Salir" "Retorna Menu Anterior"
|
||||
EXIT MENU
|
||||
END MENU
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION inpcad022()
|
||||
#WHENEVER ERROR CONTINUE
|
||||
## Captura los datos que va a contener el registro
|
||||
|
||||
LET int_flag = false
|
||||
INPUT BY NAME articulo9.*
|
||||
|
||||
## Verifica que el codigo no exista en el catalogo de articulo9. Si existe,
|
||||
## entonces despliega los datos del registro existente.
|
||||
AFTER FIELD cod_n
|
||||
IF articulo9.cod_n is null then
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_n
|
||||
END IF
|
||||
|
||||
AFTER FIELD cod_tipo
|
||||
IF articulo9.cod_tipo is null then
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_tipo
|
||||
END IF
|
||||
AFTER FIELD cod_grupo
|
||||
IF articulo9.cod_grupo is null then
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_grupo
|
||||
END IF
|
||||
AFTER FIELD cod_sec
|
||||
IF (articulo9.cod_n is null AND articulo9.cod_grupo is null AND
|
||||
articulo9.cod_tipo is null AND articulo9.cod_sec is null) THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_n
|
||||
ELSE
|
||||
SELECT * INTO articulo9.* FROM intb00022
|
||||
WHERE cod_n = articulo9.cod_n AND
|
||||
cod_grupo = articulo9.cod_grupo AND
|
||||
cod_tipo = articulo9.cod_tipo AND
|
||||
cod_sec = articulo9.cod_sec
|
||||
|
||||
IF status >= 0 THEN
|
||||
IF status != NOTFOUND THEN
|
||||
IF articulo9.status_t = "E" THEN
|
||||
LET numero_msg = 36
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_n
|
||||
END IF
|
||||
DISPLAY BY NAME articulo9.*
|
||||
LET numero_msg = 12
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_n
|
||||
END IF
|
||||
ELSE
|
||||
CALL integridad()
|
||||
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
END IF
|
||||
AFTER FIELD descrip_esp
|
||||
IF articulo9.descrip_esp IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD descrip_esp
|
||||
END IF
|
||||
|
||||
## Verifica si la unidad de medida existe en la tabla correspondiente.
|
||||
|
||||
AFTER FIELD unidad_med
|
||||
IF articulo9.unidad_med IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD unidad_med
|
||||
END IF
|
||||
|
||||
AFTER FIELD costo_real_ci
|
||||
IF articulo9.costo_real_ci IS NULL THEN
|
||||
LET articulo9.costo_real_ci = 0
|
||||
END IF
|
||||
|
||||
AFTER FIELD costo_real_si
|
||||
IF articulo9.costo_real_si IS NULL THEN
|
||||
LET articulo9.costo_real_si = 0
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
INSERT INTO intb00022 VALUES (articulo9.cod_n, articulo9.cod_grupo,
|
||||
articulo9.cod_tipo, articulo9.cod_sec, articulo9.descrip_esp,
|
||||
articulo9.descrip_ing, articulo9.unidad_med,articulo9.costo_real_ci,
|
||||
articulo9.costo_real_si,null,USER,CURRENT, null, null)
|
||||
|
||||
# Verifica el Status que retorna luego de insertar el registro en la tabla.
|
||||
# Si el Status es diferente de cero quiere decir que hubo problemas durante
|
||||
# la creacion del registro, entonces despliega un mensaje .
|
||||
|
||||
LET numero_msg = 1
|
||||
CALL msg(numero_msg)
|
||||
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION inpcmf022()
|
||||
#WHENEVER ERROR CONTINUE
|
||||
LET int_flag = false
|
||||
## Aqui se prepara para la captura del criterio de seleccion
|
||||
|
||||
CONSTRUCT criterio ON intb00022.* FROM intb00022.*
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET SELEC = " SELECT UNIQUE * FROM intb00022 where ",
|
||||
" status_t is null and ",
|
||||
criterio clipped,
|
||||
" ORDER BY 1,2,3,4"
|
||||
|
||||
PREPARE busca FROM selec
|
||||
CALL integridad()
|
||||
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
DECLARE datos SCROLL CURSOR FOR busca
|
||||
OPEN datos
|
||||
FETCH FIRST datos INTO articulo9.*
|
||||
IF status >= 0 THEN
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 3
|
||||
CALL msg(numero_msg)
|
||||
RETURN
|
||||
END IF
|
||||
ELSE
|
||||
|
||||
CALL integridad()
|
||||
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
DISPLAY BY NAME articulo9.*
|
||||
|
||||
MENU "OPCIONES "
|
||||
COMMAND "Siguiente"
|
||||
"Presenta en pantalla el proximo registro encontrado"
|
||||
FETCH NEXT datos INTO articulo9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 4
|
||||
CALL msg(numero_msg)
|
||||
END IF
|
||||
DISPLAY BY NAME articulo9.*
|
||||
|
||||
COMMAND "Anterior"
|
||||
"Presenta en pantalla el registro anterior encontrado"
|
||||
FETCH PREVIOUS datos INTO articulo9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 5
|
||||
CALL msg(numero_msg)
|
||||
END IF
|
||||
DISPLAY BY NAME articulo9.*
|
||||
|
||||
COMMAND "Primero"
|
||||
"Presenta en pantalla el primer registro encontrado"
|
||||
FETCH FIRST datos INTO articulo9.*
|
||||
DISPLAY BY NAME articulo9.*
|
||||
LET numero_msg = 5
|
||||
CALL msg(numero_msg)
|
||||
COMMAND "Ultimo"
|
||||
"Presenta en pantalla el ultimo registro encontrado"
|
||||
FETCH LAST datos INTO articulo9.*
|
||||
DISPLAY BY NAME articulo9.*
|
||||
LET numero_msg = 4
|
||||
CALL msg(numero_msg)
|
||||
COMMAND "Escoger"
|
||||
"<Esc> Actualiza Registro <Supr> Cancela Operacion"
|
||||
IF articulo9.status_t="E" THEN
|
||||
LET numero_msg= 36
|
||||
CALL msg(numero_msg)
|
||||
RETURN
|
||||
END IF
|
||||
INPUT BY NAME articulo9.descrip_esp,articulo9.descrip_ing,
|
||||
articulo9.unidad_med,articulo9.costo_real_ci,
|
||||
articulo9.costo_real_si,articulo9.us_crea,
|
||||
articulo9.fech_crea,articulo9.us_mod,
|
||||
articulo9.fech_mod WITHOUT DEFAULTS
|
||||
|
||||
AFTER FIELD descrip_esp
|
||||
IF articulo9.descrip_esp IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD descrip_esp
|
||||
END IF
|
||||
|
||||
AFTER FIELD unidad_med
|
||||
IF articulo9.unidad_med IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD unidad_med
|
||||
END IF
|
||||
|
||||
AFTER FIELD costo_real_ci
|
||||
IF articulo9.costo_real_ci IS NULL THEN
|
||||
LET articulo9.costo_real_ci = 0
|
||||
END IF
|
||||
|
||||
AFTER FIELD costo_real_si
|
||||
IF articulo9.costo_real_si IS NULL THEN
|
||||
LET articulo9.costo_real_si = 0
|
||||
END IF
|
||||
|
||||
AFTER INPUT
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = false
|
||||
RETURN
|
||||
END IF
|
||||
IF articulo9.unidad_med IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD unidad_med
|
||||
ELSE
|
||||
SELECT codigo_unidad FROM intb00007
|
||||
WHERE codigo_unidad = articulo9.unidad_med
|
||||
AND status_t is null
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 17
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD unidad_med
|
||||
END IF
|
||||
|
||||
CALL integridad()
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
|
||||
IF articulo9.descrip_esp IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD descrip_esp
|
||||
END IF
|
||||
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
|
||||
#### Verifica si el usuario presiono la tecla <Supr>
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
UPDATE intb00022 SET descrip_esp = articulo9.descrip_esp,
|
||||
descrip_ing = articulo9.descrip_ing,
|
||||
unidad_med = articulo9.unidad_med,
|
||||
costo_real_ci = articulo9.costo_real_ci,
|
||||
costo_real_si = articulo9.costo_real_si,
|
||||
us_mod = USER,
|
||||
fech_mod = CURRENT
|
||||
WHERE cod_n = articulo9.cod_n AND cod_grupo = articulo9.cod_grupo AND
|
||||
cod_tipo = articulo9.cod_tipo AND cod_sec = articulo9.cod_sec
|
||||
|
||||
LET numero_msg = 13
|
||||
CALL msg(numero_msg)
|
||||
|
||||
COMMAND KEY ("L") "eLiminar"
|
||||
|
||||
UPDATE intb00022 SET status_t ="E" ,us_mod = user,fech_mod = current
|
||||
WHERE cod_n = articulo9.cod_n and
|
||||
cod_grupo = articulo9.cod_grupo AND
|
||||
cod_tipo = articulo9.cod_tipo AND
|
||||
cod_sec = articulo9.cod_sec
|
||||
|
||||
LET numero_msg = 39
|
||||
CALL msg(numero_msg)
|
||||
COMMAND "Retornar"
|
||||
"Retorna al menu anterior"
|
||||
EXIT MENU
|
||||
END MENU
|
||||
END FUNCTION
|
||||
|
||||
Reference in New Issue
Block a user