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
+50
View File
@@ -0,0 +1,50 @@
MAIN
CONNECT TO 'smarmotech' USER 'jsoto' USING 'lmmjvsd2014'
CALL balance()
END MAIN
FUNCTION balance()
DEFINE ptipo,pcliente,idx INT,
balance,valor1,valor2 DEC(12,2)
DELETE FROM tmpbalances
DECLARE buscar CURSOR FOR
SELECT DISTINCT a.tipo_cliente,a.sec_cliente FROM vetb00002 a,cctb00001 b
WHERE a.tipo_cliente = b.tipo_cliente AND a.sec_cliente = b.sec_cliente AND a.tipo_cliente = 15 AND
b.status_t IS NULL
ORDER BY a.tipo_cliente,a.sec_cliente
LET idx = 0
FOREACH buscar INTO ptipo,pcliente
SELECT SUM(a.valor+a.monto_desc) INTO valor1 FROM cctb00001 a
WHERE a.fecha_orig <='12/31/2019' and
a.tipo_cliente = ptipo and
a.sec_cliente = pcliente and
a.status_t is null and tipo_doc NOT IN ("AV","AP")
IF valor1 IS NULL THEN
LET valor1 = 0.00
END IF
LET valor2 = 0.00
SELECT SUM(a.valor+a.monto_desc) INTO valor2 FROM cctb00001 a
WHERE a.fecha_orig <= '12/31/2019' and
a.tipo_cliente = ptipo and
a.sec_cliente = pcliente and
a.status_t is null and tipo_doc in ("AV") and num_doc = aplica_a
IF valor2 IS NULL THEN
LET valor2 = 0.00
END IF
LET balance = valor1 - valor2
IF balance IS NULL THEN LET balance = 0 END IF
DISPLAY "data ",ptipo," ",pcliente," ",balance," procesando ",idx
INSERT INTO tmpbalances VALUES (ptipo,pcliente,balance)
LET idx = idx + 1
END FOREACH
END FUNCTION