86 lines
2.8 KiB
Plaintext
86 lines
2.8 KiB
Plaintext
GLOBALS "ipprgb000.4gl"
|
|
DEFINE xcodigo VARCHAR(50)
|
|
|
|
FUNCTION impdocumento(numeroid,codmov)
|
|
DEFINE numeroid,codmov INT
|
|
|
|
CALL buscadoc(numeroid,codmov) RETURNING p_iptb57.*,arr_iptb58
|
|
|
|
LET r_filename = "ipprmt020.4rp"
|
|
iF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
|
|
|
|
LET r_output="PDF"
|
|
LET preview=1
|
|
CALL fgl_report_selectDevice(r_output) -- changing default
|
|
CALL fgl_report_selectPreview(preview) -- changing default
|
|
LET handler = fgl_report_commitCurrentSettings() -- commit changes
|
|
ELSE
|
|
RETURN
|
|
END IF
|
|
START REPORT requiere TO XML HANDLER HANDLER
|
|
|
|
FOR idx = 1 TO arr_iptb58.getLength()
|
|
IF arr_iptb58[idx].cod_Sec IS NOT NULL THEN
|
|
LET xcodigo =arr_iptb58[idx].cod_n USING '&&&&&','-',
|
|
arr_iptb58[idx].cod_grupo USING '&&&&&','-',
|
|
arr_iptb58[idx].cod_tipo USING '&&&&&&','-',
|
|
arr_iptb58[idx].cod_sec USING '&&&&&&&'
|
|
|
|
OUTPUT TO REPORT requiere(arr_iptb58[idx].*,despiece[idx].*, xcodigo)
|
|
|
|
END IF
|
|
|
|
END FOR
|
|
FINISH REPORT requiere
|
|
LET tienedespiece = FALSE
|
|
END FUNCTION
|
|
|
|
REPORT requiere(detalle,xdespiece,codigo)
|
|
DEFINE hora STRING,
|
|
detalle RECORD
|
|
area INT,
|
|
cod_n,cod_grupo,cod_tipo,cod_sec INT,
|
|
descripcion VARCHAR(100),
|
|
unidad_med VARCHAR(4),
|
|
cantidad_1,cantidad,cantidad_o1,cantidad1,factor_conv DEC(12,5)
|
|
END RECORD,
|
|
xdespiece RECORD
|
|
id_etiqueta SMALLINT,
|
|
cod_n SMALLINT,
|
|
cod_grupo SMALLINT,
|
|
cod_tipo SMALLINT,
|
|
cod_sec SMALLINT,
|
|
lado_1 DEC(12,5),
|
|
lado_2 DEC(12,5),
|
|
lado_3 DEC(12,5),
|
|
cantidad DEC(12,5),
|
|
medida DEC(12,5),
|
|
secuencia,id_despiece INT,
|
|
bodega SMALLINT
|
|
|
|
END RECORD,
|
|
codigo VARCHAR(50),
|
|
|
|
x INT,
|
|
etiqueta VARCHAR(100)
|
|
|
|
ORDER BY codigo
|
|
FORMAT
|
|
FIRST PAGE HEADER
|
|
SELECT a.nombre INTO p_companias.nombre FROM companias a
|
|
LET hora = CURRENT
|
|
PRINTX hora,p_companias.nombre
|
|
BEFORE GROUP OF codigo
|
|
PRINTX detalle.*,p_iptb57.*,
|
|
nombreMov,nombreBodega,nombreBodegaDestino,nombreUsuario
|
|
|
|
ON EVERY ROW
|
|
SELECT a.descripcion INTO etiqueta FROM vetb00026 a
|
|
WHERE a.codid = xdespiece.id_etiqueta
|
|
|
|
|
|
LET total_cantidad = total_cantidad + xdespiece.cantidad
|
|
|
|
PRINTX codigo,xdespiece.*,tienedespiece,etiqueta,total_cantidad,total_medida
|
|
END REPORT
|