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
+263
View File
@@ -0,0 +1,263 @@
{
-------------------------------------------------------------------------------
PROGRAMA : IRPRRP005
OBJETIVO : REPORTE EXISTENCIAS
PROGRAMADOR : Ing. Juan Fco. Soto.
FECHA REALIZACION : Marzo 1, 1993.
Modificado por : Johnny Soto
Fecha Modificacion : 22 Enero 1995
-------------------------------------------------------------------------------
}
GLOBALS "irprgb000.4gl"
DEFINE ano_c CHAR(4),
p_mes INTEGER,
nomb1 CHAR(12),
t_existe,t_valor DECIMAL(12,2),
opt5 CHAR(1)
MAIN
DEFER INTERRUPT
CALL arg_val(1) RETURNING usuarios
CALL arg_val(2) RETURNING Clave
CALL arg_val(3) RETURNING impresor
CONNECT TO "smarmotech" USER usuarios USING clave
SELECT * INTO p_companias.* FROM companias
CALL irprrp005()
END MAIN
FUNCTION irprrp005()
DEFINE mes CHAR(2)
DEFINE idx_ant,idx_cos,idx_act SMALLINT
DEFINE salir,primera CHAR(1)
DEFINE balance_in DECIMAL(12,2)
DEFINE existe RECORD
cod_n LIKE intb00001.cod_n,
cod_grupo LIKE intb00001.cod_grupo,
cod_tipo LIKE intb00001.cod_tipo,
cod_sec LIKE intb00001.cod_sec,
descrip_esp LIKE intb00001.descrip_esp,
unidad_med LIKE intb00001.unidad_med,
codigo LIKE irtb00010.codigo,
nombre LIKE irtb00010.nombre,
existe_act DECIMAL(10,2),
costo LIKE intb00013.costo_st
END RECORD
DEFINE select_cost,select_act,select_ant CHAR(1000)
OPTIONS
FORM LINE 8,
ERROR LINE 23,
COMMENT LINE 21
OPEN FORM infmrp005 FROM "irfmrp005"
DISPLAY FORM infmrp005
INPUT BY NAME datos_cons.fech_fi
AFTER FIELD fech_fi
IF datos_cons.fech_fi IS NULL THEN
LET numero_msg = 16
CALL msg(numero_msg)
NEXT FIELD fech_fi
END IF
AFTER INPUT
IF int_flag THEN
LET numero_msg = 2
CALL msg(numero_msg)
LET int_flag = false
RETURN
END IF
EXIT INPUT
END INPUT
CONSTRUCT criterio ON d.cod_n,d.cod_grupo,d.cod_tipo,d.cod_sec
FROM cod_n,cod_grupo,cod_tipo,cod_sec
LET select_cost =
"SELECT d.cod_n,d.cod_grupo,d.cod_tipo,d.cod_sec,d.descrip_esp, ",
" d.unidad_med,a.codigo,a.nombre ",
"FROM irtb00002 d,irtb00010 a ",
"WHERE ",criterio CLIPPED," AND d.status_t is null ",
" AND d.cod_tipo = a.codigo ",
" ORDER BY a.codigo,d.cod_n,d.cod_grupo,d.cod_tipo,d.cod_Sec "
DISPLAY "<< Estoy Buscando Los Costos Actuales >>"
AT 17,14 ATTRIBUTE (REVERSE,BOLD)
CALL seleccionarsalida() RETURNING r_output
LET handler = configureOutput(r_output)
START REPORT reporte_5 TO XML HANDLER handler
PREPARE busca_costo FROM select_cost
DECLARE material_costo SCROLL CURSOR FOR busca_costo
OPEN material_costo
FOREACH material_costo INTO existe.*
LET existe.existe_act = 0
LET existe.costo = 0
IF int_flag THEN
LET numero_msg = 2
CALL msg(numero_msg)
LET int_flag = FALSE
RETURN
END IF
LET p_param = "N"
LET ano_c = YEAR(datos_cons.fech_fi)
SELECT MAX(a.mes_fin) INTO p_mes
FROM irtb00013 a
WHERE (a.cod_n = existe.cod_n and a.cod_grupo = existe.cod_grupo and
a.cod_tipo = existe.cod_tipo and a.cod_sec = existe.cod_sec) and
(a.ano = ano_c) and a.status_t is null
SELECT a.costo_st INTO existe.costo FROM irtb00013 a
WHERE (a.cod_n = existe.cod_n and a.cod_grupo = existe.cod_grupo and
a.cod_tipo = existe.cod_tipo and a.cod_sec = existe.cod_sec) and
(a.ano = ano_c and a.mes_fin = p_mes) and a.status_t is null
IF existe.costo IS NULL THEN
LET existe.costo = 0
END IF
SELECT SUM(a.cantidad_2) INTO existe.existe_act
FROM irtb00006 a
WHERE a.cod_n = existe.cod_n and a.cod_grupo = existe.cod_grupo and
a.cod_tipo = existe.cod_tipo and a.cod_sec = existe.cod_sec and
a.fecha <= datos_cons.fech_fi and a.status_t is null
IF existe.existe_act IS NULL THEN
LET existe.existe_act = 0
END IF
OUTPUT TO REPORT reporte_5(existe.*)
END FOREACH
FINISH REPORT reporte_5
END FUNCTION
REPORT reporte_5(x)
DEFINE x RECORD
cod_n LIKE intb00001.cod_n,
cod_grupo LIKE intb00001.cod_grupo,
cod_tipo LIKE intb00001.cod_tipo,
cod_sec LIKE intb00001.cod_sec,
descrip_esp LIKE intb00001.descrip_esp,
unidad_med LIKE intb00001.unidad_med,
codigo LIKE irtb00010.codigo,
nombre LIKE irtb00010.nombre,
existe_act DECIMAL(10,2),
costo LIKE intb00013.costo_st
END RECORD,
no_reg SMALLINT
DEFINE total_c,total_p DECIMAL (12,2)
DEFINE doble_on CHAR(2)
DEFINE doble_off CHAR(2)
DEFINE negrillas_on CHAR(2)
DEFINE negrillas_off CHAR(2)
DEFINE comp_on CHAR(3)
DEFINE comp_off CHAR(2)
DEFINE doce CHAR(3)
DEFINE hora CHAR(5)
OUTPUT
TOP MARGIN 0
LEFT MARGIN 0
BOTTOM MARGIN 2
PAGE LENGTH 150
FORMAT
PAGE HEADER
LET hora = time
PRINT COLUMN 1, doce
PRINT COLUMN 1, "irprrp005",
COLUMN 24, " M A R M O T E C H S. A.",
COLUMN 89, "Pag. ",pageno using "###"
PRINT COLUMN 1,
COLUMN 24, " Sistema de Inventario de Repuestos",
COLUMN 89, today using "dd/mm/yyyy"
PRINT COLUMN 24, " Valorizacion Inventario Al ",datos_cons.fech_fi
USING "dd/mm/yyyy",
COLUMN 92, hora
SKIP 1 LINES
PRINT COLUMN 1, "--------------------------------------------------",
"--------------------------------------------------",
"----------------------------------------"
PRINT COLUMN 96, "Costo"
PRINT COLUMN 1, "Codigo",
COLUMN 12, "Descripcion",
COLUMN 82, "Existencia",
COLUMN 96, "Standard",
COLUMN 115, "Total"
PRINT COLUMN 1, "--------------------------------------------------",
"--------------------------------------------------",
"----------------------------------------"
IF t_existe is null THEN
LET t_existe = 0
END IF
IF t_valor is null THEN
LET t_valor = 0
END IF
SKIP 1 LINE
BEFORE GROUP OF x.codigo
SKIP 1 LINE
PRINT negrillas_on, x.nombre,negrillas_off
SKIP 1 LINE
ON EVERY ROW
IF x.existe_act <> 0 THEN
IF no_reg is null THEN
LET no_reg = 0
END IF
PRINT COLUMN 1, x.cod_n USING "&","-",x.cod_grupo USING "&&&","-",
x.cod_tipo USING "&&&","-",x.cod_sec USING "&&&&&&",
" ",x.descrip_esp WORDWRAP RIGHT MARGIN 70 , ' ', x.unidad_med CLIPPED,
COLUMN 79, x.existe_act USING "---,---,---.##",
COLUMN 94, x.costo USING "#,###,###.####",
COLUMN 109, x.existe_act * x.costo USING "---,---,---.##"
LET no_reg = no_reg + 1
LET t_existe = t_existe + x.existe_act
END IF
ON LAST ROW
LET t_valor = SUM(x.existe_act * x.costo)
PRINT COLUMN 109, "--------------"
PRINT COLUMN 109, t_valor USING "(((,(((,(##.##)"
PRINT COLUMN 1, "==================================================",
"==================================================",
"========="
PRINT COLUMN 4, "Total Registros Impresos =", no_reg USING "<<<<"
PRINT COLUMN 1, "==================================================",
"==================================================",
"========="
PRINT COLUMN 4, comp_off
END REPORT