JSOTO QA G6 (.250): arreglos CG/Activos/Repuestos/Informatica, DBDATE, imagenes de reportes y cgprrp008

Programas (bugs encontrados en las pruebas funcionales en la .250):
- acprmt004/acprmt005: MIN/MAX sobre la fecha real (no sobre texto CONVERT 103); acprmt004 alinea rowid.
- cgprrp008: lee cgtb00004 (no la copia cgtb00004_tmp del 14-mar-2026) y solo regenera
  cgtb00016 cuando se corre sin filtro de cuenta.
- cgprrp014: CONSTRUCT con los nombres de campo del form (cod_sp_sc).
- cgfmrp013: defaultValue del combo = cgprrp012.4rp.
- cgprrp022/edprrp029: salida getPreviewDevice() en lugar de SVG fijo.
- edprrp080: no consume numero ED con afecta = NO.
- cgprmt004/022/037, segprmt0001: sin CONNECT "IFMX" (-6366); EXTERIOR via cross-DB.
- irprcs001: agrega CONNECT; irprmt021: columna idestado; irprmt066: la anulacion sin
  MaintainX ya no se deshace (-255); otrodir/bodegas: rama '2' llena origen y destino.
- teprmt001: ajustes G6.

Despliegue G6:
- DBDATE=dmy4 en config/Application.xcf, config/Main_prg.xcf, resources/Application.xcf
  y en el grupo MODULOS del .4pw (los programas lanzados por el menu heredan el entorno).
- 31 .4rp: IMAGEBOX con rutas absolutas file:///E:|F:|C: -> relativas IMAGENES/...;
  se agregan IMAGENES/LOGO.JPG y genero_logo.png.
