-- F1 es el módulo equivalente a FCO, porque el campo es de 2
delete from aut_operaciones where operacion like 'FCO%';
COMMIT;
delete from rel_oper_menus where ejecuta_operacion like 'FCO%'; 
delete from rel_oper_menus where modulo = 'F1';
COMMIT;
delete from rel_oper_modulos where operacion like 'FCO%';
delete from operaciones where operacion like 'FCO%';
delete from menus where modulo = 'F1'; 
delete modulos where modulo = 'F1';
COMMIT;

--insertando el nuevo modulo
insert into modulos (modulo, descripcion, instalado, version, release, modificacion, etiqueta, exe) 
values ('F1', 'Fiscal de Colombia', 0, 3, 1, 0, 'Fiscal Colombia - por Data Tecnologia', 'FCO');

commit;

insert into menus (modulo, menu, descripcion, icono, ruta) values ('F1', 0, 'Menú Principal', 7, NULL);
insert into menus (modulo, menu, descripcion, icono, ruta) values ('F1', 10, 'Parámetros y Archivos', 1, NULL);
insert into menus (modulo, menu, descripcion, icono, ruta) values ('F1', 20, 'Administración y Registros', 2, NULL);
insert into menus (modulo, menu, descripcion, icono, ruta) values ('F1', 30, 'Procesos', 6, NULL);
insert into menus (modulo, menu, descripcion, icono, ruta) values ('F1', 40, 'Consultas', 3, NULL); 
insert into menus (modulo, menu, descripcion, icono, ruta) values ('F1', 50, 'Reportes y Archivos', 7, NULL);

commit;

insert into rel_oper_menus (modulo, menu, secuencia, tipo_llamada, ejecuta_menu) values ('F1',0, 1, 1, 10);
insert into rel_oper_menus (modulo, menu, secuencia, tipo_llamada, ejecuta_menu) values ('F1',0, 2, 1, 20);
insert into rel_oper_menus (modulo, menu, secuencia, tipo_llamada, ejecuta_menu) values ('F1',0, 3, 1, 30);
insert into rel_oper_menus (modulo, menu, secuencia, tipo_llamada, ejecuta_menu) values ('F1',0, 4, 1, 40); 
insert into rel_oper_menus (modulo, menu, secuencia, tipo_llamada, ejecuta_menu) values ('F1',0, 5, 1, 50);

COMMIT;

--operacion FCO1010 de Parametros del Fiscal
delete from rel_oper_menus where ejecuta_operacion = 'FCO1010';
delete from rel_oper_modulos where operacion = 'FCO1010';
delete from operaciones where operacion = 'FCO1010';
delete from aut_operaciones where operacion = 'FCO1010';

insert into operaciones  values ('FCO1010', 'Parámetros Fiscal de Colombia', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1010' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1010','F1');
insert into aut_operaciones values ('ADAM','FCO1010',4);
COMMIT;

--operacion FCO1020 Administradoras EPS
delete from rel_oper_menus where ejecuta_operacion = 'FCO1020';
delete from rel_oper_modulos where operacion = 'FCO1020';
delete from operaciones where operacion = 'FCO1020';
delete from aut_operaciones where operacion = 'FCO1020';

insert into operaciones  values ('FCO1020', 'Entidades Promotoras Salud', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1020' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1020','F1');
insert into aut_operaciones values ('ADAM','FCO1020',4);
COMMIT;

--operacion FCO1030 Administradoras AFP
delete from rel_oper_menus where ejecuta_operacion = 'FCO1030';
delete from rel_oper_modulos where operacion = 'FCO1030';
delete from operaciones where operacion = 'FCO1030';
delete from aut_operaciones where operacion = 'FCO1030';

insert into operaciones  values ('FCO1030', 'Administradoras de Fondos de Pensiones', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1030' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1030','F1');
insert into aut_operaciones values ('ADAM','FCO1030',4);
COMMIT;

--operacion FCO1035 Cajas de Compensación
delete from rel_oper_menus where ejecuta_operacion = 'FCO1035';
delete from rel_oper_modulos where operacion = 'FCO1035';
delete from operaciones where operacion = 'FCO1035';
delete from aut_operaciones where operacion = 'FCO1035';

insert into operaciones  values ('FCO1035', 'Cajas de Compensación Familiar', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1035' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1035','F1');
insert into aut_operaciones values ('ADAM','FCO1035',4);
COMMIT;

