-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 16-12-2022 a las 09:37:48
-- Versión del servidor: 8.0.31-0ubuntu0.20.04.2
-- Versión de PHP: 7.4.3

START TRANSACTION;
















CREATE TABLE `pasajes_viaticos_catalog_items` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `value` int NOT NULL,
  `label` varchar(250) NOT NULL,
  `lang` varchar(5) NOT NULL,
  `orden` int DEFAULT NULL,
  `catalog_code` varchar(50) NOT NULL,
  `catalog_code_dep` varchar(50) NOT NULL,
  `catalog_id_dep` int NOT NULL,
  `description` varchar(512) NOT NULL,
  `svg_image` varchar(150) DEFAULT NULL,
  `status` varchar(2) NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_catalog_items`
--

INSERT INTO `pasajes_viaticos_catalog_items` (`id`, `users_sid`, `global_branch_office_id`, `value`, `label`, `lang`, `orden`, `catalog_code`, `catalog_code_dep`, `catalog_id_dep`, `description`, `svg_image`, `status`, `created_at`, `updated_at`) VALUES
(2, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'PRIMERA CATEGORIA', 'es', NULL, 'CATEGORIAVIATICO', '0', 0, 'PRIMERA CATEGORIA', NULL, 'A', '2021-12-07 12:08:35', '2021-12-07 12:08:35'),
(3, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'SEGUNDA CATEGORIA', 'es', NULL, 'CATEGORIAVIATICO', '0', 0, 'SEGUNDA CATEGORIA', NULL, 'A', '2021-12-07 12:08:45', '2021-12-07 12:08:45'),
(4, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'TERCERA CATEGORIA', 'es', NULL, 'CATEGORIAVIATICO', '0', 0, 'TERCERA CATEGORIA', NULL, 'A', '2021-12-07 12:08:54', '2021-12-07 12:18:09'),
(5, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'INTERNACIONAL', 'es', NULL, 'CATEGORIA', '0', 0, 'INTERNACIONAL', NULL, 'A', '2021-12-07 14:54:16', '2021-12-07 14:54:16'),
(6, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'INTERIOR', 'es', NULL, 'CATEGORIA', '0', 0, 'INTERIOR', NULL, 'A', '2021-12-07 14:54:35', '2021-12-07 14:54:35'),
(7, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'INTERDEPARTAMENTAL', 'es', NULL, 'CATEGORIA', 'CATEGORIA', 2, 'INTERDEPARTAMENTAL', NULL, 'A', '2021-12-07 14:55:45', '2021-12-07 14:58:11'),
(8, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'NORTE AMERICA, EUROPA, ASIA, AFRICA Y OCEANIA', 'es', NULL, 'CATEGORIA', 'CATEGORIA', 1, 'NORTE AMERICA, EUROPA, ASIA, AFRICA Y OCEANIA', NULL, 'A', '2021-12-07 14:57:57', '2021-12-07 14:57:57'),
(9, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'INTERIOR DEL DEPARTAMENTO', 'es', NULL, 'CATEGORIA', 'CATEGORIA', 2, 'INTERIOR DEL DEPARTAMENTO', NULL, 'A', '2021-12-07 14:58:32', '2021-12-07 14:58:32'),
(10, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'FRANJA DE FRONTERA', 'es', NULL, 'CATEGORIA', 'CATEGORIA', 2, 'FRANJA DE FRONTERA', NULL, 'A', '2021-12-07 14:58:46', '2021-12-07 14:58:46'),
(11, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'CENTRO, SUD AMERICA Y EL CARIBE', 'es', NULL, 'CATEGORIA', 'CATEGORIA', 1, 'CENTRO, SUD AMERICA Y EL CARIBE', NULL, 'A', '2021-12-07 14:59:24', '2021-12-07 14:59:24'),
(12, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'AEREO EMPRESA PRIVADA', 'es', NULL, 'MEDIO', '0', 0, 'AEREO EMPRESA PRIVADA', NULL, 'A', '2021-12-07 15:50:46', '2022-05-09 12:15:55'),
(13, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'TERRESTRE EMPRESA PRIVADA', 'es', NULL, 'MEDIO', '0', 0, 'TERRESTRE EMPRESA PRIVADA', NULL, 'A', '2021-12-07 15:51:15', '2021-12-07 15:51:15'),
(14, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'VEHICULO OFICIAL DEL ESTADO', 'es', NULL, 'MEDIO', '0', 0, 'VEHICULO OFICIAL DEL ESTADO', NULL, 'A', '2021-12-07 15:53:34', '2021-12-07 15:53:34'),
(15, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 4, 'COMITIVA OFICIAL CON EL PRESIDENTE DEL ESTADO PLURINACIONAL DE BOLIVIA', 'es', NULL, 'MEDIO', '0', 0, 'COMITIVA OFICIAL CON EL PRESIDENTE DEL ESTADO PLURINACIONAL DE BOLIVIA', NULL, 'A', '2021-12-07 15:57:22', '2021-12-07 15:57:22'),
(16, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'MINISTRO(A)', 'es', NULL, 'AUTORIDAD', '0', 0, 'MINISTRO(A)', NULL, 'A', '2021-12-09 10:48:13', '2022-06-10 11:25:59'),
(17, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'VICEMINISTROS(AS)', 'es', NULL, 'AUTORIDAD', '0', 0, 'VICEMINISTROS(AS)', NULL, 'A', '2021-12-09 10:48:25', '2021-12-09 10:48:25'),
(18, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'DIRECTORES GENERALES Y JEFES DE UNIDAD', 'es', NULL, 'AUTORIDAD', '0', 0, 'DIRECTORES GENERALES Y JEFES DE UNIDAD', NULL, 'A', '2021-12-09 10:48:40', '2021-12-09 10:48:40'),
(19, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 4, 'RESTO DEL PERSONAL DEPENDIENTE', 'es', NULL, 'AUTORIDAD', '0', 0, 'RESTO DEL PERSONAL DEPENDIENTE', NULL, 'A', '2021-12-09 10:48:58', '2021-12-09 10:48:58'),
(20, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'SOLO IDA', 'es', NULL, 'FORMA', '0', 0, 'SOLO IDA', NULL, 'A', '2021-12-22 15:31:52', '2021-12-22 15:31:52'),
(21, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'SOLO VUELTA', 'es', NULL, 'FORMA', '0', 0, 'SOLO VUELTA', NULL, 'A', '2021-12-22 15:31:59', '2021-12-22 15:31:59'),
(23, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'PASE A BORDO (BOARDING PASS)', 'es', NULL, 'PASEABORDO', '0', 0, 'PASE A BORDO', NULL, 'A', '2022-01-24 10:01:46', '2022-01-24 10:01:46'),
(24, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'TICKET DE TRANSPORTE TERRESTRE', 'es', NULL, 'PASEABORDO', '0', 0, 'TICKET DE TRANSPORTE TERRESTRE', NULL, 'A', '2022-01-24 10:02:03', '2022-01-24 10:02:03'),
(25, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'INTERMEDIO', 'es', NULL, 'FORMA', '0', 0, 'INTERMEDIO', NULL, 'A', '2022-05-03 11:50:55', '2022-05-03 11:50:55'),
(26, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 4, 'IDA Y VUELTA', 'es', NULL, 'FORMA', '0', 0, 'IDA Y VUELTA', NULL, 'A', '2022-05-03 11:51:03', '2022-05-03 11:51:03'),
(27, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'BILLETE AEREO DE IDA Y VUELTA', 'es', NULL, 'MEDIO', 'MEDIO', 1, 'BILLETE AEREO DE IDA Y VUELTA', NULL, 'A', '2022-05-04 13:51:33', '2022-05-04 13:55:04'),
(28, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'BILLETE AEREO DE SOLO IDA', 'es', NULL, 'MEDIO', 'MEDIO', 1, 'BILLETE AEREO DE SOLO IDA', NULL, 'A', '2022-05-04 13:51:49', '2022-05-04 13:55:11'),
(29, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'BILLETE AEREO DE SOLO VUELTA', 'es', NULL, 'MEDIO', 'MEDIO', 1, 'BILLETE AEREO DE SOLO VUELTA', NULL, 'A', '2022-05-04 13:52:03', '2022-05-04 13:55:16'),
(30, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 4, 'SIN BILLETE AEREO ASIGNADO', 'es', NULL, 'MEDIO', 'MEDIO', 1, 'SIN BILLETE AEREO ASIGNADO', NULL, 'A', '2022-05-04 13:52:13', '2022-05-04 13:55:24'),
(31, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'BILLETE DE BUS DE IDA Y VUELTA', 'es', NULL, 'MEDIO', 'MEDIO', 2, 'BILLETE DE BUS DE IDA Y VUELTA', NULL, 'A', '2022-05-04 13:53:11', '2022-05-04 13:55:54'),
(32, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'BILLETE DE BUS DE SOLO IDA', 'es', NULL, 'MEDIO', 'MEDIO', 2, 'BILLETE DE BUS DE SOLO IDA', NULL, 'A', '2022-05-04 13:53:21', '2022-05-04 13:55:59'),
(33, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'BILLETE DE BUS DE SOLO VUELTA', 'es', NULL, 'MEDIO', 'MEDIO', 2, 'BILLETE DE BUS DE SOLO VUELTA', NULL, 'A', '2022-05-04 13:54:01', '2022-05-04 13:56:03'),
(34, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 4, 'SIN BILLETE DE BUS ASIGNADO', 'es', NULL, 'MEDIO', 'MEDIO', 2, 'SIN BILLETE DE BUS ASIGNADO', NULL, 'A', '2022-05-04 13:54:39', '2022-05-04 13:56:09'),
(35, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'SIN BILLETE DE BUS O AEREO ASIGNADO', 'es', NULL, 'MEDIO', 'MEDIO', 3, 'SIN BILLETE DE BUS O AEREO ASIGNADO', NULL, 'A', '2022-05-04 13:56:53', '2022-05-04 13:56:53'),
(36, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'SIN BILLETE DE BUS O AEREO ASIGNADO', 'es', NULL, 'MEDIO', 'MEDIO', 4, 'SIN BILLETE DE BUS O AEREO ASIGNADO', NULL, 'A', '2022-05-04 13:57:39', '2022-05-04 13:57:39'),
(37, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 5, 'COMISION FINANCIADA POR ORGANISMOS EXTERNOS', 'es', NULL, 'MEDIO', '0', 0, 'COMISION FINANCIADA POR ORGANISMOS EXTERNOS', NULL, 'A', '2022-05-09 12:48:06', '2022-05-09 12:52:26');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_configuration`
--

