182 lines
5.8 KiB
Plaintext
182 lines
5.8 KiB
Plaintext
{
|
|
---------------------------------------------------------------------------
|
|
PROGRAMA : CTMNMT000
|
|
OBJETIVO : Menu de Mantenimientos del Sistema de Costos.
|
|
PROGRAMADOR : Juan Fco. Soto (Johnny)
|
|
FECHA REALIZACION : Junio 14, 1993.
|
|
---------------------------------------------------------------------------
|
|
}
|
|
GLOBALS
|
|
"ctprgb000.4gl"
|
|
|
|
MAIN
|
|
DEFER INTERRUPT
|
|
CALL ctmnmt000()
|
|
END MAIN
|
|
|
|
FUNCTION ctmnmt000()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
END FUNCTION
|
|
|
|
FUNCTION opciones_ctmnmt000()
|
|
DEFINE p_user CHAR(9)
|
|
DEFINE luz CHAR(5)
|
|
DEFINE opt CHAR(2),
|
|
fechaact DATE
|
|
|
|
OPTIONS
|
|
PROMPT LINE 8,
|
|
ERROR LINE 24
|
|
|
|
CALL pantalla()
|
|
|
|
DISPLAY "Mantenimientos" AT 6,33
|
|
DISPLAY "ctmnmt000" AT 4,3 ATTRIBUTE(blue)
|
|
DISPLAY "1-Catalogo Semi-elaborados ctprmt001" AT 10,1
|
|
DISPLAY "2-Ctas Material,Labor y Gastos ctfmmt025" AT 11,1
|
|
DISPLAY "3-Unidades de Medidas ctprmt007" AT 12,1
|
|
DISPLAY "4-Costos de Liquidacion ctprmt009" AT 13,1
|
|
DISPLAY "5-Inventario Semi Elaborado ctprmt012" AT 14,1
|
|
DISPLAY "6-Dias de Produccion ctprmt013" AT 15,1
|
|
DISPLAY "7-Inv. Prod. en Proc. ctprmt014" AT 16,1
|
|
DISPLAY "8-Rel. Prod/Semi-Elab ctprrp019" AT 17,1
|
|
|
|
DISPLAY "9-Costo St. Semi-Elab ctprmt022" AT 10,42
|
|
DISPLAY "10-Costo Ptos. En Proc ctprmt024" AT 11,42
|
|
DISPLAY "11-Hist. Variacion Consumo ctfmmt015" AT 12,42
|
|
DISPLAY "12-Estructura de Costo ctprmt010" AT 13,42
|
|
DISPLAY "13-Produccion Diaria ctprmt003" AT 14,42
|
|
DISPLAY "14-Periodo de Semanas ctprmt030" AT 15,42
|
|
DISPLAY "15-Actualizacion Costos Prod ctmnmt" AT 16,42
|
|
DISPLAY "S- Retorna Menu Anterior" AT 22,28
|
|
ATTRIBUTE(BOLD)
|
|
|
|
|
|
#DISPLAY "9-Factor Semi-elab. ctprmt017" AT 18,1
|
|
#DISPLAY "10-Costo Standard ctprmt018" AT 10,42
|
|
#DISPLAY "14-Costo Real Acumul. ctprmt025" AT 14,42
|
|
#DISPLAY "15-Cost. Real Mensual ctprmt026" AT 15,42
|
|
#DISPLAY "16-Cost. Real Semi-Pro ctprmt011" AT 16,42
|
|
#DISPLAY "17-Costo Standard Mant. Rep ctprmt027" AT 17,42
|
|
|
|
|
|
LABEL vuelve:
|
|
PROMPT "OPCION: " attribute(blue) FOR OPT
|
|
LET opt = UPSHIFT(opt) clipped
|
|
|
|
IF opt != "S" THEN
|
|
SELECT unique usuario INTO p_user FROM seg0001
|
|
WHERE usuario = user
|
|
CALL seg000(p_user,opt,"ctmnmt000") RETURNING luz
|
|
IF luz = "roja" THEN
|
|
ERROR "NO TIENE PERMISO PARA UTILIZAR OPCION"
|
|
GOTO vuelve
|
|
END IF
|
|
END IF
|
|
|
|
CASE
|
|
WHEN OPT = "1"
|
|
CALL ctprmt001()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "2"
|
|
run "isql -s -fr ctfmmt025"
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "3"
|
|
CALL ctprmt007()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "4"
|
|
CALL ctprmt009()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "5"
|
|
CALL ctprmt012()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "6"
|
|
CALL ctprmt013()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "7"
|
|
CALL ctprmt014()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "8"
|
|
CALL ctprmt019()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "9"
|
|
CALL ctprmt022()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "10"
|
|
CALL ctprmt024()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "11"
|
|
RUN "isql -fr ctfmmt000"
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "12"
|
|
CALL ctprmt010()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "13"
|
|
CALL ctprmt003()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "14"
|
|
CALL ctprmt030()
|
|
CLEAR SCREEN
|
|
CALL opciones_ctmnmt000()
|
|
WHEN OPT = "15"
|
|
OPEN WINDOW act AT 10,5 WITH FORM "ctfmact"
|
|
INPUT BY NAME fechaact
|
|
IF int_flag THEN
|
|
LET numero_msg = 2
|
|
CALL msg(numero_msg)
|
|
CLOSE WINDOW act
|
|
ELSE
|
|
update cttb00003 set costo_lab = (select AVG(costo_lab) from cttb00034 where cttb00003.cod_prod = cttb00034.cod_prod and fecha >= "01012008" and status_t is null),
|
|
costo_gasto = (select avg(costo_ga) from cttb00034 where cttb00003.cod_prod = cttb00034.cod_prod and fecha >= "01012008" and status_t is null)
|
|
where fecha >= fechaact
|
|
END IF
|
|
CLOSE WINDOW act
|
|
WHEN OPT = "S" or OPT = "s"
|
|
RETURN
|
|
OTHERWISE
|
|
CALL opciones_ctmnmt000()
|
|
END CASE
|
|
END FUNCTION
|
|
|
|
FUNCTION pantalla()
|
|
DEFINE fecha CHAR(8),
|
|
hora char(5)
|
|
SELECT * INTO p_compania.*
|
|
FROM companias
|
|
LET l = (80 - LENGTH(p_compania.nombre CLIPPED)) / 2
|
|
LET fecha = today USING "dd/mm/yy"
|
|
LET hora = time
|
|
DISPLAY p_compania.nombre CLIPPED AT 4,l
|
|
ATTRIBUTE (REVERSE,blue)
|
|
DISPLAY fecha AT 4,70 ATTRIBUTE (blue)
|
|
DISPLAY "Sistema de Costos" AT 5,31
|
|
DISPLAY hora AT 6,73 ATTRIBUTE(blue)
|
|
|
|
CALL fgl_drawbox(5,79,3,1)
|
|
CALL fgl_drawbox(1,79,22,1)
|
|
END FUNCTION
|
|
|
|
FUNCTION integridad()
|
|
IF sqlca.sqlcode < 0 THEN
|
|
LET numero_msg = sqlca.sqlcode
|
|
CALL msg(numero_msg)
|
|
DISPLAY numero_msg AT 23,70
|
|
LET bandera = 1
|
|
SLEEP 2
|
|
RETURN
|
|
END IF
|
|
END FUNCTION
|