- 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).
247 lines
7.1 KiB
Plaintext
247 lines
7.1 KiB
Plaintext
{
|
|
-------------------------------------------------------------------------------
|
|
PROGRAMA : INPRRP032
|
|
OBJETIVO : MAESTRA DE COSTOS
|
|
PROGRAMADOR : JUAN F. SOTO
|
|
FECHA REALIZACION : MARZO 17, 1995
|
|
-------------------------------------------------------------------------------
|
|
}
|
|
GLOBALS "inprgb000.4gl"
|
|
DEFINE p_ano CHAR(4)
|
|
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL ARG_VAL(1) RETURNING usuarios
|
|
CALL ARG_VAL(2) RETURNING clave
|
|
CALL ARG_VAL(3) RETURNING impresor
|
|
|
|
SELECT * INTO p_companias.* FROM companias
|
|
CALL inprrp032()
|
|
END MAIN
|
|
|
|
|
|
FUNCTION inprrp032()
|
|
|
|
DEFINE productos RECORD
|
|
mes_ini LIKE intb00013.mes_ini,
|
|
mes_fin LIKE intb00013.mes_fin,
|
|
cod_n LIKE intb00013.cod_n,
|
|
cod_grupo LIKE intb00013.cod_grupo,
|
|
cod_tipo LIKE intb00013.cod_tipo,
|
|
cod_sec LIKE intb00013.cod_sec,
|
|
descrip_esp LIKE intb00001.descrip_esp,
|
|
unidad_med LIKE intb00001.unidad_med,
|
|
costo_st LIKE intb00013.costo_st
|
|
END RECORD
|
|
|
|
OPTIONS
|
|
FORM LINE 8,
|
|
ERROR LINE 23,
|
|
COMMENT LINE 21
|
|
|
|
CLEAR SCREEN
|
|
|
|
OPEN FORM infmrp032 FROM "infmrp032"
|
|
DISPLAY FORM infmrp032
|
|
CALL pantalla()
|
|
DISPLAY "inprrp032" AT 4,3
|
|
DISPLAY "Maestra de Costos" AT 6,31
|
|
|
|
LET tipo_papel = 1
|
|
CALL msgrp000(tipo_papel)
|
|
|
|
LABEL otra:
|
|
INPUT BY NAME p_ano
|
|
SELECT COUNT(*) FROM intb00013 where ano = p_ano
|
|
IF status = notfound THEN
|
|
LET numero_msg = 12
|
|
CALL msg(numero_msg)
|
|
GOTO otra
|
|
END IF
|
|
|
|
CONSTRUCT criterio ON a.mes_ini,a.mes_fin,a.cod_n,
|
|
a.cod_grupo,
|
|
a.cod_tipo,a.cod_sec
|
|
FROM mes_ini,mes_fin,cod_n,cod_grupo,cod_tipo,
|
|
cod_sec
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
RETURN
|
|
END IF
|
|
|
|
LET SELEC = "SELECT a.mes_ini,a.mes_fin,a.cod_n,a.cod_grupo,",
|
|
"a.cod_tipo, ",
|
|
" a.cod_sec,b.descrip_esp,b.unidad_med,a.costo_st ",
|
|
" FROM intb00001 b, intb00013 a ",
|
|
" WHERE ",
|
|
criterio clipped,
|
|
" and a.cod_n = b.cod_n AND ",
|
|
"a.cod_grupo = b.cod_grupo AND ",
|
|
"a.cod_tipo = b.cod_tipo AND ",
|
|
"a.cod_sec = b.cod_sec AND ",
|
|
"a.ano = ? and ",
|
|
"a.status_t is NULL ",
|
|
" ORDER BY 3,4,5,6"
|
|
|
|
LET SELEC1 = "SELECT COUNT(*) ",
|
|
" FROM intb00001 b, intb00013 a ",
|
|
" WHERE ",
|
|
criterio clipped,
|
|
" and a.cod_n = b.cod_n AND ",
|
|
"a.cod_grupo = b.cod_grupo AND ",
|
|
"a.cod_tipo = b.cod_tipo AND ",
|
|
"a.cod_sec = b.cod_sec AND ",
|
|
"a.ano = ? and ",
|
|
"a.status_t is NULL "
|
|
|
|
PREPARE comando30 FROM selec1
|
|
DECLARE busca1 CURSOR FOR comando30
|
|
OPEN busca1 USING p_ano
|
|
|
|
FETCH busca1 INTO regi
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
RETURN
|
|
END IF
|
|
|
|
DISPLAY "Buscando Informacion ... Espere Por Favor" AT 17,14
|
|
ATTRIBUTE (REVERSE,BOLD)
|
|
|
|
PREPARE busca FROM selec
|
|
|
|
CALL integridad()
|
|
IF bandera = 1 THEN
|
|
LET bandera = 0
|
|
RETURN
|
|
END IF
|
|
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
LET int_flag = FALSE
|
|
RETURN
|
|
END IF
|
|
|
|
DECLARE accion CURSOR FOR busca
|
|
OPEN accion USING p_ano
|
|
|
|
DISPLAY " " AT 17,14
|
|
DISPLAY "<< Reporte Generandose ... Por Favor Espere. >>"
|
|
AT 17,14 ATTRIBUTE (REVERSE)
|
|
|
|
START REPORT costeo TO "C:\\archivo"
|
|
LET p_param = "S"
|
|
WHILE status != notfound
|
|
|
|
FETCH accion INTO productos.*
|
|
IF status = NOTFOUND THEN
|
|
EXIT WHILE
|
|
END IF
|
|
|
|
CALL termometro(regi,p_param)
|
|
LET p_param = "N"
|
|
OUTPUT TO REPORT costeo(productos.*)
|
|
|
|
END WHILE
|
|
FINISH REPORT costeo
|
|
|
|
CLEAR SCREEN
|
|
|
|
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
|
|
|
REPORT costeo(x)
|
|
DEFINE x RECORD
|
|
mes_ini LIKE intb00013.mes_ini,
|
|
mes_fin LIKE intb00013.mes_fin,
|
|
cod_n LIKE intb00013.cod_n,
|
|
cod_grupo LIKE intb00013.cod_grupo,
|
|
cod_tipo LIKE intb00013.cod_tipo,
|
|
cod_sec LIKE intb00013.cod_sec,
|
|
descrip_esp LIKE intb00001.descrip_esp,
|
|
unidad_med LIKE intb00001.unidad_med,
|
|
costo_st LIKE intb00013.costo_st
|
|
END RECORD
|
|
|
|
DEFINE tipo1 CHAR(21)
|
|
DEFINE descrip2,descrip1 CHAR(10)
|
|
DEFINE total DECIMAL(11,4)
|
|
DEFINE doble_on CHAR(2)
|
|
DEFINE doble_off CHAR(2)
|
|
DEFINE negrillas_on CHAR(6)
|
|
DEFINE negrillas_off CHAR(6)
|
|
DEFINE comp_on CHAR(3)
|
|
DEFINE comp_off CHAR(3)
|
|
DEFINE doce CHAR(3)
|
|
DEFINE hora CHAR(5)
|
|
|
|
OUTPUT
|
|
TOP MARGIN 0
|
|
LEFT MARGIN 0
|
|
BOTTOM MARGIN 4
|
|
|
|
FORMAT
|
|
PAGE HEADER
|
|
|
|
LET doble_on = ASCII 14
|
|
LET doble_off = ASCII 20
|
|
LET negrillas_on = ASCII 27, ASCII 69
|
|
LET negrillas_off = ASCII 27, ASCII 70
|
|
LET comp_on = ASCII 15
|
|
LET comp_off = ASCII 18
|
|
LET doce = ASCII 27, ASCII 77
|
|
LET hora = time
|
|
|
|
LET lj = (80 - LENGTH(p_companias.nombre CLIPPED))/2
|
|
PRINT COLUMN 3, comp_off,negrillas_on
|
|
PRINT COLUMN 2, "inprrp032",
|
|
COLUMN lj, p_companias.nombre CLIPPED,
|
|
COLUMN 73, "Pag. ",pageno using "###"
|
|
PRINT COLUMN 17, " Sistema de Inventario de Materia Prima",
|
|
COLUMN 73, today using "dd/mm/yyyy"
|
|
PRINT COLUMN 17, " Maestra de Costos",
|
|
COLUMN 76, hora
|
|
|
|
SELECT UNIQUE descrip INTO descrip1 FROM mestable
|
|
WHERE mes = x.mes_ini
|
|
|
|
IF status = notfound THEN
|
|
LET status = 0
|
|
END IF
|
|
|
|
SELECT UNIQUE descrip INTO descrip2 FROM mestable
|
|
WHERE mes = x.mes_fin
|
|
|
|
IF status = notfound THEN
|
|
LET status = 0
|
|
END IF
|
|
|
|
SKIP 1 LINE
|
|
PRINT COLUMN 2, "Periodo: ", negrillas_off, descrip1 clipped, " A ",
|
|
descrip2,"/",p_ano
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"------------------------------"
|
|
|
|
PRINT COLUMN 73, "Costo"
|
|
PRINT COLUMN 2, "Codigo",
|
|
COLUMN 30, "Descripcion",
|
|
COLUMN 73, "Standard"
|
|
|
|
PRINT COLUMN 1, "--------------------------------------------------",
|
|
"------------------------------"
|
|
PRINT COLUMN 3, negrillas_off
|
|
ON EVERY ROW
|
|
|
|
PRINT COLUMN 2, x.cod_n USING "&","-",x.cod_grupo USING "&","-",
|
|
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&",
|
|
COLUMN 30, x.descrip_esp," ",x.unidad_med,
|
|
COLUMN 69, x.costo_st using "###,###.####"
|
|
|
|
END REPORT
|
|
|