Instruccion de Johnny: todos los directorios de fuentes de inventario deben migrarse de la carpeta temporal PROYECTOS a la carpeta real PROYECTO, ya que PROYECTOS sera eliminada. Se elimino tambien un archivo suelto sin relacion llamado "ipdir" que existia en PROYECTO (del commit inicial) y bloqueaba el nombre de la carpeta. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
162 lines
5.1 KiB
Plaintext
162 lines
5.1 KiB
Plaintext
{
|
|
-------------------------------------------------------------------------------
|
|
PROGRAMA : IPPRRP004
|
|
OBJETIVO : Operacion por Tipo de Movimiento detallado para
|
|
enviar por correo
|
|
PROGRAMADOR : Ing. Juan Fco. Soto
|
|
FECHA REALIZACION : Septiembre 2015
|
|
-------------------------------------------------------------------------------
|
|
}
|
|
GLOBALS "ipprgb000.4gl"
|
|
DEFINE nombre_v CHAR(20)
|
|
|
|
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 ipprrp004()
|
|
END MAIN
|
|
|
|
FUNCTION ipprrp004()
|
|
|
|
DEFINE select_ac STRING,
|
|
idx smallint
|
|
|
|
DEFINE acumulado RECORD
|
|
orden INT,
|
|
cod_n LIKE iptb00002.cod_n,
|
|
cod_grupo LIKE iptb00002.cod_grupo,
|
|
cod_tipo LIKE iptb00002.cod_tipo,
|
|
cod_sec LIKE iptb00002.cod_sec,
|
|
descrip_esp CHAR(50),
|
|
unidad_med LIKE iptb00002.unidad_med,
|
|
consumo DECIMAL(12,5)
|
|
|
|
END RECORD
|
|
OPEN WINDOW w1 WITH FORM "ipfmrp004_1"
|
|
|
|
INPUT acumulado.orden FROM num_orden
|
|
AFTER INPUT
|
|
IF INT_FLAG THEN
|
|
CALL msg(2)
|
|
LET INT_FLAG =FALSE
|
|
RETURN
|
|
END IF
|
|
IF acumulado.orden IS NULL THEN
|
|
CALL msg(16)
|
|
NEXT FIELD num_orden
|
|
END IF
|
|
END INPUT
|
|
CONSTRUCT criterio ON c.cod_n,c.cod_grupo,c.cod_tipo,c.cod_sec
|
|
FROM cod_n,cod_grupo,cod_tipo,cod_sec
|
|
|
|
LET select_ac =
|
|
"SELECT c.num_oc,c.cod_n,c.cod_grupo,c.cod_tipo,c.cod_sec,b.descrip_esp,b.unidad_med, ",
|
|
" SUM(c.cantidad_2) ",
|
|
"FROM iptb00006 c,iptb00002 b ",
|
|
"WHERE c.cod_mov in (20,70,71,84,81) and c.num_oc =? and ",criterio CLIPPED,
|
|
" and c.cod_n=b.cod_n and c.cod_grupo=b.cod_grupo and ",
|
|
" c.cod_tipo=b.cod_tipo and c.cod_sec=b.cod_sec ",
|
|
" AND c.status_t is NULL ",
|
|
"GROUP BY c.num_oc,c.cod_n,c.cod_grupo,c.cod_tipo,c.cod_sec,b.descrip_esp,b.unidad_med ",
|
|
"ORDER BY c.cod_n,c.cod_grupo,c.cod_tipo,c.cod_sec "
|
|
|
|
CALL seleccionarsalida() RETURNING r_output
|
|
|
|
|
|
PREPARE busca_ant FROM select_ac
|
|
DECLARE actual SCROLL CURSOR FOR busca_ant
|
|
OPEN actual USING acumulado.orden
|
|
LET idx=1
|
|
FOREACH actual INTO acumulado.*
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = false
|
|
RETURN
|
|
END IF
|
|
IF idx=1 THEN
|
|
CALL configureoutput(r_output) RETURNING handler
|
|
START REPORT opera TO XML HANDLER HANDLER
|
|
|
|
END IF
|
|
|
|
# Buscando Los Costos de Los Materiales
|
|
|
|
|
|
OUTPUT TO REPORT opera(acumulado.*)
|
|
LET idx=idx+1
|
|
END FOREACH
|
|
IF idx > 1 THEN
|
|
FINISH REPORT opera
|
|
ELSE
|
|
CALL fgl_winmessage("INFO","NO EXISTEN REGISTROS CON ESA CONDICION","INFO")
|
|
END IF
|
|
|
|
|
|
END FUNCTION
|
|
|
|
REPORT opera(x)
|
|
DEFINE x RECORD
|
|
orden INT,
|
|
cod_n LIKE iptb00002.cod_n,
|
|
cod_grupo LIKE iptb00002.cod_grupo,
|
|
cod_tipo LIKE iptb00002.cod_tipo,
|
|
cod_sec LIKE iptb00002.cod_sec,
|
|
descrip_esp CHAR(50),
|
|
unidad_med LIKE iptb00002.unidad_med,
|
|
consumo DECIMAL(12,5)
|
|
|
|
END RECORD
|
|
|
|
DEFINE l SMALLINT
|
|
DEFINE hora CHAR(5)
|
|
|
|
|
|
OUTPUT
|
|
TOP MARGIN 0
|
|
LEFT MARGIN 0
|
|
BOTTOM MARGIN 0
|
|
PAGE LENGTH 100
|
|
|
|
ORDER BY x.cod_n,x.cod_grupo,x.cod_tipo,x.cod_sec
|
|
|
|
FORMAT
|
|
|
|
PAGE HEADER
|
|
LET hora = TIME
|
|
LET l = (141 - LENGTH(p_companias.nombre CLIPPED))/2
|
|
PRINT COLUMN 1, "ipprrp004_1",
|
|
COLUMN l, p_companias.nombre CLIPPED,
|
|
COLUMN 134, "Pag. ",pageno using "###"
|
|
PRINT COLUMN 54, "Sistema de Inventario de Productos",
|
|
COLUMN 134, today using "dd/mm/yyyy"
|
|
PRINT COLUMN 47, "Produccion Ordenes",
|
|
COLUMN 137, hora
|
|
PRINT COLUMN 54,"ORDEN: ",x.orden USING "&&&&&&"
|
|
|
|
LET l = (141 - LENGTH(nombre_v)) / 2
|
|
|
|
SKIP 1 LINES
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------"
|
|
|
|
PRINT COLUMN 1, "Producto",
|
|
COLUMN 55, "Cantidad"
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"--------------------------------------------------"
|
|
|
|
ON EVERY ROW
|
|
|
|
PRINT COLUMN 1, x.cod_n USING "&&&&","-",x.cod_grupo USING "&&&&","-",
|
|
x.cod_tipo USING "&&&&","-",x.cod_sec USING "&&&&"," ",
|
|
x.descrip_esp[1,50],
|
|
COLUMN 56, x.consumo USING "###,###.###"
|
|
|
|
END REPORT
|