Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md
This commit is contained in:
@@ -0,0 +1,325 @@
|
||||
{
|
||||
------------------------------------------------------------------
|
||||
PROGRAMA : VEPRMT011
|
||||
OBJETIVO : Actualizacion del Pago de Facturas Transportadas
|
||||
a los Transportistas (Tabla : vetb00030)
|
||||
PROGRAMADOR : Lic. Abner Montalvo Z.
|
||||
FECHA REALIZACION : Enero 19, 1993
|
||||
------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS "veprgb000.4gl"
|
||||
|
||||
FUNCTION veprmt011()
|
||||
# WHENEVER ERROR CONTINUE
|
||||
CLEAR SCREEN
|
||||
OPTIONS
|
||||
FORM LINE 9,
|
||||
ERROR LINE 23,
|
||||
HELP FILE "vepray000.exe",
|
||||
HELP KEY CONTROL-W,
|
||||
COMMENT LINE 21
|
||||
|
||||
OPEN FORM vefmmt011 FROM "vefmmt011"
|
||||
DISPLAY FORM vefmmt011
|
||||
CALL pantalla()
|
||||
CALL ayuda()
|
||||
DISPLAY "veprmt011" AT 4,3
|
||||
DISPLAY "Pago Facturas Transportistas" AT 6,26
|
||||
|
||||
MENU "OPCIONES"
|
||||
COMMAND "Consultar-modificar"
|
||||
"<Esc> Realiza Busqueda <Delete> Cancela Operacion"
|
||||
HELP 6
|
||||
LET int_flag = FALSE
|
||||
CALL vepcmf011()
|
||||
COMMAND "Salir" "Retorna Menu Anterior"
|
||||
EXIT MENU
|
||||
END MENU
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION vepcmf011()
|
||||
# WHENEVER ERROR CONTINUE
|
||||
MESSAGE ""
|
||||
LET int_flag = false
|
||||
## Aqui se prepara para la captura del criterio de seleccion
|
||||
|
||||
CONSTRUCT criterio ON vetb00030.cod_transp, vetb00030.sec_transp,
|
||||
vetb00030.factura, vetb00030.pagada
|
||||
FROM cod_transp, sec_transp,
|
||||
factura, pagada
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
CALL ayuda()
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET SELEC = " SELECT UNIQUE cod_transp, sec_transp, factura, ",
|
||||
" pagada, us_crea, fech_crea, us_mod, fech_mod ",
|
||||
" FROM vetb00030 where ",
|
||||
" status_t is null and ",
|
||||
criterio clipped,
|
||||
" ORDER BY 1,2,3"
|
||||
|
||||
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 pagos_transp.*
|
||||
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 pagos_transp.*
|
||||
LET transportista.cod_transp = pagos_transp.cod_transp
|
||||
LET transportista.sec_transp = pagos_transp.sec_transp
|
||||
CALL busca_nombre_transportista()
|
||||
|
||||
MENU "OPCIONES "
|
||||
COMMAND "Siguiente"
|
||||
"Presenta en pantalla el proximo registro encontrado"
|
||||
FETCH NEXT datos INTO pagos_transp.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 4
|
||||
CALL msg(numero_msg)
|
||||
END IF
|
||||
DISPLAY BY NAME pagos_transp.*
|
||||
LET transportista.cod_transp = pagos_transp.cod_transp
|
||||
LET transportista.sec_transp = pagos_transp.sec_transp
|
||||
CALL busca_nombre_transportista()
|
||||
|
||||
COMMAND "Anterior"
|
||||
"Presenta en pantalla el registro anterior encontrado"
|
||||
FETCH PREVIOUS datos INTO pagos_transp.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 5
|
||||
CALL msg(numero_msg)
|
||||
END IF
|
||||
DISPLAY BY NAME pagos_transp.*
|
||||
LET transportista.cod_transp = pagos_transp.cod_transp
|
||||
LET transportista.sec_transp = pagos_transp.sec_transp
|
||||
CALL busca_nombre_transportista()
|
||||
|
||||
COMMAND "Primero"
|
||||
"Presenta en pantalla el primer registro encontrado"
|
||||
FETCH FIRST datos INTO pagos_transp.*
|
||||
DISPLAY BY NAME pagos_transp.*
|
||||
LET numero_msg = 5
|
||||
CALL msg(numero_msg)
|
||||
LET transportista.cod_transp = pagos_transp.cod_transp
|
||||
LET transportista.sec_transp = pagos_transp.sec_transp
|
||||
CALL busca_nombre_transportista()
|
||||
|
||||
COMMAND "Ultimo"
|
||||
"Presenta en pantalla el ultimo registro encontrado"
|
||||
FETCH LAST datos INTO pagos_transp.*
|
||||
DISPLAY BY NAME pagos_transp.*
|
||||
LET numero_msg = 4
|
||||
CALL msg(numero_msg)
|
||||
LET transportista.cod_transp = pagos_transp.cod_transp
|
||||
LET transportista.sec_transp = pagos_transp.sec_transp
|
||||
CALL busca_nombre_transportista()
|
||||
|
||||
COMMAND "Ver"
|
||||
"Visualiza la cantidad de cajas por producto que tiene la factura"
|
||||
CALL consulta_cajas_ft()
|
||||
|
||||
COMMAND "Escoger"
|
||||
"<Esc> Actualiza Registro <Delete> Cancela Operacion"
|
||||
INPUT BY NAME pagos_transp.pagada,
|
||||
pagos_transp.us_crea,
|
||||
pagos_transp.fech_crea,
|
||||
pagos_transp.us_mod,
|
||||
pagos_transp.fech_mod WITHOUT DEFAULTS
|
||||
|
||||
AFTER FIELD pagada
|
||||
IF pagos_transp.pagada IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD pagada
|
||||
END IF
|
||||
|
||||
IF pagos_transp.pagada != "s" AND
|
||||
pagos_transp.pagada != "S" AND
|
||||
pagos_transp.pagada != "n" AND
|
||||
pagos_transp.pagada != "N" THEN
|
||||
LET numero_msg = -1301
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD pagada
|
||||
END IF
|
||||
|
||||
AFTER INPUT
|
||||
#### Verifica si el usuario presiono la tecla <Delete>
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
CALL ayuda()
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF pagos_transp.pagada != "s" AND
|
||||
pagos_transp.pagada != "S" AND
|
||||
pagos_transp.pagada != "n" AND
|
||||
pagos_transp.pagada != "N" THEN
|
||||
LET numero_msg = -1301
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD pagada
|
||||
END IF
|
||||
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
|
||||
#### Verifica si el usuario presiono la tecla <Delete>
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
CALL ayuda()
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
UPDATE vetb00030 SET pagada = pagos_transp.pagada,
|
||||
us_mod = USER,
|
||||
fech_mod = CURRENT
|
||||
WHERE factura = pagos_transp.factura and
|
||||
cod_transp = pagos_transp.cod_transp and
|
||||
sec_transp = pagos_transp.sec_transp
|
||||
|
||||
LET numero_msg = 13
|
||||
CALL msg(numero_msg)
|
||||
|
||||
COMMAND "Retornar"
|
||||
"Retorna al menu anterior"
|
||||
CALL ayuda()
|
||||
EXIT MENU
|
||||
END MENU
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION busca_nombre_transportista()
|
||||
# Esta funcion busca el nombre del transportista y lo despliega en pantalla
|
||||
# Esta funcion es valida solamente para la consulta-modificacion.
|
||||
|
||||
SELECT i.nombre, i.status_t INTO descrip1, status_reg
|
||||
FROM vetb00015 i
|
||||
WHERE i.cod_transp = transportista.cod_transp AND
|
||||
i.sec_transp = transportista.sec_transp
|
||||
|
||||
IF status >= 0 THEN
|
||||
IF status = NOTFOUND THEN
|
||||
LET numero_msg = 78
|
||||
CALL msg(numero_msg)
|
||||
ELSE
|
||||
IF status_reg = "E" THEN
|
||||
LET numero_msg = 79
|
||||
CALL msg(numero_msg)
|
||||
END IF
|
||||
END IF
|
||||
DISPLAY descrip1 TO nombre
|
||||
ELSE
|
||||
CALL integridad()
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION consulta_cajas_ft()
|
||||
OPEN WINDOW busqueda AT 7,2 WITH FORM "vefmwd074"
|
||||
ATTRIBUTE (BORDER,FORM LINE FIRST + 2,COMMENT LINE LAST,MESSAGE LINE LAST)
|
||||
|
||||
LET selec = "SELECT a.cod_n, a.cod_grupo, a.cod_tipo, a.cod_sec, ",
|
||||
"c.descrip_esp, (a.cantidad/d.cantidad) ",
|
||||
"FROM vetb00003 a, iptb00002 c, vetb00014 d ",
|
||||
"WHERE a.factura = ? AND a.cod_n = c.cod_n AND ",
|
||||
"a.cod_grupo = c.cod_grupo AND ",
|
||||
"a.cod_tipo = c.cod_tipo AND ",
|
||||
"a.cod_sec = c.cod_sec AND ",
|
||||
"a.cod_n = d.cod_n AND ",
|
||||
"a.cod_grupo = d.cod_grupo AND ",
|
||||
"a.cod_tipo = d.cod_tipo AND ",
|
||||
"a.cod_sec = d.cod_sec AND ",
|
||||
"a.status_t is null AND ",
|
||||
"c.status_t is null AND ",
|
||||
"d.status_T is null ",
|
||||
"ORDER BY 1,2,3,4 "
|
||||
|
||||
DISPLAY pagos_transp.factura TO factura
|
||||
MESSAGE " Estoy Buscando Informaciones de la Factura"
|
||||
PREPARE buscar FROM selec
|
||||
DECLARE buscar_cajas CURSOR FOR buscar
|
||||
OPEN buscar_cajas USING pagos_transp.factura
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
GO TO salir_consulta_p
|
||||
END IF
|
||||
|
||||
IF status >= 0 THEN
|
||||
IF status = notfound THEN
|
||||
LET numero_msg = 3
|
||||
CALL msg(numero_msg)
|
||||
END IF
|
||||
ELSE
|
||||
CALL integridad()
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
END IF
|
||||
END IF
|
||||
LET idx = 1
|
||||
LET longitud = 0
|
||||
|
||||
WHILE status != NOTFOUND
|
||||
FETCH buscar_cajas INTO arr_cajas[idx].*
|
||||
IF status = NOTFOUND THEN
|
||||
INITIALIZE arr_cajas[idx].* TO NULL
|
||||
LET idx = idx + 1
|
||||
INITIALIZE arr_cajas[idx].* TO NULL
|
||||
LET arr_cajas[idx].descrip1 =
|
||||
" Total Cajas :"
|
||||
LET arr_cajas[idx].cajas1 = longitud
|
||||
LET idx = idx + 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET longitud = longitud + arr_cajas[idx].cajas1
|
||||
LET idx = idx + 1
|
||||
END WHILE
|
||||
|
||||
CALL set_count(idx-1)
|
||||
MESSAGE " <Esc> Retornar a la Pantalla Anterior"
|
||||
DISPLAY ARRAY arr_cajas TO cs_074.*
|
||||
|
||||
LABEL salir_consulta_p:
|
||||
CLOSE WINDOW busqueda
|
||||
|
||||
END FUNCTION
|
||||
|
||||
Reference in New Issue
Block a user