--operacion FCO1040 Sucursales de la compañia
delete from rel_oper_menus where ejecuta_operacion = 'FCO1040';
delete from rel_oper_modulos where operacion = 'FCO1040';
delete from operaciones where operacion = 'FCO1040';
delete from aut_operaciones where operacion = 'FCO1040';

insert into operaciones  values ('FCO1040', 'Sucursales de la compañia', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1040' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1040','F1');
insert into aut_operaciones values ('ADAM','FCO1040',4);
COMMIT;

--operacion FCO1045 Centros de Trabajo
delete from rel_oper_menus where ejecuta_operacion = 'FCO1045';
delete from rel_oper_modulos where operacion = 'FCO1045';
delete from operaciones where operacion = 'FCO1045';
delete from aut_operaciones where operacion = 'FCO1045';

insert into operaciones  values ('FCO1045', 'Centros de Trabajo', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1045' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1045','F1');
insert into aut_operaciones values ('ADAM','FCO1045',4);
COMMIT;

--operacion FCO1050 Definicion reporte de autoliquidacion
delete from rel_oper_menus where ejecuta_operacion = 'FCO1050';
delete from rel_oper_modulos where operacion = 'FCO1050';
delete from operaciones where operacion = 'FCO1050';
delete from aut_operaciones where operacion = 'FCO1050';

insert into operaciones  values ('FCO1050', 'Definición de Reportes de Autoliquidación', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1050' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1050','F1');
insert into aut_operaciones values ('ADAM','FCO1050',4);
COMMIT;

--operacion FCO1060 Datos Adicionales de la compañia
delete from rel_oper_menus where ejecuta_operacion = 'FCO1060';
delete from rel_oper_modulos where operacion = 'FCO1060';
delete from operaciones where operacion = 'FCO1060';
delete from aut_operaciones where operacion = 'FCO1060';

insert into operaciones  values ('FCO1060', 'Datos Adicionales de la compañia', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1060' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1060','F1');
insert into aut_operaciones values ('ADAM','FCO1060',4);
COMMIT;

--operacion FCO1070 de Mantenimiento de medios de bancos
delete from rel_oper_menus where ejecuta_operacion = 'FCO1070';
delete from rel_oper_modulos where operacion = 'FCO1070';
delete from operaciones where operacion = 'FCO1070';
delete from aut_operaciones where operacion = 'FCO1070';

insert into operaciones  values ('FCO1070', 'Definición de Medios para Bancos', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1070' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1070','F1');
insert into aut_operaciones values ('ADAM','FCO1070',4);
COMMIT;

--operacion FCO1080 Definicion de Reportes Varios
delete from rel_oper_menus where ejecuta_operacion = 'FCO1080';
delete from rel_oper_modulos where operacion = 'FCO1080';
delete from operaciones where operacion = 'FCO1080';
delete from aut_operaciones where operacion = 'FCO1080';