CREATE TABLE `pasajes_viaticos_configuration` (
  `relative` varchar(50) NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch office on core',
  `administrative_affairs` varchar(50) NOT NULL COMMENT 'Related to users sid',
  `pyv_in_charge` varchar(50) NOT NULL COMMENT 'Related to users sid',
  `before_national_trip` smallint NOT NULL DEFAULT '2',
  `before_international_trip` smallint NOT NULL DEFAULT '4',
  `admministrative_resolution` text,
  `days_after_trip` smallint NOT NULL DEFAULT '8',
  `noon_time` time NOT NULL COMMENT 'The noon time',
  `decimals` smallint NOT NULL,
  `currency_id` int NOT NULL DEFAULT '1' COMMENT 'Related to currency table',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_configuration`
--

INSERT INTO `pasajes_viaticos_configuration` (`relative`, `users_sid`, `global_branch_office_id`, `administrative_affairs`, `pyv_in_charge`, `before_national_trip`, `before_international_trip`, `admministrative_resolution`, `days_after_trip`, `noon_time`, `decimals`, `currency_id`, `status`, `created_at`, `updated_at`) VALUES
('69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', '7ce7a7a9-5ddf-4727-8d0b-1ec2dc2cf8cb', 'eeef3815-11de-4a4a-a6ac-8619b4e9b4ca', 2, 4, 'Que la constitución política del estado aprobada mediante reféndum de fecha 25 de enero de 2009, en el artículo 232 establece que la administración pública se rige por los principios de legitimidad, legalidad, imparcialidad, publicidad, compromiso e interés social, ética, transparencia, igualdad, competencia, eficiencia, calidad, calidez, honestidad, responsabilidad y resultados. Además de disposiciones legales al caso, y:\nQue el inciso c) del artículo de la Ley 1178 de fecha 20 de julio de 1990, de administración y control gubernamentales, tiene por objeto, lograr que todo servidor público, sin distinción de jerarquía, asuma plena responsabilidad por sus actos. El artículo 28, determina que todo servidor público responderá de los resultados emergentes del desempeño de las funciones, deberes y atribuciones asignados a su cargo.\nQue el Decreto Supremo 1788 del 7 de noviembre de 2013, establece la escala de viáticos, categorías y pasajes para los servidores públicos, personal eventual y consultores individuales de línea del servidor público que viajan en comisión oficial al exterior e interior del país, además establece aspectos operativos relacionados a gastos realizados en el exterior como en el interior del Estado, emergentes de viajes oficiales.\nQue el Decreto Supremo 27327 del 31 de enero de 2004, refiere en su parte considerativa que es necesario establecer un marco de austeridad racionalizado al gasto de las entidades públicas.\nQue el artículo 3, parágrafo II, del Decreto Supremo 4393, del 13 de noviembre de 2020, modifica el capítulo X del Título III del Decreto Supremo 29894, del 7 de febrero de 2009, Organización del Órgano Ejecutivo: cambiando el nomen iuris del Ministerio de Hidrocarburos por MINISTERIO DE HIDROCARBUROS Y ENERGÍAS.\nQue el reglamento interno de pasajes y viáticos del Ministerio de Hidrocarburos y Energías, aprobado mediante Resolución Ministerial 118-19 del 20 de septiembre de 2019, se constituye en un instrumento operativo y complementario de control interno, cuyo objetivo consiste en normal, controlar y hacer eficiente la solicitud, asigación y descargo de los recursos desembolsados para el pago de viáticos, pasajes y gastos de representación a servidores públicos del Ministerio de Hidrocarburos y Energías que realizan viajes al interior y/o exterior del país en comisión oficial.\nQue el reglamento interno de pasajes y viáticos del Ministerio de Hidrocarburos y Energías, en el artículo 23 en sus dos parágrafos establece que, para proceder al pago de viáticos cuando la estadía programada se extienda por más días, el servidor público o personal dependiente del Ministerio de Hidrocarburos y Energías deberá presentar vía el Sistema de Control de Pasajes y Viáticos a la Dirección General de Asuntos Administrativos, el informe administrativo de descargo de pasajes y viáticos, el mismo que debe considerar las fechas y horarios del pase a bordo (aéreo) y otros (terrestre); aprobado por su inmediato superior, solicitando expresamente la cancelación de los días de viático adicionales.\nEn caso de que la extensión del viaje sea en fin de semana o feriado, se requerirá Resolución Administrativa o Ministerial (viajes al exterior) para la tercera categoría, según corresponda; o Resolución Suprema en caso de viajes internacionales de la primera y segunda categoría.', 8, '13:30:00', 2, 2, 'A', '2022-04-11 08:42:59', '2022-11-18 10:10:55');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_escala`
--

CREATE TABLE `pasajes_viaticos_escala` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `type_id` int NOT NULL COMMENT 'related to catalogs items = CATEGORIA',
  `subtype_id` int NOT NULL COMMENT 'related to catalogs items = SUBCATEGORIA',
  `categoria_viatico_id` int NOT NULL COMMENT 'related to catalogs items  = CATEGORIAVIATICO',
  `amount` decimal(10,5) NOT NULL,
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `status` enum('A','X') NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_escala`
--

INSERT INTO `pasajes_viaticos_escala` (`id`, `users_sid`, `global_branch_office_id`, `type_id`, `subtype_id`, `categoria_viatico_id`, `amount`, `currency_id`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 1, 1, '360.00000', 1, 'A', '2021-12-13 10:26:40', '2021-12-13 10:26:40'),
(2, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 1, 2, '300.00000', 1, 'A', '2021-12-13 10:26:59', '2021-12-13 10:26:59'),
(3, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 1, 3, '276.00000', 1, 'A', '2021-12-13 10:27:14', '2021-12-13 10:27:14'),
(4, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 2, 1, '300.00000', 1, 'A', '2021-12-13 10:27:28', '2021-12-13 10:27:28'),
(5, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 2, 2, '240.00000', 1, 'A', '2021-12-13 10:27:41', '2021-12-13 10:27:41'),
(6, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 2, 3, '207.00000', 1, 'A', '2021-12-13 10:27:52', '2021-12-13 10:27:52'),
(7, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 1, 1, '553.00000', 2, 'A', '2021-12-13 11:24:06', '2021-12-13 11:24:06'),
(8, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 1, 2, '465.00000', 2, 'A', '2021-12-13 11:24:21', '2021-12-13 11:24:21'),
(9, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 1, 3, '371.00000', 2, 'A', '2021-12-13 11:24:44', '2021-12-13 11:24:44'),
(10, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 2, 1, '332.00000', 2, 'A', '2021-12-13 11:25:11', '2021-12-13 11:25:11'),
(11, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 2, 2, '277.00000', 2, 'A', '2021-12-13 11:25:24', '2021-12-13 11:25:24'),
(12, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 2, 3, '222.00000', 2, 'A', '2021-12-13 11:25:36', '2021-12-13 11:25:36'),
(13, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 3, 1, '583.00000', 2, 'A', '2021-12-13 11:25:56', '2021-12-13 11:25:56'),
(14, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 3, 2, '491.00000', 2, 'A', '2021-12-13 11:26:10', '2021-12-13 11:26:10'),
(15, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 3, 3, '391.00000', 2, 'A', '2021-12-13 11:26:34', '2021-12-13 11:54:43');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_fly_ticket_control`
--

CREATE TABLE `pasajes_viaticos_fly_ticket_control` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `supplier_vendors_id` varchar(50) NOT NULL COMMENT 'Related to supplier vendor table',
  `issue_date` date NOT NULL,
  `electronic_ticket` varchar(50) NOT NULL,
  `traveler_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Related to users sid',
  `traveler_document` varchar(35) NOT NULL,
  `origin` varchar(200) NOT NULL,
  `destiny` varchar(200) NOT NULL,
  `way_id` int NOT NULL COMMENT 'related to catalogs items = FORMA',
  `itinerary_datetime` datetime NOT NULL,
  `itinerary_datetime_arrive` datetime NOT NULL,
  `total` decimal(10,5) NOT NULL,
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `stage` enum('R','C','A','RU') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'R=Reserved, C=Confirmed, A=Cancelled, RU=ReUsed',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_fly_ticket_related_request`
--

CREATE TABLE `pasajes_viaticos_fly_ticket_related_request` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `request_id` int DEFAULT NULL COMMENT 'Related to request id',
  `provisional` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL COMMENT 'The provisional UUID',
  `fly_ticket_control_id` int NOT NULL COMMENT 'Related to pasajes_viaticos_fly_ticket_control',
  `way_id` int NOT NULL COMMENT 'Related to catalogs items = ''FORMA''',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_itinerary`
--

CREATE TABLE `pasajes_viaticos_itinerary` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int NOT NULL COMMENT 'Related to request table',
  `provisional` varchar(50) DEFAULT NULL COMMENT 'a uuid data',
  `where_from` varchar(250) NOT NULL,
  `itinerary_datetime` datetime NOT NULL,
  `transportway_id` int NOT NULL COMMENT 'related to catalogs items  = MEDIO',
  `to_where` varchar(250) NOT NULL,
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_message_notification`
--

CREATE TABLE `pasajes_viaticos_message_notification` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'Related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'Related to branch table',
  `follow_message` varchar(50) NOT NULL COMMENT 'This is a UUID for the same message',
  `request_id` int DEFAULT NULL COMMENT 'Related to the request id, but could be null',
  `receivers` text NOT NULL COMMENT 'Many users sid separated by |',
  `reason` varchar(200) NOT NULL COMMENT 'The reason title',
  `complete_message` longtext NOT NULL,
  `attachments` text,
  `actions` enum('A','R','RS','D','J','AT') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'J' COMMENT 'J=Just a request, A=Autorize or proceed, R=Rejected, RS=Resend, D=Derived, AT=Attended',
  `readed` enum('Y','N') NOT NULL DEFAULT 'N',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_relation`
--

CREATE TABLE `pasajes_viaticos_relation` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `cargo_id` int NOT NULL COMMENT 'related to catalogs items = CARGO',
  `inmediato_superior_id` int NOT NULL COMMENT 'related to catalogs items = SUPERIOR',
  `categoria_viatico_id` int NOT NULL COMMENT 'related to catalogs items = CATEGORIAVIATICO	',
  `autoridad_id` int NOT NULL COMMENT 'related to catalogs items = AUTORIDAD',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_relation`
--

INSERT INTO `pasajes_viaticos_relation` (`id`, `users_sid`, `global_branch_office_id`, `cargo_id`, `inmediato_superior_id`, `categoria_viatico_id`, `autoridad_id`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 76, 40, 3, 4, 'A', '2021-12-09 11:59:08', '2021-12-09 11:59:08'),
(2, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 1, 1, 1, 'A', '2021-12-09 12:05:49', '2021-12-09 12:05:49'),
(3, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 73, 40, 3, 4, 'A', '2021-12-09 12:21:21', '2021-12-09 12:22:55'),
(4, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 180, 40, 3, 4, 'X', '2021-12-16 12:33:20', '2022-03-03 09:02:53'),
(5, '7ce7a7a9-5ddf-4727-8d0b-1ec2dc2cf8cb', '69abe0de-7812-41bd-9124-6a7238aee7d1', 40, 1, 3, 3, 'A', '2022-03-23 14:55:30', '2022-03-23 14:55:30'),
(6, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 55, 51, 3, 4, 'A', '2022-04-12 09:29:42', '2022-04-12 09:29:42'),
(7, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 34, 24, 3, 4, 'A', '2022-04-12 09:30:55', '2022-04-12 09:30:55'),
(8, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 35, 24, 3, 4, 'A', '2022-04-12 09:35:07', '2022-04-12 09:35:07'),
(9, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 36, 24, 3, 4, 'A', '2022-04-12 09:35:27', '2022-04-12 09:35:27'),
(10, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 37, 24, 3, 4, 'A', '2022-04-12 09:35:39', '2022-04-12 09:35:39'),
(11, 'eeef3815-11de-4a4a-a6ac-8619b4e9b4ca', '69abe0de-7812-41bd-9124-6a7238aee7d1', 81, 77, 3, 3, 'A', '2022-04-12 15:22:42', '2022-04-12 15:22:42'),
(12, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 175, 1, 2, 2, 'A', '2022-04-13 08:49:52', '2022-04-13 08:49:52');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_administrative_resolution`
--

CREATE TABLE `pasajes_viaticos_request_administrative_resolution` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int NOT NULL COMMENT 'Related to pasajes_viaticos_request table',
  `mem` varchar(45) NOT NULL,
  `person_id` int NOT NULL COMMENT 'Related to person table',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_approve_reject`
--

CREATE TABLE `pasajes_viaticos_request_approve_reject` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int NOT NULL COMMENT 'Related to pasajes_viaticos_request table',
  `approve_reject_date_time` datetime NOT NULL,
  `stage` enum('A','R') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_request_approve_reject`
--

INSERT INTO `pasajes_viaticos_request_approve_reject` (`id`, `users_sid`, `global_branch_office_id`, `request_id`, `approve_reject_date_time`, `stage`, `status`, `created_at`, `updated_at`) VALUES
(1, '7ce7a7a9-5ddf-4727-8d0b-1ec2dc2cf8cb', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, '2022-11-18 10:15:42', 'A', 'A', '2022-11-18 10:15:42', '2022-11-18 10:15:42'),
(2, '7ce7a7a9-5ddf-4727-8d0b-1ec2dc2cf8cb', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, '2022-11-21 16:37:33', 'A', 'A', '2022-11-21 16:37:33', '2022-11-21 16:37:33'),
(3, '7ce7a7a9-5ddf-4727-8d0b-1ec2dc2cf8cb', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, '2022-12-15 11:51:58', 'A', 'A', '2022-12-15 11:51:58', '2022-12-15 11:51:58');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_attachments`
--

CREATE TABLE `pasajes_viaticos_request_attachments` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int NOT NULL COMMENT 'Related to pasajes_viaticos_request table',
  `mem` varchar(45) NOT NULL,
  `mem_date_time` datetime NOT NULL,
  `attachments` text,
  `doctype` enum('A1','A2','A3','A4','A5','A6','A7') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'A1',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_request_attachments`
--

INSERT INTO `pasajes_viaticos_request_attachments` (`id`, `users_sid`, `global_branch_office_id`, `request_id`, `mem`, `mem_date_time`, `attachments`, `doctype`, `status`, `created_at`, `updated_at`) VALUES
(2, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'M-OEP1', '2022-11-18 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-11-18 10:18:17e9bea6e1-827e-4214-a68d-0c79a86a51dc.pdf', 'A1', 'A', '2022-11-18 10:18:17', '2022-11-18 10:18:17'),
(3, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'M-OEP1', '2022-11-18 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-11-18 10:18:320e86fceb-7803-4538-a336-f7b8dbe879e8.pdf', 'A2', 'A', '2022-11-18 10:18:32', '2022-11-18 10:18:32'),
(4, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'M-OEP1', '2022-11-18 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-11-18 10:20:37f1c72650-9f04-4546-bc67-5ae2d8b5511e.pdf', 'A4', 'A', '2022-11-18 10:20:37', '2022-11-18 10:20:37'),
(5, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'M-OEP2', '2022-11-21 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-11-21 16:38:0567ec18ef-2cca-41f1-9dc8-8121d9f38e24.pdf', 'A1', 'A', '2022-11-21 16:38:05', '2022-11-21 16:38:05'),
(6, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'M-OEP2', '2022-11-21 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-11-21 16:38:29f29760b0-123f-4192-8045-1fa0e10ab27c.pdf', 'A2', 'A', '2022-11-21 16:38:29', '2022-11-21 16:38:29'),
(7, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, 'M-OEP2', '2022-11-21 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-11-21 16:41:18440aff0c-6e79-47f1-acd2-6a0b43d31844.pdf', 'A4', 'A', '2022-11-21 16:41:18', '2022-11-21 16:41:18'),
(8, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'M-OEP1', '2022-11-21 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-11-21 16:45:5011537189-e6ad-4f10-a135-b2bf5babdf12.pdf', 'A7', 'A', '2022-11-21 16:45:50', '2022-11-21 16:45:50'),
(13, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'M-UAP3', '2022-12-15 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-12-15 11:57:0149a7f37e-c7f6-4c23-b738-01729f040c51.pdf', 'A1', 'A', '2022-12-15 11:57:01', '2022-12-15 11:57:01'),
(14, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, 'M-UAP3', '2022-12-15 00:00:00', 'http://127.0.0.1:8003/storage/attachments/2022-12-15 11:57:0717244a02-c04c-4bd6-8960-79b17a614899.pdf', 'A2', 'A', '2022-12-15 11:57:07', '2022-12-15 11:57:07');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_calculation`
--

CREATE TABLE `pasajes_viaticos_request_calculation` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int NOT NULL COMMENT 'Related to request table',
  `overnight` decimal(10,5) NOT NULL,
  `representation_expenses` enum('Y','N') NOT NULL DEFAULT 'N',
  `days_before` decimal(10,2) NOT NULL,
  `trip_days` decimal(10,2) NOT NULL,
  `amount_designed` decimal(10,5) NOT NULL,
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_final_inform`
--

CREATE TABLE `pasajes_viaticos_request_final_inform` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int DEFAULT NULL COMMENT 'Related to request table',
  `cite` varchar(50) NOT NULL COMMENT 'Numero de hoja de ruta',
  `addressed_to_id` int NOT NULL COMMENT 'Related to catalogs items = ''CARGO''',
  `inform` longtext NOT NULL COMMENT 'Long text for the inform',
  `fullfilled` enum('Y','N') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'Y' COMMENT 'For N = Required reliquidation, for Y = Nothing happend',
  `conclusion` text NOT NULL,
  `recomendation` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `attachments` text COMMENT 'Files separated by commas',
  `stage` enum('P','A','R') NOT NULL DEFAULT 'P',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_request_final_inform`
--

INSERT INTO `pasajes_viaticos_request_final_inform` (`id`, `users_sid`, `global_branch_office_id`, `request_id`, `cite`, `addressed_to_id`, `inform`, `fullfilled`, `conclusion`, `recomendation`, `attachments`, `stage`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'INF-1', 40, '<p>asjkdjhags jdhgas dkjhasg dajshgd kasjdhg kasdg asjdhgas</p><p>4asjdhg askjdhgas kdjhas gdkajs4akjdsasg djkhas</p><p>&nbsp;</p><p>akjshdg asjkdhg askjdhg as</p>', 'Y', 'askjdhg askjdhg askjdhg askdjghas kdjh', 'asdkjhg askjdhg askdjhasg dkjashg dkhas', NULL, 'A', 'A', '2022-11-21 16:43:26', '2022-11-21 16:45:41');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_final_inform_cite`
--

CREATE TABLE `pasajes_viaticos_request_final_inform_cite` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int DEFAULT NULL COMMENT 'Related to request table',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_request_final_inform_cite`
--

INSERT INTO `pasajes_viaticos_request_final_inform_cite` (`id`, `users_sid`, `global_branch_office_id`, `request_id`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 'A', '2022-11-21 16:43:26', '2022-11-21 16:43:26');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_formulario_110`
--

CREATE TABLE `pasajes_viaticos_request_formulario_110` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int DEFAULT NULL COMMENT 'Related to request table',
  `presentation_date` date NOT NULL COMMENT 'Fecha de presentacion',
  `ammount` decimal(10,4) NOT NULL COMMENT 'Puede ser 0',
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `attachments` text,
  `stage` enum('P','A','R') NOT NULL DEFAULT 'P',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_request_formulario_110`
--

INSERT INTO `pasajes_viaticos_request_formulario_110` (`id`, `users_sid`, `global_branch_office_id`, `request_id`, `presentation_date`, `ammount`, `currency_id`, `attachments`, `stage`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, '2022-11-21', '900.0000', 2, NULL, 'A', 'A', '2022-11-21 16:44:39', '2022-11-21 16:45:41');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_itinerary`
--

CREATE TABLE `pasajes_viaticos_request_itinerary` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int DEFAULT NULL COMMENT 'Related to request table',
  `provisional` varchar(50) DEFAULT NULL COMMENT 'a uuid data',
  `origin` varchar(250) NOT NULL,
  `itinerary_datetime` datetime NOT NULL,
  `itinerary_datetime_arrive` datetime DEFAULT NULL,
  `way_id` int NOT NULL COMMENT 'related to catalogs items  = FORMA',
  `transportway_id` int NOT NULL COMMENT 'related to catalogs items  = MEDIO',
  `destiny` varchar(250) NOT NULL,
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_request_itinerary`
--

INSERT INTO `pasajes_viaticos_request_itinerary` (`id`, `users_sid`, `global_branch_office_id`, `request_id`, `provisional`, `origin`, `itinerary_datetime`, `itinerary_datetime_arrive`, `way_id`, `transportway_id`, `destiny`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, NULL, 'La Paz', '2022-11-23 16:00:00', '2022-11-23 17:30:00', 1, 1, 'Cochabamba', 'A', '2022-11-18 10:07:49', '2022-11-18 10:08:44'),
(2, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, NULL, 'Cochabamba', '2022-11-25 10:00:00', '2022-11-25 11:30:00', 2, 1, 'La Paz', 'A', '2022-11-18 10:08:21', '2022-11-18 10:08:44'),
(3, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, NULL, 'La Paz', '2022-11-23 09:00:00', '2022-11-23 10:30:00', 1, 1, 'Cochabamba', 'A', '2022-11-21 16:35:27', '2022-11-21 16:36:36'),
(4, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, NULL, 'Cochabamba', '2022-11-25 14:00:00', '2022-11-25 15:00:00', 2, 1, 'La Paz', 'A', '2022-11-21 16:35:59', '2022-11-21 16:36:36'),
(5, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, NULL, 'Cobija', '2022-12-19 09:00:00', '2022-12-19 10:30:00', 1, 1, 'Santa Cruz de la Sierra', 'A', '2022-12-15 11:48:49', '2022-12-15 11:49:25'),
(6, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 3, NULL, 'Santa Cruz de la Sierra', '2022-12-22 12:00:00', '2022-12-22 13:30:00', 2, 1, 'Cobija', 'A', '2022-12-15 11:49:20', '2022-12-15 11:49:25');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_reliquidation`
--

CREATE TABLE `pasajes_viaticos_request_reliquidation` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int NOT NULL COMMENT 'Related to pasajes_viaticos_request table',
  `departure_date_time` datetime NOT NULL,
  `arrival_date_time` datetime NOT NULL,
  `reason` longtext,
  `stage` enum('P','A','R') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'A',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_reliquidation_itinerary`
--

CREATE TABLE `pasajes_viaticos_request_reliquidation_itinerary` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int DEFAULT NULL COMMENT 'Related to request table',
  `itinerary_id` int DEFAULT NULL COMMENT 'related to pasajes_viaticos_request_itinerary table',
  `origin` varchar(250) DEFAULT NULL,
  `itinerary_datetime` datetime NOT NULL,
  `itinerary_datetime_arrive` datetime NOT NULL,
  `way_id` int DEFAULT NULL COMMENT 'related to catalogs items = FORMA	',
  `transportway_id` int DEFAULT NULL COMMENT 'related to catalogs items = MEDIO	',
  `destiny` varchar(250) DEFAULT NULL,
  `stage` enum('P','A','R') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'A',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_reliquidation_itinerary_costs`
--

CREATE TABLE `pasajes_viaticos_request_reliquidation_itinerary_costs` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int DEFAULT NULL COMMENT 'Related to request table',
  `cost` decimal(10,5) NOT NULL,
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `stage` enum('P','A','R') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'A',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_request_weekend_holliday`
--

CREATE TABLE `pasajes_viaticos_request_weekend_holliday` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `request_id` int NOT NULL COMMENT 'Related to pasajes_viaticos_request table',
  `weekends_holidays` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'All dates separated by commas',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_request_weekend_holliday`
--

INSERT INTO `pasajes_viaticos_request_weekend_holliday` (`id`, `users_sid`, `global_branch_office_id`, `request_id`, `weekends_holidays`, `status`, `created_at`, `updated_at`) VALUES
(1, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, '2022-06-04 00:00:00', 'A', '2022-06-02 12:29:10', '2022-06-02 12:29:10'),
(2, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, '2022-06-05 00:00:00', 'A', '2022-06-02 12:29:10', '2022-06-02 12:29:10'),
(3, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, '2022-06-11 00:00:00', 'A', '2022-06-07 09:20:06', '2022-06-07 09:20:06'),
(4, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 2, '2022-06-12 00:00:00', 'A', '2022-06-07 09:20:06', '2022-06-07 09:20:06');

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `pasajes_viaticos_resume`
--

CREATE TABLE `pasajes_viaticos_resume` (
  `id` int NOT NULL,
  `users_sid` varchar(50) NOT NULL COMMENT 'related to users table',
  `global_branch_office_id` varchar(50) NOT NULL COMMENT 'related to branch office',
  `person_id` int NOT NULL COMMENT 'Related to person table',
  `request_id` int NOT NULL COMMENT 'Related to request table',
  `days_before` decimal(10,2) NOT NULL,
  `trip_days` decimal(10,2) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency_id` int NOT NULL COMMENT 'Related to currency table',
  `stage` enum('A','R') NOT NULL DEFAULT 'A',
  `status` enum('A','X') NOT NULL DEFAULT 'A',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Volcado de datos para la tabla `pasajes_viaticos_resume`
--

INSERT INTO `pasajes_viaticos_resume` (`id`, `users_sid`, `global_branch_office_id`, `person_id`, `request_id`, `days_before`, `trip_days`, `amount`, `currency_id`, `stage`, `status`, `created_at`, `updated_at`) VALUES
(7, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 1, '5.00', '2.00', '742.00', 2, 'A', 'A', '2022-11-18 10:08:44', '2022-11-18 10:08:44'),
(8, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 2, '2.00', '2.50', '927.50', 2, 'A', 'A', '2022-11-21 16:36:36', '2022-11-21 16:36:36'),
(9, '69abe0de-7812-41bd-9124-6a7238aee7d1', '69abe0de-7812-41bd-9124-6a7238aee7d1', 1, 3, '4.00', '3.00', '1113.00', 2, 'A', 'A', '2022-12-15 11:49:25', '2022-12-15 11:49:25');

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `pasajes_viaticos_catalog_items`
--
ALTER TABLE `pasajes_viaticos_catalog_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pasajes_viaticos_catalog_items_value_IDX` (`value`) USING BTREE,
  ADD KEY `fk_users_sid_catalogs_items` (`users_sid`);

--
-- Indices de la tabla `pasajes_viaticos_configuration`
--
ALTER TABLE `pasajes_viaticos_configuration`
  ADD PRIMARY KEY (`relative`),
  ADD UNIQUE KEY `configuration.relative` (`relative`),
  ADD KEY `fk_users_configuration` (`users_sid`),
  ADD KEY `fk_administrative_affairs_configuration` (`administrative_affairs`),
  ADD KEY `fk_pyv_in_charge_configuration` (`pyv_in_charge`),
  ADD KEY `fk_currency_id_configuration` (`currency_id`);

--
-- Indices de la tabla `pasajes_viaticos_escala`
--
ALTER TABLE `pasajes_viaticos_escala`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_escala` (`users_sid`),
  ADD KEY `fk_type_id_escala` (`type_id`),
  ADD KEY `fk_subtype_id_escala` (`subtype_id`),
  ADD KEY `fk_categoria_viatico_id_escala` (`categoria_viatico_id`),
  ADD KEY `fk_currency_id_escala` (`currency_id`);

--
-- Indices de la tabla `pasajes_viaticos_fly_ticket_control`
--
ALTER TABLE `pasajes_viaticos_fly_ticket_control`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_fly_ticket_control` (`users_sid`),
  ADD KEY `fk_supplier_vendors_id_fly_ticket_control` (`supplier_vendors_id`),
  ADD KEY `fk_traveler_id_fly_ticket_control` (`traveler_id`),
  ADD KEY `fk_way_id_fly_ticket_control` (`way_id`),
  ADD KEY `fk_currency_id_fly_ticket_control` (`currency_id`);

--
-- Indices de la tabla `pasajes_viaticos_fly_ticket_related_request`
--
ALTER TABLE `pasajes_viaticos_fly_ticket_related_request`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_fly_ticket_related_request` (`users_sid`),
  ADD KEY `fk_request_id_fly_ticket_related_request` (`request_id`),
  ADD KEY `fk_fly_ticket_control_id_fly_ticket_related_request` (`fly_ticket_control_id`),
  ADD KEY `fk_way_id_fly_ticket_related_request` (`way_id`);

--
-- Indices de la tabla `pasajes_viaticos_itinerary`
--
ALTER TABLE `pasajes_viaticos_itinerary`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_itinerary` (`users_sid`),
  ADD KEY `fk_request_id_itinerary` (`request_id`),
  ADD KEY `fk_transportway_id_itinerary` (`transportway_id`),
  ADD KEY `id` (`id`);

--
-- Indices de la tabla `pasajes_viaticos_message_notification`
--
ALTER TABLE `pasajes_viaticos_message_notification`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_message_notification` (`users_sid`),
  ADD KEY `fk_request_id_message_notification` (`request_id`);

--
-- Indices de la tabla `pasajes_viaticos_relation`
--
ALTER TABLE `pasajes_viaticos_relation`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_relation` (`users_sid`),
  ADD KEY `fk_cargo_id_relation` (`cargo_id`),
  ADD KEY `fk_inmediato_superior_id_relation` (`inmediato_superior_id`),
  ADD KEY `fk_categoria_viatico_id_relation` (`categoria_viatico_id`),
  ADD KEY `fk_autoridad_id_relation` (`autoridad_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_administrative_resolution`
--
ALTER TABLE `pasajes_viaticos_request_administrative_resolution`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_administrative_resolution` (`users_sid`),
  ADD KEY `fk_request_id_request_administrative_resolution` (`request_id`),
  ADD KEY `fk_person_id_request_administrative_resolution` (`person_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_approve_reject`
--
ALTER TABLE `pasajes_viaticos_request_approve_reject`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_approve_reject` (`users_sid`),
  ADD KEY `fk_request_id_request_approve_reject` (`request_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_attachments`
--
ALTER TABLE `pasajes_viaticos_request_attachments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_attachments` (`users_sid`),
  ADD KEY `fk_request_id_request_attachments` (`request_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_calculation`
--
ALTER TABLE `pasajes_viaticos_request_calculation`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_calculation` (`users_sid`),
  ADD KEY `fk_request_id_request_calculation` (`request_id`),
  ADD KEY `fk_currency_id_request_calculation` (`currency_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_final_inform`
--
ALTER TABLE `pasajes_viaticos_request_final_inform`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_final_inform` (`users_sid`),
  ADD KEY `fk_request_id_request_final_inform` (`request_id`),
  ADD KEY `fk_addressed_to_id_request_final_inform` (`addressed_to_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_final_inform_cite`
--
ALTER TABLE `pasajes_viaticos_request_final_inform_cite`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_final_inform_cite` (`users_sid`),
  ADD KEY `fk_request_id_request_final_inform_cite` (`request_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_formulario_110`
--
ALTER TABLE `pasajes_viaticos_request_formulario_110`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_formulario_110` (`users_sid`),
  ADD KEY `fk_request_id_request_formulario_110` (`request_id`),
  ADD KEY `fk_currency_id_request_formulario_110` (`currency_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_itinerary`
--
ALTER TABLE `pasajes_viaticos_request_itinerary`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_itinerary` (`users_sid`),
  ADD KEY `fk_request_id_request_itinerary` (`request_id`),
  ADD KEY `fk_way_id_request_itinerary` (`way_id`),
  ADD KEY `fk_transportway_id_request_itinerary` (`transportway_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_reliquidation`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_reliquidation` (`users_sid`),
  ADD KEY `fk_request_id_request_reliquidation` (`request_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_reliquidation_itinerary`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation_itinerary`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_reliquidation_itinerary` (`users_sid`),
  ADD KEY `fk_request_id_request_reliquidation_itinerary` (`request_id`),
  ADD KEY `fk_itinerary_id_request_reliquidation_itinerary` (`itinerary_id`),
  ADD KEY `fk_way_id_request_reliquidation_itinerary` (`way_id`),
  ADD KEY `fk_transportway_id_request_reliquidation_itinerary` (`transportway_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_reliquidation_itinerary_costs`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation_itinerary_costs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_reliquidation_itinerary_costs` (`users_sid`),
  ADD KEY `fk_request_id_request_reliquidation_itinerary_costs` (`request_id`),
  ADD KEY `fk_currency_id_request_reliquidation_itinerary_costs` (`currency_id`);

--
-- Indices de la tabla `pasajes_viaticos_request_weekend_holliday`
--
ALTER TABLE `pasajes_viaticos_request_weekend_holliday`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_request_weekend_holliday` (`users_sid`),
  ADD KEY `fk_request_id_request_weekend_holliday` (`request_id`);

--
-- Indices de la tabla `pasajes_viaticos_resume`
--
ALTER TABLE `pasajes_viaticos_resume`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_users_sid_resume` (`users_sid`),
  ADD KEY `fk_person_id_resume` (`person_id`),
  ADD KEY `fk_request_id_resume` (`request_id`),
  ADD KEY `fk_currency_id_resume` (`currency_id`);

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_catalog_items`
--
ALTER TABLE `pasajes_viaticos_catalog_items`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_escala`
--
ALTER TABLE `pasajes_viaticos_escala`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_fly_ticket_control`
--
ALTER TABLE `pasajes_viaticos_fly_ticket_control`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_fly_ticket_related_request`
--
ALTER TABLE `pasajes_viaticos_fly_ticket_related_request`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_itinerary`
--
ALTER TABLE `pasajes_viaticos_itinerary`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_message_notification`
--
ALTER TABLE `pasajes_viaticos_message_notification`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_relation`
--
ALTER TABLE `pasajes_viaticos_relation`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_administrative_resolution`
--
ALTER TABLE `pasajes_viaticos_request_administrative_resolution`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_approve_reject`
--
ALTER TABLE `pasajes_viaticos_request_approve_reject`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_attachments`
--
ALTER TABLE `pasajes_viaticos_request_attachments`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_calculation`
--
ALTER TABLE `pasajes_viaticos_request_calculation`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_final_inform`
--
ALTER TABLE `pasajes_viaticos_request_final_inform`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_final_inform_cite`
--
ALTER TABLE `pasajes_viaticos_request_final_inform_cite`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_formulario_110`
--
ALTER TABLE `pasajes_viaticos_request_formulario_110`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_itinerary`
--
ALTER TABLE `pasajes_viaticos_request_itinerary`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_reliquidation`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_reliquidation_itinerary`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation_itinerary`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_reliquidation_itinerary_costs`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation_itinerary_costs`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_request_weekend_holliday`
--
ALTER TABLE `pasajes_viaticos_request_weekend_holliday`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT de la tabla `pasajes_viaticos_resume`
--
ALTER TABLE `pasajes_viaticos_resume`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- Restricciones para tablas volcadas
--

--
-- Filtros para la tabla `pasajes_viaticos_catalog_items`
--
ALTER TABLE `pasajes_viaticos_catalog_items`
  ADD CONSTRAINT `fk_users_sid_catalogs_items` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_configuration`
--
ALTER TABLE `pasajes_viaticos_configuration`
  ADD CONSTRAINT `fk_administrative_affairs_configuration` FOREIGN KEY (`administrative_affairs`) REFERENCES `core`.`global_users` (`sid`),
  ADD CONSTRAINT `fk_currency_id_configuration` FOREIGN KEY (`currency_id`) REFERENCES `core`.`global_currency` (`id`),
  ADD CONSTRAINT `fk_pyv_in_charge_configuration` FOREIGN KEY (`pyv_in_charge`) REFERENCES `core`.`global_users` (`sid`),
  ADD CONSTRAINT `fk_users_configuration` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_escala`
--
ALTER TABLE `pasajes_viaticos_escala`
  ADD CONSTRAINT `fk_categoria_viatico_id_escala` FOREIGN KEY (`categoria_viatico_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_currency_id_escala` FOREIGN KEY (`currency_id`) REFERENCES `core`.`global_currency` (`id`),
  ADD CONSTRAINT `fk_subtype_id_escala` FOREIGN KEY (`subtype_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_type_id_escala` FOREIGN KEY (`type_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_users_sid_escala` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_fly_ticket_control`
--
ALTER TABLE `pasajes_viaticos_fly_ticket_control`
  ADD CONSTRAINT `fk_currency_id_fly_ticket_control` FOREIGN KEY (`currency_id`) REFERENCES `core`.`global_currency` (`id`),
  ADD CONSTRAINT `fk_supplier_vendors_id_fly_ticket_control` FOREIGN KEY (`supplier_vendors_id`) REFERENCES `core_supplier`.`supplier_vendors` (`relative`),
  ADD CONSTRAINT `fk_traveler_id_fly_ticket_control` FOREIGN KEY (`traveler_id`) REFERENCES `core`.`global_users` (`sid`),
  ADD CONSTRAINT `fk_users_sid_fly_ticket_control` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`),
  ADD CONSTRAINT `fk_way_id_fly_ticket_control` FOREIGN KEY (`way_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`);

--
-- Filtros para la tabla `pasajes_viaticos_fly_ticket_related_request`
--
ALTER TABLE `pasajes_viaticos_fly_ticket_related_request`
  ADD CONSTRAINT `fk_fly_ticket_control_id_fly_ticket_related_request` FOREIGN KEY (`fly_ticket_control_id`) REFERENCES `pasajes_viaticos_fly_ticket_control` (`id`),
  ADD CONSTRAINT `fk_request_id_fly_ticket_related_request` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_fly_ticket_related_request` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`),
  ADD CONSTRAINT `fk_way_id_fly_ticket_related_request` FOREIGN KEY (`way_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`);

--
-- Filtros para la tabla `pasajes_viaticos_itinerary`
--
ALTER TABLE `pasajes_viaticos_itinerary`
  ADD CONSTRAINT `fk_request_id_itinerary` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_transportway_id_itinerary` FOREIGN KEY (`transportway_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_users_sid_itinerary` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_message_notification`
--
ALTER TABLE `pasajes_viaticos_message_notification`
  ADD CONSTRAINT `fk_request_id_message_notification` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_message_notification` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_relation`
--
ALTER TABLE `pasajes_viaticos_relation`
  ADD CONSTRAINT `fk_autoridad_id_relation` FOREIGN KEY (`autoridad_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_cargo_id_relation` FOREIGN KEY (`cargo_id`) REFERENCES `core`.`global_catalog_items` (`value`),
  ADD CONSTRAINT `fk_categoria_viatico_id_relation` FOREIGN KEY (`categoria_viatico_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_inmediato_superior_id_relation` FOREIGN KEY (`inmediato_superior_id`) REFERENCES `core`.`global_catalog_items` (`value`),
  ADD CONSTRAINT `fk_users_sid_relation` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_administrative_resolution`
--
ALTER TABLE `pasajes_viaticos_request_administrative_resolution`
  ADD CONSTRAINT `fk_person_id_request_administrative_resolution` FOREIGN KEY (`person_id`) REFERENCES `core`.`global_person` (`id`),
  ADD CONSTRAINT `fk_request_id_request_administrative_resolution` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_administrative_resolution` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_approve_reject`
--
ALTER TABLE `pasajes_viaticos_request_approve_reject`
  ADD CONSTRAINT `fk_request_id_request_approve_reject` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_approve_reject` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_attachments`
--
ALTER TABLE `pasajes_viaticos_request_attachments`
  ADD CONSTRAINT `fk_request_id_request_attachments` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_attachments` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_calculation`
--
ALTER TABLE `pasajes_viaticos_request_calculation`
  ADD CONSTRAINT `fk_currency_id_request_calculation` FOREIGN KEY (`currency_id`) REFERENCES `core`.`global_currency` (`id`),
  ADD CONSTRAINT `fk_request_id_request_calculation` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_calculation` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_final_inform`
--
ALTER TABLE `pasajes_viaticos_request_final_inform`
  ADD CONSTRAINT `fk_addressed_to_id_request_final_inform` FOREIGN KEY (`addressed_to_id`) REFERENCES `core`.`global_catalog_items` (`value`),
  ADD CONSTRAINT `fk_request_id_request_final_inform` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_final_inform` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_final_inform_cite`
--
ALTER TABLE `pasajes_viaticos_request_final_inform_cite`
  ADD CONSTRAINT `fk_request_id_request_final_inform_cite` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_final_inform_cite` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_formulario_110`
--
ALTER TABLE `pasajes_viaticos_request_formulario_110`
  ADD CONSTRAINT `fk_currency_id_request_formulario_110` FOREIGN KEY (`currency_id`) REFERENCES `core`.`global_currency` (`id`),
  ADD CONSTRAINT `fk_request_id_request_formulario_110` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_formulario_110` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_itinerary`
--
ALTER TABLE `pasajes_viaticos_request_itinerary`
  ADD CONSTRAINT `fk_request_id_request_itinerary` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_transportway_id_request_itinerary` FOREIGN KEY (`transportway_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_users_sid_request_itinerary` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`),
  ADD CONSTRAINT `fk_way_id_request_itinerary` FOREIGN KEY (`way_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`);

--
-- Filtros para la tabla `pasajes_viaticos_request_reliquidation`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation`
  ADD CONSTRAINT `fk_request_id_request_reliquidation` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_reliquidation` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_reliquidation_itinerary`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation_itinerary`
  ADD CONSTRAINT `fk_itinerary_id_request_reliquidation_itinerary` FOREIGN KEY (`itinerary_id`) REFERENCES `pasajes_viaticos_request_itinerary` (`id`),
  ADD CONSTRAINT `fk_request_id_request_reliquidation_itinerary` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_transportway_id_request_reliquidation_itinerary` FOREIGN KEY (`transportway_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`),
  ADD CONSTRAINT `fk_users_sid_request_reliquidation_itinerary` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`),
  ADD CONSTRAINT `fk_way_id_request_reliquidation_itinerary` FOREIGN KEY (`way_id`) REFERENCES `pasajes_viaticos_catalog_items` (`value`);

--
-- Filtros para la tabla `pasajes_viaticos_request_reliquidation_itinerary_costs`
--
ALTER TABLE `pasajes_viaticos_request_reliquidation_itinerary_costs`
  ADD CONSTRAINT `fk_currency_id_request_reliquidation_itinerary_costs` FOREIGN KEY (`currency_id`) REFERENCES `core`.`global_currency` (`id`),
  ADD CONSTRAINT `fk_request_id_request_reliquidation_itinerary_costs` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_reliquidation_itinerary_costs` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_request_weekend_holliday`
--
ALTER TABLE `pasajes_viaticos_request_weekend_holliday`
  ADD CONSTRAINT `fk_request_id_request_weekend_holliday` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_request_weekend_holliday` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);

--
-- Filtros para la tabla `pasajes_viaticos_resume`
--
ALTER TABLE `pasajes_viaticos_resume`
  ADD CONSTRAINT `fk_currency_id_resume` FOREIGN KEY (`currency_id`) REFERENCES `core`.`global_currency` (`id`),
  ADD CONSTRAINT `fk_person_id_resume` FOREIGN KEY (`person_id`) REFERENCES `core`.`global_person` (`id`),
  ADD CONSTRAINT `fk_request_id_resume` FOREIGN KEY (`request_id`) REFERENCES `pasajes_viaticos_request` (`id`),
  ADD CONSTRAINT `fk_users_sid_resume` FOREIGN KEY (`users_sid`) REFERENCES `core`.`global_users` (`sid`);
COMMIT;