- Paquete mbs: incluye bin/*.4rp y bin/IMAGENES (antes el GAR no llevaba los reportes).
- resources/TopMenu.4st (irprcs008 daba -8014); bin/cgprcs024.4rp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 15:30:24 -04:00
co-authored by Claude Opus 5.5
parent 95aa24c029
commit 705fadfdb4
57 changed files with 358 additions and 208 deletions
+27 -12
View File
@@ -48,6 +48,7 @@ GLOBALS
clave CHAR(16)
END RECORD
DEFINE fecha_inicial,fecha_final DATE
DEFINE regenera SMALLINT -- TRUE = corrida sin filtro: actualiza cgtb00016
MAIN
DEFER INTERRUPT
CALL ARG_VAL(1) RETURNING usuarios
@@ -112,9 +113,15 @@ FUNCTION cgprrp008()
END IF
EXIT CONSTRUCT
END CONSTRUCT
-- cgtb00016 (base de cgprrp012/013) solo se regenera cuando se corre el mes
-- COMPLETO; con filtro de cuenta se borraba el mes y se reinsertaban solo
-- las cuentas filtradas (balance incompleto).
LET regenera = (criterio.trim() = "1=1")
IF regenera THEN
DELETE FROM cgtb00016 WHERE ano = p_ano AND mes=p_mes AND programa='cgprrp012.4rp'
DELETE FROM cgtb00016 WHERE ano = p_ano AND mes=p_mes AND programa='cgprrp013.4rp' AND
estado_m='390'
END IF
LET p = 1
LET selec =
@@ -132,7 +139,7 @@ DISPLAY "cuenta ",cuenta_reg
LET selec =
"SELECT b.cuenta_no,b.descripcion,b.estado_a,b.estado_m, ",
" ISNULL(SUM(a.debito),0),ISNULL(SUM(a.credito),0),b.nivel,b.analitico,b.aplica_a ",
"FROM cgtb00001 b LEFT OUTER JOIN cgtb00004_tmp a ON (a.cuenta_no = b.cuenta_no) AND (a.fecha BETWEEN ? AND ?) ",
"FROM cgtb00001 b LEFT OUTER JOIN cgtb00004 a ON (a.cuenta_no = b.cuenta_no) AND (a.fecha BETWEEN ? AND ?) ",
" AND (a.status_t IS NULL) ",
"WHERE (a.status_t IS NULL) AND ",
@@ -290,7 +297,7 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
# Balance Anterior
LET x.cuenta_no = x.cuenta_no clipped
SELECT sum(debito-credito) INTO balan_ant FROM cgtb00004_tmp
SELECT sum(debito-credito) INTO balan_ant FROM cgtb00004
WHERE (fecha < fecha1) and (cuenta_no[1] = x.cuenta_no) and
status_t is null
@@ -300,7 +307,7 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
# Actividades del mes
SELECT SUM(a.debito),SUM(a.credito) INTO x.debito,x.credito
FROM cgtb00004_tmp a
FROM cgtb00004 a
WHERE (a.cuenta_no[1] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha between fecha1 and fecha2)
@@ -316,7 +323,7 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
# Para Las Sub-control
IF x.nivel > 1 THEN
LET x.cuenta_no = x.cuenta_no clipped
SELECT SUM(a.debito-a.credito) INTO balan_ant FROM cgtb00004_tmp a
SELECT SUM(a.debito-a.credito) INTO balan_ant FROM cgtb00004 a
WHERE (a.cuenta_no[1,2] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha < fecha1 )
IF balan_ant is null THEN
@@ -325,14 +332,14 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
# Actividades del mes
SELECT SUM(a.debito),SUM(a.credito) INTO x.debito,x.credito
FROM cgtb00004_tmp a
FROM cgtb00004 a
WHERE (a.cuenta_no[1,2] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha between fecha1 and fecha2)
# Otras cuentas sub-controles (Balance Anterior)
IF x.cuenta_no[3] != " " THEN
SELECT SUM(a.debito-a.credito) INTO balan_ant FROM cgtb00004_tmp a
SELECT SUM(a.debito-a.credito) INTO balan_ant FROM cgtb00004 a
WHERE (a.cuenta_no[1,3] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha < fecha1 )
IF balan_ant is null THEN
@@ -340,13 +347,13 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
END IF
# Actividades del mes
SELECT SUM(a.debito),SUM(a.credito) INTO x.debito,x.credito
FROM cgtb00004_tmp a
FROM cgtb00004 a
WHERE (a.cuenta_no[1,3] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha between fecha1 and fecha2)
END IF
# Otras cuentas sub-controles (Actividades del mes)
IF x.cuenta_no[4] != " " THEN
SELECT SUM(a.debito-a.credito) INTO balan_ant FROM cgtb00004_tmp a
SELECT SUM(a.debito-a.credito) INTO balan_ant FROM cgtb00004 a
WHERE (a.cuenta_no[1,4] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha < fecha1 )
IF balan_ant is null THEN
@@ -354,7 +361,7 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
END IF
SELECT SUM(a.debito),SUM(a.credito) INTO x.debito,x.credito
FROM cgtb00004_tmp a
FROM cgtb00004 a
WHERE (a.cuenta_no[1,4] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha between fecha1 and fecha2)
END IF
@@ -382,11 +389,13 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
#END IF
LET balan_act = balan_ant + actividad
IF regenera THEN
INSERT INTO cgtb00016(ano,mes,cuenta_no,estado_a,estado_m,balance_ant,actividad,balance_act,programa,descripcion,
primern,debito,credito)
VALUES (p_ano,p_mes,x.cuenta_no,x.estado_a,x.estado_m,
balan_ant,actividad,balan_act,'cgprrp012.4rp',x.descripcion,x.nivel,
x.debito,x.credito)
END IF
IF valor_88_act is null THEN
LET valor_88_act = 0
@@ -408,7 +417,7 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
IF x.nivel > 2 THEN
# Balance Inicial
SELECT SUM(b.debito - b.credito) INTO balance FROM cgtb00004_tmp b
SELECT SUM(b.debito - b.credito) INTO balance FROM cgtb00004 b
WHERE (b.cuenta_no=x.cuenta_no) AND b.status_t IS NULL AND (b.fecha < fecha1)
IF balance IS NULL THEN
@@ -435,11 +444,13 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
COLUMN 112, balance + actividad USING "((,(((,(((,(((.##)"
# END IF
LET balan_act = balance + actividad
IF regenera THEN
INSERT INTO cgtb00016 (ano,mes,cuenta_no,estado_a,estado_m,balance_ant,actividad,balance_act,programa,
descripcion,primern,debito,credito)
VALUES (p_ano,p_mes,x.cuenta_no,x.estado_a,x.estado_m,
balance,actividad,balan_act,'cgprrp012.4rp',x.descripcion,x.nivel,
x.debito,x.credito)
END IF
END IF
# Busca las cuentas que tienen que ver con el beneficio neto
@@ -482,7 +493,7 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
FOREACH busca INTO x.cuenta_no,x.descripcion,x.estado_a,x.estado_m
LET x.cuenta_no = x.cuenta_no clipped
SELECT sum(a.debito-a.credito) INTO balan_ant FROM cgtb00004_tmp a
SELECT sum(a.debito-a.credito) INTO balan_ant FROM cgtb00004 a
WHERE (a.cuenta_no[1] = x.cuenta_no) and (a.fecha < fecha1) and
a.status_t is null
@@ -492,7 +503,7 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
# Actividades del mes
SELECT SUM(a.debito),SUM(a.credito) INTO x.debito,x.credito
FROM cgtb00004_tmp a
FROM cgtb00004 a
WHERE (a.cuenta_no[1] = x.cuenta_no) and a.status_t IS NULL AND
(a.fecha between fecha1 and fecha2)
@@ -557,8 +568,10 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
PRINT COLUMN 1, "---------------------------------------------------",
"---------------------------------------------------",
"-------------------------------"
IF regenera THEN
INSERT INTO cgtb00016 (ano,mes,estado_a,balance_ant,actividad,balance_act,programa,debito,credito)
VALUES (p_ano,p_mes,'275',t_balan_ant,t_actividad,t_balan_act,'cgprrp012.4rp',t_debito,t_credito)
END IF
SKIP TO TOP OF PAGE
LET t_debito = 0
@@ -610,8 +623,10 @@ REPORT mayor_anal_gral(x,fecha1,fecha2)
END IF
IF regenera THEN
INSERT INTO cgtb00016 (ano,mes,estado_m,balance_ant,actividad,balance_act,programa,debito,credito)
VALUES (p_ano,p_mes,'390',t_balan_ant,t_actividad,t_balan_act,'cgprrp013.4rp',t_debito,t_credito)
END IF
PRINT COLUMN 1, "---------------------------------------------------",