Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
IMPORT util
|
||||
|
||||
TYPE t_sync_cmd RECORD
|
||||
oper STRING,
|
||||
data STRING
|
||||
END RECORD
|
||||
|
||||
FUNCTION bodegas(url)
|
||||
DEFINE url,cmd,res,msg STRING,
|
||||
ret INT,
|
||||
i SMALLINT,
|
||||
bodegas DYNAMIC ARRAY OF RECORD
|
||||
cod_bodega SMALLINT,
|
||||
descripcion VARCHAR(60)
|
||||
END RECORD
|
||||
|
||||
DEFINE r_cmd t_sync_cmd
|
||||
DISPLAY "bodegas" TO tabla_Download
|
||||
LET r_cmd.data = util.JSON.stringify(bodegas)
|
||||
LET r_cmd.oper='bodegas'
|
||||
LET cmd = util.JSON.stringify(r_cmd)
|
||||
|
||||
CALL sync_send_command(url, cmd) RETURNING ret, res
|
||||
IF ret == 0 THEN
|
||||
CALL util.JSON.parse(res,bodegas)
|
||||
ELSE
|
||||
LET msg=SFMT(%"Connection '%1' failed",r_cmd.oper),"\n",url,"\n",res
|
||||
CALL show_sync_err(msg)
|
||||
END IF
|
||||
DELETE FROM bodegas
|
||||
FOR i = 1 TO bodegas.getLength()
|
||||
INSERT INTO bodegas
|
||||
VALUES (bodegas[i].*)
|
||||
DISPLAY i TO registro_download
|
||||
END FOR
|
||||
LET msg=SFMT(%"Download Clases '%1' ",r_cmd.oper),"\n",bodegas.getLength()
|
||||
CALL fgl_winmessage(" ",msg,"info")
|
||||
END FUNCTION
|
||||
Reference in New Issue
Block a user