Reorganiza MATERIA PRIMA a PROYECTO y avanza inprmt002/005/013/046
- Mueve todo el contenido de PROYECTOS/indir y varias funciones compartidas de PROYECTOS/otrodir hacia PROYECTO, siguiendo instruccion de Johnny (PROYECTOS se va a eliminar). - inprmt002: agrega campo Desglose faltante, corrige typo "eLiminar". - inprmt005: agrega formulario y 3 campos faltantes (Consumo, Requiere Autorizacion, Requisiciones), corrige typo "eLiminar". - inprmt013: agrega formulario, titulo, corrige typo "eLiminar". - inprmt046: agrega formulario y varias funciones/dependencias faltantes (cincodmov, clasf_bloque, medidas, defecto, buscaEmp, consultaTransportista, busca_departamento); corrige nombres de campo desalineados con el codigo (depto_a, bodega) y los convierte a ComboBox donde el codigo lo requiere. - Corrige dependencia faltante de FORMULARIOS_IN a la libreria Database (bloqueaba todo el modulo de MATERIA PRIMA).
This commit is contained in:
@@ -0,0 +1,223 @@
|
||||
{
|
||||
-------------------------------------------------------------------------------
|
||||
PROGRAMA : INPRRP017
|
||||
OBJETIVO : Existencias CON DESGLOSES
|
||||
PROGRAMADOR : Ing. Juan Fco. Soto.
|
||||
FECHA REALIZACION : Noviembre 20, 2023
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS "inprgb000.4gl"
|
||||
DEFINE total_p DECIMAL (18,4),ptotal_c DEC(18,4),
|
||||
imp1 CHAR(3), total_c SMALLINT,
|
||||
titulo_bodega VARCHAR(100)
|
||||
|
||||
MAIN
|
||||
# WHENEVER ERROR CONTINUE
|
||||
DEFER INTERRUPT
|
||||
CALL ARG_VAL(1) RETURNING usuarios
|
||||
CALL ARG_VAL(2) RETURNING clave
|
||||
CALL ARG_VAL(3) RETURNING impresor
|
||||
CALL STARTLOG("inprrp17.log")
|
||||
CONNECT to "smarmotech" USER usuarios USING clave
|
||||
|
||||
SELECT * INTO p_companias.* FROM companias
|
||||
|
||||
CALL inprrp009()
|
||||
END MAIN
|
||||
|
||||
FUNCTION inprrp009()
|
||||
DEFINE mes CHAR(2)
|
||||
DEFINE idx_ant,idx_cos,idx_act SMALLINT
|
||||
DEFINE ano_act CHAR(4)
|
||||
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,
|
||||
existe_act DECIMAL(10,2),
|
||||
costo LIKE intb00013.costo_st
|
||||
END RECORD
|
||||
|
||||
|
||||
# WHENEVER ERROR CONTINUE
|
||||
|
||||
OPTIONS
|
||||
FORM LINE 8,
|
||||
ERROR LINE 23,
|
||||
COMMENT LINE 21
|
||||
|
||||
OPEN FORM infmrp017 FROM "infmrp017"
|
||||
DISPLAY FORM infmrp017
|
||||
|
||||
INPUT BY NAME datos_cons.fech_fi,datos_cons.bodega
|
||||
BEFORE INPUT
|
||||
LET datos_cons.bodega =1
|
||||
CALL bodegas('1')
|
||||
|
||||
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
|
||||
IF datos_cons.bodega IS NULL OR datos_cons.bodega =0 THEN
|
||||
CALL msg(16)
|
||||
NEXT FIELD bodega
|
||||
END IF
|
||||
LET ano_act = year(datos_cons.fech_fi)
|
||||
LET titulo_bodega = ui.ComboBox.forName('formonly.bodega').getTextOf(datos_cons.bodega)
|
||||
END INPUT
|
||||
|
||||
CONSTRUCT criterio ON b.cod_n,b.cod_grupo, b.cod_tipo,b.cod_sec
|
||||
FROM cod_n,cod_grupo,cod_tipo,cod_sec
|
||||
|
||||
|
||||
LET selec =
|
||||
"SELECT b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec,d.descrip_esp,d.unidad_med, ",
|
||||
" sum(c.medida1) ",
|
||||
"FROM intb00002 b,intb00018 c,intb00001 d ",
|
||||
"WHERE ",
|
||||
" b.cod_tipo = a.cod_tipo and b.cod_sec = a.cod_sec and ",
|
||||
" b.cod_n = c.cod_n and b.cod_grupo = c.cod_grupo and b.cod_tipo = c.cod_tipo and b.cod_sec = c.cod_sec ",
|
||||
" and b.cod_n = d.cod_n and b.cod_grupo = d.cod_grupo and b.cod_tipo = d.cod_tipo and b.cod_sec = d.cod_sec ",
|
||||
" and c.status_t is null and c.fecha <='",datos_cons.fech_fi USING "mm/dd/yyyy","' ",
|
||||
" and c.bodega = ",datos_cons.bodega,
|
||||
" and b.status_t is null AND ",criterio CLIPPED,
|
||||
" GROUP BY b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec, ",
|
||||
" d.descrip_esp,d.unidad_med ORDER BY b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec "
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CALL selectOutput() RETURNING r_output
|
||||
CALL configureOutput(r_output) RETURNING HANDLER
|
||||
START REPORT irrp17 TO XML HANDLER HANDLER
|
||||
|
||||
|
||||
LET progreso = 10
|
||||
DISPLAY progreso to progreso
|
||||
CALL ui.Interface.refresh()
|
||||
|
||||
LET idx = 1
|
||||
PREPARE busca FROM selec
|
||||
DECLARE accion CURSOR FOR busca
|
||||
|
||||
|
||||
FOREACH accion INTO existe.*
|
||||
IF idx =1 THEN
|
||||
LET r_filename = "ipprrp017.4rp"
|
||||
iF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
|
||||
CALL selectOutput() RETURNING r_output
|
||||
CALL configureOutput(r_output) RETURNING HANDLER
|
||||
LET preview=1
|
||||
CALL fgl_report_selectDevice(r_output) -- changing default
|
||||
CALL fgl_report_selectPreview(preview) -- changing default
|
||||
LET handler = fgl_report_commitCurrentSettings() -- commit changes
|
||||
ELSE
|
||||
EXIT PROGRAM
|
||||
END IF
|
||||
|
||||
END IF
|
||||
OUTPUT TO REPORT irrp17(existe.*)
|
||||
|
||||
END FOREACH
|
||||
LET progreso = 100
|
||||
DISPLAY progreso to progreso
|
||||
CALL ui.Interface.refresh()
|
||||
|
||||
FINISH REPORT irrp17
|
||||
|
||||
END FUNCTION
|
||||
|
||||
REPORT irrp17(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,
|
||||
existe_act DECIMAL(10,2),
|
||||
costo LIKE intb00013.costo_st
|
||||
END RECORD,
|
||||
total_costo DEC(12,2)
|
||||
|
||||
DEFINE hora CHAR(5)
|
||||
OUTPUT
|
||||
TOP MARGIN 0
|
||||
LEFT MARGIN 0
|
||||
BOTTOM MARGIN 2
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
|
||||
PRINTX p_companias.nombre
|
||||
PRINT COLUMN 27, " Sistema de Inventario de Materia Prima",
|
||||
COLUMN 92, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 27, " Existencias a Diferentes Fechas",
|
||||
COLUMN 95, hora
|
||||
|
||||
SKIP 1 LINES
|
||||
PRINT COLUMN 1, "BODEGA: ",titulo_bodega
|
||||
PRINT COLUMN 1, "--------------------------------------------------",
|
||||
"--------------------------------------------------"
|
||||
|
||||
PRINT COLUMN 63, "Existencia",
|
||||
COLUMN 75, "Costo Std.",
|
||||
COLUMN 96, "Total"
|
||||
|
||||
PRINT COLUMN 1, "Codigo",
|
||||
COLUMN 12, "Descripcion",
|
||||
COLUMN 63, "Al ", datos_cons.fech_fi using "dd/mm/yyyy",
|
||||
COLUMN 75, "Al ",datos_cons.fech_fi using "dd/mm/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "--------------------------------------------------",
|
||||
"--------------------------------------------------"
|
||||
|
||||
SKIP 1 LINE
|
||||
|
||||
ON EVERY ROW
|
||||
IF total_p is null THEN
|
||||
LET total_p = 0
|
||||
END IF
|
||||
LET total_costo = 0
|
||||
LET total_costo = x.existe_act * x.costo
|
||||
|
||||
LET total_p = total_costo + total_p
|
||||
PRINT COLUMN 1, x.cod_n USING "&","-", x.cod_grupo USING "&","-",
|
||||
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&",
|
||||
COLUMN 12, x.descrip_esp CLIPPED,
|
||||
COLUMN 42, x.unidad_med,
|
||||
COLUMN 60, x.existe_act USING "---,---,---.##",
|
||||
COLUMN 75, x.costo USING "###,###.####",
|
||||
COLUMN 88, total_costo USING "---,---,-##.####"
|
||||
|
||||
ON LAST ROW
|
||||
LET ptotal_c = SUM(x.existe_act)
|
||||
PRINT COLUMN 60, "------------",
|
||||
COLUMN 88, "-------------"
|
||||
PRINT COLUMN 60, ptotal_c USING "----,---,---.##",
|
||||
COLUMN 88, total_p USING "###,###,###.##"
|
||||
|
||||
|
||||
SKIP 2 LINES
|
||||
PRINT COLUMN 1, "==================================================",
|
||||
"=================================================="
|
||||
|
||||
PRINT COLUMN 4, "Total Registros Impresos =", count(*) USING "<<<<"
|
||||
PRINT COLUMN 4, ASCII 27, ASCII 80
|
||||
END REPORT
|
||||
Reference in New Issue
Block a user