Bloqueados: lqprrp009, prprmt006 e ipprmt044 (pendiente enlazar y probar)
lqprrp009 (Liquidacion Repuestos):
- Dependencia FUNCIONESREPORT (msgrp000, seleccionarsalida).
- defecto() copiada al programa (vive en indir/defecto.4gl junto con
msgrp000 duplicado, importarla chocaba -6203); configureOutput ya la
aporta msgrp000.
- Quita Convert(...,103) que llenaba variables DATE (fecha_inicial/final).
- Titulo de ventana "Liquidacion Repuestos".
prprmt006 (Orden Produccion):
- El programa usa prtb08[idx].cod_n_c... como arreglo, pero el global
prtb08 es RECORD LIKE prtb00012.* y el arreglo arrprtb08 se quito de
prprgb000.4gl el 24/08 (68b73cf): 52 errores "Subscripting cannot be
applied". Se define arrprtb08 dentro del propio programa (mismos 7
campos que el form prfmmt006 s_orden) y se renombran 54 referencias.
Nadie mas usa arrprtb08, no hay choque con globales.
ipprmt044 (Transacciones Inventario):
- Faltaba la funcion fotos() de 12 parametros: existe en el respaldo
PROYECTOS/otrodir/fotos.4gl (version de 2017) y la llamada del programa
coincide exactamente. Se agrega a la aplicacion junto con el form
ipfmwd015.4fd. Las llamadas de ipprcs004/_1 a fotos() estan comentadas,
no se afectan. cc_avisadespacho es un procedimiento almacenado, no una
funcion 4GL.
Los tres compilan con fglcomp (esquema smarmotech); falta enlazar y
probar cuando se active la licencia de Genero (FLM-51 vencida).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,478 @@
|
||||
{
|
||||
|
||||
==============================================================
|
||||
MODULO : fotos.4gl
|
||||
FECHA : 09/02/2017
|
||||
DESARROLLADO POR : ING. JUAN SOTO
|
||||
|
||||
}
|
||||
IMPORT os
|
||||
DEFINE xusername,xsmtphost,xsmtpport, xpassword STRING
|
||||
|
||||
FUNCTION fotos(xcodn,xcodgrupo,xcodtipo,xcodsec,producto,xusuario,habilitar,xcantidadorden,
|
||||
xtmpnumero,xcodmov,xbodega,xestado)
|
||||
DEFINE xcodn,xcodgrupo,xcodtipo,xcodsec,xbodega SMALLINT,
|
||||
producto VARCHAR(100),
|
||||
xestado VARCHAR(1),
|
||||
xcantidadorden,unidadorden DEC(12,5),
|
||||
|
||||
habilitar,noexistencia BOOLEAN
|
||||
|
||||
DEFINE areageneral RECORD
|
||||
xtipo_material,xcantidad_minima VARCHAR(30),
|
||||
bookmatch VARCHAR(50),
|
||||
tipos VARCHAR(50),
|
||||
bodega SMALLINT,
|
||||
descrip_bodega VARCHAR(100)
|
||||
END RECORD
|
||||
DEFINE kdatos DYNAMIC ARRAY OF RECORD
|
||||
kimagen VARCHAR(200),
|
||||
|
||||
|
||||
lado_2 DEC(8,5),
|
||||
lado_1 DEC(8,5),
|
||||
lado_3 DEC(8,5),
|
||||
solicitado SMALLINT,
|
||||
# cantidadIni SMALLINT,
|
||||
cantidad FLOAT,
|
||||
cantidad2 FLOAT,
|
||||
tono VARCHAR(100),
|
||||
calidad VARCHAR(100),
|
||||
|
||||
disponible SMALLINT,
|
||||
xobservacion VARCHAR(200),
|
||||
id_producto CHAR(25),
|
||||
|
||||
seccion INT,
|
||||
tramo INT,
|
||||
--codid INT,
|
||||
borrar CHAR(2) ,
|
||||
nombre_file VARCHAR(100)
|
||||
END RECORD,
|
||||
kimagen_dest,kimagen_dest2 STRING,
|
||||
|
||||
xusuario VARCHAR(50),
|
||||
i,xcodmov SMALLINT,
|
||||
xtmpnumero INT,
|
||||
TOemail,cuerpo_correo,
|
||||
subject, procedimiento VARCHAR(200),
|
||||
totalMedida DEC(12,5)
|
||||
|
||||
|
||||
DEFINE s_tipo,d_tipos,mensaje,f_tipos,filepath,dir_file,opcion STRING
|
||||
|
||||
LET producto = xcodn USING "&&&&","-",xcodgrupo USING "&&&&","-",
|
||||
xcodtipo USING "&&&&","-",xcodsec USING "&&&&&&"," ",producto CLIPPED
|
||||
OPEN WINDOW w1 WITH FORM "ipfmwd015"
|
||||
|
||||
DISPLAY BY NAME producto
|
||||
DECLARE busca_imagen CURSOR FOR
|
||||
SELECT a.imagen, SUM(a.lado_1),SUM(a.lado_2),SUM(isnull(a.lado_3,0)),SUM(a.cantidad),
|
||||
SUM(a.cantidad2),a.observacion,a.id_producto, a.cod_seccion,a.cod_tramo,
|
||||
a.nombre_file,a.solicitados,a.tono,a.calidad
|
||||
FROM iptb00050 a
|
||||
WHERE a.cod_n = xcodn AND
|
||||
a.cod_grupo = xcodgrupo AND
|
||||
a.cod_tipo =xcodtipo AND
|
||||
a.cod_sec = xcodsec AND
|
||||
a.num_doc = xtmpnumero AND
|
||||
a.cod_mov = xcodmov
|
||||
|
||||
GROUP BY a.imagen, a.observacion,a.id_producto, a.cod_bodega,a.cod_seccion,a.cod_tramo,
|
||||
a.nombre_file,a.solicitados,a.tono,a.calidad
|
||||
|
||||
UNION
|
||||
SELECT a.imagen, SUM(a.lado_1),SUM(a.lado_2),SUM(isnull(a.lado_3,0)),SUM(a.cantidad),
|
||||
SUM(a.cantidad2),a.observacion,a.id_producto, a.cod_seccion,a.cod_tramo,
|
||||
a.nombre_file,a.solicitados,a.tono,a.calidad
|
||||
FROM tmpdesglose a
|
||||
WHERE a.cod_n = xcodn AND
|
||||
a.cod_grupo = xcodgrupo AND
|
||||
a.cod_tipo =xcodtipo AND
|
||||
a.cod_sec = xcodsec AND
|
||||
a.num_doc = xtmpnumero AND
|
||||
a.cod_mov = xcodmov
|
||||
|
||||
GROUP BY a.imagen, a.observacion,a.id_producto, a.cod_seccion,a.cod_tramo,
|
||||
a.nombre_file,a.solicitados,a.tono,a.calidad
|
||||
|
||||
LET kimagen_dest = "tmpfile.jpg"
|
||||
LET kimagen_dest2="tmpfile2.jpg"
|
||||
LET i=1
|
||||
LET d_tipos="jpeg"
|
||||
LET f_tipos="*.jpg *.png *.jpeg"
|
||||
LET mensaje=%"Elige Documento"
|
||||
|
||||
|
||||
LET totalMedida = 0
|
||||
|
||||
FOREACH busca_imagen INTO kdatos[i].kimagen,kdatos[i].lado_1,
|
||||
kdatos[i].lado_2,kdatos[i].lado_3,kdatos[i].cantidad,kdatos[i].cantidad2,
|
||||
kdatos[i].xobservacion,kdatos[i].id_producto,
|
||||
kdatos[i].seccion,kdatos[i].tramo,kdatos[i].nombre_file,
|
||||
kdatos[i].tono,kdatos[i].calidad,
|
||||
#,kdatos[i].solicitado,
|
||||
kdatos[i].tono,kdatos[i].calidad
|
||||
LET kdatos[i].borrar='NO'
|
||||
|
||||
# LET kdatos[i].cantidadIni = kdatos[i].cantidad
|
||||
LET totalMedida = totalMedida + kdatos[i].cantidad2
|
||||
LET i = i+1
|
||||
|
||||
END FOREACH
|
||||
|
||||
DISPLAY BY NAME totalMedida
|
||||
|
||||
CALL kdatos.deleteElement(i)
|
||||
SELECT a.usuario FROM seg0003 a
|
||||
WHERE a.usuario = xusuario AND
|
||||
a.fotos_adicionales_inventario = "SI"
|
||||
|
||||
IF STATUS <> NOTFOUND THEN
|
||||
LET habilitar = TRUE
|
||||
|
||||
DIALOG
|
||||
INPUT BY NAME areageneral.*
|
||||
BEFORE INPUT
|
||||
DISPLAY BY NAME xcantidadOrden
|
||||
IF habilitar = TRUE THEN
|
||||
--CALL DIALOG.setActionHidden("xtipo_material",FALSE)
|
||||
--CALL DIALOG.setActionHidden("xcantidad_minima",FALSE)
|
||||
--CALL DIALOG.setActionHidden("foto",FALSE)
|
||||
END IF
|
||||
SELECT DISTINCT a.tipo_material,a.cantidad_minima,a.bookmatch,a.tipos
|
||||
INTO areageneral.xtipo_material,areageneral.xcantidad_minima,areageneral.bookmatch,areageneral.tipos
|
||||
FROM iptb00052 a
|
||||
WHERE a.cod_n =xcodn AND a.cod_grupo = xcodgrupo AND
|
||||
a.cod_tipo = xcodtipo AND a.cod_sec = xcodsec AND
|
||||
a.num_doc = xtmpnumero AND a.cod_mov = xcodmov
|
||||
UNION
|
||||
SELECT DISTINCT a.tipo_material,a.cantidad_minima,a.bookmatch,a.tipos
|
||||
INTO areageneral.xtipo_material,areageneral.xcantidad_minima,areageneral.bookmatch,areageneral.tipos
|
||||
FROM tmpdesglose_master a
|
||||
WHERE a.cod_n =xcodn AND a.cod_grupo = xcodgrupo AND
|
||||
a.cod_tipo = xcodtipo AND a.cod_sec = xcodsec AND
|
||||
a.num_doc = xtmpnumero AND a.cod_mov = xcodmov
|
||||
|
||||
SELECT a.tipo_material,a.bookmatch,a.tipos
|
||||
INTO areageneral.xtipo_material,areageneral.bookmatch,areageneral.tipos
|
||||
FROM iptb00002 a
|
||||
WHERE a.cod_n =xcodn AND a.cod_grupo = xcodgrupo AND
|
||||
a.cod_tipo = xcodtipo AND a.cod_sec = xcodsec
|
||||
LET areageneral.bodega = xbodega
|
||||
SELECT a.descripcion INTO areageneral.descrip_bodega FROM
|
||||
intb00009 a WHERE a.cod_bodega = xbodega
|
||||
|
||||
DISPLAY BY NAME areageneral.xtipo_material,areageneral.xcantidad_minima,
|
||||
areageneral.bookmatch,areageneral.tipos,
|
||||
areageneral.descrip_bodega,
|
||||
areageneral.bodega
|
||||
|
||||
|
||||
END INPUT
|
||||
INPUT ARRAY kdatos FROM sdatos.* ATTRIBUTE(WITHOUT DEFAULTS)
|
||||
BEFORE INPUT
|
||||
IF habilitar = TRUE THEN
|
||||
|
||||
CALL DIALOG.setFieldActive("lado_1",TRUE)
|
||||
CALL DIALOG.setFieldActive("lado_2",TRUE)
|
||||
CALL DIALOG.setFieldActive("lado_3",TRUE)
|
||||
CALL DIALOG.setFieldActive("cantidad",TRUE)
|
||||
CALL DIALOG.setFieldActive("cantidad2",TRUE)
|
||||
|
||||
CALL DIALOG.setFieldActive("disponible",TRUE)
|
||||
CALL DIALOG.setFieldActive("xobservacion",TRUE)
|
||||
CALL DIALOG.setFieldActive("id_producto",TRUE)
|
||||
|
||||
CALL DIALOG.setFieldActive("seccion",TRUE)
|
||||
CALL DIALOG.setFieldActive("tramo",TRUE)
|
||||
CALL DIALOG.setFieldActive("borrar",TRUE)
|
||||
|
||||
CALL DIALOG.setFieldActive("solicitado",FALSE)
|
||||
END IF
|
||||
IF xestado = '2' THEN
|
||||
|
||||
CALL DIALOG.setFieldActive("lado_1",FALSE)
|
||||
CALL DIALOG.setFieldActive("lado_2",FALSE)
|
||||
CALL DIALOG.setFieldActive("lado_3",FALSE)
|
||||
CALL DIALOG.setFieldActive("cantidad",FALSE)
|
||||
CALL DIALOG.setFieldActive("cantidad2",FALSE)
|
||||
|
||||
CALL DIALOG.setFieldActive("disponible",FALSE)
|
||||
NEXT FIELD id_producto
|
||||
END IF
|
||||
|
||||
BEFORE ROW
|
||||
LET i=arr_curr()
|
||||
# LET kdatos[i].bodega = xbodega
|
||||
CALL cseccion(xbodega)
|
||||
|
||||
IF kdatos[i].kimagen IS NOT NULL THEN
|
||||
LET kimagen_dest = kdatos[i].kimagen
|
||||
DISPLAY kimagen_dest TO presenta
|
||||
END IF
|
||||
IF kdatos[i].cantidad2 < 0 THEN
|
||||
LET kdatos[i].cantidad2 = kdatos[i].cantidad2 * -1
|
||||
END IF
|
||||
DISPLAY kdatos[i].cantidad TO sdatos[scr_line()].cantidad
|
||||
|
||||
|
||||
|
||||
|
||||
AFTER FIELD seccion
|
||||
CALL ctramo(xbodega, kdatos[i].seccion)
|
||||
|
||||
|
||||
ON ACTION foto_down
|
||||
IF kdatos[i].kimagen IS NOT NULL THEN
|
||||
|
||||
LET dir_file = "tmp\\",xusuario CLIPPED,
|
||||
kimagen_dest CLIPPED
|
||||
LET s_tipo = '*jpg *.png'
|
||||
|
||||
LET opcion = 'Archivo Imagen'
|
||||
LET kimagen_dest = dir_file
|
||||
DISPLAY kimagen_dest TO presenta
|
||||
|
||||
LET mensaje = 'Guardar archivo'
|
||||
CALL ui.Interface.frontCall("standard","getenv", ["TEMP"], [filepath] )
|
||||
|
||||
LET filepath = filepath CLIPPED,"\\",kdatos[i].nombre_file CLIPPED
|
||||
|
||||
CALL ui.Interface.frontCall("standard","savefile", [dir_file,opcion,
|
||||
s_tipo,mensaje], [filepath] )
|
||||
CALL fgl_putfile(dir_file,filepath)
|
||||
|
||||
CALL ui.Interface.frontCall("standard","shellexec", [filepath],[opcion])
|
||||
|
||||
END IF
|
||||
|
||||
ON ACTION foto
|
||||
LET i = arr_curr()
|
||||
CALL ui.Interface.frontCall("standard","openfile", [dir_file,d_tipos,f_tipos,mensaje], [filepath] )
|
||||
|
||||
IF filepath IS NOT NULL THEN
|
||||
IF downshift(os.Path.extension(filepath)) = "jpg" OR
|
||||
downshift(os.Path.extension(filepath)) = "jpeg" OR
|
||||
downshift(os.Path.extension(filepath)) = "png" THEN
|
||||
|
||||
LET dir_file = os.Path.basename(filepath)
|
||||
|
||||
LET dir_file = "tmp\\",dir_file CLIPPED
|
||||
# CALL fgl_getfile(filepath,kimagen_dest2)
|
||||
CALL fgl_getfile(filepath,dir_file)
|
||||
|
||||
CALL comprimeImagen(dir_file,' -resize 500x500 ')
|
||||
|
||||
|
||||
LET kdatos[i].nombre_file = os.Path.basename(dir_file)
|
||||
DISPLAY dir_file TO presenta
|
||||
LET kdatos[i].kimagen = dir_file
|
||||
ELSE
|
||||
CALL fgl_winmessage("ERROR","EL FILE DEBE SER JPG, JPEG, PNG","INFO")
|
||||
END IF
|
||||
END IF
|
||||
{
|
||||
AFTER FIELD solicitado
|
||||
LET i = arr_curr()
|
||||
|
||||
IF kdatos[i].solicitado IS NULL THEN
|
||||
CALL fgl_winmessage("ERROR","DEBE ESPECIFICAR lA CANTIDAD SOLICITADA","INFO")
|
||||
NEXT FIELD solicitado
|
||||
END IF
|
||||
|
||||
IF kdatos[i].solicitado > kdatos[i].cantidad THEN
|
||||
CALL fgl_winmessage("ERROR","lA CANTIDAD SOLICITADA SUPERA LA DISPONIBLE","INFO")
|
||||
NEXT FIELD solicitado
|
||||
ELSE
|
||||
DISPLAY "kdatos[i].cantidadIni: ",kdatos[i].cantidadIni
|
||||
DISPLAY "kdatos[i].solicitado: ",kdatos[i].solicitado
|
||||
|
||||
LET kdatos[i].cantidad = kdatos[i].cantidadIni - kdatos[i].solicitado
|
||||
LET kdatos[i].cantidad2= kdatos[i].lado_1 * kdatos[i].lado_2 * kdatos[i].cantidad
|
||||
|
||||
DISPLAY kdatos[i].cantidad TO sdatos[scr_line()].cantidad
|
||||
DISPLAY kdatos[i].cantidad2 TO sdatos[scr_line()].cantidad2
|
||||
END IF
|
||||
}
|
||||
AFTER FIELD cantidad
|
||||
LET i = arr_curr()
|
||||
LET kdatos[i].cantidad2= kdatos[i].lado_1 * kdatos[i].lado_2 * kdatos[i].cantidad
|
||||
DISPLAY kdatos[i].cantidad2 TO sdatos[scr_line()].cantidad2
|
||||
|
||||
AFTER FIELD id_producto
|
||||
IF xestado = '2' THEN
|
||||
|
||||
SELECT DISTINCT a.lado_1,a.lado_2,a.lado_3,a.tono,a.calidad
|
||||
INTO kdatos[i].lado_1,kdatos[i].lado_2,kdatos[i].lado_3,
|
||||
kdatos[i].tono,kdatos[i].calidad
|
||||
FROM iptb00050 a WHERE a.id_producto = kdatos[i].id_producto
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
CALL msg(3)
|
||||
NEXT FIELD id_producto
|
||||
END IF
|
||||
DISPLAY kdatos[i].lado_1 TO sdatos[scr_line()].lado_1
|
||||
DISPLAY kdatos[i].lado_2 TO sdatos[scr_line()].lado_2
|
||||
DISPLAY kdatos[i].lado_3 TO sdatos[scr_line()].lado_3
|
||||
|
||||
DISPLAY kdatos[i].tono TO sdatos[scr_line()].tono
|
||||
DISPLAY kdatos[i].calidad TO sdatos[scr_line()].calidad
|
||||
END IF
|
||||
ON ACTION guardar ATTRIBUTE(TEXT="Salvar",IMAGE="save")
|
||||
|
||||
BEGIN WORK
|
||||
SELECT a.num_doc FROM tmpdesglose_master a
|
||||
WHERE a.num_doc = xtmpnumero AND a.cod_mov = xcodmov AND a.us_crea = xusuario
|
||||
IF STATUS = NOTFOUND THEN
|
||||
INSERT INTO tmpdesglose_master (cod_n,cod_grupo,cod_tipo,cod_Sec,tipo_material,cantidad_minima,us_crea,fech_crea,cantidadorden,num_doc,cod_mov,fecha,bookmatch,tipos,bodega)
|
||||
VALUES (xcodn,xcodgrupo,xcodtipo,xcodsec,areageneral.xtipo_material,areageneral.xcantidad_minima,xusuario,getdate(),xcantidadorden,xtmpnumero,xcodmov,getdate(),areageneral.bookmatch,areageneral.tipos,
|
||||
xbodega)
|
||||
END IF
|
||||
DELETE FROM tmpdesglose WHERE num_doc = xtmpnumero AND cod_mov = xcodmov AND
|
||||
cod_n = xcodn AND cod_grupo = xcodgrupo AND
|
||||
cod_tipo = xcodtipo AND cod_sec = xcodsec AND
|
||||
us_crea = xusuario
|
||||
LET xcantidadorden = 0
|
||||
LET unidadorden =0
|
||||
FOR i =1 TO kdatos.getLength()
|
||||
IF kdatos[i].calidad IS NOT NULL THEN
|
||||
IF kdatos[i].id_producto IS NULL THEN
|
||||
ROLLBACK WORK
|
||||
CALL msg(16)
|
||||
NEXT FIELD id_producto
|
||||
END IF
|
||||
IF xestado = '2' THEN
|
||||
SELECT DISTINCT id_producto FROM iptb00050 WHERE id_producto = kdatos[i].id_producto
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
CALL msg(3)
|
||||
NEXT FIELD id_producto
|
||||
END IF
|
||||
IF kdatos[i].cantidad2 < 0 THEN
|
||||
LET kdatos[i].cantidad2 = kdatos[i].cantidad2 * -1
|
||||
END IF
|
||||
CALL idexistencia(kdatos[i].id_producto,kdatos[i].cantidad2,xbodega,
|
||||
kdatos[i].seccion,kdatos[i].tramo) RETURNING noexistencia
|
||||
IF noexistencia THEN
|
||||
ROLLBACK WORK
|
||||
CALL msg(30)
|
||||
NEXT FIELD cantidad2
|
||||
END IF
|
||||
END IF
|
||||
LET kdatos[i].id_producto=kdatos[i].id_producto CLIPPED
|
||||
|
||||
LET xcantidadorden = xcantidadorden + kdatos[i].cantidad2
|
||||
LET unidadorden = unidadorden + kdatos[i].cantidad
|
||||
IF xestado = '2' THEN
|
||||
|
||||
LET kdatos[i].cantidad2 = kdatos[i].cantidad2 * -1
|
||||
END IF
|
||||
INSERT INTO tmpdesglose (cod_n,cod_grupo,cod_tipo,cod_Sec,imagen,observacion,
|
||||
lado_1,lado_2,lado_3,cantidad,
|
||||
nombre_file,us_crea,fech_crea,id_producto,
|
||||
cantidad2,cod_bodega,cod_seccion,cod_tramo,tono,calidad,num_doc,cod_mov
|
||||
)
|
||||
VALUES (xcodn,xcodgrupo,xcodtipo,xcodsec,kdatos[I].kimagen,kdatos[i].xobservacion,
|
||||
kdatos[i].lado_1,kdatos[i].lado_2,kdatos[i].lado_3,
|
||||
kdatos[i].cantidad, kdatos[i].nombre_file,xusuario,getdate(),kdatos[i].id_producto,
|
||||
kdatos[i].cantidad2,xbodega,kdatos[i].seccion,kdatos[i].tramo,kdatos[i].tono,
|
||||
kdatos[i].calidad,xtmpnumero,xcodmov)
|
||||
END IF
|
||||
END FOR
|
||||
|
||||
COMMIT WORK
|
||||
|
||||
CALL msg(1)
|
||||
|
||||
LET subject="ACTUALIZACION IMAGEN PRODUCTO"
|
||||
LET cuerpo_correo = "EL ARTICULO ",producto CLIPPED, " FUE ACTUALIZADO CON UNA IMAGEN"
|
||||
# LET toemail ='vendedores@marmotech.com.do;jsoto@marmotech.com.do'
|
||||
LET toemail ='jsoto@marmotech.com.do'
|
||||
# LET procedimiento = "{ call cc_avisadespacho(?,?,?,?) }" CLIPPED
|
||||
|
||||
# CALL envia_correo(TOemail,CCEmail,cuerpo_correo,
|
||||
# subject, procedimiento )
|
||||
|
||||
|
||||
LET xusername ='notificacion@marmotech.com.do'
|
||||
LET xsmtphost ='smtp.office365.com'
|
||||
LET xsmtpport = '587'
|
||||
LET xpassword = 'Lmmjvsd2020'
|
||||
# CALL enviaemail(Toemail,subject,cuerpo_correo,NULL,xusername,xsmtphost,xsmtpport,xpassword)
|
||||
# RETURNING retorne
|
||||
LET procedimiento = "{ call cc_avisadespacho(?,?,?,?) }" CLIPPED
|
||||
|
||||
END INPUT
|
||||
|
||||
ON ACTION retornar ATTRIBUTE(TEXT="Retornar",IMAGE="fa-long-arrow-left")
|
||||
IF xcantidadorden IS NULL THEN
|
||||
LET xcantidadorden=0
|
||||
END IF
|
||||
IF unidadorden IS NULL THEN
|
||||
LET unidadorden = 0
|
||||
END IF
|
||||
EXIT DIALOG
|
||||
|
||||
END DIALOG
|
||||
ELSE
|
||||
DISPLAY ARRAY kdatos TO sdatos.*
|
||||
BEFORE ROW
|
||||
LET i=arr_curr()
|
||||
IF kdatos[i].kimagen IS NOT NULL THEN
|
||||
LET kimagen_dest =kdatos[i].kimagen
|
||||
DISPLAY kimagen_dest TO presenta
|
||||
END IF
|
||||
|
||||
ON ACTION foto_down
|
||||
IF kdatos[i].kimagen IS NOT NULL THEN
|
||||
|
||||
LET dir_file = "tmp\\",xusuario CLIPPED,
|
||||
kimagen_dest CLIPPED
|
||||
LET s_tipo = '*jpg *.png'
|
||||
|
||||
LET opcion = 'Archivo Imagen'
|
||||
|
||||
|
||||
LET mensaje = 'Guardar archivo'
|
||||
CALL ui.Interface.frontCall("standard","getenv", ["TEMP"], [filepath] )
|
||||
|
||||
LET filepath = filepath CLIPPED,"\\",kdatos[i].nombre_file CLIPPED
|
||||
|
||||
CALL ui.Interface.frontCall("standard","savefile", [dir_file,opcion,
|
||||
s_tipo,mensaje], [filepath] )
|
||||
CALL fgl_putfile(dir_file,filepath)
|
||||
CALL comprimeImagen(filepath,' -resize 500x500 ')
|
||||
|
||||
CALL ui.Interface.frontCall("standard","shellexec", [filepath],[opcion])
|
||||
|
||||
END IF
|
||||
AFTER DISPLAY
|
||||
EXIT DISPLAY
|
||||
END DISPLAY
|
||||
END IF
|
||||
CLOSE WINDOW w1
|
||||
|
||||
RETURN xcantidadorden,unidadorden
|
||||
|
||||
END FUNCTION
|
||||
FUNCTION idexistencia(id,cantidad,pbodega, secc,fila)
|
||||
DEFINE id VARCHAR(25),
|
||||
existencia,cantidad DEC(12,5),
|
||||
secc,fila,pbodega INT
|
||||
|
||||
SELECT ISNULL(SUM(a.cantidad2),0) INTO existencia FROM iptb00050 a
|
||||
WHERE a.id_producto = id AND
|
||||
a.cod_bodega = pbodega AND
|
||||
a.cod_seccion = secc AND
|
||||
a.cod_tramo = fila AND
|
||||
a.status_t IS NULL
|
||||
|
||||
IF cantidad > existencia THEN
|
||||
RETURN TRUE
|
||||
ELSE
|
||||
RETURN FALSE
|
||||
END IF
|
||||
|
||||
|
||||
END FUNCTION
|
||||
Reference in New Issue
Block a user