Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md

This commit is contained in:
2026-08-18 20:59:52 -04:00
commit 454973e269
5978 changed files with 2664094 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
IMPORT util
TYPE t_sync_cmd RECORD
oper STRING,
data STRING
END RECORD
FUNCTION valida_usuario(u,url)
DEFINE u RECORD
usuario VARCHAR(50),
clave VARCHAR(20),
sesion VARCHAR(10)
END RECORD
DEFINE r_cmd t_sync_cmd
DEFINE cmd, res, msg,url STRING,
ret INT
DEFINE r RECORD
perror STRING,
pbodega SMALLINT
END RECORD
LET r_cmd.oper = "v_usuarios"
LET r_cmd.data = util.JSON.stringify(u) -- aca se convierte a string los datos de la operacion
LET cmd = util.JSON.stringify(r_cmd) -- aca se convierte a string el comando/operacion a enviar al server
CALL sync_send_command(url, cmd) RETURNING ret, res
TRY
IF ret == 0 THEN
CALL util.JSON.parse(res,r)
IF r.perror = "VALIDO" THEN
RETURN TRUE,r.pbodega
ELSE
LET msg=SFMT(%"Connection '%1' failed",r_cmd.oper),"\n",url,"\n",res
CALL show_sync_err(msg)
RETURN FALSE,r.pbodega
END IF
ELSE
LET msg=SFMT(%"Connection '%1' failed",r_cmd.oper),"\n",url,"\n",res
CALL show_sync_err(msg)
RETURN FALSE,r.pbodega
END IF
CATCH
ERROR "ERROR EN VALIDACION USUARIO"
RETURN FALSE,r.pbodega
END TRY
END FUNCTION