Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md
This commit is contained in:
@@ -0,0 +1,247 @@
|
||||
{
|
||||
-------------------------------------------------------------------------------
|
||||
PROGRAMA : COPRRP016
|
||||
OBJETIVO : VALORES FOB (Copia del coprrp016)
|
||||
PROGRAMADOR : Ing. Juan Fco. Soto
|
||||
FECHA REALIZACION : Marzo 30, 1993
|
||||
-------------------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS "coprgb000.4gl"
|
||||
|
||||
FUNCTION coprrp016()
|
||||
DEFINE idx_c SMALLINT
|
||||
DEFINE salir CHAR(1)
|
||||
DEFINE mes CHAR(2)
|
||||
DEFINE materia RECORD
|
||||
cod_n LIKE intb00002.cod_n,
|
||||
cod_grupo LIKE intb00002.cod_grupo,
|
||||
cod_tipo LIKE intb00002.cod_tipo,
|
||||
cod_sec LIKE intb00002.cod_sec,
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
pto_reorden LIKE intb00002.pto_reorden,
|
||||
dia_llegada LIKE intb00002.dia_llegada,
|
||||
cod_nab LIKE intb00002.cod_nab,
|
||||
bodega LIKE intb00002.bodega ,
|
||||
unidad_med LIKE intb00001.unidad_med,
|
||||
base LIKE intb00002.base,
|
||||
descrip CHAR(30),
|
||||
pais CHAR(25),
|
||||
precio DECIMAL(10,2)
|
||||
END RECORD,
|
||||
cod smallint
|
||||
DEFINE select_cost CHAR(1000)
|
||||
|
||||
# WHENEVER ERROR CONTINUE
|
||||
|
||||
OPTIONS
|
||||
FORM LINE 8,
|
||||
ERROR LINE 23,
|
||||
COMMENT LINE 21
|
||||
|
||||
CLEAR SCREEN
|
||||
|
||||
OPEN FORM cofmrp016 FROM "cofmrp016"
|
||||
DISPLAY FORM cofmrp016
|
||||
CALL pantalla()
|
||||
DISPLAY "coprrp016" AT 4,3
|
||||
DISPLAY "Catalogo de Materia Prima" AT 6,29
|
||||
IF status < 0 THEN
|
||||
CALL integridad()
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
INPUT BY NAME decide
|
||||
|
||||
AFTER FIELD decide
|
||||
IF decide IS NULL THEN
|
||||
NEXT FIELD decide
|
||||
END IF
|
||||
END INPUT
|
||||
|
||||
CONSTRUCT criterio ON b.cod_n,b.cod_grupo,
|
||||
b.cod_tipo,b.cod_sec
|
||||
FROM
|
||||
cod_n,cod_grupo,
|
||||
cod_tipo,cod_sec
|
||||
|
||||
IF decide = "A" THEN
|
||||
LET SELEC = "SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec, ",
|
||||
" b.descrip_esp,a.pto_reorden,a.dia_llegada,a.cod_nab,",
|
||||
" a.bodega,b.unidad_med,a.base,c.descrip,c.pais ",
|
||||
" FROM intb00002 a, intb00001 b,aranceles c ",
|
||||
" WHERE ",
|
||||
"a.cod_n = b.cod_n AND ",
|
||||
"a.cod_grupo = b.cod_grupo AND ",
|
||||
"a.cod_tipo = b.cod_tipo AND ",
|
||||
"a.cod_sec = b.cod_sec AND ",
|
||||
"a.cod_nab = c.codigo AND ",
|
||||
"a.status_t is NULL AND ",
|
||||
"b.status_t is NULL AND ",
|
||||
criterio clipped,
|
||||
" ORDER BY 5"
|
||||
|
||||
ELSE
|
||||
LET SELEC = "SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec, ",
|
||||
" b.descrip_esp,a.pto_reorden,a.dia_llegada,a.cod_nab,",
|
||||
" a.bodega,b.unidad_med,a.base,c.descrip,c.pais ",
|
||||
" FROM intb00002 a, intb00001 b,aranceles c ",
|
||||
" WHERE ",
|
||||
"a.cod_n = b.cod_n AND ",
|
||||
"a.cod_grupo = b.cod_grupo AND ",
|
||||
"a.cod_tipo = b.cod_tipo AND ",
|
||||
"a.cod_sec = b.cod_sec AND ",
|
||||
"a.cod_nab = c.codigo AND ",
|
||||
"a.status_t is NULL AND ",
|
||||
"b.status_t is NULL AND ",
|
||||
criterio clipped,
|
||||
" ORDER BY 8,1,2,3,4"
|
||||
END IF
|
||||
|
||||
DISPLAY "<< Buscando Las Materias Primas >>"
|
||||
AT 19,14 ATTRIBUTE (REVERSE)
|
||||
PREPARE busca FROM selec
|
||||
DISPLAY " "
|
||||
AT 19,14
|
||||
|
||||
CALL integridad()
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DECLARE accion CURSOR FOR busca
|
||||
OPEN accion
|
||||
|
||||
DISPLAY "<< Reporte Generandose ... Por Favor Espere. >>"
|
||||
AT 19,14 ATTRIBUTE (REVERSE)
|
||||
|
||||
START REPORT maestra2 TO "C:\\archivo"
|
||||
|
||||
WHILE status != notfound
|
||||
FETCH accion INTO materia.*
|
||||
IF status = notfound THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
OUTPUT TO REPORT maestra2(materia.*)
|
||||
|
||||
END WHILE
|
||||
FINISH REPORT maestra2
|
||||
|
||||
CLEAR SCREEN
|
||||
|
||||
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
||||
|
||||
REPORT maestra2(x)
|
||||
DEFINE x RECORD
|
||||
cod_n LIKE intb00002.cod_n,
|
||||
cod_grupo LIKE intb00002.cod_grupo,
|
||||
cod_tipo LIKE intb00002.cod_tipo,
|
||||
cod_sec LIKE intb00002.cod_sec,
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
pto_reorden LIKE intb00002.pto_reorden,
|
||||
dia_llegada LIKE intb00002.dia_llegada,
|
||||
cod_nab LIKE intb00002.cod_nab,
|
||||
bodega LIKE intb00002.bodega,
|
||||
unidad_med LIKE intb00001.unidad_med,
|
||||
base LIKE intb00002.base,
|
||||
descrip CHAR(30),
|
||||
pais CHAR(25),
|
||||
precio DECIMAL(10,2)
|
||||
END RECORD
|
||||
DEFINE l SMALLINT
|
||||
DEFINE doble_on CHAR(2)
|
||||
DEFINE doble_off CHAR(2)
|
||||
DEFINE negrillas_on CHAR(2)
|
||||
DEFINE negrillas_off CHAR(2)
|
||||
DEFINE comp_on CHAR(2)
|
||||
DEFINE comp_off CHAR(2)
|
||||
DEFINE doce CHAR(2)
|
||||
DEFINE hora CHAR(5)
|
||||
DEFINE varia CHAR(19)
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET doble_on = ASCII 14
|
||||
LET doble_off = ASCII 20
|
||||
LET negrillas_on = ASCII 27, ASCII 69
|
||||
LET negrillas_off = ASCII 27, ASCII 70
|
||||
LET comp_on = ASCII 15
|
||||
LET comp_off = ASCII 18
|
||||
LET doce = ASCII 27, ASCII 77
|
||||
LET hora = time
|
||||
|
||||
LET l = (91 - LENGTH(p_companias.nombre CLIPPED))/2
|
||||
PRINT COLUMN 3, ASCII 27, ASCII 80,doce,negrillas_on
|
||||
PRINT COLUMN 1, "coprrp016",
|
||||
COLUMN l, p_companias.nombre CLIPPED,
|
||||
COLUMN 84, "Pag. ",pageno using "###"
|
||||
PRINT COLUMN 38, "Sistema de Compras",
|
||||
COLUMN 84, today using "dd/mm/yy"
|
||||
PRINT COLUMN 32, "Reporte de Valor FOB - ADUANA",
|
||||
COLUMN 87, hora
|
||||
IF decide = "N" THEN
|
||||
LET varia = "N u m e r i c o" clipped
|
||||
ELSE
|
||||
LET varia = "A l f a b e t i c o"
|
||||
END IF
|
||||
LET l = (94 - LENGTH(varia)) / 2
|
||||
PRINT COLUMN l, varia
|
||||
|
||||
# ESTA LINEA TIENE 50 GUIONES
|
||||
|
||||
PRINT COLUMN 1, doce
|
||||
PRINT COLUMN 1, "--------------------------------------------------",
|
||||
"--------------------------------------------"
|
||||
|
||||
PRINT COLUMN 1, "Codigo"
|
||||
|
||||
PRINT COLUMN 1, "Arancel",
|
||||
COLUMN 17, " M a t e r i a l",
|
||||
COLUMN 52, "Pais",
|
||||
COLUMN 82, "FOB/Pagado"
|
||||
|
||||
# ESTA LINEA TIENE 50 GUIONES
|
||||
|
||||
PRINT COLUMN 1, "--------------------------------------------------",
|
||||
"--------------------------------------------"
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
PRINT COLUMN 1, x.cod_nab,
|
||||
COLUMN 14, x.cod_n USING "&","-",x.cod_grupo USING "&","-",
|
||||
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&",
|
||||
2 spaces,x.descrip_esp,2 spaces,x.unidad_med,2 spaces,
|
||||
x.pais, 4 spaces,x.precio
|
||||
|
||||
AFTER GROUP OF x.cod_nab
|
||||
SKIP 1 LINE
|
||||
|
||||
ON LAST ROW
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 3, "Total de Registros Impresos = ", count(*) USING "####"
|
||||
PRINT COLUMN comp_off
|
||||
|
||||
END REPORT
|
||||
|
||||
Reference in New Issue
Block a user