insert into operaciones  values ('FCO1080', 'Definicion de Reportes Varios', 1, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 10, NVL(max(secuencia),0) + 1, 2, null, 'FCO1080' from rel_oper_menus where modulo='F1' and menu = 10;
insert into rel_oper_modulos values ('FCO1080','F1');
insert into aut_operaciones values ('ADAM','FCO1080',4);
COMMIT;

--operacion FCO2000 Registro de Ausentismos
delete from rel_oper_menus where ejecuta_operacion = 'FCO2000';
delete from rel_oper_modulos where operacion = 'FCO2000';
delete from operaciones where operacion = 'FCO2000';
delete from aut_operaciones where operacion = 'FCO2000';

insert into operaciones  values ('FCO2000', 'Registro de Ausentismos', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2000' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2000','F1');
insert into aut_operaciones values ('ADAM','FCO2000',4);
COMMIT;

--operacion FCO2005 Aportantes por Fuera de Nomina
delete from rel_oper_menus where ejecuta_operacion = 'FCO2005';
delete from rel_oper_modulos where operacion = 'FCO2005';
delete from operaciones where operacion = 'FCO2005';
delete from aut_operaciones where operacion = 'FCO2005';

insert into operaciones  values ('FCO2005', 'Aportantes por Fuera de Nomina', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2005' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2005','F1');
insert into aut_operaciones values ('ADAM','FCO2005',4);
COMMIT;


-- operacion FCO2010 Autorizaciones de Incapacidades y Licencias de Maternidad
delete from rel_oper_menus where ejecuta_operacion = 'FCO2010';
delete from rel_oper_modulos where operacion = 'FCO2010';
delete from operaciones where operacion = 'FCO2010';
delete from aut_operaciones where operacion = 'FCO2010';

insert into operaciones  values ('FCO2010', 'Autorizaciones de Incapacidades y Licencias de Maternidad', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2010' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2010','F1');
insert into aut_operaciones values ('ADAM','FCO2010',4);
COMMIT;

--operacion FCO2020 Registro y Administración de Embargos
delete from rel_oper_menus where ejecuta_operacion = 'FCO2020';
delete from rel_oper_modulos where operacion = 'FCO2020';
delete from operaciones where operacion = 'FCO2020';
delete from aut_operaciones where operacion = 'FCO2020';

insert into operaciones  values ('FCO2020', 'Registro y Administración de Embargos', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2020' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2020','F1');
insert into aut_operaciones values ('ADAM','FCO2020',4);
COMMIT;

--operacion FCO2030 Registro de Traslado de EPS
delete from rel_oper_menus where ejecuta_operacion = 'FCO2030';
delete from rel_oper_modulos where operacion = 'FCO2030';
delete from operaciones where operacion = 'FCO2030';
delete from aut_operaciones where operacion = 'FCO2030';

insert into operaciones  values ('FCO2030', 'Registro de Traslado de EPS', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2030' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2030','F1');
insert into aut_operaciones values ('ADAM','FCO2030',4);
COMMIT;

--operacion FCO2040 Registro de Traslado de EPS
delete from rel_oper_menus where ejecuta_operacion = 'FCO2040';
delete from rel_oper_modulos where operacion = 'FCO2040';
delete from operaciones where operacion = 'FCO2040';
delete from aut_operaciones where operacion = 'FCO2040';

insert into operaciones  values ('FCO2040', 'Registro de Traslado de Fondo de Pensiones', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2040' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2040','F1');
insert into aut_operaciones values ('ADAM','FCO2040',4);
COMMIT;

--operacion FCO2060 Tablas Salud
delete from rel_oper_menus where ejecuta_operacion = 'FCO2060';
delete from rel_oper_modulos where operacion = 'FCO2060';
delete from operaciones where operacion = 'FCO2060';
delete from aut_operaciones where operacion = 'FCO2060';

insert into operaciones  values ('FCO2060', 'Tablas Salud', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2060' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2060','F1');
insert into aut_operaciones values ('ADAM','FCO2060',4);
COMMIT;

--operacion FCO2070 Tablas Pensiones
delete from rel_oper_menus where ejecuta_operacion = 'FCO2070';
delete from rel_oper_modulos where operacion = 'FCO2070';
delete from operaciones where operacion = 'FCO2070';
delete from aut_operaciones where operacion = 'FCO2070';

insert into operaciones  values ('FCO2070', 'Tablas Pensiones', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2070' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2070','F1');
insert into aut_operaciones values ('ADAM','FCO2070',4);
COMMIT;

--operacion FCO2080 Tablas ISS (Autol)
delete from rel_oper_menus where ejecuta_operacion = 'FCO2080';
delete from rel_oper_modulos where operacion = 'FCO2080';
delete from operaciones where operacion = 'FCO2080';
delete from aut_operaciones where operacion = 'FCO2080';

insert into operaciones  values ('FCO2080', 'Tablas ISS (Autol)', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2080' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2080','F1');
insert into aut_operaciones values ('ADAM','FCO2080',4);
COMMIT;

--operacion FCO2085 Tablas ISS (SIGA)
delete from rel_oper_menus where ejecuta_operacion = 'FCO2085';
delete from rel_oper_modulos where operacion = 'FCO2085';
delete from operaciones where operacion = 'FCO2085';
delete from aut_operaciones where operacion = 'FCO2085';

insert into operaciones  values ('FCO2085', 'Tablas ISS (SIGA)', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2085' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2085','F1');
insert into aut_operaciones values ('ADAM','FCO2085',4);
COMMIT;

--operacion FCO2090 Tablas Riesgos Profesionales
delete from rel_oper_menus where ejecuta_operacion = 'FCO2090';
delete from rel_oper_modulos where operacion = 'FCO2090';
delete from operaciones where operacion = 'FCO2090';
delete from aut_operaciones where operacion = 'FCO2090';

insert into operaciones  values ('FCO2090', 'Tablas Riesgos Profesionales', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2090' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2090','F1');
insert into aut_operaciones values ('ADAM','FCO2090',4);
COMMIT;

--operacion FCO2095 Tablas Planilla Integrada
delete from rel_oper_menus where ejecuta_operacion = 'FCO2095';
delete from rel_oper_modulos where operacion = 'FCO2095';
delete from operaciones where operacion = 'FCO2095';
delete from aut_operaciones where operacion = 'FCO2095';

insert into operaciones  values ('FCO2095', 'Control Planilla Integrada', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2095' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2095','F1');
insert into aut_operaciones values ('ADAM','FCO2095',4);
COMMIT;

--operacion FCO2095 Tablas Planilla Integrada para Pensionados
delete from rel_oper_menus where ejecuta_operacion = 'FCO2096';
delete from rel_oper_modulos where operacion = 'FCO2096';
delete from operaciones where operacion = 'FCO2096';
delete from aut_operaciones where operacion = 'FCO2096';

insert into operaciones  values ('FCO2096', 'Control Planilla Integrada Pensionados', 2, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 20, NVL(max(secuencia),0) + 1, 2, null, 'FCO2096' from rel_oper_menus where modulo='F1' and menu = 20;
insert into rel_oper_modulos values ('FCO2096','F1');
insert into aut_operaciones values ('ADAM','FCO2096',4);
COMMIT;

--operacion FCO3010 Efectuar Traslados de Administradora
delete from rel_oper_menus where ejecuta_operacion = 'FCO3010';
delete from rel_oper_modulos where operacion = 'FCO3010';
delete from operaciones where operacion = 'FCO3010';
delete from aut_operaciones where operacion = 'FCO3010';

insert into operaciones  values ('FCO3010', 'Efectuar Traslados de Administradora', 6, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3010' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3010','F1');
insert into aut_operaciones values ('ADAM','FCO3010',4);
COMMIT;


--operacion FCO3040 Actualizar Variable de Trabajador
delete from rel_oper_menus where ejecuta_operacion = 'FCO3040';
delete from rel_oper_modulos where operacion = 'FCO3040';
delete from operaciones where operacion = 'FCO3040';
delete from aut_operaciones where operacion = 'FCO3040';

insert into operaciones  values ('FCO3040', 'Actualizar Variable de Trabajador', 6, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3040' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3040','F1');
insert into aut_operaciones values ('ADAM','FCO3040',4);
COMMIT;


--operacion FCO3050 de Medios para bancos
delete from rel_oper_menus where ejecuta_operacion = 'FCO3050';
delete from rel_oper_modulos where operacion = 'FCO3050';
delete from operaciones where operacion = 'FCO3050';
delete from aut_operaciones where operacion = 'FCO3050';

insert into operaciones  values ('FCO3050', 'Generación de Medios para Bancos', 4, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3050' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3050','F1');
insert into aut_operaciones values ('ADAM','FCO3050',4);
COMMIT;

--operacion FCO3051 de Medios para bancos NI
delete from rel_oper_menus where ejecuta_operacion = 'FCO3051';
delete from rel_oper_modulos where operacion = 'FCO3051';
delete from operaciones where operacion = 'FCO3051';
delete from aut_operaciones where operacion = 'FCO3051';

insert into operaciones  values ('FCO3051', 'Generación de Medios para Bancos NI', 4, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3051' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3051','F1');
insert into aut_operaciones values ('ADAM','FCO3051',4);
COMMIT;

--operacion FCO3060 Cierre de período de autoliquidación
delete from rel_oper_menus where ejecuta_operacion = 'FCO3060';
delete from rel_oper_modulos where operacion = 'FCO3060';
delete from operaciones where operacion = 'FCO3060';
delete from aut_operaciones where operacion = 'FCO3060';

insert into operaciones  values ('FCO3060', 'Cierre de período de autoliquidación', 4, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3060' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3060','F1');
insert into aut_operaciones values ('ADAM','FCO3060',4);
COMMIT;

--operacion FCO3070 Reapertura de período de autoliquidación
delete from rel_oper_menus where ejecuta_operacion = 'FCO3070';
delete from rel_oper_modulos where operacion = 'FCO3070';
delete from operaciones where operacion = 'FCO3070';
delete from aut_operaciones where operacion = 'FCO3070';

insert into operaciones  values ('FCO3070', 'Reapertura de período de autoliquidación', 4, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3070' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3070','F1');
insert into aut_operaciones values ('ADAM','FCO3070',4);
COMMIT;

--operacion FCO3080 Cierre de período de autoliquidación Pensionados
delete from rel_oper_menus where ejecuta_operacion = 'FCO3080';
delete from rel_oper_modulos where operacion = 'FCO3080';
delete from operaciones where operacion = 'FCO3080';
delete from aut_operaciones where operacion = 'FCO3080';

insert into operaciones  values ('FCO3080', 'Cierre de período de autoliquidación Pensionados', 4, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3080' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3080','F1');
insert into aut_operaciones values ('ADAM','FCO3080',4);
COMMIT;

--operacion FCO3090 Reapertura de período de autoliquidación Pensionados
delete from rel_oper_menus where ejecuta_operacion = 'FCO3090';
delete from rel_oper_modulos where operacion = 'FCO3090';
delete from operaciones where operacion = 'FCO3090';
delete from aut_operaciones where operacion = 'FCO3090';

insert into operaciones  values ('FCO3090', 'Reapertura de período de autoliquidación Pensionados', 4, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 30, NVL(max(secuencia),0) + 1, 2, null, 'FCO3090' from rel_oper_menus where modulo='F1' and menu = 30;
insert into rel_oper_modulos values ('FCO3090','F1');
insert into aut_operaciones values ('ADAM','FCO3090',4);
COMMIT;

--operacion FCO5010 Reportes y Medios Magneticos
delete from rel_oper_menus where ejecuta_operacion = 'FCO5010';
delete from rel_oper_modulos where operacion = 'FCO5010';
delete from operaciones where operacion = 'FCO5010';
delete from aut_operaciones where operacion = 'FCO5010';

insert into operaciones  values ('FCO5010', 'Reportes y Medios Magneticos', 7, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 50, NVL(max(secuencia),0) + 1, 2, null, 'FCO5010' from rel_oper_menus where modulo='F1' and menu = 50;
insert into rel_oper_modulos values ('FCO5010','F1');
insert into aut_operaciones values ('ADAM','FCO5010',4);
COMMIT;

--operacion FCO5015 Archivo Planilla Integrada
delete from rel_oper_menus where ejecuta_operacion = 'FCO5015';
delete from rel_oper_modulos where operacion = 'FCO5015';
delete from operaciones where operacion = 'FCO5015';
delete from aut_operaciones where operacion = 'FCO5015';

insert into operaciones  values ('FCO5015', 'Generar Archivo Planilla Integrada', 7, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 50, NVL(max(secuencia),0) + 1, 2, null, 'FCO5015' from rel_oper_menus where modulo='F1' and menu = 50;
insert into rel_oper_modulos values ('FCO5015','F1');
insert into aut_operaciones values ('ADAM','FCO5015',4);
COMMIT;

--operacion FCO5016 Archivo Planilla Integrada Pensionados
delete from rel_oper_menus where ejecuta_operacion = 'FCO5016';
delete from rel_oper_modulos where operacion = 'FCO5016';
delete from operaciones where operacion = 'FCO5016';
delete from aut_operaciones where operacion = 'FCO5016';

insert into operaciones  values ('FCO5016', 'Generar Archivo Planilla Integrada Pensionados', 7, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 50, NVL(max(secuencia),0) + 1, 2, null, 'FCO5016' from rel_oper_menus where modulo='F1' and menu = 50;
insert into rel_oper_modulos values ('FCO5016','F1');
insert into aut_operaciones values ('ADAM','FCO5016',4);
COMMIT;

--operacion FCO5020 Generacion de Reportes Varios
delete from rel_oper_menus where ejecuta_operacion = 'FCO5020';
delete from rel_oper_modulos where operacion = 'FCO5020';
delete from operaciones where operacion = 'FCO5020';
delete from aut_operaciones where operacion = 'FCO5020';

insert into operaciones  values ('FCO5020', 'Generacion de Reportes Varios', 7, 1, NULL,NULL,NULL,NULL);
insert into rel_oper_menus select 'F1', 50, NVL(max(secuencia),0) + 1, 2, null, 'FCO5020' from rel_oper_menus where modulo='F1' and menu = 50;
insert into rel_oper_modulos values ('FCO5020','F1');
insert into aut_operaciones values ('ADAM','FCO5020',4);
COMMIT;

update operaciones
set descripcion_ope = '(MF) ' || SUBSTR(descripcion_ope, 1, 55)
where operacion like 'MF%'
AND descripcion_ope NOT LIKE '(MF)%';
commit;
