233 lines
7.8 KiB
Plaintext
233 lines
7.8 KiB
Plaintext
{
|
|
-------------------------------------------------------------------------------
|
|
PROGRAMA : COPRRP008
|
|
OBJETIVO : Relacion Formas de Embarque - Materia Prima -
|
|
Producto Terminado
|
|
PROGRAMADOR : Ing. Betania Guerrero Perez
|
|
FECHA REALIZACION : Octubre 27, 1992
|
|
-------------------------------------------------------------------------------
|
|
}
|
|
GLOBALS "coprgb000.4gl"
|
|
|
|
FUNCTION coprrp008()
|
|
|
|
DEFINE embarque RECORD
|
|
cod_embarque LIKE cotb00027.cod_embarque,
|
|
descrip_emb LIKE cotb00027.descrip_emb,
|
|
cod_furg LIKE cotb00003.cod_furg,
|
|
descrip_furg LIKE cotb00003.descrip_furg,
|
|
cod_n LIKE intb00001.cod_n,
|
|
cod_grupo LIKE intb00001.cod_grupo,
|
|
cod_tipo LIKE intb00001.cod_tipo,
|
|
cod_sec LIKE intb00001.cod_sec,
|
|
descrip_esp LIKE intb00001.descrip_esp,
|
|
unidad_med LIKE intb00001.unidad_med,
|
|
cantidad LIKE cotb00004.cantidad
|
|
END RECORD
|
|
|
|
WHENEVER ERROR CONTINUE
|
|
|
|
OPTIONS
|
|
FORM LINE 8,
|
|
ERROR LINE 23,
|
|
COMMENT LINE 21
|
|
|
|
OPEN FORM cofmrp008 FROM "cofmrp008"
|
|
DISPLAY FORM cofmrp008
|
|
CALL pantalla()
|
|
DISPLAY "coprrp008" AT 4,3
|
|
DISPLAY "Relacion Formas de Embarque-Materia Prima-Producto Terminado"
|
|
AT 6,10
|
|
|
|
LET tipo_papel = 2
|
|
CALL msgrp000(tipo_papel)
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = false
|
|
RETURN
|
|
END IF
|
|
|
|
CONSTRUCT criterio ON a.cod_embarque FROM cod_embarque
|
|
|
|
LET SELEC = "SELECT a.cod_embarque,a.descrip_emb,b.cod_furg, ",
|
|
"b.descrip_furg,c.cod_n,c.cod_grupo,c.cod_tipo,c.cod_sec, ",
|
|
"c.descrip_esp,c.unidad_med,d.cantidad ",
|
|
" FROM cotb00027 a,cotb00003 b,intb00001 c,cotb00004 d ",
|
|
" WHERE ",
|
|
"a.cod_embarque = d.cod_embarque AND ",
|
|
"b.cod_furg = d.cod_furg AND ",
|
|
"d.cod_n = c.cod_n AND ",
|
|
"d.cod_grupo = c.cod_grupo AND ",
|
|
"d.cod_tipo = c.cod_tipo AND ",
|
|
"d.cod_sec = c.cod_sec AND ",
|
|
"a.status_t is null AND ",
|
|
criterio clipped,
|
|
" ORDER BY 1,3"
|
|
|
|
DISPLAY "Buscando Informacion ... Espere Por Favor" AT 19,14
|
|
ATTRIBUTE (REVERSE,BOLD)
|
|
|
|
PREPARE busca FROM selec
|
|
|
|
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
|
|
|
|
DISPLAY " " AT 19,14
|
|
DISPLAY "<< Reporte Generandose ... Por Favor Espere. >>"
|
|
AT 19,14 ATTRIBUTE (REVERSE)
|
|
|
|
DECLARE accion CURSOR FOR busca
|
|
|
|
START REPORT formas TO "C:\\archivo"
|
|
|
|
FOREACH accion INTO embarque.*
|
|
IF STATUS = NOTFOUND THEN
|
|
EXIT FOREACH
|
|
END IF
|
|
|
|
OUTPUT TO REPORT formas(embarque.*)
|
|
END FOREACH
|
|
FINISH REPORT formas
|
|
CLEAR SCREEN
|
|
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
|
|
|
REPORT formas(x)
|
|
DEFINE x RECORD
|
|
cod_embarque LIKE cotb00027.cod_embarque,
|
|
descrip_emb LIKE cotb00027.descrip_emb,
|
|
cod_furg LIKE cotb00003.cod_furg,
|
|
descrip_furg LIKE cotb00003.descrip_furg,
|
|
cod_n LIKE intb00001.cod_n,
|
|
cod_grupo LIKE intb00001.cod_grupo,
|
|
cod_tipo LIKE intb00001.cod_tipo,
|
|
cod_sec LIKE intb00001.cod_sec,
|
|
descrip_esp LIKE intb00001.descrip_esp,
|
|
unidad_med LIKE intb00001.unidad_med,
|
|
cantidad LIKE cotb00004.cantidad
|
|
END RECORD
|
|
|
|
|
|
DEFINE b_furg,bandera,bandera1 CHAR(1)
|
|
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 normal CHAR(2)
|
|
DEFINE hora CHAR(5)
|
|
OUTPUT
|
|
TOP MARGIN 0
|
|
LEFT MARGIN 2
|
|
BOTTOM 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 normal = ASCII 27, ASCII 80
|
|
LET hora = time
|
|
|
|
LET l = (131 - LENGTH(p_companias.nombre CLIPPED))/2
|
|
PRINT COLUMN 3, ASCII 27, ASCII 80
|
|
PRINT COLUMN 1, normal, comp_on, negrillas_on
|
|
COLUMN 2, "coprrp008",
|
|
COLUMN l, p_companias.nombre CLIPPED,
|
|
COLUMN 124, "Pag. ",pageno using "###"
|
|
PRINT COLUMN 58, "Sistema de Compras",
|
|
COLUMN 124, today using "dd/mm/yy"
|
|
PRINT COLUMN 33, "Relacion Formas de Embarque - ",
|
|
"Materia Prima - Producto Terminado",
|
|
COLUMN 127, hora
|
|
|
|
SKIP 1 LINES
|
|
|
|
LET bandera1 = "S"
|
|
PRINT COLUMN 2, "Codigo",
|
|
COLUMN 9, x.cod_embarque using "<<",
|
|
COLUMN 14, "Embarque",
|
|
COLUMN 23, x.descrip_emb
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------",
|
|
"--------------------------------"
|
|
|
|
PRINT COLUMN 2, "Codigo",
|
|
COLUMN 11, "Furgon",
|
|
COLUMN 65, "Codigo",
|
|
COLUMN 80, "Descripcion",
|
|
COLUMN 111, "Und",
|
|
COLUMN 124, "Cantidad"
|
|
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------",
|
|
"--------------------------------"
|
|
|
|
SKIP 1 LINE
|
|
BEFORE GROUP OF x.cod_embarque
|
|
LET bandera = "S"
|
|
BEFORE GROUP OF x.cod_furg
|
|
LET b_furg = "S"
|
|
|
|
ON EVERY ROW
|
|
IF bandera = "S" AND bandera1 IS NULL THEN
|
|
|
|
SKIP 1 LINE
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------",
|
|
"--------------------------------"
|
|
|
|
PRINT COLUMN 2, "Codigo",
|
|
COLUMN 9, x.cod_embarque using "<<",
|
|
COLUMN 14, "Embarque",
|
|
COLUMN 23, x.descrip_emb
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------",
|
|
"--------------------------------"
|
|
END IF
|
|
|
|
IF b_furg = "S" THEN
|
|
PRINT COLUMN 2, x.cod_furg using "<<",
|
|
COLUMN 11, x.descrip_furg;
|
|
END IF
|
|
|
|
LET b_furg = "N"
|
|
LET bandera1 = NULL
|
|
|
|
PRINT COLUMN 65, x.cod_n USING "&","-",
|
|
COLUMN 67, x.cod_grupo USING "&","-",
|
|
COLUMN 69, x.cod_tipo USING "&&","-",
|
|
COLUMN 72, x.cod_sec USING "&&&",
|
|
COLUMN 80, x.descrip_esp,
|
|
COLUMN 111, x.unidad_med,
|
|
COLUMN 119, x.cantidad USING "##,###,###.##"
|
|
|
|
LET bandera = "N"
|
|
|
|
{ ON LAST ROW
|
|
SKIP 1 LINES
|
|
PRINT COLUMN 2, "Total de Registros Impresos = ", count(*) USING "####"
|
|
PRINT COLUMN 2, ASCII 27, ASCII 80}
|
|
|
|
END REPORT
|
|
|