102 lines
3.0 KiB
Plaintext
102 lines
3.0 KiB
Plaintext
{
|
|
================================================================
|
|
PROGRAMA :IPPRRP020O
|
|
OBJETIVO :IMPRIMIR LAS ETIQUETAS DE LOS PRODUCTOS TERMINADOS
|
|
FECHA :MAYO 13,2011
|
|
===============================================================
|
|
}
|
|
|
|
GLOBALS
|
|
"ipprgb000.4gl"
|
|
|
|
DEFINE codigo_dp INT,
|
|
descripcion_dp CHAR(50)
|
|
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL ARG_VAL(1) RETURNING usuarios
|
|
CALL ARG_VAL(2) RETURNING clave
|
|
|
|
|
|
CONNECT to "smarmotech" user usuarios USING clave
|
|
SELECT a.* INTO p_companias.* FROM companias a
|
|
|
|
CALL ipprrp020()
|
|
END MAIN
|
|
|
|
FUNCTION ipprrp020()
|
|
DEFINE codigo_act INT,
|
|
descripcion_act char(50),
|
|
fecha_compra DATE
|
|
|
|
DEFINE handler om.SaxDocumentHandler, -- return value from fgl_report_commitCurrentSettings()
|
|
salida,r_filename STRING, -- filename of Report Design Document including .4rp extension
|
|
r_output STRING, -- output format option
|
|
preview INTEGER -- TRUE/FALSE, to set preview option
|
|
|
|
OPEN WINDOW w1 AT 10,1 WITH FORM "ipfmrp020"
|
|
CONSTRUCT criterio ON a.cod_n,a.descripcion,a.departamento
|
|
FROM codigo_act,descripcion_act,codigo_dp
|
|
|
|
LET selec = "SELECT a.codigo,a.descripcion,a.departamento,b.nom_dpto,CONVERT(CHAR(10),a.fech_compra,103) FROM actb00001 a,adtb00001 b ",
|
|
" WHERE a.status_t IS NULL AND ",criterio CLIPPED,
|
|
" AND a.departamento = b.departamento "
|
|
|
|
PREPARE comando FROM selec
|
|
DECLARE busca CURSOR FOR comando
|
|
|
|
LET r_filename = "acprrp010.4rp"
|
|
IF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
|
|
LET r_output='SVG'
|
|
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
|
|
END IF
|
|
|
|
START REPORT activos TO "dummy"
|
|
IF handler IS NOT NULL THEN -- report engine was configured ok
|
|
|
|
|
|
FOREACH busca INTO codigo_act,descripcion_act,codigo_dp,
|
|
descripcion_dp ,fecha_compra
|
|
OUTPUT TO REPORT activos(codigo_act,descripcion_act,fecha_compra)
|
|
END FOREACH
|
|
END IF
|
|
FINISH REPORT activos
|
|
|
|
END FUNCTION
|
|
|
|
REPORT activos(x,descripcion,xfecha_compra)
|
|
DEFINE x INT,
|
|
fecha,xfecha_compra DATE,
|
|
barcodigo_act CHAR(128),
|
|
descripcion CHAR(50)
|
|
ORDER BY x
|
|
FORMAT
|
|
FIRST PAGE HEADER
|
|
LET fecha = TODAY
|
|
BEFORE GROUP OF x
|
|
|
|
#ON EVERY ROW
|
|
LET barcodigo_act = "STARTB",codigo_128(x)
|
|
|
|
PRINTX x,codigo_dp,descripcion,descripcion_dp,fecha,barcodigo_act,Xfecha_compra
|
|
END REPORT
|
|
|
|
FUNCTION codigo_128(cod_val)
|
|
|
|
DEFINE cod_val,x INTEGER,
|
|
aux_str,barcode STRING
|
|
|
|
LET aux_str=cod_val USING "<<<<<<&"
|
|
|
|
LET barcode=""
|
|
|
|
FOR x=1 TO LENGTH(aux_str)
|
|
LET barcode=barcode,",",aux_str.getCharAt(x)
|
|
END FOR
|
|
LET barcode=barcode CLIPPED,",+,1"
|
|
RETURN barcode
|
|
|
|
END FUNCTION |