Files
DECOMARMOL/PROYECTO/nodir/nocarnet.4gl
T
2026-09-22 20:38:51 -04:00

63 lines
2.5 KiB
Plaintext

GLOBALS
"noprgb000.4gl"
DEFINE direccion_suc,telefono_suc VARCHAR(100)
FUNCTION cardnet(xnumemp)
DEFINE tmpfile STRING,
foto BYTE,
xnumemp INT
LET direccion_suc = NULL
LET telefono_suc = NULL
LOCATE foto IN MEMORY
SELECT a.nom1_emp,a.apell1_emp,a.num_emp,a.cedula,b.nom_puesto,a.foto_empleado,c.direccion,c.telefono
INTO datos_cheque.nom1_emp,datos_cheque.apell1_emp,datos_cheque.num_emp,
datos_cheque.cedula,puesto.nom_puesto,foto,direccion_suc,telefono_suc
FROM adtb00003 a LEFT OUTER JOIN sucursales c ON a.sucid=c.sucid,adtb00004 b
WHERE a.num_emp = xnumemp and a.cod_puesto = b.cod_puesto
AND a.status_t IS NULL
LET r_filename = 'noprrp044.4rp'
LET tmpfile = '.\\TMP\\tmpfoto.jpg'
IF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
LET preview=1
LET r_output = 'PDF'
CALL fgl_report_selectDevice(r_output) -- changing default
CALL fgl_report_selectPreview(preview) -- changing default
CALL fgl_report_setPrinterSides("two-sided-short-edge")
LET handler = fgl_report_commitCurrentSettings() -- commit changes
END IF
IF handler IS NOT NULL THEN -- report engine was configured ok
START REPORT reporte TO XML HANDLER handler
END IF
IF foto IS NOT NULL THEN
CALL foto.writeFile(tmpfile)
ELSE
LET tmpfile='.\\TMP\\fotodefault.jpg'
END IF
OUTPUT TO REPORT reporte(tmpfile)
FINISH REPORT reporte
END FUNCTION
REPORT reporte(xtmpfile)
DEFINE xtmpfile STRING
FORMAT
ON EVERY ROW
#DISPLAY "ubicacion ",ubicacionhtml
IF direccion_suc IS NOT NULL THEN
LET p_companias.direccion = direccion_suc
LET p_companias.telefono = telefono_suc
ELSE
SELECT c.direccion,c.telefono INTO p_companias.direccion,p_companias.telefono
FROM sucursales c WHERE c.sucid = 1
END IF
PRINTX datos_cheque.nom1_emp,datos_cheque.apell1_emp,datos_cheque.num_emp,
p_companias.direccion,p_Companias.telefono,datos_cheque.cedula,
puesto.nom_puesto,xtmpfile
END REPORT