- 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).
116 lines
3.2 KiB
Plaintext
116 lines
3.2 KiB
Plaintext
{
|
|
==========================================================================
|
|
PROGRAMA : INPRMT009
|
|
OBJETIVO : CERRAR INVENTARIO MATERIA PRIMA
|
|
REALIZADO POR : JUAN F. SOTO
|
|
FECHA : DICIEMBRE 1, 1994.
|
|
==========================================================================
|
|
}
|
|
GLOBALS "inprgb000.4gl"
|
|
DEFINE trx RECORD LIKE intb00006.*
|
|
DEFINE p_fecha1,p_fecha2 DATE,
|
|
cantidad DECIMAL(12,2),
|
|
opt4,opt1 CHAR(1),
|
|
p_ano SMALLINT,
|
|
err_val INTEGER
|
|
|
|
DEFINE datos2 RECORD
|
|
cod_n SMALLINT,
|
|
cod_grupo SMALLINT,
|
|
cod_tipo SMALLINT,
|
|
cod_sec SMALLINT,
|
|
cantidad DECIMAL(12,2)
|
|
END RECORD
|
|
|
|
|
|
MAIN
|
|
CALL cierra()
|
|
END MAIN
|
|
FUNCTION cierra()
|
|
|
|
OPTIONS
|
|
PROMPT LINE 12,
|
|
ERROR LINE 24
|
|
LET lj = (80 - LENGTH(p_companias.nombre CLIPPED))/2
|
|
DISPLAY p_companias.nombre CLIPPED AT 1,lj
|
|
DISPLAY "Cierre de Transacciones Materia Prima" AT 2,21
|
|
|
|
PROMPT "Entre Ano A Cerrar? " FOR p_ano
|
|
DISPLAY "ANO A PROCESAR ES EL ",p_ano using "####" AT 11,30
|
|
ATTRIBUTE (BOLD,BLINK)
|
|
PROMPT "Esta seguro de proceder (S/N)? " FOR opt1
|
|
LET opt1 = upshift(opt1)
|
|
IF opt1 != "S" THEN
|
|
RETURN
|
|
END IF
|
|
|
|
SELECT fecha_inicio INTO p_fecha1
|
|
FROM prdtable
|
|
WHERE mes = 1 and ano = p_ano
|
|
|
|
SELECT fecha_corte INTO p_fecha2
|
|
FROM prdtable
|
|
WHERE mes = 12 and ano = p_ano
|
|
|
|
DISPLAY "En Proceso... Espere Por Favor" AT 23,1 ATTRIBUTE (BOLD)
|
|
SELECT unique cod_n FROM intb00010
|
|
WHERE fecha between p_fecha1 and p_fecha2
|
|
IF status != notfound THEN
|
|
ERROR "HAY TRANSACCIONES EN EL HISTORICO CON ESTOS PARAMETROS"
|
|
sleep 2
|
|
RETURN
|
|
END IF
|
|
DISPLAY "HACIENDO BACKUP DE LAS TABLAS... ESPERE" AT 11,1
|
|
|
|
# Copia A Disco de Las Informaciones
|
|
UNLOAD TO "intb00002.ld" SELECT *FROM intb00002
|
|
UNLOAD TO "intb00006.ld" SELECT *FROM intb00006
|
|
|
|
RUN "dbschema -t intb00002 -d rayovac in2.sql"
|
|
RUN "dbschema -t intb00006 -d rayovac in6.sql"
|
|
|
|
DISPLAY "El Formato de copia se hara en CPIO " AT 10,1
|
|
DISPLAY "Introduzca Diskett 3 1/2 en Unidad" AT 11,1
|
|
LABEL vuelve:
|
|
PROMPT "Presione <ENTER> Cuando Este Listo" FOR opt4
|
|
RUN "cpio -ocvB intb*.ld in2.sql in6.sql > /dev/rdsk/f0t" RETURNING err_val
|
|
IF err_val = 256 THEN
|
|
ERROR "UNIDAD NO ESTA LISTA"
|
|
SLEEP 3
|
|
GOTO vuelve
|
|
END IF
|
|
DISPLAY err_val AT 13,1
|
|
|
|
# Introduce la maestra en la tabla historica de la maestra
|
|
DISPLAY "ESTOY ACTUALIZANDO LA TABLA HISTORICA DE LA MAESTRA" AT 14,1
|
|
INSERT INTO intb00025 SELECT * FROM intb00002
|
|
|
|
DISPLAY "ESTOY ACTUALIZANDO LA TABLA HISTORICA DE TRANSACCIONES" AT 14,1
|
|
# Introduce Informacion al Historico
|
|
DECLARE ins_cur CURSOR FOR
|
|
SELECT * FROM intb00006
|
|
WHERE fecha <= p_fecha2
|
|
|
|
FOREACH ins_cur INTO trx.*
|
|
INSERT INTO intb00010 VALUES (trx.*)
|
|
END FOREACH
|
|
|
|
# Borra las Informacion de la tabla de transacciones
|
|
DELETE FROM intb00006 WHERE fecha <= p_fecha2
|
|
|
|
DECLARE busca CURSOR FOR
|
|
SELECT cod_n,cod_grupo,cod_tipo,cod_Sec,sum(cantidad_2)
|
|
FROM intb00010
|
|
WHERE fecha <= p_fecha2 and status_t is null
|
|
GROUP BY 1,2,3,4
|
|
|
|
FOREACH busca INTO datos2.*
|
|
|
|
INSERT INTO intb00006(num_doc,fecha,cod_mov,cod_n,cod_grupo,cod_tipo,cod_sec,
|
|
cantidad_2,us_crea,fech_crea)
|
|
VALUES (1,p_fecha2,99,datos2.cod_n,datos2.cod_grupo,datos2.cod_tipo,datos2.cod_sec,
|
|
datos2.cantidad,user,current)
|
|
|
|
END FOREACH
|
|
END FUNCTION
|