-- Table structure for rxf_retencionxdetalle_factura
-- ----------------------------
CREATE TABLE `rxf_retencionxdetalle_factura`  (
  `rxf_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de retención por detalle de factura',
  `rxf_id_def` int(11) NOT NULL COMMENT 'Llave principal de factura',
  `rxf_id_ret` int(11) NOT NULL COMMENT 'Llave principal de retenciones',
  `rxf_id_cmr` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de Comprobante retención',
  `rxf_monto` decimal(19, 6) NULL DEFAULT NULL COMMENT 'Monto retenido',
  `rxf_porcentaje` decimal(19, 2) NULL DEFAULT NULL COMMENT 'porcentaje retenido',
  `rxf_aplicado` tinyint(4) NULL DEFAULT NULL COMMENT '1=si, 0=no (si la retención ya fue aplicada a la factura)',
  `rxf_estado` tinyint(4) NOT NULL COMMENT '0=inactivo, 1=activo',
  `rxf_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `rxf_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `rxf_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `rxf_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`rxf_id`) USING BTREE,
  INDEX `fk_rxf_id_def`(`rxf_id_def` ASC) USING BTREE,
  INDEX `fk_rxf_id_ret`(`rxf_id_ret` ASC) USING BTREE,
  INDEX `fk_rxf_id_cmr`(`rxf_id_cmr` ASC) USING BTREE,
  CONSTRAINT `fk_rxf_id_cmr` FOREIGN KEY (`rxf_id_cmr`) REFERENCES `cmr_comprobante_retencion` (`cmr_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxf_id_def` FOREIGN KEY (`rxf_id_def`) REFERENCES `def_detalle_fact` (`def_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_rxf_id_ret` FOREIGN KEY (`rxf_id_ret`) REFERENCES `ret_retencion` (`ret_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Retención por detalle de factura.' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxf_retencionxdetalle_factura
-- ----------------------------
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (1, 115, 2, NULL, 0.000000, NULL, NULL, 1, 54, '2023-04-14 11:53:16', 54, '2023-04-14 11:53:16');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (2, 267, 2, NULL, 0.700000, NULL, NULL, 1, 1, '2024-07-01 10:22:26', 1, '2024-07-01 10:22:26');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (3, 268, 2, NULL, 0.070000, NULL, NULL, 1, 1, '2024-07-03 17:03:54', 1, '2024-07-03 17:03:54');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (4, 362, 2, NULL, 0.700000, NULL, NULL, 1, 1, '2024-08-20 16:50:39', 1, '2024-08-20 16:50:39');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (5, 391, 2, NULL, 3.550000, NULL, NULL, 1, 1, '2024-11-20 16:56:00', 1, '2024-11-20 16:56:00');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (6, 392, 2, NULL, 1.400000, NULL, NULL, 1, 1, '2024-11-21 10:42:26', 1, '2024-11-21 10:42:26');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (7, 393, 2, NULL, 2.500000, NULL, NULL, 1, 1, '2024-11-21 10:42:26', 1, '2024-11-21 10:42:26');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (8, 394, 2, NULL, 5.000000, NULL, NULL, 1, 1, '2024-11-21 21:30:24', 1, '2024-11-21 21:30:24');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (9, 395, 2, NULL, 2.000000, NULL, NULL, 1, 1, '2024-11-21 21:30:24', 1, '2024-11-21 21:30:24');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (10, 396, 2, NULL, 4.500000, NULL, NULL, 1, 1, '2024-11-26 13:10:41', 1, '2024-11-26 13:10:41');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (11, 398, 2, NULL, 10.000000, NULL, NULL, 1, 1, '2025-01-13 21:03:08', 1, '2025-01-13 21:03:08');
INSERT INTO `rxf_retencionxdetalle_factura` VALUES (12, 407, 2, NULL, 1.500000, NULL, NULL, 1, 1, '2025-01-27 15:25:13', 1, '2025-01-27 15:25:13');

-- ----------------------------
-- Table structure for rxi_requisicion_inventario
-- ----------------------------
CREATE TABLE `rxi_requisicion_inventario`  (
  `rxi_id` int(11) NOT NULL AUTO_INCREMENT,
  `rxi_id_bod` int(11) NULL DEFAULT NULL,
  `rxi_id_usu_solicita` int(11) NULL DEFAULT NULL COMMENT 'Usuario solicita (usario crea la requisición)',
  `rxi_id_usu_anulacion` int(11) NULL DEFAULT NULL COMMENT 'Usuario anula requisición',
  `rxi_id_usu_aprueba` int(11) NULL DEFAULT NULL COMMENT 'usuario aprueba requisición',
  `rxi_id_flu` int(11) NULL DEFAULT NULL COMMENT 'codigo de flujo',
  `rxi_id_prd` int(11) NULL DEFAULT NULL COMMENT 'codigo de prioridad',
  `rxi_id_emp` int(11) NULL DEFAULT NULL COMMENT 'Id de Empleado que usará o utilizara los productos de la requisición.',
  `rxi_id_ord` int(11) NULL DEFAULT NULL COMMENT 'Codigo de la orden',
  `rxi_id_pcl` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de proyecto por cliente',
  `rxi_id_psp` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de tipo de presupuesto',
  `rxi_id_ace` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de Actividad especifica',
  `rxi_id_acg` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de Actividad general',
  `rxi_id_suc_solicita` int(11) NULL DEFAULT NULL COMMENT 'sucursal que solicita',
  `rxi_id_emp_solicita` int(11) NULL DEFAULT NULL COMMENT 'Id de Empleado que solicita ',
  `rxi_numero` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Número correlativo de la requisición',
  `rxi_cliente` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Cliente',
  `rxi_descripcion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'descripcion',
  `rxi_tipo` int(11) NULL DEFAULT NULL COMMENT 'tipo 1=Producto, 2=servicio, 3=activo fijo ',
  `rxi_proceso_requisicion` tinyint(4) NULL DEFAULT NULL COMMENT 'tipo de proceso para la requisición 1=Para salida de inventario, 2=Para procesar oden de compra, 3=para solicitar un traslado',
  `rxi_fecha` datetime NULL DEFAULT NULL COMMENT 'Fecha registro',
  `rxi_descripcion_anulacion` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'este campo servira para argumentar el porque se esta anulando una requisicion.',
  `rxi_fecha_anulacion` datetime NULL DEFAULT NULL COMMENT 'Fecha anulación',
  `rxi_descripcion_finaliza` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'este campo servira para argumentar el porque se esta dando por despachada la requisición.',
  `rxi_justificacion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Justificación de la requisición.',
  `rxi_descripcion_entrega` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'descripcion de entrega.',
  `rxi_estado` tinyint(4) NULL DEFAULT NULL COMMENT '1 = Creada\r\n 2 = Pendiente de Autorizacion\r\n3 = Autorizada\r\n 4 = Rechazada\r\n 5 = Anulada\r\n 6 = Parcial\r\n 0 = Despachada',
  `rxi_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `rxi_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  `rxi_fecha_creacion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Auditoria',
  `rxi_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`rxi_id`) USING BTREE,
  INDEX `fk_rxi_id_flu`(`rxi_id_flu` ASC) USING BTREE,
  INDEX `fk_rxi_id_usu_anulacion`(`rxi_id_usu_anulacion` ASC) USING BTREE,
  INDEX `fk_rxi_id_usu_aprueba`(`rxi_id_usu_aprueba` ASC) USING BTREE,
  INDEX `fk_rxi_id_usu_solicita`(`rxi_id_usu_solicita` ASC) USING BTREE,
  INDEX `fk_rxi_id_bod`(`rxi_id_bod` ASC) USING BTREE,
  INDEX `fk_rxi_id_prd`(`rxi_id_prd` ASC) USING BTREE,
  INDEX `fk_rxi_id_emp`(`rxi_id_emp` ASC) USING BTREE,
  INDEX `fk_rxi_id_ord`(`rxi_id_ord` ASC) USING BTREE,
  INDEX `fk_rxi_id_pcl`(`rxi_id_pcl` ASC) USING BTREE,
  INDEX `fk_rxi_id_psp`(`rxi_id_psp` ASC) USING BTREE,
  INDEX `fk_rxi_id_ace`(`rxi_id_ace` ASC) USING BTREE,
  INDEX `fk_rxi_id_acg`(`rxi_id_acg` ASC) USING BTREE,
  CONSTRAINT `fk_rxi_id_ace` FOREIGN KEY (`rxi_id_ace`) REFERENCES `ace_actividad_especifica` (`ace_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_acg` FOREIGN KEY (`rxi_id_acg`) REFERENCES `acg_actividad_general` (`acg_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_bod` FOREIGN KEY (`rxi_id_bod`) REFERENCES `bod_bodega` (`bod_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_emp` FOREIGN KEY (`rxi_id_emp`) REFERENCES `emp_empleado` (`emp_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_flu` FOREIGN KEY (`rxi_id_flu`) REFERENCES `flu_flujo` (`flu_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_ord` FOREIGN KEY (`rxi_id_ord`) REFERENCES `ord_orden` (`ord_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_pcl` FOREIGN KEY (`rxi_id_pcl`) REFERENCES `pcl_proyecto_cliente` (`pcl_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_prd` FOREIGN KEY (`rxi_id_prd`) REFERENCES `prd_prioridad` (`prd_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_psp` FOREIGN KEY (`rxi_id_psp`) REFERENCES `psp_presupuesto` (`psp_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_usu_anulacion` FOREIGN KEY (`rxi_id_usu_anulacion`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_usu_aprueba` FOREIGN KEY (`rxi_id_usu_aprueba`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxi_id_usu_solicita` FOREIGN KEY (`rxi_id_usu_solicita`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 38 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxi_requisicion_inventario
-- ----------------------------
INSERT INTO `rxi_requisicion_inventario` VALUES (1, NULL, 1, NULL, 1, 3, 3, NULL, NULL, NULL, NULL, NULL, NULL, 1, 87, '2021-00001', NULL, 'TINTAS', 4, NULL, '2021-02-18 00:00:00', NULL, NULL, NULL, '', '', 0, 1, '2021-02-18 11:26:44', '2021-02-18 11:12:40', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (2, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-00002', NULL, 'Compra de maiz ', 1, NULL, '2021-04-23 00:00:00', NULL, NULL, NULL, '', '', 1, 1, '2021-04-23 11:39:00', '2021-04-23 11:39:00', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (3, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-00003', NULL, 'test', 1, NULL, '2021-08-25 00:00:00', NULL, NULL, NULL, '', '', 2, 1, '2021-08-25 16:49:25', '2021-08-25 04:49:15', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (4, NULL, 1, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-00004', NULL, 'Compra', 1, NULL, '2021-10-20 00:00:00', NULL, NULL, NULL, '', '', 3, 1, '2021-11-05 17:35:02', '2021-10-20 10:23:22', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (5, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-00005', NULL, 'test', 1, NULL, '2021-11-05 00:00:00', NULL, NULL, NULL, '', '', 2, 1, '2021-11-05 17:37:12', '2021-11-05 05:37:02', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (6, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-00006', NULL, 'test2', 1, NULL, '2021-11-05 00:00:00', NULL, NULL, NULL, '', '', 2, 1, '2021-11-05 17:41:12', '2021-11-05 05:40:43', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (7, NULL, 1, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2021-00007', NULL, 'Compra', 1, NULL, '2021-11-10 00:00:00', NULL, NULL, NULL, '', '', 0, 1, '2021-11-10 15:59:56', '2021-11-10 03:55:51', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (8, NULL, 1, NULL, 1, 3, 3, NULL, NULL, NULL, NULL, NULL, NULL, 1, 4, '2022-00008', NULL, 'Resma de Papel', 1, NULL, '2022-01-18 00:00:00', NULL, NULL, NULL, '', '', 3, 1, '2022-01-18 09:57:24', '2022-01-18 09:56:10', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (9, NULL, 1, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2022-00009', NULL, 'Compra de materiales', 1, NULL, '2022-01-18 00:00:00', NULL, NULL, NULL, '', '', 0, 1, '2022-01-18 11:34:39', '2022-01-18 11:22:13', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (10, 5, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00001', NULL, 'Para operaciones de enero ', 1, NULL, '2022-01-18 00:00:00', NULL, NULL, NULL, NULL, NULL, 0, 1, '2022-01-18 11:55:46', '2022-01-18 11:45:26', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (11, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00002', NULL, 'Consumo mes nov', 1, NULL, '2022-11-15 00:00:00', NULL, NULL, NULL, NULL, NULL, 0, 1, '2024-09-27 14:33:37', '2022-11-15 03:39:39', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (12, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00003', NULL, 'Pedido Carne', 1, NULL, '2023-01-13 00:00:00', NULL, NULL, NULL, NULL, NULL, 6, 1, '2023-01-13 11:24:49', '2023-01-13 11:22:52', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (13, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00004', NULL, 'compra desinfectante', 1, NULL, '2023-05-12 00:00:00', NULL, NULL, NULL, NULL, NULL, 3, 1, '2024-03-12 15:33:20', '2023-05-12 10:02:55', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (14, NULL, 1, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-00010', NULL, 'Pedido de mercaderia 19052023', 1, NULL, '2023-05-19 00:00:00', NULL, NULL, NULL, '', '', 0, 1, '2023-05-19 10:38:34', '2023-05-19 10:32:12', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (15, 6, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00005', NULL, 'Requsicion de papeleria mes mayo 2023', 1, NULL, '2023-05-24 00:00:00', NULL, NULL, NULL, NULL, NULL, 6, 1, '2023-05-24 12:02:04', '2023-05-24 11:59:21', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (16, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00006', NULL, 'solicitud de materiales', 1, NULL, '2023-08-18 00:00:00', NULL, NULL, NULL, NULL, NULL, 6, 1, '2023-08-18 09:57:32', '2023-08-18 09:49:10', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (17, NULL, 1, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-00011', NULL, 'test', 1, NULL, '2023-11-28 00:00:00', NULL, NULL, NULL, '', '', 3, 1, '2023-11-28 10:55:45', '2023-11-28 10:42:26', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (18, NULL, 1, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-00012', NULL, 'test', 1, NULL, '2023-11-28 00:00:00', NULL, NULL, NULL, '', '', 3, 1, '2023-11-28 10:55:24', '2023-11-28 10:50:01', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (19, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-00013', NULL, 'test', 1, NULL, '2023-11-28 00:00:00', NULL, NULL, NULL, '', '', 2, 1, '2023-11-28 11:03:52', '2023-11-28 11:03:39', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (20, NULL, 1, NULL, NULL, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-00014', NULL, 'Faltante de caja', 1, NULL, '2023-11-28 00:00:00', NULL, NULL, NULL, '', '', 2, 1, '2023-11-28 11:18:07', '2023-11-28 11:16:31', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (21, NULL, 1, NULL, 1, 3, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-00015', NULL, 'test', 1, NULL, '2024-01-17 00:00:00', NULL, NULL, NULL, '', '', 2, 1, '2024-01-17 22:05:51', '2024-01-17 10:00:24', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (22, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00007', NULL, 'Materiaales para reparaciones', 1, NULL, '2024-02-08 00:00:00', NULL, NULL, NULL, NULL, NULL, 6, 1, '2024-02-08 10:33:08', '2024-02-08 10:20:09', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (23, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00008', NULL, 'repuestos', 1, NULL, '2024-02-08 00:00:00', NULL, NULL, NULL, NULL, NULL, 3, 1, '2024-02-08 10:49:42', '2024-02-08 10:49:10', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (24, 1, 1, NULL, NULL, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00009', NULL, 'Solicitud', 1, NULL, '2024-04-24 00:00:00', NULL, NULL, NULL, NULL, NULL, 2, 1, '2024-04-24 04:04:46', '2024-04-24 04:03:46', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (25, 1, 1, NULL, NULL, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00010', NULL, 'PRODUCTO', 1, NULL, '2024-05-03 00:00:00', NULL, NULL, NULL, NULL, NULL, 2, 1, '2024-05-03 03:14:07', '2024-05-03 03:13:30', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (26, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00011', NULL, 'Abastecimiento de bodega 2', 1, NULL, '2024-06-19 00:00:00', NULL, NULL, NULL, NULL, NULL, 0, 1, '2024-06-19 10:54:35', '2024-06-19 09:57:34', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (27, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00012', NULL, 'Se ha agotado el stock', 1, NULL, '2024-07-02 00:00:00', NULL, NULL, NULL, NULL, NULL, 0, 1, '2024-07-02 09:44:47', '2024-07-02 09:40:43', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (28, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00013', NULL, 'Pedido mensual de mecarderia', 1, NULL, '2024-07-16 00:00:00', NULL, NULL, NULL, NULL, NULL, 6, 1, '2024-07-16 11:35:12', '2024-07-16 11:12:52', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (29, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00014', NULL, 'abstaecimiento', 1, NULL, '2024-07-29 00:00:00', NULL, NULL, NULL, NULL, NULL, 3, 1, '2024-07-29 10:49:39', '2024-07-29 10:49:39', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (30, NULL, 49, NULL, NULL, 3, 2, NULL, NULL, NULL, NULL, NULL, NULL, 1, 85, '2024-00016', NULL, 'prueba', 1, NULL, '2024-07-29 00:00:00', NULL, NULL, NULL, '.', '.', 1, 49, '2024-07-29 04:01:07', '2024-07-29 04:01:07', 49);
INSERT INTO `rxi_requisicion_inventario` VALUES (31, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00015', NULL, 'Traslado', 1, NULL, '2024-08-28 00:00:00', NULL, NULL, NULL, NULL, NULL, 3, 1, '2024-08-28 16:46:42', '2024-08-28 04:46:42', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (32, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00016', NULL, 'Solciitud de material ', 1, NULL, '2024-09-27 00:00:00', NULL, NULL, NULL, NULL, NULL, 6, 1, '2024-09-27 14:32:04', '2024-09-27 02:30:39', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (33, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00017', NULL, 'Productos a solicitar', 1, NULL, '2025-01-06 00:00:00', NULL, NULL, NULL, NULL, NULL, 3, 1, '2025-01-06 15:19:21', '2025-01-06 03:18:03', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (34, 1, 1, NULL, 1, 1, NULL, 9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00018', NULL, 'Nota descripcion', 1, NULL, '2025-01-06 00:00:00', NULL, NULL, NULL, NULL, NULL, 3, 1, '2025-01-06 15:31:35', '2025-01-06 03:24:10', 1);
INSERT INTO `rxi_requisicion_inventario` VALUES (35, NULL, 65, NULL, NULL, 3, NULL, NULL, 92, NULL, NULL, NULL, NULL, NULL, NULL, '00017', NULL, 'Requisición de compras por Planificación de Producción', 1, NULL, '2025-02-24 09:18:38', NULL, NULL, NULL, NULL, NULL, 1, 65, '2025-02-24 09:18:38', '2025-02-24 09:18:38', 65);
INSERT INTO `rxi_requisicion_inventario` VALUES (36, 1, 65, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '00019', NULL, 'Requisición de Inventario por Programación de Producción', 1, NULL, '2025-02-24 09:59:18', NULL, NULL, NULL, 'Requisición de Inventario por Programación de Producción', NULL, 3, 1, '2025-02-24 10:03:55', '2025-02-24 09:59:18', 65);
INSERT INTO `rxi_requisicion_inventario` VALUES (37, 1, 65, NULL, NULL, 1, NULL, 1, 94, NULL, NULL, NULL, NULL, NULL, NULL, '00020', 'GRUPO SATELITE CASA MATRIZ', NULL, 1, 1, '2025-02-24 10:02:22', NULL, NULL, NULL, NULL, NULL, 1, 65, '2025-02-24 10:02:22', '2025-02-24 10:02:22', 65);

-- ----------------------------
-- Table structure for rxl_riesgoxplaza
-- ----------------------------
CREATE TABLE `rxl_riesgoxplaza`  (
  `rxl_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de riesgo por plaza',
  `rxl_id_nir` int(11) NOT NULL COMMENT 'Llave principal de nivel de riesgo',
  `rxl_id_tri` int(11) NOT NULL COMMENT 'Llave principal de tipo de riesgo',
  `rxl_id_plz` int(11) NOT NULL COMMENT 'llave de primaria del registro',
  `rxl_estado` tinyint(4) NOT NULL COMMENT 'Estado del registro 1=activo, 0=inactivo',
  `rxl_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxl_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `rxl_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxl_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`rxl_id`) USING BTREE,
  INDEX `fk_rxl_id_nir`(`rxl_id_nir` ASC) USING BTREE,
  INDEX `fk_rxl_id_plz`(`rxl_id_plz` ASC) USING BTREE,
  INDEX `fk_rxl_id_tri`(`rxl_id_tri` ASC) USING BTREE,
  CONSTRAINT `fk_rxl_id_nir` FOREIGN KEY (`rxl_id_nir`) REFERENCES `nir_nivel_riesgo` (`nir_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_rxl_id_plz` FOREIGN KEY (`rxl_id_plz`) REFERENCES `plz_plaza` (`plz_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_rxl_id_tri` FOREIGN KEY (`rxl_id_tri`) REFERENCES `tri_tipo_riesgo` (`tri_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Riesgos por plaza' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxl_riesgoxplaza
-- ----------------------------

-- ----------------------------
-- Table structure for rxp_rolxpaso
-- ----------------------------
CREATE TABLE `rxp_rolxpaso`  (
  `rxp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'codigo principal de relacion',
  `rxp_id_psf` int(11) NOT NULL COMMENT 'codigo de paso por flujo',
  `rxp_id_rol` int(11) NOT NULL COMMENT 'codigo principal de relacion',
  `rxp_estado` int(11) NOT NULL COMMENT 'estado de registro',
  `rxp_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxp_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxp_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `rxp_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`rxp_id`) USING BTREE,
  INDEX `fk_rxp_id_rol`(`rxp_id_rol` ASC) USING BTREE,
  INDEX `fk_psf_id_rxp`(`rxp_id_psf` ASC) USING BTREE,
  CONSTRAINT `fk_psf_id_rxp` FOREIGN KEY (`rxp_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxp_id_rol` FOREIGN KEY (`rxp_id_rol`) REFERENCES `rol_rol` (`rol_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 37 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'roles aosciados en cada paso' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxp_rolxpaso
-- ----------------------------
INSERT INTO `rxp_rolxpaso` VALUES (2, 2, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (3, 1, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (5, 1, 4, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (6, 6, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (7, 7, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (8, 7, 4, 1, 1, 1, '2019-07-23 00:00:00', '2021-11-05 17:36:21');
INSERT INTO `rxp_rolxpaso` VALUES (9, 8, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (13, 11, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (14, 12, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (15, 5, 3, 1, 1, 1, '2019-07-23 00:00:00', '2019-07-23 00:00:00');
INSERT INTO `rxp_rolxpaso` VALUES (21, 14, 3, 1, 1, 1, '2019-07-24 10:03:37', '2019-07-24 10:10:54');
INSERT INTO `rxp_rolxpaso` VALUES (22, 14, 20, 1, 1, 1, '2019-07-24 10:14:43', '2019-10-21 16:23:54');
INSERT INTO `rxp_rolxpaso` VALUES (23, 15, 3, 1, 1, 1, '2019-07-24 10:16:12', '2019-10-21 16:24:12');
INSERT INTO `rxp_rolxpaso` VALUES (24, 15, 20, 1, 1, 1, '2019-07-24 10:16:59', '2019-10-23 14:54:04');
INSERT INTO `rxp_rolxpaso` VALUES (25, 16, 7, 1, 1, 1, '2019-07-24 10:36:56', '2019-07-24 10:36:56');
INSERT INTO `rxp_rolxpaso` VALUES (26, 16, 3, 1, 1, 1, '2019-07-24 10:37:10', '2019-07-24 10:37:10');
INSERT INTO `rxp_rolxpaso` VALUES (28, 17, 3, 1, 1, 1, '2019-10-21 16:24:47', '2019-10-21 16:24:47');
INSERT INTO `rxp_rolxpaso` VALUES (29, 17, 4, 1, 1, 1, '2019-10-21 16:25:03', '2022-01-18 10:42:21');
INSERT INTO `rxp_rolxpaso` VALUES (30, 17, 20, 1, 1, 1, '2019-10-21 16:25:21', '2019-10-21 16:25:21');
INSERT INTO `rxp_rolxpaso` VALUES (33, 20, 1, 1, 1, 1, '2021-08-24 15:31:07', '2021-08-24 15:31:07');
INSERT INTO `rxp_rolxpaso` VALUES (34, 21, 1, 1, 1, 1, '2021-08-24 15:32:07', '2021-08-24 15:45:52');
INSERT INTO `rxp_rolxpaso` VALUES (35, 22, 1, 1, 1, 1, '2021-08-24 15:33:08', '2021-08-24 15:33:08');
INSERT INTO `rxp_rolxpaso` VALUES (36, 23, 1, 1, 1, 1, '2021-08-24 15:33:38', '2023-05-24 11:44:13');

-- ----------------------------
-- Table structure for rxs_rifaxsucursal
-- ----------------------------
CREATE TABLE `rxs_rifaxsucursal`  (
  `rxs_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'LLave principal de rifa por sucursal',
  `rxs_id_crf` int(11) NOT NULL COMMENT 'LLave principal de Configuracion rifa',
  `rxs_id_suc` int(11) NOT NULL COMMENT 'Identificador de la sucursal',
  `rxs_estado` tinyint(4) NOT NULL COMMENT '1=activo, 0=inactivo',
  `rxs_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxs_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `rxs_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxs_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`rxs_id`) USING BTREE,
  INDEX `fk_rxs_id_crf`(`rxs_id_crf` ASC) USING BTREE,
  INDEX `fk_rxs_id_suc`(`rxs_id_suc` ASC) USING BTREE,
  CONSTRAINT `fk_rxs_id_crf` FOREIGN KEY (`rxs_id_crf`) REFERENCES `crf_configuracion_rifa` (`crf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_rxs_id_suc` FOREIGN KEY (`rxs_id_suc`) REFERENCES `suc_sucursal` (`suc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Rifas por sucursal' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxs_rifaxsucursal
-- ----------------------------
INSERT INTO `rxs_rifaxsucursal` VALUES (1, 2, 1, 1, 1, '2018-11-30 14:12:38', 1, '2018-11-30 14:12:38');

-- ----------------------------
-- Table structure for rxt_articuloxtabla_llamada
-- ----------------------------
CREATE TABLE `rxt_articuloxtabla_llamada`  (
  `rxt_id` int(11) NOT NULL AUTO_INCREMENT,
  `rxt_id_tbl` int(11) NOT NULL,
  `rxt_id_art` int(11) NOT NULL,
  `rxt_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `rxt_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxt_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `rxt_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxt_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`rxt_id`) USING BTREE,
  INDEX `fk_rxt_id_tbl`(`rxt_id_tbl` ASC) USING BTREE,
  INDEX `fk_rxt_id_art`(`rxt_id_art` ASC) USING BTREE,
  CONSTRAINT `fk_rxt_id_art` FOREIGN KEY (`rxt_id_art`) REFERENCES `art_articulo` (`art_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_rxt_id_tbl` FOREIGN KEY (`rxt_id_tbl`) REFERENCES `tbl_tabla_llamadas` (`tbl_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxt_articuloxtabla_llamada
-- ----------------------------

-- ----------------------------
-- Table structure for rxv_retencionxorden_venta
-- ----------------------------
CREATE TABLE `rxv_retencionxorden_venta`  (
  `rxv_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave primaria de retencion por detalle de orden venta',
  `rxv_id_dov` int(11) NOT NULL COMMENT 'Llave primaria de detalle de Orden de venta',
  `rxv_id_ret` int(11) NOT NULL COMMENT 'Llave principal de retenciones',
  `rxv_monto` decimal(19, 6) NOT NULL COMMENT 'Monto',
  `rxv_porcentaje` decimal(19, 6) NOT NULL COMMENT 'Porcentaje que en su momento poseia la retención (bitacora)',
  `rxv_estado` int(11) NOT NULL COMMENT 'Estado de registro (1=activo, 0=inactivo)',
  `rxv_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxv_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `rxv_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxv_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`rxv_id`) USING BTREE,
  INDEX `fk_rxv_id_dov`(`rxv_id_dov` ASC) USING BTREE,
  INDEX `fk_rxv_id_ret`(`rxv_id_ret` ASC) USING BTREE,
  CONSTRAINT `fk_rxv_id_dov` FOREIGN KEY (`rxv_id_dov`) REFERENCES `dov_detalle_orden_venta` (`dov_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_rxv_id_ret` FOREIGN KEY (`rxv_id_ret`) REFERENCES `ret_retencion` (`ret_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxv_retencionxorden_venta
-- ----------------------------

-- ----------------------------
-- Table structure for rxz_retencionxcotizacion
-- ----------------------------
CREATE TABLE `rxz_retencionxcotizacion`  (
  `rxz_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal- relacion',
  `rxz_id_axc` int(11) NULL DEFAULT NULL COMMENT 'articulo por cotizacion',
  `rxz_id_ret` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de retenciones',
  `rxz_monto` decimal(19, 2) NOT NULL COMMENT 'Monto de impuesto retenido',
  `rxz_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `rxz_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `rxz_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `rxz_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoría',
  `rxz_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoría',
  PRIMARY KEY (`rxz_id`) USING BTREE,
  INDEX `fk_rxz_id_axc`(`rxz_id_axc` ASC) USING BTREE,
  INDEX `fk_rxz_id_ret`(`rxz_id_ret` ASC) USING BTREE,
  CONSTRAINT `fk_rxz_id_axc` FOREIGN KEY (`rxz_id_axc`) REFERENCES `axc_articuloxcotizacion` (`axc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_rxz_id_ret` FOREIGN KEY (`rxz_id_ret`) REFERENCES `ret_retencion` (`ret_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Tabla de detalle de retencion por cotizacion' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of rxz_retencionxcotizacion
-- ----------------------------

-- ----------------------------
-- Table structure for sar_saldo_articulo
-- ----------------------------
CREATE TABLE `sar_saldo_articulo`  (
  `sar_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave prinicipal - Saldos de Inventarios',
  `sar_id_art` int(11) NOT NULL COMMENT 'Llave prinicipal - articulos',
  `sar_id_sxb` int(11) NULL DEFAULT NULL COMMENT 'llave principal de sectores por bodega',
  `sar_id_bod` int(11) NOT NULL COMMENT 'Llave prinicipal - Bodegas',
  `sar_cant_actual` decimal(19, 4) NOT NULL COMMENT 'Cantidad Actual',
  `sar_precio` decimal(19, 10) NOT NULL COMMENT 'Precio de costo',
  `sar_fecha_caducidad` datetime NULL DEFAULT NULL COMMENT 'Fecha de caducidad ',
  `sar_estado` tinyint(4) NOT NULL COMMENT 'Estado del Registro 1=activo, 0=inactivo',
  `sar_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sar_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sar_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sar_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  `sar_id_dpv` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de documento proveedor',
  PRIMARY KEY (`sar_id`) USING BTREE,
  INDEX `fk_sar_id_art`(`sar_id_art` ASC) USING BTREE,
  INDEX `fk_sar_id_bod`(`sar_id_bod` ASC) USING BTREE,
  INDEX `fk_sar_id_sxb`(`sar_id_sxb` ASC) USING BTREE,
  CONSTRAINT `fk_sar_id_art` FOREIGN KEY (`sar_id_art`) REFERENCES `art_articulo` (`art_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sar_id_bod` FOREIGN KEY (`sar_id_bod`) REFERENCES `bod_bodega` (`bod_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sar_id_sxb` FOREIGN KEY (`sar_id_sxb`) REFERENCES `sxb_sectorxbodega` (`sxb_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 167 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sar_saldo_articulo
-- ----------------------------
INSERT INTO `sar_saldo_articulo` VALUES (1, 42, NULL, 5, 45.0000, 4.8489580000, NULL, 1, 1, '2022-01-18 09:52:31', 1, '2022-01-18 11:55:45', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (2, 42, NULL, 5, 100.0000, 4.8489580000, NULL, 1, 1, '2022-01-18 11:40:55', 1, '2022-01-18 11:40:55', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (3, 42, NULL, 1, 25.0000, 1.6666670000, NULL, 1, 1, '2022-01-18 11:48:56', 1, '2024-09-27 14:32:04', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (4, 1, NULL, 1, 0.0000, 5.0000000000, NULL, 1, 1, '2022-01-18 11:51:19', 1, '2024-07-11 12:43:04', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (5, 5, NULL, 1, 50.0000, 4.0000000000, NULL, 1, 1, '2022-01-18 11:51:19', 1, '2022-01-18 11:51:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (6, 6, NULL, 1, 43.0000, 3.0000000000, NULL, 1, 1, '2022-01-18 11:51:19', 1, '2024-10-08 18:03:41', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (7, 42, NULL, 5, 15.0000, 4.8489580000, NULL, 1, 1, '2022-01-18 11:56:59', 1, '2022-01-18 11:56:59', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (8, 43, NULL, 1, 0.0000, 1.4606710000, NULL, 1, 1, '2022-11-15 14:46:02', 1, '2024-05-20 10:44:44', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (9, 45, NULL, 1, 80.0000, 2.5526320000, NULL, 1, 1, '2022-11-15 15:24:43', 1, '2024-07-16 11:35:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (10, 44, NULL, 1, 245.0000, 2.7115380000, NULL, 1, 1, '2022-11-15 15:24:43', 1, '2024-07-16 11:35:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (11, 43, NULL, 1, 60.0000, 1.4606710000, NULL, 1, 1, '2022-11-15 15:24:43', 1, '2024-09-27 14:33:37', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (12, 43, NULL, 1, 200.0000, 1.4606710000, NULL, 1, 1, '2022-11-15 15:33:41', 1, '2022-11-15 15:33:41', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (13, 48, NULL, 1, 254.0000, 2.7500000000, NULL, 1, 1, '2023-01-13 09:55:53', 1, '2025-02-14 11:13:02', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (14, 46, NULL, 1, 0.0000, 3.5000000000, NULL, 1, 1, '2023-01-13 09:55:53', 1, '2024-02-08 11:02:49', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (15, 47, NULL, 1, 53.0000, 3.2000000000, NULL, 1, 1, '2023-01-13 09:55:53', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (16, 49, NULL, 1, 250.0000, 1.7500000000, NULL, 1, 1, '2023-01-13 09:55:53', 1, '2023-01-13 09:55:53', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (17, 56, NULL, 1, 2.0000, 100.0000000000, NULL, 1, 1, '2023-01-13 10:22:46', 1, '2023-01-13 10:22:46', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (18, 46, NULL, 1, 439.0000, 3.5000000000, NULL, 1, 1, '2023-01-13 11:20:48', 1, '2024-08-06 20:28:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (19, 46, NULL, 5, 30.0000, 3.5000000000, NULL, 1, 1, '2023-01-13 11:24:49', 1, '2023-01-13 11:24:49', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (20, 47, NULL, 1, 250.0000, 3.2000000000, NULL, 1, 1, '2023-01-13 11:27:33', 1, '2023-01-13 11:27:33', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (21, 52, NULL, 1, 195.0000, 105.9000000000, NULL, 1, 1, '2023-01-13 12:25:53', 1, '2023-01-13 12:25:53', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (22, 47, NULL, 1, 500.0000, 3.2000000000, NULL, 1, 1, '2023-01-31 13:06:49', 1, '2023-01-31 13:06:49', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (23, 67, NULL, 1, 0.0000, 0.0090000000, NULL, 1, 1, '2023-04-18 10:19:55', 1, '2024-08-06 20:28:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (24, 67, NULL, 1, 1000.0000, 0.0090000000, NULL, 1, 1, '2023-04-18 11:28:10', 1, '2023-04-18 11:28:10', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (25, 74, NULL, 1, 0.0000, 2.6412990000, '2024-12-31 00:00:00', 1, 1, '2023-05-19 09:18:08', 1, '2024-07-29 10:46:10', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (26, 75, NULL, 1, 0.0000, 0.9870000000, '2025-06-25 00:00:00', 1, 1, '2023-05-19 09:18:08', 1, '2024-07-29 10:46:10', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (27, 76, NULL, 1, 290.0000, 0.0900000000, '2026-09-16 00:00:00', 1, 1, '2023-05-19 09:18:08', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (28, 77, NULL, 1, 7.0000, 1.4916670000, '2024-02-02 00:00:00', 1, 1, '2023-05-19 09:18:08', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (29, 78, NULL, 1, 398.0000, 0.1100000000, '2026-05-31 00:00:00', 1, 1, '2023-05-19 09:18:08', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (30, 79, NULL, 1, 200.0000, 0.0700000000, '2024-08-06 00:00:00', 1, 1, '2023-05-19 09:18:08', 1, '2023-05-19 09:25:38', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (31, 74, NULL, 5, 15.0000, 2.6400000000, '2024-12-31 00:00:00', 1, 1, '2023-05-19 09:25:38', 1, '2023-05-19 09:25:38', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (32, 75, NULL, 5, 100.0000, 0.8000000000, '2025-06-25 00:00:00', 1, 1, '2023-05-19 09:25:38', 1, '2023-05-19 09:25:38', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (33, 76, NULL, 5, 200.0000, 0.0900000000, '2026-09-16 00:00:00', 1, 1, '2023-05-19 09:25:38', 1, '2023-05-19 09:25:38', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (34, 77, NULL, 5, 10.0000, 1.4500000000, '2024-02-02 00:00:00', 1, 1, '2023-05-19 09:25:38', 1, '2023-05-19 09:25:38', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (35, 78, NULL, 5, 200.0000, 0.1100000000, '2026-05-31 00:00:00', 1, 1, '2023-05-19 09:25:38', 1, '2023-05-19 09:25:38', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (36, 79, NULL, 5, 100.0000, 0.0700000000, '2024-08-06 00:00:00', 1, 1, '2023-05-19 09:25:38', 1, '2023-05-19 09:25:38', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (37, 77, NULL, 1, 100.0000, 1.4916670000, NULL, 1, 1, '2023-05-19 10:42:05', 1, '2023-05-19 10:42:05', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (38, 75, NULL, 1, 0.0000, 0.9870000000, NULL, 1, 1, '2023-05-19 10:42:05', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (39, 80, NULL, 1, 1000.0000, 0.5068560000, NULL, 1, 1, '2023-05-23 11:41:43', 1, '2023-05-23 11:41:43', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (40, 80, NULL, 1, 974.0000, 0.5068560000, NULL, 1, 1, '2023-05-23 11:41:43', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (41, 76, NULL, 1, 100.0000, 0.0900000000, NULL, 1, 1, '2023-05-23 11:54:29', 1, '2023-05-23 11:54:29', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (42, 74, NULL, 1, 998318.0000, 2.6412990000, '2023-06-21 00:00:00', 1, 1, '2023-05-23 12:00:44', 1, '2025-02-10 08:49:05', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (43, 74, NULL, 1, 500.0000, 2.6412990000, '2023-08-31 00:00:00', 1, 1, '2023-05-23 12:02:12', 1, '2023-05-23 12:02:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (44, 81, NULL, 1, 5000.0000, 0.6500000000, NULL, 1, 1, '2023-05-23 12:09:54', 1, '2023-05-23 12:09:54', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (45, 81, NULL, 1, 4994.0000, 0.6500000000, NULL, 1, 1, '2023-05-23 12:09:54', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (46, 82, NULL, 6, 495.0000, 6.3571430000, NULL, 1, 1, '2023-05-24 11:34:03', 1, '2023-05-24 12:02:04', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (47, 45, NULL, 6, 90.0000, 2.1666670000, NULL, 1, 1, '2023-05-24 11:34:03', 1, '2023-05-24 12:09:48', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (48, 82, NULL, 6, 200.0000, 6.3571430000, NULL, 1, 1, '2023-05-24 11:52:23', 1, '2023-05-24 11:52:23', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (49, 45, NULL, 6, 200.0000, 2.1666670000, NULL, 1, 1, '2023-05-24 11:52:23', 1, '2023-05-24 11:52:23', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (50, 82, NULL, 6, 100.0000, 6.3571430000, NULL, 1, 1, '2023-05-24 12:09:34', 1, '2023-05-24 12:09:34', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (51, 83, NULL, 1, 50.0000, 125.0000000000, NULL, 1, 1, '2023-05-26 11:19:28', 1, '2023-05-26 11:36:21', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (52, 83, NULL, 1, 0.0000, 125.0000000000, NULL, 1, 1, '2023-05-26 11:19:28', 1, '2023-05-26 11:36:21', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (53, 83, NULL, 1, 100.0000, 125.0000000000, NULL, 1, 1, '2023-05-26 11:31:37', 1, '2023-05-26 11:31:37', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (54, 83, NULL, 5, 10.0000, 120.3140630000, NULL, 1, 1, '2023-05-26 11:32:30', 1, '2023-05-26 11:32:30', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (55, 83, NULL, 5, 100.0000, 120.3140630000, NULL, 1, 1, '2023-05-26 11:36:21', 1, '2023-05-26 11:36:21', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (56, 83, NULL, 5, 50.0000, 120.3140630000, NULL, 1, 1, '2023-05-26 11:36:21', 1, '2023-05-26 11:36:21', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (57, 89, NULL, 1, 240.0000, 0.6100000000, '2024-05-31 00:00:00', 1, 1, '2023-07-04 09:39:25', 1, '2023-07-04 09:39:25', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (58, 88, NULL, 1, 24.0000, 0.8489290000, '2024-06-30 00:00:00', 1, 1, '2023-07-04 09:39:25', 1, '2023-07-04 09:39:25', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (59, 86, NULL, 1, 10.0000, 0.6700000000, '2024-01-31 00:00:00', 1, 1, '2023-07-04 09:39:25', 1, '2025-01-15 16:42:22', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (60, 87, NULL, 1, 5.0000, 0.3422220000, '2023-11-30 00:00:00', 1, 1, '2023-07-04 09:39:25', 1, '2025-01-15 16:50:06', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (61, 84, NULL, 1, 10.0000, 0.3700000000, '2023-09-30 00:00:00', 1, 1, '2023-07-04 09:39:25', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (62, 85, NULL, 1, 7.0000, 1.0100000000, '2023-12-19 00:00:00', 1, 1, '2023-07-04 09:39:25', 1, '2025-01-15 11:38:15', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (63, 88, NULL, 1, 60.0000, 0.8489290000, '2024-06-19 00:00:00', 1, 1, '2023-07-04 09:40:58', 1, '2023-07-04 09:40:58', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (64, 44, NULL, 1, 100.0000, 2.7115380000, NULL, 1, 1, '2023-08-18 10:06:21', 1, '2023-08-18 10:06:21', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (65, 45, NULL, 1, 100.0000, 2.5526320000, NULL, 1, 1, '2023-08-18 10:06:21', 1, '2023-08-18 10:06:21', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (66, 91, NULL, 1, 100000.0000, 0.5000000000, NULL, 1, 1, '2023-10-04 13:54:19', 1, '2023-10-04 13:54:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (67, 92, NULL, 1, 100000.0000, 0.2500000000, NULL, 1, 1, '2023-10-04 13:54:19', 1, '2023-10-04 13:54:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (68, 95, NULL, 1, 100000.0000, 0.4500000000, NULL, 1, 1, '2023-10-04 13:54:19', 1, '2023-10-04 13:54:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (69, 93, NULL, 1, 99998.0000, 5.5000000000, NULL, 1, 1, '2023-10-04 13:54:19', 1, '2024-07-11 12:43:04', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (70, 74, NULL, 1, 100000.0000, 2.6412990000, NULL, 1, 1, '2023-10-04 13:54:19', 1, '2023-10-04 13:54:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (71, 80, NULL, 1, 100000.0000, 0.5068560000, NULL, 1, 1, '2023-10-04 13:54:19', 1, '2023-10-04 13:54:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (72, 99, NULL, 1, 0.0000, 2.6410170000, NULL, 1, 1, '2023-12-12 15:35:08', 1, '2024-06-19 10:55:50', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (73, 99, NULL, 1, 0.0000, 2.6410170000, NULL, 1, 1, '2023-12-12 15:38:55', 1, '2024-06-19 10:55:50', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (74, 105, NULL, 1, 24.0000, 1.0000000000, NULL, 1, 1, '2024-02-08 08:48:20', 1, '2024-02-08 10:33:08', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (75, 99, NULL, 1, 214.5000, 2.6410170000, NULL, 1, 1, '2024-02-08 10:44:14', 1, '2024-06-19 10:55:51', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (76, 44, NULL, 1, 300.0000, 2.7115380000, NULL, 1, 1, '2024-02-08 10:44:14', 1, '2024-02-08 10:44:14', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (77, 43, NULL, 1, 700.0000, 1.4606710000, NULL, 1, 1, '2024-02-08 10:44:14', 1, '2024-02-08 10:44:14', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (78, 99, NULL, 1, 84.0000, 2.6410170000, NULL, 1, 1, '2024-02-08 10:46:22', 1, '2024-02-08 10:46:22', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (79, 45, NULL, 1, 610.0000, 2.5526320000, NULL, 1, 1, '2024-02-08 11:02:29', 1, '2024-02-08 11:02:29', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (80, 90, NULL, 1, 1390.0000, 1.5000000000, NULL, 1, 1, '2024-02-19 22:55:51', 1, '2024-07-11 12:43:04', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (81, 14, NULL, 1, 244.0000, 2.5000000000, NULL, 1, 1, '2024-05-20 02:27:51', 1, '2024-08-06 20:28:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (82, 113, NULL, 1, 975.0000, 6.5000000000, NULL, 1, 1, '2024-05-20 09:55:11', 1, '2025-01-27 15:25:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (83, 114, NULL, 1, 1495.0000, 3.2500000000, NULL, 1, 1, '2024-05-20 09:55:11', 1, '2025-01-27 15:25:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (84, 115, NULL, 1, 4849.0000, 197.3701630000, NULL, 1, 1, '2024-05-20 09:55:11', 1, '2025-01-27 15:25:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (85, 45, NULL, 1, 200.0000, 2.5526320000, NULL, 1, 1, '2024-05-20 10:44:19', 1, '2024-05-20 10:44:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (86, 115, NULL, 5, 200.0000, 4.5000000000, NULL, 1, 1, '2024-05-22 11:31:15', 1, '2024-05-22 11:31:15', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (87, 115, NULL, 1, 100.0000, 197.3701630000, NULL, 1, 1, '2024-06-03 09:41:33', 1, '2024-06-03 09:41:33', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (88, 115, NULL, 1, 500.0000, 197.3701630000, NULL, 1, 1, '2024-06-03 09:46:14', 1, '2024-06-03 09:46:14', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (89, 96, NULL, 1, 161.0000, 53.9055230000, NULL, 1, 1, '2024-06-03 09:46:14', 1, '2024-08-30 13:37:51', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (90, 96, NULL, 1, 50.0000, 53.9055230000, NULL, 1, 1, '2024-06-03 10:33:15', 1, '2024-06-03 10:33:15', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (91, 96, NULL, 1, 50.0000, 53.9055230000, NULL, 1, 1, '2024-06-03 10:34:07', 1, '2024-06-03 10:34:07', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (92, 115, NULL, 1, 500.0000, 197.3701630000, NULL, 1, 1, '2024-06-03 11:16:58', 1, '2024-06-03 11:16:58', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (93, 96, NULL, 1, 300.0000, 53.9055230000, NULL, 1, 1, '2024-06-03 11:16:58', 1, '2024-06-03 11:16:58', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (94, 115, NULL, 1, 800.0000, 197.3701630000, NULL, 1, 1, '2024-06-03 11:22:22', 1, '2024-06-03 11:22:22', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (95, 96, NULL, 1, 300.0000, 53.9055230000, NULL, 1, 1, '2024-06-03 11:22:22', 1, '2024-06-03 11:22:22', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (96, 115, NULL, 1, 500.0000, 197.3701630000, '2024-06-19 00:00:00', 1, 1, '2024-06-19 10:36:45', 1, '2024-06-19 10:36:45', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (97, 96, NULL, 1, 200.0000, 53.9055230000, NULL, 1, 1, '2024-06-19 10:36:45', 1, '2024-06-19 10:36:45', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (98, 115, NULL, 1, 300.0000, 197.3701630000, NULL, 1, 1, '2024-06-19 10:51:14', 1, '2024-06-19 10:51:14', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (99, 99, NULL, 5, 92.5000, 2.6410170000, NULL, 1, 1, '2024-06-19 10:55:50', 1, '2024-06-19 10:55:50', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (100, 99, NULL, 5, 42.0000, 2.6410170000, NULL, 1, 1, '2024-06-19 10:55:50', 1, '2024-06-19 10:55:50', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (101, 99, NULL, 5, 75.5000, 2.6410170000, NULL, 1, 1, '2024-06-19 10:55:50', 1, '2024-06-19 10:55:50', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (102, 99, NULL, 5, 210.0000, 2.6410170000, NULL, 1, 1, '2024-06-19 10:55:51', 1, '2024-06-19 10:55:51', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (103, 114, NULL, 1, 4.0000, 3.2500000000, NULL, 1, 1, '2024-06-19 11:01:35', 1, '2024-06-19 11:01:35', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (104, 115, NULL, 1, 500.0000, 197.3701630000, NULL, 1, 1, '2024-07-01 09:48:40', 1, '2024-07-01 09:48:40', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (105, 96, NULL, 1, 400.0000, 53.9055230000, NULL, 1, 1, '2024-07-01 09:48:40', 1, '2024-07-01 09:48:40', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (106, 87, NULL, 1, 10.0000, 0.3422220000, NULL, 1, 1, '2024-07-02 09:52:59', 1, '2024-07-02 09:52:59', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (107, 75, NULL, 1, 0.0000, 0.9870000000, '2025-01-02 00:00:00', 1, 1, '2024-07-02 09:52:59', 1, '2024-08-30 10:24:08', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (108, 87, NULL, 6, 5.0000, 0.3422220000, '2023-11-30 00:00:00', 1, 1, '2024-07-02 09:56:48', 1, '2024-07-02 09:56:48', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (109, 44, NULL, 5, 30.0000, 2.7115380000, NULL, 1, 1, '2024-07-16 11:35:12', 1, '2024-07-16 11:35:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (110, 45, NULL, 5, 10.0000, 2.5526320000, NULL, 1, 1, '2024-07-16 11:35:12', 1, '2024-07-16 11:35:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (111, 43, NULL, 5, 15.0000, 1.4606710000, NULL, 1, 1, '2024-07-16 11:35:12', 1, '2024-07-16 11:35:12', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (112, 42, NULL, 1, 100.0000, 1.6666670000, NULL, 1, 1, '2024-07-23 10:01:57', 1, '2024-07-23 10:01:57', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (113, 74, NULL, 1, 25.0000, 2.6412990000, '2024-12-30 00:00:00', 1, 1, '2024-07-29 10:03:53', 1, '2024-07-29 10:03:53', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (114, 74, NULL, 5, 30.0000, 2.6400000000, '2024-12-31 00:00:00', 1, 1, '2024-07-29 10:46:10', 1, '2024-07-29 10:46:10', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (115, 74, NULL, 5, 20.0000, 2.6400000000, '2023-06-21 00:00:00', 1, 1, '2024-07-29 10:46:10', 1, '2024-07-29 10:46:10', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (116, 75, NULL, 5, 100.0000, 0.8000000000, '2025-06-25 00:00:00', 1, 1, '2024-07-29 10:46:10', 1, '2024-07-29 10:46:10', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (117, 74, NULL, 1, 500.0000, 2.6412990000, NULL, 1, 1, '2024-07-29 10:57:39', 1, '2024-07-29 10:57:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (118, 80, NULL, 1, 100.0000, 0.5068560000, NULL, 1, 1, '2024-07-29 10:57:39', 1, '2024-07-29 10:57:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (119, 91, NULL, 1, 1000.0000, 0.5000000000, NULL, 1, 1, '2024-07-29 10:57:39', 1, '2024-07-29 10:57:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (120, 74, NULL, 1, 250.0000, 2.6412990000, '2024-09-30 00:00:00', 1, 1, '2024-07-29 11:20:55', 1, '2024-07-29 11:20:55', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (121, 75, NULL, 1, 95.0000, 0.9870000000, NULL, 1, 1, '2024-08-06 21:49:56', 1, '2024-10-08 17:55:42', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (122, 75, NULL, 1, 0.0000, 0.9870000000, NULL, 1, 1, '2024-08-06 21:49:56', 1, '2024-10-08 17:39:54', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (123, 96, NULL, 1, 500.0000, 53.9055230000, NULL, 1, 1, '2024-08-14 11:25:23', 1, '2024-08-14 11:25:23', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (124, 96, NULL, 1, 200.0000, 53.9055230000, NULL, 1, 1, '2024-08-14 11:30:36', 1, '2024-08-14 11:30:36', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (125, 96, NULL, 2, 10.0000, 53.9055230000, NULL, 1, 1, '2024-08-14 11:41:22', 1, '2024-08-14 11:41:22', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (126, 115, NULL, 1, 500.0000, 197.3701630000, NULL, 1, 1, '2024-08-14 16:00:56', 1, '2024-08-14 16:00:56', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (127, 115, NULL, 1, 5000.0000, 197.3701630000, NULL, 1, 1, '2024-08-14 16:03:40', 1, '2024-08-14 16:03:40', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (128, 115, NULL, 1, 10.0000, 197.3701630000, NULL, 1, 1, '2024-08-29 12:08:19', 1, '2024-08-29 12:08:19', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (129, 96, NULL, 1, 1.0000, 53.9055230000, NULL, 1, 1, '2024-08-29 12:09:00', 1, '2024-08-29 12:09:00', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (130, 115, NULL, 1, 10.0000, 197.3701630000, NULL, 1, 1, '2024-08-29 12:25:58', 1, '2024-08-29 12:25:58', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (131, 115, NULL, 1, 10.0000, 197.3701630000, NULL, 1, 1, '2024-09-20 10:31:07', 1, '2024-09-20 10:31:07', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (132, 115, NULL, 1, 100.0000, 197.3701630000, NULL, 1, 1, '2024-09-27 14:29:09', 1, '2024-09-27 14:29:09', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (133, 42, NULL, 1, 1000.0000, 1.6666670000, NULL, 1, 1, '2024-09-27 14:29:09', 1, '2024-09-27 14:29:09', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (134, 43, NULL, 2, 25.0000, 1.4606710000, NULL, 1, 1, '2024-09-27 14:33:37', 1, '2024-09-27 14:33:37', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (135, 121, NULL, 1, 60.0000, 0.2500000000, NULL, 1, 1, '2024-10-10 10:47:36', 1, '2024-10-10 10:47:36', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (136, 125, NULL, 1, 45.0000, 0.1900000000, NULL, 1, 1, '2024-10-10 10:47:36', 1, '2024-10-10 10:47:36', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (137, 124, NULL, 1, 37.0000, 1.0906380000, NULL, 1, 1, '2024-10-10 10:47:36', 1, '2024-10-10 10:47:36', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (138, 123, NULL, 1, 151.0000, 0.1522810000, NULL, 1, 1, '2024-10-10 10:47:36', 1, '2024-10-10 10:47:36', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (139, 122, NULL, 1, 167.0000, 0.1800000000, NULL, 1, 1, '2024-10-10 10:47:36', 1, '2024-10-10 10:47:36', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (140, 126, NULL, 1, 2.0000, 5.0000000000, NULL, 1, 1, '2024-10-10 10:49:39', 1, '2024-10-10 10:49:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (141, 127, NULL, 1, 6.0000, 5.0000000000, NULL, 1, 1, '2024-10-10 10:49:39', 1, '2024-10-10 10:49:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (142, 128, NULL, 1, 4.0000, 6.0000000000, NULL, 1, 1, '2024-10-10 10:49:39', 1, '2024-10-10 10:49:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (143, 129, NULL, 1, 8.0000, 7.0000000000, NULL, 1, 1, '2024-10-10 10:49:39', 1, '2024-10-10 10:49:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (144, 123, NULL, 1, 20.0000, 0.1522810000, NULL, 1, 1, '2024-10-17 16:33:58', 1, '2024-10-17 16:33:58', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (145, 124, NULL, 1, 10.0000, 1.0906380000, NULL, 1, 1, '2024-10-17 16:33:58', 1, '2024-10-17 16:33:58', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (146, 131, NULL, 1, 100.0000, 0.0000000000, NULL, 1, 65, '2024-10-17 17:09:26', 65, '2024-10-17 17:09:26', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (147, 131, NULL, 1, 200.0000, 0.0000000000, NULL, 1, 65, '2024-10-17 17:52:02', 65, '2024-10-17 17:52:02', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (148, 133, NULL, 1, 5000.0000, 2.5000000000, NULL, 1, 65, '2024-10-17 18:02:17', 65, '2024-10-17 18:02:17', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (149, 132, NULL, 1, 10000.0000, 3.5000000000, NULL, 1, 65, '2024-10-17 18:02:17', 65, '2024-10-17 18:02:17', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (150, 131, NULL, 1, 100.0000, 2.2500000000, NULL, 1, 65, '2024-10-17 18:06:06', 65, '2024-10-17 18:06:06', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (151, 131, NULL, 1, 10.0000, 2.2500000000, NULL, 1, 1, '2024-10-23 15:01:52', 1, '2024-10-23 15:01:52', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (152, 131, NULL, 1, 30.0000, 2.6800000000, NULL, 1, 1, '2024-10-23 16:55:36', 1, '2024-10-23 16:55:36', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (153, 131, NULL, 1, 20.0000, 2.6800000000, NULL, 1, 1, '2024-10-23 16:57:13', 1, '2024-10-23 16:57:13', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (154, 75, NULL, 1, 5.0000, 0.9870000000, NULL, 1, 1, '2024-12-05 16:16:15', 1, '2024-12-05 16:16:15', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (155, 85, NULL, 1, 2.0000, 1.0100000000, NULL, 1, 1, '2025-01-15 12:20:44', 1, '2025-01-15 12:20:44', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (156, 86, NULL, 1, 2.0000, 0.6700000000, NULL, 1, 1, '2025-01-15 16:44:39', 1, '2025-01-15 16:44:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (157, 87, NULL, 1, 1.0000, 0.3422220000, NULL, 1, 1, '2025-01-15 16:52:34', 1, '2025-01-15 16:52:34', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (158, 136, NULL, 1, 10.0000, 0.0000000000, NULL, 1, 65, '2025-01-17 19:37:53', 65, '2025-01-17 19:37:53', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (159, 74, NULL, 1, 1635.0000, 2.6412990000, NULL, 1, 1, '2025-02-14 11:23:47', 1, '2025-02-14 11:23:47', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (160, 137, NULL, 1, 500.0000, 0.0000000000, NULL, 1, 65, '2025-02-24 09:43:23', 65, '2025-02-24 09:43:23', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (161, 139, NULL, 1, 10000.0000, 2.0000000000, NULL, 1, 65, '2025-02-24 09:48:39', 65, '2025-02-24 09:48:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (162, 138, NULL, 1, 10000.0000, 1.0000000000, NULL, 1, 65, '2025-02-24 09:48:39', 65, '2025-02-24 09:48:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (163, 140, NULL, 1, 10000.0000, 3.0000000000, NULL, 1, 65, '2025-02-24 09:48:39', 65, '2025-02-24 09:48:39', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (164, 137, NULL, 1, 100.0000, 67.9500000000, NULL, 1, 65, '2025-02-24 10:05:47', 65, '2025-02-24 10:05:47', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (165, 137, NULL, 1, 100.0000, 0.0000000000, NULL, 1, 1, '2025-02-24 13:12:33', 1, '2025-02-24 13:12:33', NULL);
INSERT INTO `sar_saldo_articulo` VALUES (166, 137, NULL, 1, 100.0000, 0.0000000000, NULL, 1, 1, '2025-02-24 13:12:34', 1, '2025-02-24 13:12:34', NULL);

-- ----------------------------
-- Table structure for scc_seccion
-- ----------------------------
CREATE TABLE `scc_seccion`  (
  `scc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de Sección',
  `scc_codigo` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Código',
  `scc_nombre` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre de sección',
  `scc_estado` tinyint(4) NOT NULL COMMENT 'estado de registro 1=activo, 0=inactivo',
  `scc_usu_creacion` int(11) NOT NULL COMMENT 'Auditoría',
  `scc_fecha_creacion` datetime NOT NULL COMMENT 'Auditoría',
  `scc_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoría',
  `scc_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoría',
  PRIMARY KEY (`scc_id`) USING BTREE,
  UNIQUE INDEX `ind_codigo`(`scc_codigo` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of scc_seccion
-- ----------------------------
INSERT INTO `scc_seccion` VALUES (1, '0001', '01', 1, 1, '2023-10-12 11:39:10', 1, '2023-10-12 11:39:10');
INSERT INTO `scc_seccion` VALUES (2, '0002', '02', 1, 1, '2023-10-12 11:39:19', 1, '2023-10-12 11:39:19');
INSERT INTO `scc_seccion` VALUES (3, '0003', 'A', 1, 1, '2024-01-18 19:38:16', 1, '2024-01-18 19:38:16');
INSERT INTO `scc_seccion` VALUES (4, '0004', 'B', 1, 1, '2024-01-18 19:39:01', 1, '2024-01-18 19:39:01');

-- ----------------------------
-- Table structure for scc_seguimiento_cxc
-- ----------------------------
CREATE TABLE `scc_seguimiento_cxc`  (
  `scc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `scc_id_cli` int(11) NOT NULL COMMENT 'Llave con cliente',
  `scc_id_fac` int(11) NULL DEFAULT NULL COMMENT 'Llave con la factura cuando es a detalle',
  `scc_id_tsg` int(11) NOT NULL COMMENT 'Llave con Tipo de seguimiento',
  `scc_fecha` datetime NOT NULL COMMENT 'Fecha que se realizo',
  `scc_fecha_proximo` date NOT NULL COMMENT 'Fecha proximo contacto',
  `scc_comentario` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'Comentarios del seguimiento',
  `scc_estado` tinyint(4) NOT NULL COMMENT 'Estado 1=activo, 0=inactivo',
  `scc_usu_creacion` int(11) NOT NULL COMMENT 'Usuario creo',
  `scc_fecha_creacion` datetime NOT NULL COMMENT 'Fecha creo',
  `scc_usu_modificacion` int(11) NOT NULL COMMENT 'Usuario modifica',
  `scc_fecha_modificacion` datetime NOT NULL COMMENT 'Fecha modifica',
  PRIMARY KEY (`scc_id`) USING BTREE,
  INDEX `fk_scc_id_cli`(`scc_id_cli` ASC) USING BTREE,
  INDEX `fk_scc_id_fac`(`scc_id_fac` ASC) USING BTREE,
  INDEX `fk_scc_id_tsg`(`scc_id_tsg` ASC) USING BTREE,
  CONSTRAINT `fk_scc_id_cli` FOREIGN KEY (`scc_id_cli`) REFERENCES `cli_cliente` (`cli_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_scc_id_fac` FOREIGN KEY (`scc_id_fac`) REFERENCES `fac_factura` (`fac_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_scc_id_tsg` FOREIGN KEY (`scc_id_tsg`) REFERENCES `tsg_tipo_seguimiento` (`tsg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of scc_seguimiento_cxc
-- ----------------------------
INSERT INTO `scc_seguimiento_cxc` VALUES (1, 26, 197, 1, '2024-06-26 11:07:15', '2024-06-30', 'El dia 30 se va a cancelar la factura', 1, 1, '2024-06-26 11:06:44', 1, '2024-06-26 11:06:44');
INSERT INTO `scc_seguimiento_cxc` VALUES (2, 26, 197, 2, '2024-06-26 11:07:41', '2024-06-28', 'Ya se tienen programado cheque', 1, 1, '2024-06-26 11:07:22', 1, '2024-06-26 11:07:22');

-- ----------------------------
-- Table structure for scl_sucursal_cliente
-- ----------------------------
CREATE TABLE `scl_sucursal_cliente`  (
  `scl_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificador de la sucursal cliente',
  `scl_id_cli` int(11) NOT NULL COMMENT 'Llave primaria - Clientes',
  `scl_id_mun` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria - entidad municipio',
  `scl_codigo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Codigo de sucursal',
  `scl_nombre` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre de la sucursal',
  `scl_direccion` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Direccion de la sucursal',
  `scl_estado` tinyint(4) NOT NULL COMMENT 'estado del registro 1=activo, 0=inactivo',
  `scl_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `scl_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `scl_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `scl_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`scl_id`) USING BTREE,
  INDEX `ix_suc_codigo`(`scl_codigo` ASC) USING BTREE,
  INDEX `fk_scl_id_cli`(`scl_id_cli` ASC) USING BTREE,
  INDEX `fk_scl_id_mun`(`scl_id_mun` ASC) USING BTREE,
  CONSTRAINT `fk_scl_id_cli` FOREIGN KEY (`scl_id_cli`) REFERENCES `cli_cliente` (`cli_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_scl_id_mun` FOREIGN KEY (`scl_id_mun`) REFERENCES `mun_municipio` (`mun_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Entidad - Sucursales por cliente' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of scl_sucursal_cliente
-- ----------------------------
INSERT INTO `scl_sucursal_cliente` VALUES (1, 1, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (2, 2, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (3, 3, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (4, 4, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (5, 5, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (6, 6, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (7, 7, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (8, 8, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (9, 9, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (10, 10, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (11, 11, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (12, 12, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (13, 13, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (14, 14, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (15, 15, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (16, 16, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (17, 17, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (18, 18, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (19, 19, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');
INSERT INTO `scl_sucursal_cliente` VALUES (20, 20, 108, '1', 'Casa Matriz', 'Casa Matriz	Km 7.5 Blvd. El Ejercito, Calle Antigua al Matazano, Soyapango', 1, 1, '0000-00-00 00:00:00', 1, '0000-00-00 00:00:00');

-- ----------------------------
-- Table structure for scm_seguimiento_comparativo_compra
-- ----------------------------
CREATE TABLE `scm_seguimiento_comparativo_compra`  (
  `scm_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de seguimiento comparativo Compra',
  `scm_id_psf` int(11) NOT NULL COMMENT 'codigo de paso de  flujo',
  `scm_id_ccc` int(11) NOT NULL COMMENT 'Llave primaria de comparativo de cotizacion compra',
  `scm_id_usu` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de Usuario.',
  `scm_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de entrada de paso',
  `scm_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de salida de paso',
  `scm_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Observaciones ',
  `scm_anexo` varchar(300) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Anexo (ruta)',
  `scm_estado` int(11) NOT NULL COMMENT 'estado de flujo',
  `scm_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `scm_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `scm_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `scm_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`scm_id`) USING BTREE,
  INDEX `fk_scm_id_ccc`(`scm_id_ccc` ASC) USING BTREE,
  INDEX `fk_scm_id_psf`(`scm_id_psf` ASC) USING BTREE,
  INDEX `fk_scm_id_usu`(`scm_id_usu` ASC) USING BTREE,
  CONSTRAINT `fk_scm_id_ccc` FOREIGN KEY (`scm_id_ccc`) REFERENCES `ccc_comparativo_cotizacion_compra` (`ccc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_scm_id_psf` FOREIGN KEY (`scm_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_scm_id_usu` FOREIGN KEY (`scm_id_usu`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Seguimiento de comparativo compra' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of scm_seguimiento_comparativo_compra
-- ----------------------------
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (1, 14, 5, 1, '2019-10-21 10:00:46', '2019-10-21 10:01:00', 'Autorizar', NULL, 1, 1, 1, '2019-10-21 10:00:46', '2019-10-21 10:01:00');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (2, 15, 5, 1, '2019-10-21 10:01:00', '2019-10-21 13:54:19', 'Aprobado', NULL, 1, 1, 1, '2019-10-21 10:01:00', '2019-10-21 01:54:19');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (3, 16, 5, 1, '2019-10-21 13:54:20', '2019-10-21 16:25:43', 'Autorizado', NULL, 1, 1, 1, '2019-10-21 01:54:20', '2019-10-21 04:25:43');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (4, 17, 5, 1, '2019-10-21 16:25:43', NULL, NULL, NULL, 1, 1, 1, '2019-10-21 04:25:43', '2019-10-21 04:25:43');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (5, 14, 6, 1, '2019-10-23 14:41:30', '2019-10-23 14:52:12', 'Aprobacion', NULL, 1, 1, 1, '2019-10-23 02:41:30', '2019-10-23 02:52:12');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (6, 15, 6, 1, '2019-10-23 14:52:12', '2019-10-23 14:54:45', 'Autorizado', NULL, 1, 1, 1, '2019-10-23 02:52:12', '2019-10-23 02:54:45');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (7, 17, 6, 1, '2019-10-23 14:54:45', NULL, NULL, NULL, 1, 1, 1, '2019-10-23 02:54:45', '2019-10-23 02:54:45');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (8, 14, 7, 1, '2020-02-25 13:16:36', '2020-02-25 13:19:13', 'FAVOR REVISAR ', NULL, 1, 1, 1, '2020-02-25 01:16:36', '2020-02-25 01:19:13');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (9, 15, 7, 1, '2020-02-25 13:19:13', '2020-02-25 13:20:26', 'DE ACUERDO PROCEDE ', NULL, 1, 1, 1, '2020-02-25 01:19:13', '2020-02-25 01:20:26');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (10, 17, 7, 1, '2020-02-25 13:20:26', NULL, NULL, NULL, 1, 1, 1, '2020-02-25 01:20:26', '2020-02-25 01:20:26');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (11, 14, 8, 33, '2020-06-29 14:38:30', '2020-06-29 14:38:48', 'aprobar gas para produccion', NULL, 1, 33, 33, '2020-06-29 02:38:30', '2020-06-29 02:38:48');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (12, 15, 8, 2, '2020-06-29 14:38:48', '2020-06-29 14:53:43', 'Ok', NULL, 1, 33, 2, '2020-06-29 02:38:48', '2020-06-29 02:53:43');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (13, 17, 8, 2, '2020-06-29 14:53:43', NULL, NULL, NULL, 1, 2, 2, '2020-06-29 02:53:43', '2020-06-29 02:53:43');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (14, 14, 9, 33, '2020-06-29 16:46:07', '2020-06-29 16:46:21', 'aprobar', NULL, 1, 33, 33, '2020-06-29 04:46:07', '2020-06-29 04:46:21');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (15, 15, 9, 9, '2020-06-29 16:46:21', '2020-06-29 16:47:29', 'ok', NULL, 1, 33, 9, '2020-06-29 04:46:21', '2020-06-29 04:47:29');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (16, 17, 9, 9, '2020-06-29 16:47:29', NULL, NULL, NULL, 1, 9, 9, '2020-06-29 04:47:29', '2020-06-29 04:47:29');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (17, 14, 10, 1, '2020-07-01 10:17:32', '2020-07-06 17:28:04', 'auto', NULL, 1, 1, 1, '2020-07-01 10:17:32', '2020-07-06 05:28:04');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (18, 15, 10, 1, '2020-07-06 17:28:04', '2020-07-06 17:50:38', 'Autorizado', NULL, 1, 1, 1, '2020-07-06 05:28:04', '2020-07-06 05:50:38');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (19, 17, 10, 1, '2020-07-06 17:50:38', NULL, NULL, NULL, 1, 1, 1, '2020-07-06 05:50:38', '2020-07-06 05:50:38');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (20, 14, 11, 1, '2021-02-18 11:22:41', '2021-02-18 11:24:03', 'autorizar', NULL, 1, 1, 1, '2021-02-18 11:22:41', '2021-02-18 11:24:03');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (21, 15, 11, 1, '2021-02-18 11:24:03', '2021-02-18 11:24:30', 'Aprobado', NULL, 1, 1, 1, '2021-02-18 11:24:03', '2021-02-18 11:24:30');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (22, 17, 11, 1, '2021-02-18 11:24:30', NULL, NULL, NULL, 1, 1, 1, '2021-02-18 11:24:30', '2021-02-18 11:24:30');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (23, 14, 12, 1, '2022-01-18 10:30:52', '2022-01-18 10:31:06', 'revisar', NULL, 1, 1, 1, '2022-01-18 10:30:52', '2022-01-18 10:31:06');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (24, 15, 12, 1, '2022-01-18 10:31:06', '2022-01-18 10:38:07', NULL, NULL, 1, 1, 1, '2022-01-18 10:31:06', '2022-01-18 10:38:07');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (25, 17, 12, 1, '2022-01-18 10:38:07', NULL, NULL, NULL, 1, 1, 1, '2022-01-18 10:38:07', '2022-01-18 10:38:07');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (26, 14, 13, 1, '2022-01-18 11:29:16', '2022-01-18 11:29:58', 'favor de revisar', NULL, 1, 1, 1, '2022-01-18 11:29:16', '2022-01-18 11:29:58');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (27, 15, 13, 1, '2022-01-18 11:29:58', '2022-01-18 11:31:29', NULL, NULL, 1, 1, 1, '2022-01-18 11:29:58', '2022-01-18 11:31:29');
INSERT INTO `scm_seguimiento_comparativo_compra` VALUES (28, 17, 13, 1, '2022-01-18 11:31:29', NULL, NULL, NULL, 1, 1, 1, '2022-01-18 11:31:29', '2022-01-18 11:31:29');

-- ----------------------------
-- Table structure for scr_scrum
-- ----------------------------
CREATE TABLE `scr_scrum`  (
  `scr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal del contrato',
  `scr_id_usu_consultor` int(11) NULL DEFAULT NULL,
  `scr_fecha` datetime NOT NULL COMMENT 'Fecha fin del contrato',
  `scr_asignacion` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Cuota mensual',
  `scr_descripcion` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT '¿Que has hecho para alcanzar la meta del sprint (ayer)?',
  `scr_problema` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '¿Has tenido algún Problema para alcanzar la meta del sprint?',
  `scr_siguiente_scrum` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '¿En que continuarias trabajando para alcanzar la meta del sprint (hoy)?',
  `scr_avance_plan` decimal(19, 2) NULL DEFAULT NULL COMMENT 'avance del plan asignado',
  `scr_estado` int(11) NOT NULL COMMENT 'estado 1=activo, 0=inactivo',
  `scr_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `scr_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `scr_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `scr_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`scr_id`) USING BTREE,
  INDEX `fk_scr_id_usu_consultor`(`scr_id_usu_consultor` ASC) USING BTREE,
  CONSTRAINT `fk_scr_id_usu_consultor` FOREIGN KEY (`scr_id_usu_consultor`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of scr_scrum
-- ----------------------------

-- ----------------------------
-- Table structure for seb_sector_bodega
-- ----------------------------
CREATE TABLE `seb_sector_bodega`  (
  `seb_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de sector',
  `seb_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre de Sector',
  `seb_descripcion` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Descripción del sector.',
  `seb_estado` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'Estado del Registro',
  `seb_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `seb_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `seb_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `seb_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`seb_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Sectores que posee una bodega' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of seb_sector_bodega
-- ----------------------------
INSERT INTO `seb_sector_bodega` VALUES (1, 'Estante1 B1', 'Estante1 B1', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (2, 'Estante2 B1', 'Estante2 B1', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (3, 'Estante3 B1', 'Estante3 B1', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (4, 'Estante4 B1', 'Estante4 B1', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (5, 'Estante1 B2', 'Estante1 B2', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (6, 'Estante2 B2', 'Estante2 B2', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (7, 'Estante3 B2', 'Estante3 B2', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (8, 'Estante4 B2', 'Estante4 B2', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (9, 'Sector1 B3', 'Sector1 B3', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (10, 'Sector1 B4', 'Sector1 B4', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (11, 'Sector1 B5', 'Sector1 B5', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (12, 'Sector Resinas B6', 'Sector Resinas B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (13, 'Sector Polvos B6', 'Sector Polvos B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (14, 'Sector Pigmentos B6', 'Sector Pigmentos B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (15, 'Sector Tintas B6', 'Sector Tintas B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (16, 'Sector Aditivos B6', 'Sector Aditivos B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (17, 'Sector Solventes B6', 'Sector Solventes B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (18, 'Sector Pastas B6', 'Sector Pastas B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (19, 'Sector Bases B6', 'Sector Bases B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (20, 'Sector Gas B6', 'Sector Gas B6', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (21, 'Sector Envases B7', 'Sector Envases B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (22, 'Sector Envases para Aerosol B7', 'Sector Envases para Aerosol B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (23, 'Sector Etiquetas B7', 'Sector Etiquetas B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (24, 'Sector Cajas B7', 'Sector Cajas B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (25, 'Sector Tapones B7', 'Sector Tapones B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (26, 'Sector Valvulas B7', 'Sector Valvulas B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (27, 'Sector Actuadores B7', 'Sector Actuadores B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (28, 'Sector Agitadores B7', 'Sector Agitadores B7', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (29, 'Sector Resinas B8', 'Sector Resinas B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (30, 'Sector Polvos B8', 'Sector Polvos B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (31, 'Sector Pigmentos B8', 'Sector Pigmentos B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (32, 'Sector Tintas B8', 'Sector Tintas B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (33, 'Sector Aditivos B8', 'Sector Aditivos B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (34, 'Sector Solventes B8', 'Sector Solventes B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (35, 'Sector Pastas B8', 'Sector Pastas B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (36, 'Sector Bases B8', 'Sector Bases B8', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (37, 'Sector Envases B9', 'Sector Envases B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (38, 'Sector Envases para Aerosol B9', 'Sector Envases para Aerosol B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (39, 'Sector Etiquetas B9', 'Sector Etiquetas B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (40, 'Sector Cajas B9', 'Sector Cajas B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (41, 'Sector Tapones B9', 'Sector Tapones B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (42, 'Sector Valvulas B9', 'Sector Valvulas B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (43, 'Sector Actuadores B9', 'Sector Actuadores B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (44, 'Sector Agitadores B9', 'Sector Agitadores B9', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (45, 'Sector Envases B10', 'Sector Envases B10', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (46, 'Sector1 B101', 'Sector1 B101', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (47, 'Sector1 B102', 'Sector1 B102', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (48, 'Sector1 B103', 'Sector1 B103', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (49, 'Sector1 B104', 'Sector1 B104', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (50, 'Sector1 B105', 'Sector1 B105', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (51, 'Sector1 B106', 'Sector1 B106', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (52, 'Sector1 B17', 'Sector1 B17', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `seb_sector_bodega` VALUES (53, 'Sector1B18', 'Sector1B18', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');

-- ----------------------------
-- Table structure for sec_sector_cliente
-- ----------------------------
CREATE TABLE `sec_sector_cliente`  (
  `sec_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Codigo de sector',
  `sec_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre de  sector',
  `sec_estado` tinyint(4) NOT NULL COMMENT 'Estado de   sector',
  `sec_usu_mod` int(11) NOT NULL COMMENT 'Ultimo usuario que modifico',
  `sec_fecha_mod` datetime NOT NULL COMMENT 'Ultima fecha de modificacion ',
  PRIMARY KEY (`sec_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Catalogo de clasificacion de sectores (educacion, comercio,e' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sec_sector_cliente
-- ----------------------------
INSERT INTO `sec_sector_cliente` VALUES (1, 'Ganadero', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (2, 'Pesquero', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (3, 'Minero', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (4, 'Forestal', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (5, 'Industrial', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (6, 'Energetico', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (7, 'Construccion', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (8, 'Trasnporte', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (9, 'Comunicaciones', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (10, 'Comercial', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (11, 'Turistico', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (12, 'Sanitario', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (13, 'Educativo', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (14, 'Otros', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (15, 'Religioso', 1, 1, '2019-02-19 15:16:30');
INSERT INTO `sec_sector_cliente` VALUES (16, 'Economia', 1, 1, '2022-02-14 14:30:10');
INSERT INTO `sec_sector_cliente` VALUES (17, 'ingenieria informatica', 1, 1, '2022-02-14 14:30:10');
INSERT INTO `sec_sector_cliente` VALUES (18, 'marketing y ventas', 1, 1, '2022-02-14 14:30:45');

-- ----------------------------
-- Table structure for sec_seguimiento_cliente
-- ----------------------------
CREATE TABLE `sec_seguimiento_cliente`  (
  `sec_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'codigo de seguimiento',
  `sec_id_tsg` int(11) NULL DEFAULT NULL COMMENT 'Id de tipo de Seguimiento',
  `sec_id_con` int(11) NULL DEFAULT NULL COMMENT 'Codigo de contacto',
  `sec_fecha` datetime NULL DEFAULT NULL COMMENT 'fecha de seguimiento',
  `sec_fecha_proximo` datetime NULL DEFAULT NULL COMMENT 'Fecha de proximo contacto',
  `sec_comentario` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'comentario proporcionada por el cliente',
  `sec_lugar` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'lugar',
  `sec_invitados` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'invitados',
  `sec_estado` tinyint(4) NULL DEFAULT 1 COMMENT 'estado del registro 1=activo, 0=inactivo',
  `sec_usu_crea` int(11) NULL DEFAULT NULL COMMENT 'usuario  de creacion',
  `sec_fecha_crea` datetime NULL DEFAULT current_timestamp() COMMENT ' fecha de creación',
  `sec_usu_mod` int(11) NULL DEFAULT NULL COMMENT 'Ultimo usuario  de modificacion',
  `sec_fecha_mod` datetime NULL DEFAULT NULL COMMENT 'Ultima fecha de modificacion',
  PRIMARY KEY (`sec_id`) USING BTREE,
  INDEX `fk_seg_id_con`(`sec_id_con` ASC) USING BTREE,
  INDEX `fk_seg_id_tsg`(`sec_id_tsg` ASC) USING BTREE,
  CONSTRAINT `sec_id_con` FOREIGN KEY (`sec_id_con`) REFERENCES `con_contacto` (`con_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `sec_id_tsg` FOREIGN KEY (`sec_id_tsg`) REFERENCES `tsg_tipo_seguimiento` (`tsg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Seguimiento de clientes' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sec_seguimiento_cliente
-- ----------------------------

-- ----------------------------
-- Table structure for sef_serie_factura
-- ----------------------------
CREATE TABLE `sef_serie_factura`  (
  `sef_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal - series de facturas/documentos',
  `sef_id_tif` int(11) NOT NULL COMMENT 'Llave pricnipal de tipo de factura',
  `sef_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre de serie',
  `sef_abrev` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Abreviacion de la serie',
  `sef_resolucion` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Resolución de tickets',
  `sef_fecha_resolucion` datetime NULL DEFAULT NULL COMMENT 'Fecha resolucion',
  `sef_estado` tinyint(4) NOT NULL COMMENT 'Estado de la serie',
  `sef_fecha_mod` datetime NOT NULL COMMENT 'Auditoria',
  `sef_usu_mod` int(11) NOT NULL COMMENT 'Auditoria',
  `sef_fecha_crea` datetime NULL DEFAULT NULL COMMENT 'Auditoria',
  `sef_usu_crea` int(11) NULL DEFAULT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sef_id`) USING BTREE,
  INDEX `fk_sef_id_tif`(`sef_id_tif` ASC) USING BTREE,
  CONSTRAINT `fk_sef_id_tif` FOREIGN KEY (`sef_id_tif`) REFERENCES `tif_tipo_factura` (`tif_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 21 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'series aplicadas a facturación.' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sef_serie_factura
-- ----------------------------
INSERT INTO `sef_serie_factura` VALUES (1, 1, '19DS000C', '19DS000C', '84972019', '2019-02-11 00:00:00', 1, '2020-05-05 14:59:47', 9, '2020-05-05 14:59:47', 9);
INSERT INTO `sef_serie_factura` VALUES (2, 3, '19DS000F_M', '19DS000F', '84972019', '2019-02-11 00:00:00', 1, '2020-05-05 15:07:44', 9, '2020-05-05 15:07:44', 9);
INSERT INTO `sef_serie_factura` VALUES (3, 1, '19DS004C', '19DS004C', '413082019', '2019-07-23 00:00:00', 1, '2020-05-05 15:09:52', 9, '2020-05-05 15:09:52', 9);
INSERT INTO `sef_serie_factura` VALUES (4, 3, '19DS004F', '19DS004F', '413082019', '2019-07-23 00:00:00', 1, '2020-05-05 15:11:35', 9, '2020-05-05 15:11:35', 9);
INSERT INTO `sef_serie_factura` VALUES (5, 1, '20SD000C_M', '20SD000C', '2142020', '2020-01-03 00:00:00', 1, '2020-06-11 15:37:36', 9, '2020-06-11 15:37:36', 9);
INSERT INTO `sef_serie_factura` VALUES (6, 7, 'FFE', 'FFE', '2007', '2011-01-01 00:00:00', 1, '2020-05-05 15:16:32', 9, '2020-05-05 15:16:32', 9);
INSERT INTO `sef_serie_factura` VALUES (7, 5, '13DS000T', '13DS000T', '15012', '2010-12-31 00:00:00', 1, '2020-05-07 11:23:17', 9, '2020-05-07 11:23:17', 9);
INSERT INTO `sef_serie_factura` VALUES (8, 1, 'SALDO INICIAL', 'SAIN', '2020', '2018-05-12 12:00:00', 0, '2020-05-12 12:00:00', 1, '2020-05-12 12:00:00', 1);
INSERT INTO `sef_serie_factura` VALUES (9, 5, 'NC', 'NC', 'R202008', '2020-01-01 00:00:00', 1, '2020-08-24 14:57:50', 1, '2020-08-24 14:57:50', 1);
INSERT INTO `sef_serie_factura` VALUES (10, 1, 'CCF 6TY7UY', 'CFF', '6TY7UY', '2021-05-06 00:00:00', 1, '2021-05-06 09:40:54', 1, '2021-05-06 09:40:54', 1);
INSERT INTO `sef_serie_factura` VALUES (11, 13, 'Ticket 1_M', 'TK1', '2020-050555-44', '2023-05-25 00:00:00', 1, '2023-05-25 10:59:28', 1, '2023-05-25 10:59:28', 1);
INSERT INTO `sef_serie_factura` VALUES (12, 6, 'Nota Remision', 'NR', 'NR001', '2023-10-04 00:00:00', 1, '2023-10-04 15:20:08', 1, '2023-10-04 15:20:08', 1);
INSERT INTO `sef_serie_factura` VALUES (13, 1, 'CRED_FISCAL_DTE_C1', 'CCFE', 'CCFDTE01', '2024-05-01 00:00:00', 1, '2024-05-04 20:35:36', 1, '2024-05-04 20:35:36', 1);
INSERT INTO `sef_serie_factura` VALUES (14, 3, 'CONS_FIN_DTE_C1', 'FE', 'FEDTE01', '2024-05-01 00:00:00', 1, '2024-05-04 20:35:36', 1, '2024-05-04 20:35:36', 1);
INSERT INTO `sef_serie_factura` VALUES (15, 13, 'TICKET_DTE_C1', 'TKTE', 'TKTDTE01', '2024-05-01 00:00:00', 1, '2024-05-04 20:35:36', 1, '2024-05-04 20:35:36', 1);
INSERT INTO `sef_serie_factura` VALUES (16, 6, 'Remision Electronica', 'REMELE', 'as00000111111', '2024-08-28 00:00:00', 1, '2024-08-28 13:27:46', 1, '2024-08-28 13:27:46', 1);
INSERT INTO `sef_serie_factura` VALUES (17, 1, 'CRED_FISCAL_DTE_C2', 'CCFE', 'CCFDTE02', '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1);
INSERT INTO `sef_serie_factura` VALUES (18, 3, 'CONS_FIN_DTE_C2', 'FE', 'FEDTE02', '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1);
INSERT INTO `sef_serie_factura` VALUES (19, 5, 'NOTA_CRED_DTE_C2', 'NCE', 'NCEDRE02', '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1);
INSERT INTO `sef_serie_factura` VALUES (20, 6, 'NOTA_REMI_DTE_C2', 'NRE', 'NREDTE02', '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1, '2024-11-11 00:00:00', 1);

-- ----------------------------
-- Table structure for seg_seguimiento
-- ----------------------------
CREATE TABLE `seg_seguimiento`  (
  `seg_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'codigo de seguimiento',
  `seg_id_cot` int(11) NULL DEFAULT NULL COMMENT 'Codigo de la cotizacion',
  `seg_id_con` int(11) NULL DEFAULT NULL COMMENT 'Codigo de contacto',
  `seg_id_tsg` int(11) NULL DEFAULT NULL COMMENT 'Id de Tipo de Seguimiento',
  `seg_fecha` datetime NOT NULL COMMENT 'fecha de seguimiento',
  `seg_fecha_proximo` datetime NOT NULL COMMENT 'Fecha de proximo contacto',
  `seg_comentario` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'comentario proporcionada por el cliente',
  `seg_invitados` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'invitados',
  `seg_estado` tinyint(4) NULL DEFAULT 1 COMMENT 'estado 1=activo, 0=inactivo',
  `seg_lugar` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'lugar',
  `seg_usu_mod` int(11) NOT NULL COMMENT 'Ultimo usuario  de modificacion',
  `seg_fecha_mod` datetime NOT NULL COMMENT 'Ultima fecha de modificacion',
  `seg_usu_crea` int(11) NULL DEFAULT NULL COMMENT 'Ultimo usuario  de creacion',
  `seg_fecha_crea` datetime NULL DEFAULT NULL COMMENT 'Ultima fecha de creacion',
  PRIMARY KEY (`seg_id`) USING BTREE,
  INDEX `fk_seg_id_con`(`seg_id_con` ASC) USING BTREE,
  INDEX `fk_seg_id_cot`(`seg_id_cot` ASC) USING BTREE,
  INDEX `fk_seg_id_tsg`(`seg_id_tsg` ASC) USING BTREE,
  CONSTRAINT `fk_seg_id_con` FOREIGN KEY (`seg_id_con`) REFERENCES `con_contacto` (`con_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_seg_id_cot` FOREIGN KEY (`seg_id_cot`) REFERENCES `cot_cotizacion` (`cot_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_seg_id_tsg` FOREIGN KEY (`seg_id_tsg`) REFERENCES `tsg_tipo_seguimiento` (`tsg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Seguimiento de clientes' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of seg_seguimiento
-- ----------------------------
INSERT INTO `seg_seguimiento` VALUES (1, 26, 12, 1, '2024-07-26 00:00:00', '2024-07-30 00:00:00', 'Nos manifiesta en proceso de decision ', NULL, 1, NULL, 1, '2024-07-26 15:42:50', 1, '2024-07-26 15:42:50');
INSERT INTO `seg_seguimiento` VALUES (2, 29, 16, 1, '2024-10-10 00:00:00', '2024-10-10 00:00:00', 'cliente pide le llame mas tarde', NULL, 1, NULL, 1, '2024-10-10 13:51:32', 1, '2024-10-10 13:51:32');

-- ----------------------------
-- Table structure for seg_seguimiento_cont
-- ----------------------------
CREATE TABLE `seg_seguimiento_cont`  (
  `seg_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave primaria - Seguimiento contrato',
  `seg_id_obc` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria de obligacion',
  `seg_desde` datetime NOT NULL COMMENT 'Fecha de inicio de cumplimiento',
  `seg_hasta` datetime NOT NULL COMMENT 'Fecha de fin de cumplimiento',
  `seg_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `seg_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `seg_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  `seg_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `seg_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`seg_id`) USING BTREE,
  INDEX `fk_seg_id_obc`(`seg_id_obc` ASC) USING BTREE,
  CONSTRAINT `fk_seg_id_obc` FOREIGN KEY (`seg_id_obc`) REFERENCES `obc_obligacion_contrato` (`obc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Obligaciones por contratos' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of seg_seguimiento_cont
-- ----------------------------
INSERT INTO `seg_seguimiento_cont` VALUES (1, 1, '2024-07-11 00:00:00', '2024-07-13 00:00:00', 1, '2024-07-11 17:41:02', '2024-07-11 17:41:02', 1, 1);

-- ----------------------------
-- Table structure for seg_seguro
-- ----------------------------
CREATE TABLE `seg_seguro`  (
  `seg_id` int(11) NOT NULL AUTO_INCREMENT,
  `seg_nombre` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `seg_descripcion` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `seg_estado` tinyint(4) NOT NULL,
  `seg_fecha_mod` datetime NOT NULL,
  `seg_usu_mod` int(11) NOT NULL,
  PRIMARY KEY (`seg_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of seg_seguro
-- ----------------------------
INSERT INTO `seg_seguro` VALUES (1, 'Seguro de Vida', 'Seguro de Vida', 1, '2020-04-28 09:02:33', 5);
INSERT INTO `seg_seguro` VALUES (2, 'Seguro Medico Hospitalario', 'Seguro Medico Hospitalario', 1, '2020-04-28 09:02:00', 5);

-- ----------------------------
-- Table structure for sel_seguimiento_llamada
-- ----------------------------
CREATE TABLE `sel_seguimiento_llamada`  (
  `sel_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de seguimiento de llamada',
  `sel_id_tsg` int(11) NULL DEFAULT NULL COMMENT 'Id de tipo de Seguimiento',
  `sel_id_esn` int(11) NULL DEFAULT NULL COMMENT 'Identificador de Estados de atención de llamada',
  `sel_id_tbl` int(11) NOT NULL COMMENT 'Llave principal de tablero de llamadas',
  `sel_id_ven` int(11) NOT NULL COMMENT 'codigo de vendedor (realiza el seguimiento)',
  `sel_fecha` datetime NOT NULL COMMENT 'fecha de seguimiento (la actual)',
  `sel_fecha_proximo` datetime NULL DEFAULT NULL COMMENT 'Fecha de proximo contacto',
  `sel_comentario` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'comentario proporcionado por el cliente',
  `sel_notificado` tinyint(4) NULL DEFAULT NULL COMMENT 'Seguimiento notificado (por correo) 0 o null = no, 1 = si',
  `sel_estado` tinyint(4) NOT NULL COMMENT 'estado del registro 1=activo, 0=inactivo',
  `sel_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sel_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sel_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sel_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sel_id`) USING BTREE,
  INDEX `fk_sel_id_esn`(`sel_id_esn` ASC) USING BTREE,
  INDEX `fk_sel_id_tbl`(`sel_id_tbl` ASC) USING BTREE,
  INDEX `fk_sel_id_tsg`(`sel_id_tsg` ASC) USING BTREE,
  INDEX `fk_sel_id_ven`(`sel_id_ven` ASC) USING BTREE,
  CONSTRAINT `fk_sel_id_esn` FOREIGN KEY (`sel_id_esn`) REFERENCES `esn_estado_atencion` (`esn_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sel_id_tbl` FOREIGN KEY (`sel_id_tbl`) REFERENCES `tbl_tabla_llamadas` (`tbl_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sel_id_tsg` FOREIGN KEY (`sel_id_tsg`) REFERENCES `tsg_tipo_seguimiento` (`tsg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sel_id_ven` FOREIGN KEY (`sel_id_ven`) REFERENCES `ven_vendedor` (`ven_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sel_seguimiento_llamada
-- ----------------------------

-- ----------------------------
-- Table structure for sep_seguro_paciente
-- ----------------------------
CREATE TABLE `sep_seguro_paciente`  (
  `sep_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de seguro de paciente',
  `sep_id_pol` int(11) NOT NULL COMMENT 'Llave principal de Poliza',
  `sep_id_epp` int(11) NOT NULL COMMENT 'Llave principal de Expediente de paciente',
  `sep_certificado` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Certificado',
  `sep_porcentaje_seguro` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Porcentaje seguro',
  `sep_porcentaje_paciente` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Porcentaje paciente',
  `sep_tipo` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'tipo 1=Titular, 2=Beneficiario ',
  `sep_estado` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'estado del registro 1=activo, 0=inactivo',
  `sep_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sep_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sep_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sep_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sep_id`) USING BTREE,
  INDEX `fk_sep_id_epp`(`sep_id_epp` ASC) USING BTREE,
  INDEX `fk_sep_id_pol`(`sep_id_pol` ASC) USING BTREE,
  CONSTRAINT `fk_sep_id_epp` FOREIGN KEY (`sep_id_epp`) REFERENCES `epp_expediente_paciente` (`epp_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sep_id_pol` FOREIGN KEY (`sep_id_pol`) REFERENCES `pol_poliza` (`pol_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Entidad - Seguros de paciente' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sep_seguro_paciente
-- ----------------------------
INSERT INTO `sep_seguro_paciente` VALUES (1, 3, 2, '001', 50.00, 50.00, 1, 1, 1, '2023-10-04 01:27:41', 1, '2023-10-04 01:27:41');

-- ----------------------------
-- Table structure for ser_serie
-- ----------------------------
CREATE TABLE `ser_serie`  (
  `ser_id` int(11) NOT NULL AUTO_INCREMENT,
  `ser_id_art` int(11) NULL DEFAULT NULL,
  `ser_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `ser_abrev` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `ser_estado` tinyint(4) NOT NULL,
  `ser_fecha_mod` datetime NOT NULL,
  `ser_usu_mod` int(11) NOT NULL,
  PRIMARY KEY (`ser_id`) USING BTREE,
  INDEX `fk_ser_id_art`(`ser_id_art` ASC) USING BTREE,
  CONSTRAINT `fk_ser_id_art` FOREIGN KEY (`ser_id_art`) REFERENCES `art_articulo` (`art_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of ser_serie
-- ----------------------------

-- ----------------------------
-- Table structure for sga_seguimiento_matriz
-- ----------------------------
CREATE TABLE `sga_seguimiento_matriz`  (
  `sga_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal - Seguimiento de Matriz',
  `sga_id_mxu` int(11) NOT NULL COMMENT 'Llave Principal -Matriz  por Unidad',
  `sga_id_psf` int(11) NOT NULL COMMENT 'Llave Principal - Paso Flujo',
  `sga_id_usu_inicia` int(11) NOT NULL COMMENT 'Llave principal - Usuario Inicia el paso',
  `sga_id_usu_cierra` int(11) NULL DEFAULT NULL COMMENT 'Llave principal - Usuario cierra el paso',
  `sga_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de entrada de paso',
  `sga_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de salida de paso',
  `sga_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Observaciones ',
  `sga_anexo` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Anexos',
  `sga_estado` int(11) NOT NULL COMMENT 'estado de flujo',
  `sga_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sga_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sga_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sga_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sga_id`) USING BTREE,
  INDEX `fk_sga_id_mxu`(`sga_id_mxu` ASC) USING BTREE,
  INDEX `fk_sga_id_psf`(`sga_id_psf` ASC) USING BTREE,
  CONSTRAINT `fk_sga_id_mxu` FOREIGN KEY (`sga_id_mxu`) REFERENCES `mxu_matrizxunidad` (`mxu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sga_id_psf` FOREIGN KEY (`sga_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Seguimiento de Matriz' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sga_seguimiento_matriz
-- ----------------------------

-- ----------------------------
-- Table structure for sgc_seguimiento_compra
-- ----------------------------
CREATE TABLE `sgc_seguimiento_compra`  (
  `sgc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificador principal del seguimiento compra',
  `sgc_id_orc` int(11) NOT NULL COMMENT 'Llave principal de la Orden de compra',
  `sgc_id_tsg` int(11) NULL DEFAULT NULL COMMENT 'Id de tipo de Seguimiento',
  `sgc_id_mts` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de motivo de seguimiento',
  `sgc_fecha` datetime NOT NULL COMMENT 'Fecha del seguimiento',
  `sgc_contacto` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Contacto',
  `sgc_comentario` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Comentarios',
  `sgc_fecha_prox_seg` datetime NULL DEFAULT NULL COMMENT 'Fecha de próximo seguimiento',
  `sgc_estado` int(11) NOT NULL COMMENT 'estado de flujo',
  `sgc_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgc_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgc_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sgc_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sgc_id`) USING BTREE,
  INDEX `fk_sgc_id_mts`(`sgc_id_mts` ASC) USING BTREE,
  INDEX `fk_sgc_id_orc`(`sgc_id_orc` ASC) USING BTREE,
  INDEX `fk_sgc_id_tsg`(`sgc_id_tsg` ASC) USING BTREE,
  CONSTRAINT `fk_sgc_id_mts` FOREIGN KEY (`sgc_id_mts`) REFERENCES `mts_motivo_seguimiento` (`mts_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgc_id_orc` FOREIGN KEY (`sgc_id_orc`) REFERENCES `orc_orden_compra` (`orc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgc_id_tsg` FOREIGN KEY (`sgc_id_tsg`) REFERENCES `tsg_tipo_seguimiento` (`tsg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Seguimiento de la Orden de Compra. (realizar seguimiento más' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgc_seguimiento_compra
-- ----------------------------

-- ----------------------------
-- Table structure for sgd_seguimiento_directorio
-- ----------------------------
CREATE TABLE `sgd_seguimiento_directorio`  (
  `sgd_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de seguimiento de directorio',
  `sgd_id_tsg` int(11) NOT NULL COMMENT 'Id de tipo de Seguimiento',
  `sgd_id_drn` int(11) NOT NULL COMMENT 'Llave principal directorio contactos.',
  `sgd_id_usu_seguimiento` int(11) NOT NULL COMMENT 'Llave principal de Usuario. (quien genera el seguimiento)',
  `sgd_fecha` datetime NOT NULL COMMENT 'fecha de seguimiento (la actual)',
  `sgd_fecha_proximo` datetime NULL DEFAULT NULL COMMENT 'Fecha de proximo contacto',
  `sgd_contacto` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Contacto del directorio',
  `sgd_comentario` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'comentario',
  `sgd_lugar` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Lugar',
  `sgd_invitados` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Invitados',
  `sgd_estado` tinyint(4) NULL DEFAULT NULL COMMENT 'estado del registro 1=activo, 0=inactivo',
  `sgd_usu_creacion` int(11) NULL DEFAULT NULL COMMENT 'Auditoria',
  `sgd_fecha_creacion` datetime NULL DEFAULT NULL COMMENT 'Auditoria',
  `sgd_usu_modificacion` int(11) NULL DEFAULT NULL COMMENT 'Auditoria',
  `sgd_fecha_modificacion` datetime NULL DEFAULT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgd_id`) USING BTREE,
  INDEX `fk_sgd_id_drn`(`sgd_id_drn` ASC) USING BTREE,
  INDEX `fk_sgd_id_tsg`(`sgd_id_tsg` ASC) USING BTREE,
  INDEX `fk_sgd_id_usu_seguimiento`(`sgd_id_usu_seguimiento` ASC) USING BTREE,
  CONSTRAINT `fk_sgd_id_drn` FOREIGN KEY (`sgd_id_drn`) REFERENCES `drn_directorio_contacto` (`drn_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgd_id_tsg` FOREIGN KEY (`sgd_id_tsg`) REFERENCES `tsg_tipo_seguimiento` (`tsg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgd_id_usu_seguimiento` FOREIGN KEY (`sgd_id_usu_seguimiento`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Seguimiento al directorio de contactos.' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgd_seguimiento_directorio
-- ----------------------------
INSERT INTO `sgd_seguimiento_directorio` VALUES (1, 2, 3, 35, '2020-05-28 14:23:58', '2020-06-04 00:00:00', 'ernesto', 'email', NULL, NULL, 1, 35, '2020-05-28 14:23:58', 35, '2020-05-28 14:23:58');
INSERT INTO `sgd_seguimiento_directorio` VALUES (2, 1, 3, 35, '2020-06-30 11:34:26', '2020-06-30 00:00:00', 'ernesto', 'Se programa visita para la proxima semana', NULL, NULL, 1, 35, '2020-06-30 11:34:26', 35, '2020-06-30 11:34:26');
INSERT INTO `sgd_seguimiento_directorio` VALUES (3, 1, 4, 1, '2020-07-01 18:23:58', '2020-07-02 00:00:00', 'Mario Posada ', 'Seguimiento - base de datos', NULL, NULL, 1, 1, '2020-07-01 18:23:58', 1, '2020-07-01 18:23:58');
INSERT INTO `sgd_seguimiento_directorio` VALUES (4, 1, 5, 1, '2020-07-02 15:08:57', '2020-07-03 00:00:00', 'Mario Lemus', 'llamar manana ', NULL, NULL, 1, 1, '2020-07-02 15:08:57', 1, '2020-07-02 15:08:57');
INSERT INTO `sgd_seguimiento_directorio` VALUES (5, 1, 6, 18, '2020-07-06 09:23:54', '2020-07-06 00:00:00', 'Juan Perez', 'Primera llamada para solicitar visita a Empresa', 'Santa Ana', 'Gerente General', 1, 18, '2020-07-06 09:23:54', 18, '2020-07-06 09:23:54');
INSERT INTO `sgd_seguimiento_directorio` VALUES (6, 4, 6, 18, '2020-07-06 09:26:24', '2020-07-09 00:00:00', 'Juan Perez', 'Se Realizao primera visita para presentacion de empresa', 'Santa Ana', 'Encargado de compras', 1, 18, '2020-07-06 09:26:24', 18, '2020-07-06 09:26:24');

-- ----------------------------
-- Table structure for sge_seguim_estrategico
-- ----------------------------
CREATE TABLE `sge_seguim_estrategico`  (
  `sge_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave Principal - Seguimiento Plan Estrategico',
  `sge_id_pes` int(11) NOT NULL COMMENT 'Llave Principal - Plan Estrategico',
  `sge_id_psf` int(11) NOT NULL COMMENT 'Llave Principal - Paso Flujo',
  `sge_id_usu` int(11) NOT NULL COMMENT 'Llave principal - Usuario',
  `sge_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de entrada de paso',
  `sge_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de salida de paso',
  `sge_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Observaciones ',
  `sge_anexo` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Anexos',
  `sge_estado` int(11) NOT NULL COMMENT 'estado de flujo',
  `sge_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sge_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sge_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sge_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sge_id`) USING BTREE,
  INDEX `fk_sge_id_pes`(`sge_id_pes` ASC) USING BTREE,
  INDEX `fk_sge_id_psf`(`sge_id_psf` ASC) USING BTREE,
  INDEX `FK_reference_1696`(`sge_id_usu` ASC) USING BTREE,
  CONSTRAINT `FK_reference_1696` FOREIGN KEY (`sge_id_usu`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sge_id_pes` FOREIGN KEY (`sge_id_pes`) REFERENCES `pes_plan_estrategico` (`pes_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sge_id_psf` FOREIGN KEY (`sge_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sge_seguim_estrategico
-- ----------------------------

-- ----------------------------
-- Table structure for sgf_seguim_formulacion
-- ----------------------------
CREATE TABLE `sgf_seguim_formulacion`  (
  `sgf_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'LLave Principal - Seguimiento Formulación',
  `sgf_id_psf` int(11) NOT NULL COMMENT 'Llave Principal - Paso Flujo',
  `sgf_id_pxu` int(11) NOT NULL COMMENT 'Llave Principal - Plan Operativo por Unidad',
  `sgf_usu_apertura` int(11) NOT NULL COMMENT 'Usuario crea el Paso',
  `sgf_usu_cierra` int(11) NULL DEFAULT NULL COMMENT 'Usuario Cierra el paso',
  `sgf_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de Entrada del paso',
  `sgf_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de Salida del paso',
  `sgf_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Comentario del paso',
  `sgf_anexo` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Anexo del paso',
  `sgf_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgf_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgf_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgf_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgf_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgf_id`) USING BTREE,
  INDEX `fk_sgf_id_psf`(`sgf_id_psf` ASC) USING BTREE,
  INDEX `fk_sgf_id_pxu`(`sgf_id_pxu` ASC) USING BTREE,
  CONSTRAINT `fk_sgf_id_psf` FOREIGN KEY (`sgf_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgf_id_pxu` FOREIGN KEY (`sgf_id_pxu`) REFERENCES `pxu_plan_operativoxunidad` (`pxu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgf_seguim_formulacion
-- ----------------------------

-- ----------------------------
-- Table structure for sgg_seguimiento_riesgo_flujo
-- ----------------------------
CREATE TABLE `sgg_seguimiento_riesgo_flujo`  (
  `sgg_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal - Seguimiento de riesgo(Seguimiento)',
  `sgg_id_sgu` int(11) NOT NULL COMMENT 'Llave principal- Seguimiento de Riesgo',
  `sgg_id_psf` int(11) NOT NULL COMMENT 'Llave Principal - Paso Flujo',
  `sgg_id_usu` int(11) NOT NULL COMMENT 'Llave principal - Usuario',
  `sgg_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de entrada de paso',
  `sgg_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de salida de paso',
  `sgg_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Observaciones ',
  `sgg_anexo` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Anexos',
  `sgg_estado` int(11) NOT NULL COMMENT 'Estado de flujo',
  `sgg_usu_creacion` int(11) NOT NULL COMMENT 'Auditoría',
  `sgg_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoría',
  `sgg_fecha_creacion` datetime NOT NULL COMMENT 'Auditoría',
  `sgg_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoría',
  PRIMARY KEY (`sgg_id`) USING BTREE,
  INDEX `fk_sgg_id_psf`(`sgg_id_psf` ASC) USING BTREE,
  INDEX `fk_sgg_id_sgu`(`sgg_id_sgu` ASC) USING BTREE,
  CONSTRAINT `fk_sgg_id_psf` FOREIGN KEY (`sgg_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgg_id_sgu` FOREIGN KEY (`sgg_id_sgu`) REFERENCES `sgu_seguimiento_resumen` (`sgu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Tabla para el seguimiento de riesgo (flujo)' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgg_seguimiento_riesgo_flujo
-- ----------------------------

-- ----------------------------
-- Table structure for sgi_seguimiento_inc
-- ----------------------------
CREATE TABLE `sgi_seguimiento_inc`  (
  `sgi_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal -Seguimiento de incidencia',
  `sgi_id_inc` int(11) NOT NULL COMMENT 'Llave principal - Incidencias',
  `sgi_id_etr` int(11) NOT NULL COMMENT 'Llave principal - etapas',
  `sgi_fecha` datetime NOT NULL COMMENT 'Fecha de registro de incidencia',
  `sgi_observacion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observacion de seguimiento',
  `sgi_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgi_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgi_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgi_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgi_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgi_id`) USING BTREE,
  INDEX `fk_sgi_id_etr`(`sgi_id_etr` ASC) USING BTREE,
  INDEX `fk_sgi_id_inc`(`sgi_id_inc` ASC) USING BTREE,
  CONSTRAINT `fk_sgi_id_etr` FOREIGN KEY (`sgi_id_etr`) REFERENCES `etr_etapa_entregable` (`etr_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgi_id_inc` FOREIGN KEY (`sgi_id_inc`) REFERENCES `inc_incidencia` (`inc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Catalogo de seguimiento de incidencias (tracking)' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgi_seguimiento_inc
-- ----------------------------
INSERT INTO `sgi_seguimiento_inc` VALUES (1, 4, 1, '2024-02-09 14:27:21', NULL, 1, 1, 1, '2024-02-09 14:27:21', '2024-02-09 14:27:21');
INSERT INTO `sgi_seguimiento_inc` VALUES (2, 5, 1, '2024-02-09 14:28:59', NULL, 1, 1, 1, '2024-02-09 14:28:59', '2024-02-09 14:28:59');
INSERT INTO `sgi_seguimiento_inc` VALUES (3, 1, 1, '2024-02-09 14:29:00', NULL, 1, 1, 1, '2024-02-09 14:28:59', '2024-02-09 14:28:59');
INSERT INTO `sgi_seguimiento_inc` VALUES (4, 2, 1, '2024-02-09 14:29:00', NULL, 1, 1, 1, '2024-02-09 14:28:59', '2024-02-09 14:28:59');
INSERT INTO `sgi_seguimiento_inc` VALUES (5, 3, 1, '2024-02-09 14:29:00', NULL, 1, 1, 1, '2024-02-09 14:28:59', '2024-02-09 14:28:59');
INSERT INTO `sgi_seguimiento_inc` VALUES (6, 2, 2, '2024-02-09 14:41:48', NULL, 1, 1, 1, '2024-02-09 14:41:48', '2024-02-09 14:41:48');
INSERT INTO `sgi_seguimiento_inc` VALUES (7, 2, 3, '2024-06-13 10:54:04', NULL, 1, 1, 1, '2024-06-13 10:54:04', '2024-06-13 10:54:04');
INSERT INTO `sgi_seguimiento_inc` VALUES (8, 3, 2, '2024-08-14 12:42:06', NULL, 1, 1, 1, '2024-08-14 12:42:06', '2024-08-14 12:42:06');
INSERT INTO `sgi_seguimiento_inc` VALUES (9, 2, 5, '2024-08-14 19:12:25', NULL, 1, 1, 1, '2024-08-14 19:12:25', '2024-08-14 19:12:25');
INSERT INTO `sgi_seguimiento_inc` VALUES (10, 6, 1, '2024-08-16 06:58:06', NULL, 1, 1, 1, '2024-08-16 06:58:06', '2024-08-16 06:58:06');
INSERT INTO `sgi_seguimiento_inc` VALUES (11, 3, 3, '2024-08-27 09:29:08', NULL, 1, 1, 1, '2024-08-27 09:29:08', '2024-08-27 09:29:08');
INSERT INTO `sgi_seguimiento_inc` VALUES (12, 5, 2, '2024-09-24 15:57:49', NULL, 1, 1, 1, '2024-09-24 15:57:49', '2024-09-24 15:57:49');
INSERT INTO `sgi_seguimiento_inc` VALUES (13, 1, 2, '2024-09-27 14:42:48', NULL, 1, 1, 1, '2024-09-27 14:42:48', '2024-09-27 14:42:48');
INSERT INTO `sgi_seguimiento_inc` VALUES (14, 1, 3, '2024-09-27 14:42:59', NULL, 1, 1, 1, '2024-09-27 14:42:59', '2024-09-27 14:42:59');
INSERT INTO `sgi_seguimiento_inc` VALUES (15, 1, 2, '2024-09-27 14:43:43', NULL, 1, 1, 1, '2024-09-27 14:43:43', '2024-09-27 14:43:43');
INSERT INTO `sgi_seguimiento_inc` VALUES (16, 5, 3, '2025-02-24 12:17:21', NULL, 1, 1, 1, '2025-02-24 12:17:21', '2025-02-24 12:17:21');
INSERT INTO `sgi_seguimiento_inc` VALUES (17, 3, 4, '2025-02-24 12:18:20', NULL, 1, 1, 1, '2025-02-24 12:18:20', '2025-02-24 12:18:20');
INSERT INTO `sgi_seguimiento_inc` VALUES (18, 5, 4, '2025-02-24 12:18:26', NULL, 1, 1, 1, '2025-02-24 12:18:26', '2025-02-24 12:18:26');

-- ----------------------------
-- Table structure for sgk_seguimiento_ticket
-- ----------------------------
CREATE TABLE `sgk_seguimiento_ticket`  (
  `sgk_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal -Seguimiento de ticket',
  `sgk_id_tkh` int(11) NOT NULL COMMENT 'Llave principal - Ticket helpdesk',
  `sgk_id_esk` int(11) NOT NULL COMMENT 'Llave principal - Estado del Ticket',
  `sgk_fecha` datetime NOT NULL COMMENT 'Fecha de registro de estado',
  `sgk_observacion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observacion de seguimiento',
  `sgk_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgk_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgk_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgk_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgk_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgk_id`) USING BTREE,
  INDEX `fk_sgi_id_etr`(`sgk_id_esk` ASC) USING BTREE,
  INDEX `fk_sgi_id_inc`(`sgk_id_tkh` ASC) USING BTREE,
  CONSTRAINT `fk_sgk_id_esk` FOREIGN KEY (`sgk_id_esk`) REFERENCES `esk_estado_ticket` (`esk_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sgk_id_tkh` FOREIGN KEY (`sgk_id_tkh`) REFERENCES `tkh_ticket_helpdesk` (`tkh_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Catalogo de seguimiento de incidencias (tracking)' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgk_seguimiento_ticket
-- ----------------------------

-- ----------------------------
-- Table structure for sgm_seguimiento_comparativo_compra
-- ----------------------------
CREATE TABLE `sgm_seguimiento_comparativo_compra`  (
  `sgm_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal -Seguimiento de comparativo compra',
  `sgm_id_usu` int(11) NOT NULL COMMENT 'Llave principal de Usuario.',
  `sgm_id_ccc` int(11) NOT NULL COMMENT 'Llave primaria de comparativo de cotizacion compra',
  `sgm_fecha` datetime NOT NULL COMMENT 'Fecha de registro',
  `sgm_observacion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Observacion de seguimiento',
  `sgm_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgm_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgm_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgm_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgm_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgm_id`) USING BTREE,
  INDEX `fk_sgm_id_ccc`(`sgm_id_ccc` ASC) USING BTREE,
  INDEX `fk_sgm_id_usu`(`sgm_id_usu` ASC) USING BTREE,
  CONSTRAINT `fk_sgm_id_ccc` FOREIGN KEY (`sgm_id_ccc`) REFERENCES `ccc_comparativo_cotizacion_compra` (`ccc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgm_id_usu` FOREIGN KEY (`sgm_id_usu`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Seguimiento cormparativo compra-cotizacion' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgm_seguimiento_comparativo_compra
-- ----------------------------
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (1, 9, 4, '2019-07-24 09:26:52', 'Mejor precio de las tres cotizaciones', 1, 9, 9, '2019-07-24 09:26:52', '2019-07-24 09:26:52');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (2, 1, 5, '2019-10-21 10:00:47', 'Autorizado', 1, 1, 1, '2019-10-21 10:00:47', '2019-10-21 10:00:47');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (3, 1, 5, '2019-10-21 13:54:20', 'Aprobado', 1, 1, 1, '2019-10-21 13:54:20', '2019-10-21 13:54:20');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (4, 1, 5, '2019-10-21 16:25:43', 'Autorizado', 1, 1, 1, '2019-10-21 16:25:43', '2019-10-21 16:25:43');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (5, 1, 6, '2019-10-23 14:41:30', 'Mejor precio', 1, 1, 1, '2019-10-23 14:41:30', '2019-10-23 14:41:30');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (6, 1, 6, '2019-10-23 14:54:45', 'Autorizado', 1, 1, 1, '2019-10-23 14:54:45', '2019-10-23 14:54:45');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (7, 1, 7, '2020-02-25 13:16:36', 'SE REALIZA COMPARATIVO PARA COMPRA ', 1, 1, 1, '2020-02-25 13:16:36', '2020-02-25 13:16:36');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (8, 1, 7, '2020-02-25 13:20:26', 'DE ACUERDO PROCEDE ', 1, 1, 1, '2020-02-25 13:20:26', '2020-02-25 13:20:26');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (9, 33, 8, '2020-06-29 14:38:30', 'proveedor exclusivo', 1, 33, 33, '2020-06-29 14:38:30', '2020-06-29 14:38:30');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (10, 2, 8, '2020-06-29 14:53:43', 'Ok', 1, 2, 2, '2020-06-29 14:53:43', '2020-06-29 14:53:43');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (11, 33, 9, '2020-06-29 16:46:07', 'mejor precio', 1, 33, 33, '2020-06-29 16:46:07', '2020-06-29 16:46:07');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (12, 9, 9, '2020-06-29 16:47:29', 'ok', 1, 9, 9, '2020-06-29 16:47:29', '2020-06-29 16:47:29');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (13, 1, 10, '2020-07-01 10:17:32', 'Aprobado', 1, 1, 1, '2020-07-01 10:17:32', '2020-07-01 10:17:32');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (14, 1, 10, '2020-07-06 17:50:38', 'Autorizado', 1, 1, 1, '2020-07-06 17:50:38', '2020-07-06 17:50:38');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (15, 1, 11, '2021-02-18 11:22:42', 'menor precio', 1, 1, 1, '2021-02-18 11:22:42', '2021-02-18 11:22:42');
INSERT INTO `sgm_seguimiento_comparativo_compra` VALUES (16, 1, 11, '2021-02-18 11:24:30', 'Aprobado', 1, 1, 1, '2021-02-18 11:24:30', '2021-02-18 11:24:30');

-- ----------------------------
-- Table structure for sgm_seguimiento_mensual
-- ----------------------------
CREATE TABLE `sgm_seguimiento_mensual`  (
  `sgm_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave Principal - Seguimiento Mensual',
  `sgm_id_prm` int(11) NOT NULL COMMENT 'Llave Principal - Programación Meta',
  `sgm_id_sgn` int(11) NOT NULL COMMENT 'Llave Principal - Seguimiento Resumen',
  `sgm_ejecutado` decimal(19, 2) NOT NULL COMMENT 'Cantidad Ejecutada del mes',
  `sgm_descripcion` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'Descripción de lo realizado',
  `sgm_causa_atraso` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Causa de Retraso',
  `sgm_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgm_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgm_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgm_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgm_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgm_monto_ejecutado` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Monto usado en la ejecución',
  PRIMARY KEY (`sgm_id`) USING BTREE,
  INDEX `fk_sgm_id_prm`(`sgm_id_prm` ASC) USING BTREE,
  INDEX `fk_sgm_id_sgn`(`sgm_id_sgn` ASC) USING BTREE,
  CONSTRAINT `fk_sgm_id_prm` FOREIGN KEY (`sgm_id_prm`) REFERENCES `prm_programacion_meta` (`prm_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgm_id_sgn` FOREIGN KEY (`sgm_id_sgn`) REFERENCES `sgn_seguimiento_resumen_poa` (`sgn_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgm_seguimiento_mensual
-- ----------------------------
INSERT INTO `sgm_seguimiento_mensual` VALUES (1, 2, 1, 5.00, 'Se ejecuto con ahorro', 'Se estuvo trabajando actividades', 1, 1, 1, '2023-03-08 18:39:15', '2023-09-22 15:10:01', 8.00);

-- ----------------------------
-- Table structure for sgn_seguimiento_resumen_poa
-- ----------------------------
CREATE TABLE `sgn_seguimiento_resumen_poa`  (
  `sgn_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave Principal - Seguimiento Resumen',
  `sgn_id_flu` int(11) NOT NULL COMMENT 'Llave Principal - Flujo',
  `sgn_id_per` int(11) NOT NULL COMMENT 'Llave Principal - Periodo',
  `sgn_id_pxu` int(11) NOT NULL COMMENT 'Llave Principal - Plan Operativo por Unidad',
  `sgn_fecha` datetime NOT NULL COMMENT 'Fecha del Seguimiento',
  `sgn_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgn_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgn_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgn_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgn_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgn_id`) USING BTREE,
  INDEX `fk_sgn_id_flu`(`sgn_id_flu` ASC) USING BTREE,
  INDEX `fk_sgn_id_per`(`sgn_id_per` ASC) USING BTREE,
  INDEX `fk_sgn_id_pxu`(`sgn_id_pxu` ASC) USING BTREE,
  CONSTRAINT `fk_sgn_id_flu` FOREIGN KEY (`sgn_id_flu`) REFERENCES `flu_flujo` (`flu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgn_id_per` FOREIGN KEY (`sgn_id_per`) REFERENCES `per_periodo` (`per_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgn_id_pxu` FOREIGN KEY (`sgn_id_pxu`) REFERENCES `pxu_plan_operativoxunidad` (`pxu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgn_seguimiento_resumen_poa
-- ----------------------------
INSERT INTO `sgn_seguimiento_resumen_poa` VALUES (1, 7, 3, 1, '2023-03-08 18:39:15', 1, 1, 1, '2023-03-08 18:39:15', '2023-03-08 18:39:15');

-- ----------------------------
-- Table structure for sgo_seguimiento_orden
-- ----------------------------
CREATE TABLE `sgo_seguimiento_orden`  (
  `sgo_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificador principal del seguimiento',
  `sgo_id_orc` int(11) NOT NULL COMMENT 'Llave principal de la Orden de compra',
  `sgo_id_psf` int(11) NOT NULL COMMENT 'codigo de paso de  flujo',
  `sgo_id_usu` int(11) NOT NULL,
  `sgo_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de entrada de paso',
  `sgo_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de salida de paso',
  `sgo_observacion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observaciones ',
  `sgo_anexo` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Anexo (ruta)',
  `sgo_estado` int(11) NOT NULL COMMENT 'estado de flujo',
  `sgo_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgo_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgo_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sgo_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sgo_id`) USING BTREE,
  INDEX `fk_sgo_id_orc`(`sgo_id_orc` ASC) USING BTREE,
  INDEX `fk_sgo_id_psf`(`sgo_id_psf` ASC) USING BTREE,
  INDEX `fk_sgo_id_usu`(`sgo_id_usu` ASC) USING BTREE,
  CONSTRAINT `fk_sgo_id_orc` FOREIGN KEY (`sgo_id_orc`) REFERENCES `orc_orden_compra` (`orc_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sgo_id_psf` FOREIGN KEY (`sgo_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sgo_id_usu` FOREIGN KEY (`sgo_id_usu`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 57 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Seguimiento de la Orden de Compra.' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgo_seguimiento_orden
-- ----------------------------
INSERT INTO `sgo_seguimiento_orden` VALUES (11, 8, 20, 1, '2021-08-24 15:39:16', '2021-08-24 15:42:34', 'Enviado', NULL, 1, 1, 1, '2021-08-24 03:39:16', '2021-08-24 03:42:34');
INSERT INTO `sgo_seguimiento_orden` VALUES (12, 8, 21, 1, '2021-08-24 15:42:34', '2021-08-24 15:48:10', 'autorizado', NULL, 1, 1, 1, '2021-08-24 03:42:34', '2021-08-24 03:48:10');
INSERT INTO `sgo_seguimiento_orden` VALUES (13, 8, 22, 1, '2021-08-24 15:48:10', '2021-08-24 15:49:11', 'autorizado', NULL, 1, 1, 1, '2021-08-24 03:48:10', '2021-08-24 03:49:11');
INSERT INTO `sgo_seguimiento_orden` VALUES (14, 8, 23, 1, '2021-08-24 15:49:11', NULL, NULL, NULL, 1, 1, 1, '2021-08-24 03:49:11', '2021-08-24 03:49:11');
INSERT INTO `sgo_seguimiento_orden` VALUES (15, 9, 20, 1, '2021-08-27 16:08:19', NULL, NULL, NULL, 1, 1, 1, '2021-08-27 04:08:19', '2021-08-27 04:08:19');
INSERT INTO `sgo_seguimiento_orden` VALUES (16, 10, 20, 1, '2021-08-27 16:08:36', NULL, NULL, NULL, 1, 1, 1, '2021-08-27 04:08:36', '2021-08-27 04:08:36');
INSERT INTO `sgo_seguimiento_orden` VALUES (17, 11, 20, 1, '2021-11-10 15:59:56', '2021-11-10 16:03:12', 'autozado', NULL, 1, 1, 1, '2021-11-10 03:59:56', '2021-11-10 04:03:12');
INSERT INTO `sgo_seguimiento_orden` VALUES (18, 11, 21, 1, '2021-11-10 16:03:12', '2021-11-10 16:04:14', 'autorizado', NULL, 1, 1, 1, '2021-11-10 04:03:12', '2021-11-10 04:04:14');
INSERT INTO `sgo_seguimiento_orden` VALUES (19, 11, 22, 1, '2021-11-10 16:04:14', '2021-11-10 16:04:30', 'autorizado', NULL, 1, 1, 1, '2021-11-10 04:04:14', '2021-11-10 04:04:30');
INSERT INTO `sgo_seguimiento_orden` VALUES (20, 11, 23, 1, '2021-11-10 16:04:30', NULL, NULL, NULL, 1, 1, 1, '2021-11-10 04:04:30', '2021-11-10 04:04:30');
INSERT INTO `sgo_seguimiento_orden` VALUES (21, 12, 20, 1, '2022-01-18 11:34:39', '2022-01-18 11:35:10', 'favor de autorizar', NULL, 1, 1, 1, '2022-01-18 11:34:39', '2022-01-18 11:35:10');
INSERT INTO `sgo_seguimiento_orden` VALUES (22, 12, 21, 1, '2022-01-18 11:35:10', '2022-01-18 11:35:26', 'autorizada', NULL, 1, 1, 1, '2022-01-18 11:35:10', '2022-01-18 11:35:26');
INSERT INTO `sgo_seguimiento_orden` VALUES (23, 12, 22, 1, '2022-01-18 11:35:26', '2022-01-18 11:35:45', 'aprobado', NULL, 1, 1, 1, '2022-01-18 11:35:26', '2022-01-18 11:35:45');
INSERT INTO `sgo_seguimiento_orden` VALUES (24, 12, 23, 1, '2022-01-18 11:35:45', '2022-01-18 11:36:19', 'autorizado', NULL, 1, 1, 1, '2022-01-18 11:35:45', '2022-01-18 11:36:19');
INSERT INTO `sgo_seguimiento_orden` VALUES (25, 13, 20, 1, '2023-05-19 10:38:34', '2023-05-19 10:39:37', 'favor de autorizar', NULL, 1, 1, 1, '2023-05-19 10:38:34', '2023-05-19 10:39:37');
INSERT INTO `sgo_seguimiento_orden` VALUES (26, 13, 21, 1, '2023-05-19 10:39:37', '2023-05-19 10:40:10', 'autorizado', NULL, 1, 1, 1, '2023-05-19 10:39:37', '2023-05-19 10:40:10');
INSERT INTO `sgo_seguimiento_orden` VALUES (27, 13, 22, 1, '2023-05-19 10:40:10', '2023-05-19 10:40:25', 'autorizado', NULL, 1, 1, 1, '2023-05-19 10:40:10', '2023-05-19 10:40:25');
INSERT INTO `sgo_seguimiento_orden` VALUES (28, 13, 23, 1, '2023-05-19 10:40:25', NULL, NULL, NULL, 1, 1, 1, '2023-05-19 10:40:25', '2023-05-19 10:40:25');
INSERT INTO `sgo_seguimiento_orden` VALUES (29, 14, 20, 1, '2023-05-24 11:40:26', '2023-05-24 11:41:12', 'favor de aprobar', NULL, 1, 1, 1, '2023-05-24 11:40:26', '2023-05-24 11:41:12');
INSERT INTO `sgo_seguimiento_orden` VALUES (30, 14, 21, 1, '2023-05-24 11:41:12', '2023-05-24 11:41:47', 'autorizar', NULL, 1, 1, 1, '2023-05-24 11:41:12', '2023-05-24 11:41:47');
INSERT INTO `sgo_seguimiento_orden` VALUES (31, 14, 22, 1, '2023-05-24 11:41:47', '2023-05-24 11:42:33', 'autorizada', NULL, 1, 1, 1, '2023-05-24 11:41:47', '2023-05-24 11:42:33');
INSERT INTO `sgo_seguimiento_orden` VALUES (32, 14, 23, 1, '2023-05-24 11:42:33', NULL, NULL, NULL, 1, 1, 1, '2023-05-24 11:42:33', '2023-05-24 11:42:33');
INSERT INTO `sgo_seguimiento_orden` VALUES (33, 15, 20, 1, '2023-05-26 11:11:28', '2023-05-26 11:12:39', 'favor de autorizar', NULL, 1, 1, 1, '2023-05-26 11:11:28', '2023-05-26 11:12:39');
INSERT INTO `sgo_seguimiento_orden` VALUES (34, 15, 21, 1, '2023-05-26 11:12:39', '2023-05-26 11:13:44', 'autorizar', NULL, 1, 1, 1, '2023-05-26 11:12:39', '2023-05-26 11:13:44');
INSERT INTO `sgo_seguimiento_orden` VALUES (35, 15, 22, 1, '2023-05-26 11:13:44', '2023-05-26 11:14:12', 'autorizar', NULL, 1, 1, 1, '2023-05-26 11:13:44', '2023-05-26 11:14:12');
INSERT INTO `sgo_seguimiento_orden` VALUES (36, 15, 23, 1, '2023-05-26 11:14:12', NULL, NULL, NULL, 1, 1, 1, '2023-05-26 11:14:12', '2023-05-26 11:14:12');
INSERT INTO `sgo_seguimiento_orden` VALUES (37, 16, 20, 1, '2024-06-03 08:57:59', '2024-06-03 08:59:24', 'autoriar', NULL, 1, 1, 1, '2024-06-03 08:57:59', '2024-06-03 08:59:24');
INSERT INTO `sgo_seguimiento_orden` VALUES (38, 16, 21, 1, '2024-06-03 08:59:24', '2024-06-03 08:59:49', 'autorizada', NULL, 1, 1, 1, '2024-06-03 08:59:24', '2024-06-03 08:59:49');
INSERT INTO `sgo_seguimiento_orden` VALUES (39, 16, 22, 1, '2024-06-03 08:59:49', '2024-06-03 09:38:21', 'autorizado', NULL, 1, 1, 1, '2024-06-03 08:59:49', '2024-06-03 09:38:21');
INSERT INTO `sgo_seguimiento_orden` VALUES (40, 17, 20, 1, '2024-06-03 09:21:23', '2024-06-03 09:22:23', 'Favor de revisar', NULL, 1, 1, 1, '2024-06-03 09:21:23', '2024-06-03 09:22:23');
INSERT INTO `sgo_seguimiento_orden` VALUES (41, 17, 21, 1, '2024-06-03 09:22:23', '2024-06-03 09:24:07', 'autorizado', NULL, 1, 1, 1, '2024-06-03 09:22:23', '2024-06-03 09:24:07');
INSERT INTO `sgo_seguimiento_orden` VALUES (42, 17, 22, 1, '2024-06-03 09:24:07', '2024-06-03 09:25:32', 'autorizada', NULL, 1, 1, 1, '2024-06-03 09:24:07', '2024-06-03 09:25:32');
INSERT INTO `sgo_seguimiento_orden` VALUES (43, 17, 23, 1, '2024-06-03 09:25:32', NULL, NULL, NULL, 1, 1, 1, '2024-06-03 09:25:32', '2024-06-03 09:25:32');
INSERT INTO `sgo_seguimiento_orden` VALUES (44, 16, 23, 1, '2024-06-03 09:38:21', NULL, NULL, NULL, 1, 1, 1, '2024-06-03 09:38:21', '2024-06-03 09:38:21');
INSERT INTO `sgo_seguimiento_orden` VALUES (45, 18, 20, 1, '2024-06-03 10:02:34', '2024-06-03 10:02:45', 'favor de revisar', NULL, 1, 1, 1, '2024-06-03 10:02:34', '2024-06-03 10:02:45');
INSERT INTO `sgo_seguimiento_orden` VALUES (46, 18, 21, 1, '2024-06-03 10:02:45', '2024-06-03 10:03:03', 'autorizada', NULL, 1, 1, 1, '2024-06-03 10:02:45', '2024-06-03 10:03:03');
INSERT INTO `sgo_seguimiento_orden` VALUES (47, 18, 22, 1, '2024-06-03 10:03:03', '2024-06-03 10:04:17', 'segunda autorizacion ', NULL, 1, 1, 1, '2024-06-03 10:03:03', '2024-06-03 10:04:17');
INSERT INTO `sgo_seguimiento_orden` VALUES (48, 18, 23, 1, '2024-06-03 10:04:17', NULL, NULL, NULL, 1, 1, 1, '2024-06-03 10:04:17', '2024-06-03 10:04:17');
INSERT INTO `sgo_seguimiento_orden` VALUES (49, 19, 20, 1, '2024-07-29 11:14:02', '2024-07-29 11:14:35', 'revisar', NULL, 1, 1, 1, '2024-07-29 11:14:02', '2024-07-29 11:14:35');
INSERT INTO `sgo_seguimiento_orden` VALUES (50, 19, 21, 1, '2024-07-29 11:14:35', '2024-07-29 11:15:34', 'autoriza', NULL, 1, 1, 1, '2024-07-29 11:14:35', '2024-07-29 11:15:34');
INSERT INTO `sgo_seguimiento_orden` VALUES (51, 19, 22, 1, '2024-07-29 11:15:34', NULL, NULL, NULL, 1, 1, 1, '2024-07-29 11:15:34', '2024-07-29 11:15:34');
INSERT INTO `sgo_seguimiento_orden` VALUES (52, 20, 20, 1, '2024-10-17 16:30:20', NULL, NULL, NULL, 1, 1, 1, '2024-10-17 04:30:20', '2024-10-17 04:30:20');
INSERT INTO `sgo_seguimiento_orden` VALUES (53, 21, 20, 65, '2025-02-24 11:48:52', '2025-02-24 11:49:09', 'autoriado', NULL, 1, 65, 65, '2025-02-24 11:48:52', '2025-02-24 11:49:09');
INSERT INTO `sgo_seguimiento_orden` VALUES (54, 21, 21, 65, '2025-02-24 11:49:09', '2025-02-24 11:49:32', 'autoria', NULL, 1, 65, 65, '2025-02-24 11:49:09', '2025-02-24 11:49:32');
INSERT INTO `sgo_seguimiento_orden` VALUES (55, 21, 22, 65, '2025-02-24 11:49:32', '2025-02-24 11:51:03', 'test', NULL, 1, 65, 65, '2025-02-24 11:49:32', '2025-02-24 11:51:03');
INSERT INTO `sgo_seguimiento_orden` VALUES (56, 21, 23, 65, '2025-02-24 11:51:03', NULL, NULL, NULL, 1, 65, 65, '2025-02-24 11:51:03', '2025-02-24 11:51:03');

-- ----------------------------
-- Table structure for sgp_seguimiento_programacion
-- ----------------------------
CREATE TABLE `sgp_seguimiento_programacion`  (
  `sgp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'LLave Principal - Seguimiento Formulación',
  `sgp_id_psf` int(11) NOT NULL COMMENT 'codigo de paso de  flujo',
  `sgp_id_sgn` int(11) NOT NULL COMMENT 'Llave Principal - Seguimiento Resumen',
  `sgp_usu_apertura` int(11) NOT NULL COMMENT 'Usuario crea el Paso',
  `sgp_usu_cierra` int(11) NULL DEFAULT NULL COMMENT 'Usuario Cierra el paso',
  `sgp_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de Entrada del paso',
  `sgp_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de Salida del paso',
  `sgp_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Comentario del paso',
  `sgp_anexo` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Anexo del paso',
  `sgp_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgp_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgp_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgp_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgp_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgp_id`) USING BTREE,
  INDEX `fk_sgp_id_psf`(`sgp_id_psf` ASC) USING BTREE,
  INDEX `fk_sgp_id_sgn`(`sgp_id_sgn` ASC) USING BTREE,
  CONSTRAINT `fk_sgp_id_psf` FOREIGN KEY (`sgp_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgp_id_sgn` FOREIGN KEY (`sgp_id_sgn`) REFERENCES `sgn_seguimiento_resumen_poa` (`sgn_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgp_seguimiento_programacion
-- ----------------------------

-- ----------------------------
-- Table structure for sgp_seguimiento_programacion_procedimiento
-- ----------------------------
CREATE TABLE `sgp_seguimiento_programacion_procedimiento`  (
  `sgp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de seguimiento programación procedimiento',
  `sgp_id_pgp` int(11) NOT NULL COMMENT 'Llave principal de Programación de procedimiento',
  `sgp_id_usu` int(11) NOT NULL COMMENT 'Llave principal de Usuario.',
  `sgp_fecha` datetime NOT NULL COMMENT 'Fecha de seguimiento',
  `sgp_hora` time NOT NULL COMMENT 'Hora de seguimiento',
  `sgp_comentario` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Comentario',
  `sgp_url_anexo` varchar(300) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Url del anexo',
  `sgp_nombre_anexo` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Nombre o referencia del anexo',
  `sgp_estado` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'estado del registro 1=activo, 0=inactivo',
  `sgp_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgp_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgp_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgp_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgp_id`) USING BTREE,
  INDEX `fk_sgp_id_pgp`(`sgp_id_pgp` ASC) USING BTREE,
  INDEX `fk_sgp_id_usu`(`sgp_id_usu` ASC) USING BTREE,
  CONSTRAINT `fk_sgp_id_pgp` FOREIGN KEY (`sgp_id_pgp`) REFERENCES `pgp_programacion_procedimiento` (`pgp_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sgp_id_usu` FOREIGN KEY (`sgp_id_usu`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Entidad - Seguimiento programación proced' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgp_seguimiento_programacion_procedimiento
-- ----------------------------

-- ----------------------------
-- Table structure for sgr_seguimiento_requisicion
-- ----------------------------
CREATE TABLE `sgr_seguimiento_requisicion`  (
  `sgr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificador',
  `sgr_id_rxi` int(11) NOT NULL COMMENT 'Llave principal de la requisición',
  `sgr_id_psf` int(11) NOT NULL COMMENT 'codigo de paso de  flujo',
  `sgr_id_usu` int(11) NOT NULL,
  `sgr_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de entrada de paso',
  `sgr_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de salida de paso',
  `sgr_observacion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observaciones ',
  `sgr_anexo` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Anexo (ruta)',
  `sgr_estado` int(11) NOT NULL COMMENT 'estado de flujo',
  `sgr_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgr_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgr_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sgr_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sgr_id`) USING BTREE,
  INDEX `fk_sgr_id_psf`(`sgr_id_psf` ASC) USING BTREE,
  INDEX `fk_sgr_id_rxi`(`sgr_id_rxi` ASC) USING BTREE,
  INDEX `fk_sgr_id_usu`(`sgr_id_usu` ASC) USING BTREE,
  CONSTRAINT `fk_sgr_id_psf` FOREIGN KEY (`sgr_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgr_id_rxi` FOREIGN KEY (`sgr_id_rxi`) REFERENCES `rxi_requisicion_inventario` (`rxi_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgr_id_usu` FOREIGN KEY (`sgr_id_usu`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 93 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgr_seguimiento_requisicion
-- ----------------------------
INSERT INTO `sgr_seguimiento_requisicion` VALUES (1, 1, 6, 1, '2021-02-18 11:12:40', '2021-02-18 11:13:53', 'Solicitud', NULL, 1, 1, 1, '2021-02-18 11:12:40', '2021-02-18 11:13:53');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (2, 1, 7, 1, '2021-02-18 11:13:53', '2021-02-18 11:17:48', 'aprobado', NULL, 1, 1, 1, '2021-02-18 11:13:53', '2021-02-18 11:17:48');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (3, 1, 8, 1, '2021-02-18 11:17:48', NULL, NULL, NULL, 1, 1, 1, '2021-02-18 11:17:48', '2021-02-18 11:17:48');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (4, 2, 6, 1, '2021-04-23 11:39:00', NULL, NULL, NULL, 1, 1, 1, '2021-04-23 11:39:00', '2021-04-23 11:39:00');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (5, 3, 6, 1, '2021-08-25 16:49:15', '2021-08-25 16:49:25', 'test', NULL, 1, 1, 1, '2021-08-25 04:49:15', '2021-08-25 04:49:25');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (6, 3, 7, 1, '2021-08-25 16:49:25', NULL, NULL, NULL, 1, 1, 1, '2021-08-25 04:49:25', '2021-08-25 04:49:25');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (7, 4, 6, 1, '2021-10-20 10:23:22', '2021-10-20 10:25:18', 'autorizar', NULL, 1, 1, 1, '2021-10-20 10:23:22', '2021-10-20 10:25:18');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (8, 4, 7, 1, '2021-10-20 10:25:18', '2021-11-05 17:35:02', 'Favor de autorizar', NULL, 1, 1, 1, '2021-10-20 10:25:18', '2021-11-05 05:35:02');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (9, 4, 8, 1, '2021-11-05 17:35:02', NULL, NULL, NULL, 1, 1, 1, '2021-11-05 05:35:02', '2021-11-05 05:35:02');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (10, 5, 6, 1, '2021-11-05 17:37:02', '2021-11-05 17:37:12', 'autorizar', NULL, 1, 1, 1, '2021-11-05 05:37:02', '2021-11-05 05:37:12');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (11, 5, 7, 1, '2021-11-05 17:37:12', NULL, NULL, NULL, 1, 1, 1, '2021-11-05 05:37:12', '2021-11-05 05:37:12');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (12, 6, 6, 1, '2021-11-05 17:40:43', '2021-11-05 17:41:12', 'pasar a tareas pendientes', NULL, 1, 1, 1, '2021-11-05 05:40:43', '2021-11-05 05:41:12');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (13, 6, 7, 1, '2021-11-05 17:41:12', NULL, NULL, NULL, 1, 1, 1, '2021-11-05 05:41:12', '2021-11-05 05:41:12');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (14, 7, 6, 1, '2021-11-10 15:55:51', '2021-11-10 15:56:19', 'revisar', NULL, 1, 1, 1, '2021-11-10 03:55:51', '2021-11-10 03:56:19');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (15, 7, 7, 1, '2021-11-10 15:56:20', '2021-11-10 15:57:13', 'autorizado', NULL, 1, 1, 1, '2021-11-10 03:56:20', '2021-11-10 03:57:13');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (16, 7, 8, 1, '2021-11-10 15:57:13', NULL, NULL, NULL, 1, 1, 1, '2021-11-10 03:57:13', '2021-11-10 03:57:13');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (17, 8, 6, 1, '2022-01-18 09:56:10', '2022-01-18 09:57:03', 'solicito autorizacion', NULL, 1, 1, 1, '2022-01-18 09:56:10', '2022-01-18 09:57:03');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (18, 8, 7, 1, '2022-01-18 09:57:03', '2022-01-18 09:57:24', 'ok', NULL, 1, 1, 1, '2022-01-18 09:57:03', '2022-01-18 09:57:24');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (19, 8, 8, 1, '2022-01-18 09:57:24', NULL, NULL, NULL, 1, 1, 1, '2022-01-18 09:57:24', '2022-01-18 09:57:24');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (20, 9, 6, 1, '2022-01-18 11:22:13', '2022-01-18 11:23:26', 'favor de autorizar', NULL, 1, 1, 1, '2022-01-18 11:22:13', '2022-01-18 11:23:26');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (21, 9, 7, 1, '2022-01-18 11:23:26', '2022-01-18 11:25:29', 'autorizado', NULL, 1, 1, 1, '2022-01-18 11:23:26', '2022-01-18 11:25:29');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (22, 9, 8, 1, '2022-01-18 11:25:29', NULL, NULL, NULL, 1, 1, 1, '2022-01-18 11:25:29', '2022-01-18 11:25:29');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (23, 10, 2, 1, '2022-01-18 11:45:26', '2022-01-18 11:54:31', 'autorizado ', NULL, 1, 1, 1, '2022-01-18 11:45:26', '2022-01-18 11:54:31');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (24, 10, 1, 1, '2022-01-18 11:54:31', '2022-01-18 11:54:53', 'autorizado', NULL, 1, 1, 1, '2022-01-18 11:54:31', '2022-01-18 11:54:53');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (25, 10, 5, 1, '2022-01-18 11:54:53', NULL, NULL, NULL, 1, 1, 1, '2022-01-18 11:54:53', '2022-01-18 11:54:53');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (26, 11, 2, 1, '2022-11-15 15:39:39', '2022-11-15 15:41:31', 'autorizado', NULL, 1, 1, 1, '2022-11-15 03:39:39', '2022-11-15 03:41:31');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (27, 11, 1, 1, '2022-11-15 15:41:31', '2022-11-15 15:42:04', 'aut', NULL, 1, 1, 1, '2022-11-15 03:41:31', '2022-11-15 03:42:04');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (28, 11, 5, 1, '2022-11-15 15:42:04', NULL, NULL, NULL, 1, 1, 1, '2022-11-15 03:42:04', '2022-11-15 03:42:04');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (29, 12, 2, 1, '2023-01-13 11:22:52', '2023-01-13 11:22:52', 'Creacion de la requisicion', NULL, 1, 1, 1, '2023-01-13 11:22:52', '2023-01-13 11:22:52');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (30, 12, 5, 1, '2023-01-13 11:22:52', NULL, 'Autorizacion de requsicion automatica', NULL, 1, 1, 1, '2023-01-13 11:22:52', '2023-01-13 11:22:52');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (31, 13, 2, 1, '2023-05-12 10:02:55', '2024-03-12 15:32:44', 'Ok', NULL, 1, 1, 1, '2023-05-12 10:02:55', '2024-03-12 03:32:44');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (32, 14, 6, 1, '2023-05-19 10:32:12', '2023-05-19 10:33:36', 'favor de autorizar', NULL, 1, 1, 1, '2023-05-19 10:32:12', '2023-05-19 10:33:36');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (33, 14, 7, 1, '2023-05-19 10:33:36', '2023-05-19 10:34:00', 'autorizado procede', NULL, 1, 1, 1, '2023-05-19 10:33:36', '2023-05-19 10:34:00');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (34, 14, 8, 1, '2023-05-19 10:34:00', NULL, NULL, NULL, 1, 1, 1, '2023-05-19 10:34:00', '2023-05-19 10:34:00');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (35, 15, 2, 1, '2023-05-24 11:59:21', '2023-05-24 11:59:21', 'Creacion de la requisicion', NULL, 1, 1, 1, '2023-05-24 11:59:21', '2023-05-24 11:59:21');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (36, 15, 5, 1, '2023-05-24 11:59:21', NULL, 'Autorizacion de requsicion automatica', NULL, 1, 1, 1, '2023-05-24 11:59:21', '2023-05-24 11:59:21');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (37, 16, 2, 1, '2023-08-18 09:49:10', '2023-08-18 09:50:21', 'favor de revisar pedido de esta semana', NULL, 1, 1, 1, '2023-08-18 09:49:10', '2023-08-18 09:50:21');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (38, 16, 1, 1, '2023-08-18 09:50:21', '2023-08-18 09:54:01', 'revisada', NULL, 1, 1, 1, '2023-08-18 09:50:21', '2023-08-18 09:54:01');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (39, 16, 5, 1, '2023-08-18 09:54:01', NULL, NULL, NULL, 1, 1, 1, '2023-08-18 09:54:01', '2023-08-18 09:54:01');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (40, 17, 6, 1, '2023-11-28 10:42:26', '2023-11-28 10:42:40', 'test', NULL, 1, 1, 1, '2023-11-28 10:42:26', '2023-11-28 10:42:40');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (41, 17, 7, 1, '2023-11-28 10:42:40', '2023-11-28 10:55:45', 'autorizar', NULL, 1, 1, 1, '2023-11-28 10:42:40', '2023-11-28 10:55:45');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (42, 18, 6, 1, '2023-11-28 10:50:01', '2023-11-28 10:51:29', 'revisar incidente', NULL, 1, 1, 1, '2023-11-28 10:50:01', '2023-11-28 10:51:29');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (43, 18, 7, 1, '2023-11-28 10:51:29', '2023-11-28 10:55:24', 'test', NULL, 1, 1, 1, '2023-11-28 10:51:29', '2023-11-28 10:55:24');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (44, 18, 8, 1, '2023-11-28 10:55:24', NULL, NULL, NULL, 1, 1, 1, '2023-11-28 10:55:24', '2023-11-28 10:55:24');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (45, 17, 8, 1, '2023-11-28 10:55:45', NULL, NULL, NULL, 1, 1, 1, '2023-11-28 10:55:45', '2023-11-28 10:55:45');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (46, 19, 6, 1, '2023-11-28 11:03:39', '2023-11-28 11:03:51', 'test', NULL, 1, 1, 1, '2023-11-28 11:03:39', '2023-11-28 11:03:51');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (47, 19, 7, 1, '2023-11-28 11:03:52', NULL, NULL, NULL, 1, 1, 1, '2023-11-28 11:03:52', '2023-11-28 11:03:52');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (48, 20, 6, 1, '2023-11-28 11:16:31', '2023-11-28 11:18:07', 'test', NULL, 1, 1, 1, '2023-11-28 11:16:31', '2023-11-28 11:18:07');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (49, 20, 7, 1, '2023-11-28 11:18:07', NULL, NULL, NULL, 1, 1, 1, '2023-11-28 11:18:07', '2023-11-28 11:18:07');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (50, 21, 6, 1, '2024-01-17 22:00:24', '2024-01-17 22:03:10', 'test', NULL, 1, 1, 1, '2024-01-17 10:00:24', '2024-01-17 10:03:10');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (51, 21, 7, 1, '2024-01-17 22:03:10', '2024-01-17 22:04:01', 'test', NULL, 1, 1, 1, '2024-01-17 10:03:10', '2024-01-17 10:04:01');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (52, 21, 6, 1, '2024-01-17 22:04:01', '2024-01-17 22:05:51', 'test', NULL, 1, 1, 1, '2024-01-17 10:04:01', '2024-01-17 10:05:51');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (53, 21, 7, 1, '2024-01-17 22:05:51', NULL, NULL, NULL, 1, 1, 1, '2024-01-17 10:05:51', '2024-01-17 10:05:51');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (54, 22, 2, 1, '2024-02-08 10:20:09', '2024-02-08 10:21:27', 'favor autorizar', NULL, 1, 1, 1, '2024-02-08 10:20:09', '2024-02-08 10:21:27');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (55, 22, 1, 1, '2024-02-08 10:21:27', '2024-02-08 10:27:00', 'AUTORIZADO ', NULL, 1, 1, 1, '2024-02-08 10:21:27', '2024-02-08 10:27:00');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (56, 22, 5, 1, '2024-02-08 10:27:00', NULL, NULL, NULL, 1, 1, 1, '2024-02-08 10:27:00', '2024-02-08 10:27:00');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (57, 23, 2, 1, '2024-02-08 10:49:10', '2024-02-08 10:49:28', 'test', NULL, 1, 1, 1, '2024-02-08 10:49:10', '2024-02-08 10:49:28');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (58, 23, 1, 1, '2024-02-08 10:49:28', '2024-02-08 10:49:42', 'autorizado', NULL, 1, 1, 1, '2024-02-08 10:49:28', '2024-02-08 10:49:42');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (59, 23, 5, 1, '2024-02-08 10:49:42', NULL, NULL, NULL, 1, 1, 1, '2024-02-08 10:49:42', '2024-02-08 10:49:42');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (60, 13, 1, 1, '2024-03-12 15:32:44', '2024-03-12 15:33:20', 'ok', NULL, 1, 1, 1, '2024-03-12 03:32:44', '2024-03-12 03:33:20');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (61, 13, 5, 1, '2024-03-12 15:33:20', NULL, NULL, NULL, 1, 1, 1, '2024-03-12 03:33:20', '2024-03-12 03:33:20');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (62, 24, 2, 1, '2024-04-24 16:03:46', '2024-04-24 16:04:46', 'Apruebo ', NULL, 1, 1, 1, '2024-04-24 04:03:46', '2024-04-24 04:04:46');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (63, 24, 1, 1, '2024-04-24 16:04:46', NULL, NULL, NULL, 1, 1, 1, '2024-04-24 04:04:46', '2024-04-24 04:04:46');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (64, 25, 2, 1, '2024-05-03 15:13:30', '2024-05-03 15:14:07', 'AUTORIZACION', NULL, 1, 1, 1, '2024-05-03 03:13:30', '2024-05-03 03:14:07');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (65, 25, 1, 1, '2024-05-03 15:14:07', NULL, NULL, NULL, 1, 1, 1, '2024-05-03 03:14:07', '2024-05-03 03:14:07');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (66, 26, 2, 1, '2024-06-19 09:57:34', '2024-06-19 10:05:33', 'favor de revisar', NULL, 1, 1, 1, '2024-06-19 09:57:34', '2024-06-19 10:05:33');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (67, 26, 1, 1, '2024-06-19 10:05:33', '2024-06-19 10:06:07', 'ok autorizado', NULL, 1, 1, 1, '2024-06-19 10:05:33', '2024-06-19 10:06:07');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (68, 26, 5, 1, '2024-06-19 10:06:07', NULL, NULL, NULL, 1, 1, 1, '2024-06-19 10:06:07', '2024-06-19 10:06:07');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (69, 27, 2, 1, '2024-07-02 09:40:43', '2024-07-02 09:41:35', 'Se envia a autorizacion', NULL, 1, 1, 1, '2024-07-02 09:40:43', '2024-07-02 09:41:35');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (70, 27, 1, 1, '2024-07-02 09:41:35', '2024-07-02 09:42:52', 'Se da por aprobado', NULL, 1, 1, 1, '2024-07-02 09:41:35', '2024-07-02 09:42:52');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (71, 27, 5, 1, '2024-07-02 09:42:52', NULL, NULL, NULL, 1, 1, 1, '2024-07-02 09:42:52', '2024-07-02 09:42:52');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (72, 28, 2, 1, '2024-07-16 11:12:52', '2024-07-16 11:13:19', 'autorizado', NULL, 1, 1, 1, '2024-07-16 11:12:52', '2024-07-16 11:13:19');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (73, 28, 1, 1, '2024-07-16 11:13:19', '2024-07-16 11:15:13', 'Autorizado', NULL, 1, 1, 1, '2024-07-16 11:13:19', '2024-07-16 11:15:13');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (74, 28, 5, 1, '2024-07-16 11:15:13', NULL, NULL, NULL, 1, 1, 1, '2024-07-16 11:15:13', '2024-07-16 11:15:13');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (75, 29, 2, 1, '2024-07-29 10:49:39', '2024-07-29 10:49:39', 'Creacion de la requisicion', NULL, 1, 1, 1, '2024-07-29 10:49:39', '2024-07-29 10:49:39');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (76, 29, 5, 1, '2024-07-29 10:49:39', NULL, 'Autorizacion de requsicion automatica', NULL, 1, 1, 1, '2024-07-29 10:49:39', '2024-07-29 10:49:39');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (77, 30, 6, 49, '2024-07-29 16:01:07', NULL, NULL, NULL, 1, 49, 49, '2024-07-29 04:01:07', '2024-07-29 04:01:07');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (78, 31, 2, 1, '2024-08-28 16:46:42', '2024-08-28 16:46:42', 'Creacion de la requisicion', NULL, 1, 1, 1, '2024-08-28 04:46:42', '2024-08-28 04:46:42');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (79, 31, 5, 1, '2024-08-28 16:46:42', NULL, 'Autorizacion de requsicion automatica', NULL, 1, 1, 1, '2024-08-28 04:46:42', '2024-08-28 04:46:42');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (80, 32, 2, 1, '2024-09-27 14:30:39', '2024-09-27 14:30:39', 'Creacion de la requisicion', NULL, 1, 1, 1, '2024-09-27 02:30:39', '2024-09-27 02:30:39');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (81, 32, 5, 1, '2024-09-27 14:30:39', NULL, 'Autorizacion de requsicion automatica', NULL, 1, 1, 1, '2024-09-27 02:30:39', '2024-09-27 02:30:39');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (82, 33, 2, 1, '2025-01-06 15:18:03', '2025-01-06 15:18:42', 'Enviar', NULL, 1, 1, 1, '2025-01-06 03:18:03', '2025-01-06 03:18:42');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (83, 33, 1, 1, '2025-01-06 15:18:42', '2025-01-06 15:19:21', 'Aprobado', NULL, 1, 1, 1, '2025-01-06 03:18:42', '2025-01-06 03:19:21');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (84, 33, 5, 1, '2025-01-06 15:19:21', NULL, NULL, NULL, 1, 1, 1, '2025-01-06 03:19:21', '2025-01-06 03:19:21');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (85, 34, 2, 1, '2025-01-06 15:24:10', '2025-01-06 15:25:13', 'Enviada', NULL, 1, 1, 1, '2025-01-06 03:24:10', '2025-01-06 03:25:13');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (86, 34, 1, 1, '2025-01-06 15:25:13', '2025-01-06 15:31:35', 'Aprobado', NULL, 1, 1, 1, '2025-01-06 03:25:13', '2025-01-06 03:31:35');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (87, 34, 5, 1, '2025-01-06 15:31:35', NULL, NULL, NULL, 1, 1, 1, '2025-01-06 03:31:35', '2025-01-06 03:31:35');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (88, 35, 6, 65, '2025-02-24 09:18:38', NULL, NULL, NULL, 1, 65, 65, '2025-02-24 09:18:38', '2025-02-24 09:18:38');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (89, 36, 2, 65, '2025-02-24 09:59:18', '2025-02-24 10:00:40', 'autorizado', NULL, 1, 65, 65, '2025-02-24 09:59:18', '2025-02-24 10:00:40');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (90, 36, 1, 1, '2025-02-24 10:00:40', '2025-02-24 10:03:55', 'OK', NULL, 1, 65, 1, '2025-02-24 10:00:40', '2025-02-24 10:03:55');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (91, 37, 2, 65, '2025-02-24 10:02:22', NULL, NULL, NULL, 1, 65, 65, '2025-02-24 10:02:22', '2025-02-24 10:02:22');
INSERT INTO `sgr_seguimiento_requisicion` VALUES (92, 36, 5, 1, '2025-02-24 10:03:55', NULL, NULL, NULL, 1, 1, 1, '2025-02-24 10:03:55', '2025-02-24 10:03:55');

-- ----------------------------
-- Table structure for sgr_seguimiento_riesgo
-- ----------------------------
CREATE TABLE `sgr_seguimiento_riesgo`  (
  `sgr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave Principal',
  `sgr_id_sgu` int(11) NOT NULL COMMENT 'Llave Principal - Seguimiento Resumen de Riesgo',
  `sgr_id_rsg` int(11) NOT NULL COMMENT 'Llave Principal - Riesgo',
  `sgr_id_rsd` int(11) NOT NULL COMMENT 'Llave Principal - Riesgo residual',
  `sgr_id_imr` int(11) NULL DEFAULT NULL COMMENT 'Llave Principal - Impacto',
  `sgr_id_prb` int(11) NULL DEFAULT NULL COMMENT 'Llave Principal - Probabilidad',
  `sgr_acciones_cont` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Acciones de contingencia',
  `sgr_fecha_inicio` datetime NOT NULL COMMENT 'Fecha inicio',
  `sgr_fecha_final` datetime NOT NULL COMMENT 'Fecha final',
  `sgr_estado` int(11) NOT NULL COMMENT 'Estado 1-Activo 0-Inactivo',
  `sgr_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgr_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sgr_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sgr_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sgr_id`) USING BTREE,
  INDEX `fk_sgr_id_rsg`(`sgr_id_rsg` ASC) USING BTREE,
  INDEX `fk_sgr_id_sgu`(`sgr_id_sgu` ASC) USING BTREE,
  INDEX `fk_sgr_id_imr`(`sgr_id_imr` ASC) USING BTREE,
  INDEX `fk_sgr_id_prb`(`sgr_id_prb` ASC) USING BTREE,
  INDEX `fk_sgr_id_rsd`(`sgr_id_rsd` ASC) USING BTREE,
  CONSTRAINT `fk_sgr_id_imr` FOREIGN KEY (`sgr_id_imr`) REFERENCES `imr_impacto_riesgo` (`imr_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgr_id_prb` FOREIGN KEY (`sgr_id_prb`) REFERENCES `prb_probabilidad_riesgo` (`prb_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgr_id_rsd` FOREIGN KEY (`sgr_id_rsd`) REFERENCES `rsd_riesgo_residual` (`rsd_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgr_id_rsg` FOREIGN KEY (`sgr_id_rsg`) REFERENCES `rsg_riesgos` (`rsg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgr_id_sgu` FOREIGN KEY (`sgr_id_sgu`) REFERENCES `sgu_seguimiento_resumen` (`sgu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Tabla para el seguimiento de riesgo' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgr_seguimiento_riesgo
-- ----------------------------
INSERT INTO `sgr_seguimiento_riesgo` VALUES (1, 1, 1, 1, 3, 1, 'Prevencion 1', '2023-03-01 00:00:00', '2023-03-31 00:00:00', 1, 1, '2023-03-08 19:20:47', 1, '2023-03-08 19:20:47');

-- ----------------------------
-- Table structure for sgt_seguimiento_cita
-- ----------------------------
CREATE TABLE `sgt_seguimiento_cita`  (
  `sgt_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de seguimiento cita',
  `sgt_id_cim` int(11) NOT NULL COMMENT 'Llave principal de Cita medica',
  `sgt_id_usu` int(11) NOT NULL COMMENT 'Llave principal de Usuario.',
  `sgt_fecha` datetime NOT NULL COMMENT 'Fecha de seguimiento',
  `sgt_hora` time NOT NULL COMMENT 'Hora de seguimiento',
  `sgt_comentario` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Comentario',
  `sgt_url_anexo` varchar(300) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Url del anexo',
  `sgt_nombre_anexo` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Nombre o referencia del anexo',
  `sgt_estado` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'estado del registro 1=activo, 0=inactivo',
  `sgt_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgt_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgt_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgt_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgt_id`) USING BTREE,
  INDEX `fk_sgt_id_cim`(`sgt_id_cim` ASC) USING BTREE,
  INDEX `fk_sgt_id_usu`(`sgt_id_usu` ASC) USING BTREE,
  CONSTRAINT `fk_sgt_id_cim` FOREIGN KEY (`sgt_id_cim`) REFERENCES `cim_cita_medica` (`cim_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgt_id_usu` FOREIGN KEY (`sgt_id_usu`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Entidad - Seguimiento cita medica' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgt_seguimiento_cita
-- ----------------------------

-- ----------------------------
-- Table structure for sgu_seguimiento_resumen
-- ----------------------------
CREATE TABLE `sgu_seguimiento_resumen`  (
  `sgu_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal- Seguimiento de Riesgo',
  `sgu_id_flu` int(11) NOT NULL COMMENT 'codigo de flujo',
  `sgu_id_mxu` int(11) NOT NULL COMMENT 'Llave Principal -Matriz  por Unidad',
  `sgu_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Observaciones de Seguimiento de Riesgo',
  `sgu_fecha` datetime NOT NULL COMMENT 'Fecha de Seguimiento de Riesgo',
  `sgu_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `sgu_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgu_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sgu_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sgu_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sgu_id`) USING BTREE,
  INDEX `fk_sgu_id_flu`(`sgu_id_flu` ASC) USING BTREE,
  INDEX `fk_sgu_id_mxu`(`sgu_id_mxu` ASC) USING BTREE,
  CONSTRAINT `fk_sgu_id_flu` FOREIGN KEY (`sgu_id_flu`) REFERENCES `flu_flujo` (`flu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sgu_id_mxu` FOREIGN KEY (`sgu_id_mxu`) REFERENCES `mxu_matrizxunidad` (`mxu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Tabla para el resumen de seguimiento de riesgo' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sgu_seguimiento_resumen
-- ----------------------------
INSERT INTO `sgu_seguimiento_resumen` VALUES (1, 1, 1, 'obs', '2023-03-08 19:20:47', 1, 1, 1, '2023-03-08 19:20:47', '2023-03-08 19:20:47');

-- ----------------------------
-- Table structure for sin_sindicato
-- ----------------------------
CREATE TABLE `sin_sindicato`  (
  `sin_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal',
  `sin_codigo` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `sin_nombre` varchar(300) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `sin_descripcion` varchar(500) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `sin_estado` tinyint(4) NOT NULL COMMENT 'Estado 1=activo / 0=inactivo',
  `sin_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sin_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sin_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sin_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sin_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sin_sindicato
-- ----------------------------

-- ----------------------------
-- Table structure for slb_solicitud_beca
-- ----------------------------
CREATE TABLE `slb_solicitud_beca`  (
  `slb_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de la Solicitud de beca',
  `slb_id_alm` int(11) NULL DEFAULT NULL COMMENT 'Llave principal - Alumnos',
  `slb_id_frh` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de frecuencia de horario',
  `slb_id_pen` int(11) NULL DEFAULT NULL COMMENT 'Llave principal del pensum',
  `slb_id_ard` int(11) NULL DEFAULT NULL COMMENT 'codigo de area academica',
  `slb_id_ina` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de institución academica',
  `slb_id_usu_deniega` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de Usuario.(quien deniega la solicitud)',
  `slb_id_usu` int(11) NOT NULL COMMENT 'Llave principal de Usuario. (quien crea la solicitud)',
  `slb_id_emp_referencia` int(11) NULL DEFAULT NULL COMMENT 'Id de Empleado',
  `slb_id_tpb` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria de tipo de beca',
  `slb_id_tbs` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria de tipo de beneficiario de beca',
  `slb_id_grd` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de grado',
  `slb_id_suc` int(11) NULL DEFAULT NULL COMMENT 'Identificador de la sucursal',
  `slb_fecha_solicitud` datetime NOT NULL COMMENT 'Fecha de la solicitud',
  `slb_observacion_solicitud` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observacion de la solicitud',
  `slb_fecha_deniega` datetime NULL DEFAULT NULL COMMENT 'Fecha de la negación',
  `slb_observacion_denegar` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observacion de la negación de la solicitud',
  `slb_estado_solicitud` tinyint(4) NOT NULL COMMENT '1=creada(pendiente de autorizar), 2=Autorizada, 3=Denegada 4=Removida/inactivada (que se quite una vez autorizada)',
  `slb_estado` tinyint(4) NOT NULL COMMENT 'Estado del registro 1= activo, 0 =inactivo',
  `slb_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `slb_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `slb_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `slb_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`slb_id`) USING BTREE,
  INDEX `fk_slb_id_alm`(`slb_id_alm` ASC) USING BTREE,
  INDEX `fk_slb_id_ard`(`slb_id_ard` ASC) USING BTREE,
  INDEX `fk_slb_id_emp_referencia`(`slb_id_emp_referencia` ASC) USING BTREE,
  INDEX `fk_slb_id_frh`(`slb_id_frh` ASC) USING BTREE,
  INDEX `fk_slb_id_ina`(`slb_id_ina` ASC) USING BTREE,
  INDEX `fk_slb_id_pen`(`slb_id_pen` ASC) USING BTREE,
  INDEX `fk_slb_id_tbs`(`slb_id_tbs` ASC) USING BTREE,
  INDEX `fk_slb_id_tpb`(`slb_id_tpb` ASC) USING BTREE,
  INDEX `fk_slb_id_usu`(`slb_id_usu` ASC) USING BTREE,
  INDEX `fk_slb_id_usu_deniega`(`slb_id_usu_deniega` ASC) USING BTREE,
  INDEX `fk_slb_id_suc`(`slb_id_suc` ASC) USING BTREE,
  CONSTRAINT `fk_slb_id_alm` FOREIGN KEY (`slb_id_alm`) REFERENCES `alm_alumno` (`alm_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_ard` FOREIGN KEY (`slb_id_ard`) REFERENCES `ard_area_academica` (`ard_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_emp_referencia` FOREIGN KEY (`slb_id_emp_referencia`) REFERENCES `emp_empleado` (`emp_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_frh` FOREIGN KEY (`slb_id_frh`) REFERENCES `frh_frecuencia_horario` (`frh_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_ina` FOREIGN KEY (`slb_id_ina`) REFERENCES `ina_institucion_academica` (`ina_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_pen` FOREIGN KEY (`slb_id_pen`) REFERENCES `pen_pensum` (`pen_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_suc` FOREIGN KEY (`slb_id_suc`) REFERENCES `suc_sucursal` (`suc_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_tbs` FOREIGN KEY (`slb_id_tbs`) REFERENCES `tbs_tipo_beneficiario_solicitud` (`tbs_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_tpb` FOREIGN KEY (`slb_id_tpb`) REFERENCES `tpb_tipo_beca` (`tpb_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_usu` FOREIGN KEY (`slb_id_usu`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slb_id_usu_deniega` FOREIGN KEY (`slb_id_usu_deniega`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of slb_solicitud_beca
-- ----------------------------

-- ----------------------------
-- Table structure for sle_solicitante_empleo
-- ----------------------------
CREATE TABLE `sle_solicitante_empleo`  (
  `sle_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de Solicitante Empleo',
  `sle_id_are` int(11) NULL DEFAULT NULL COMMENT 'Id de Area',
  `sle_id_plz` int(11) NULL DEFAULT NULL COMMENT 'llave de primaria del registro de plaza',
  `sle_id_afp` int(11) NULL DEFAULT NULL COMMENT 'Identificador unico',
  `sle_id_suc` int(11) NULL DEFAULT NULL COMMENT 'Identificador de la sucursal',
  `sle_id_gen` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria - Entidad genero',
  `sle_id_esc` int(10) NULL DEFAULT NULL COMMENT 'Llave primaria de estado civil',
  `sle_id_pro` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria - profesiones',
  `sle_id_pai` int(11) NULL DEFAULT NULL COMMENT 'Llave principal - Paises',
  `sle_id_ubi` int(11) NULL DEFAULT NULL COMMENT 'Identificación unico',
  `sle_id_tic` int(11) NULL DEFAULT NULL COMMENT 'Tipo contrato',
  `sle_id_pat_contacto` int(11) NULL DEFAULT NULL COMMENT 'Llave principal',
  `sle_id_ban` int(11) NULL DEFAULT NULL COMMENT 'Identificador de banco',
  `sle_id_tds` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de tipo de incapacidad',
  `sle_id_tsr` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de tipo de sangre',
  `sle_id_mun` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria - entidad municipio',
  `sle_id_zon` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de zona',
  `sle_id_tcv` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de tipo de construcción vivienda',
  `sle_id_tiv` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de tipo de vivienda',
  `sle_id_cta` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de categoria aguinaldo',
  `sle_id_fnr` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de fuente de reclutameinto',
  `sle_id_tpc` int(11) NULL DEFAULT NULL COMMENT 'Id de tipo de cuenta',
  `sle_id_emr` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de empresa',
  `sle_id_tps` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de tipo de salario',
  `sle_expediente` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Número de expediente',
  `sle_codigo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Codigo de indentificación ',
  `sle_nombre` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombres',
  `sle_apellido` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Apellidos',
  `sle_direccion` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Direccion de vivienda',
  `sle_telefono` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Teléfono',
  `sle_lugar_nac` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Lugar de Nacimiento',
  `sle_fecha_nac` date NULL DEFAULT NULL COMMENT 'Fecha de Nacimiento',
  `sle_fecha_contrato` date NULL DEFAULT NULL COMMENT 'Fecha de Contratacion',
  `sle_fecha_retiro` date NULL DEFAULT NULL COMMENT 'Fecha de Retiro de la empresa',
  `sle_salario` decimal(19, 2) NULL DEFAULT 0.00 COMMENT 'Salario devengado',
  `sle_url_foto` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Foto de empleado',
  `sle_afp` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'numero afp',
  `sle_seguro` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'numero seguro',
  `sle_numero_cuenta` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'numero cuenta',
  `sle_salario_hora` decimal(19, 2) NULL DEFAULT 0.00 COMMENT 'Salario devengado por horas',
  `sle_salario_hora_nocturna` decimal(19, 2) NULL DEFAULT NULL COMMENT 'salario hora nocturna',
  `sle_observacion_contrato` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'observaciones del contrato',
  `sle_color_icono` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'color de icono de empleado',
  `sle_estatura` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Estatura ',
  `sle_peso` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Peso ',
  `sle_tipo_sangre` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Tipo de sangre',
  `sle_discapacidad` int(11) NULL DEFAULT NULL COMMENT 'Posee discapacidad (0=no, 1=si)',
  `sle_observacion_clinica` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'observaciones generales de los datos clinicos.',
  `sle_contacto_emergencia` varchar(300) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Nombre de la persona a quien contactar en caso de emergencia.',
  `sle_direccion_emergencia` varchar(500) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'dirección del contacto de emergencia.',
  `sle_telefono_emergencia` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'teléfono del contacto de emergencia.',
  `sle_posee_beca` int(11) NULL DEFAULT NULL COMMENT 'El empleado posee beca (1=  si, 0 o null =no)',
  `sle_es_jubilado` int(11) NULL DEFAULT NULL COMMENT 'El empleado es jubilado (1=  si, 0 o null =no)',
  `sle_fecha_jubilado` datetime NULL DEFAULT NULL COMMENT 'Fecha de jubilación',
  `sle_realizo_poligrafo` int(11) NULL DEFAULT NULL COMMENT 'El empleado realizo la prueba del poligrafo (1=  si, 0 o null =no)',
  `sle_codigo_referencia` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Código de referencia',
  `sle_aplica_afp` int(11) NULL DEFAULT NULL COMMENT 'Se aplica afp (1=  si, 0 o null =no)',
  `sle_aplica_isss` int(11) NULL DEFAULT NULL COMMENT 'se apica isss (1=  si, 0 o null =no)',
  `sle_fecha_ult_liquidacion` datetime NULL DEFAULT NULL COMMENT 'Fecha de última liquidación',
  `sle_fecha_fin_contrato` datetime NULL DEFAULT NULL COMMENT 'Fecha fin de contrato',
  `sle_fecha_antiguedad` datetime NULL DEFAULT NULL COMMENT 'Fecha de antiguedad',
  `sle_fecha_ult_vacacion` datetime NULL DEFAULT NULL COMMENT 'Fecha de última vacación',
  `sle_fecha_ult_aguinaldo` datetime NULL DEFAULT NULL COMMENT 'Fecha de último aguinaldo',
  `sle_es_reingreso` int(11) NULL DEFAULT NULL COMMENT 'Es un registro de reingreso (1=  si, 0 o null =no)',
  `sle_fecha_traslado` datetime NULL DEFAULT NULL COMMENT 'Fecha de traslado',
  `sle_metodo_pago` int(11) NULL DEFAULT NULL COMMENT 'Se establece la metodologia de pago 1=transferencia banco, 2 = cheque 3 efectivo.',
  `sle_estado` int(11) NOT NULL DEFAULT 1 COMMENT 'Estado del Registro (1:Activo, 0:Inactivo, -1:Eliminado)',
  `sle_usu_creacion` int(4) NOT NULL COMMENT 'Auditoría',
  `sle_fecha_creacion` datetime NOT NULL COMMENT 'Auditoría',
  `sle_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sle_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sle_id`) USING BTREE,
  INDEX `uk_sle_codigo`(`sle_codigo` ASC) USING BTREE,
  INDEX `fk_sle_id_afp`(`sle_id_afp` ASC) USING BTREE,
  INDEX `fk_sle_id_are`(`sle_id_are` ASC) USING BTREE,
  INDEX `fk_sle_id_ban`(`sle_id_ban` ASC) USING BTREE,
  INDEX `fk_sle_id_cta`(`sle_id_cta` ASC) USING BTREE,
  INDEX `fk_sle_id_emr`(`sle_id_emr` ASC) USING BTREE,
  INDEX `fk_sle_id_esc`(`sle_id_esc` ASC) USING BTREE,
  INDEX `fk_sle_id_fnr`(`sle_id_fnr` ASC) USING BTREE,
  INDEX `fk_sle_id_gen`(`sle_id_gen` ASC) USING BTREE,
  INDEX `fk_sle_id_mun`(`sle_id_mun` ASC) USING BTREE,
  INDEX `fk_sle_id_pai`(`sle_id_pai` ASC) USING BTREE,
  INDEX `fk_sle_id_pat_contacto`(`sle_id_pat_contacto` ASC) USING BTREE,
  INDEX `fk_sle_id_plz`(`sle_id_plz` ASC) USING BTREE,
  INDEX `fk_sle_id_pro`(`sle_id_pro` ASC) USING BTREE,
  INDEX `fk_sle_id_suc`(`sle_id_suc` ASC) USING BTREE,
  INDEX `fk_sle_id_tcv`(`sle_id_tcv` ASC) USING BTREE,
  INDEX `fk_sle_id_tds`(`sle_id_tds` ASC) USING BTREE,
  INDEX `fk_sle_id_tic`(`sle_id_tic` ASC) USING BTREE,
  INDEX `fk_sle_id_tiv`(`sle_id_tiv` ASC) USING BTREE,
  INDEX `fk_sle_id_tpc`(`sle_id_tpc` ASC) USING BTREE,
  INDEX `fk_sle_id_tps`(`sle_id_tps` ASC) USING BTREE,
  INDEX `fk_sle_id_tsr`(`sle_id_tsr` ASC) USING BTREE,
  INDEX `fk_sle_id_ubi`(`sle_id_ubi` ASC) USING BTREE,
  INDEX `fk_sle_id_zon`(`sle_id_zon` ASC) USING BTREE,
  CONSTRAINT `fk_sle_id_afp` FOREIGN KEY (`sle_id_afp`) REFERENCES `afp_afp` (`afp_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_are` FOREIGN KEY (`sle_id_are`) REFERENCES `are_area` (`are_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_ban` FOREIGN KEY (`sle_id_ban`) REFERENCES `ban_banco` (`ban_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_cta` FOREIGN KEY (`sle_id_cta`) REFERENCES `cta_categoria_aguinaldo` (`cta_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_emr` FOREIGN KEY (`sle_id_emr`) REFERENCES `emr_empresa` (`emr_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_esc` FOREIGN KEY (`sle_id_esc`) REFERENCES `esc_estado_civil` (`esc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_fnr` FOREIGN KEY (`sle_id_fnr`) REFERENCES `fnr_fuente_reclutamiento` (`fnr_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_gen` FOREIGN KEY (`sle_id_gen`) REFERENCES `gen_genero` (`gen_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_mun` FOREIGN KEY (`sle_id_mun`) REFERENCES `mun_municipio` (`mun_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_pai` FOREIGN KEY (`sle_id_pai`) REFERENCES `pai_pais` (`pai_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_pat_contacto` FOREIGN KEY (`sle_id_pat_contacto`) REFERENCES `pat_parentesco` (`pat_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_plz` FOREIGN KEY (`sle_id_plz`) REFERENCES `plz_plaza` (`plz_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_pro` FOREIGN KEY (`sle_id_pro`) REFERENCES `pro_profesion` (`pro_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_suc` FOREIGN KEY (`sle_id_suc`) REFERENCES `suc_sucursal` (`suc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_tcv` FOREIGN KEY (`sle_id_tcv`) REFERENCES `tcv_tipo_construccion_vivienda` (`tcv_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_tds` FOREIGN KEY (`sle_id_tds`) REFERENCES `tds_tipo_discapacidad` (`tds_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_tic` FOREIGN KEY (`sle_id_tic`) REFERENCES `tic_tipo_contrato` (`tic_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_tiv` FOREIGN KEY (`sle_id_tiv`) REFERENCES `tiv_tipo_vivienda` (`tiv_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_tpc` FOREIGN KEY (`sle_id_tpc`) REFERENCES `tpc_tipo_cuenta` (`tpc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_tps` FOREIGN KEY (`sle_id_tps`) REFERENCES `tps_tipo_salario` (`tps_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_tsr` FOREIGN KEY (`sle_id_tsr`) REFERENCES `tsr_tipo_sangre` (`tsr_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_ubi` FOREIGN KEY (`sle_id_ubi`) REFERENCES `ubi_ubicacion` (`ubi_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sle_id_zon` FOREIGN KEY (`sle_id_zon`) REFERENCES `zon_zona` (`zon_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Solicitante Empleo' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sle_solicitante_empleo
-- ----------------------------
INSERT INTO `sle_solicitante_empleo` VALUES (1, NULL, NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '0001', '0001', 'Luis', 'Lopez', '4 Av Nte # 24, S.S.', NULL, '', '1999-08-15', '1969-12-31', NULL, 0.00, NULL, '0', '0', '0', NULL, NULL, '', NULL, NULL, NULL, NULL, 0, '', '', '', '', NULL, 0, NULL, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 1, 1, '2023-12-18 12:10:52', 1, '2023-12-18 12:10:52');
INSERT INTO `sle_solicitante_empleo` VALUES (2, NULL, NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 103, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '0002', '0002', 'Mario', 'Hernandez', 'Col. Moritas Pje H #24, Sn Marcos', NULL, '', '1992-11-15', '1969-12-31', NULL, 0.00, NULL, '0', '0', '0', NULL, NULL, '', NULL, NULL, NULL, NULL, 0, '', '', '', '', NULL, 0, NULL, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 2, 1, '2023-12-18 12:14:25', 1, '2023-12-18 12:34:58');
INSERT INTO `sle_solicitante_empleo` VALUES (3, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 119, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '0003', '0003', 'Paola', 'Lima', 'Condominios Lorena Edif. C Apto 302, Sta. tecla', NULL, '', '1989-08-16', '1969-12-31', NULL, 0.00, NULL, '0', '0', '0', NULL, NULL, '', NULL, NULL, NULL, NULL, 0, '', '', '', '', NULL, 0, NULL, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1, 1, '2023-12-18 12:19:37', 1, '2023-12-18 12:34:38');
INSERT INTO `sle_solicitante_empleo` VALUES (4, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 106, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '0004', '0004', 'Maria', 'Fonseca', 'Bo. El calvario #13', NULL, '', '1990-05-01', '1969-12-31', NULL, 0.00, NULL, '0', '0', '0', NULL, NULL, '', NULL, NULL, NULL, NULL, 0, '', '', '', '', NULL, 0, NULL, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1, 1, '2023-12-18 12:25:07', 1, '2023-12-18 12:31:40');
INSERT INTO `sle_solicitante_empleo` VALUES (5, NULL, NULL, NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 99, NULL, NULL, NULL, NULL, NULL, NULL, 1, NULL, '0005', '0005', 'Miguel', 'Perez', 'Urb. La Gloria, Block 24 Pje. B #25', NULL, '', '1988-05-15', '1969-12-31', NULL, 0.00, NULL, '0', '0', '0', NULL, NULL, '', NULL, NULL, NULL, NULL, 0, '', '', '', '', NULL, 0, NULL, 0, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 1, 1, '2023-12-18 12:31:11', 1, '2023-12-18 12:31:11');

-- ----------------------------
-- Table structure for slm_solicitud_modificacion
-- ----------------------------
CREATE TABLE `slm_solicitud_modificacion`  (
  `slm_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'LLave Principal - Solicitud de Modificacion',
  `slm_id_flu` int(11) NOT NULL COMMENT 'Llave Principal - Flujo',
  `slm_id_pxu` int(11) NOT NULL COMMENT 'Llave Principal - Plan Operativo por Unidad',
  `slm_id_usu` int(11) NOT NULL COMMENT 'Usuario a quien pertenece la Solicitud',
  `slm_fecha` datetime NOT NULL COMMENT 'Fecha de la Solicitud',
  `slm_justificacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'Justificacion de la solicitud',
  `slm_comentarios` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Comentarios de la Solicitud',
  `slm_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `slm_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `slm_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `slm_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `slm_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`slm_id`) USING BTREE,
  INDEX `fk_slm_id_flu`(`slm_id_flu` ASC) USING BTREE,
  INDEX `fk_slm_id_pxu`(`slm_id_pxu` ASC) USING BTREE,
  CONSTRAINT `fk_slm_id_flu` FOREIGN KEY (`slm_id_flu`) REFERENCES `flu_flujo` (`flu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_slm_id_pxu` FOREIGN KEY (`slm_id_pxu`) REFERENCES `pxu_plan_operativoxunidad` (`pxu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of slm_solicitud_modificacion
-- ----------------------------

-- ----------------------------
-- Table structure for slr_solicitud_reprogramacion
-- ----------------------------
CREATE TABLE `slr_solicitud_reprogramacion`  (
  `slr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'LLave Principal - Solicitud de Reprogramacion',
  `slr_id_pxu` int(11) NOT NULL COMMENT 'Llave Principal - Plan Operativo por Unidad',
  `slr_id_per` int(11) NOT NULL COMMENT 'Llave Principal - Periodo',
  `slr_id_flu` int(255) NOT NULL COMMENT 'Llave Principal - Flujo',
  `slr_id_usu` int(11) NOT NULL COMMENT 'Usuario a quien pertenece la Solicitud',
  `slr_fecha` datetime NOT NULL COMMENT 'Fecha de la Solicitud',
  `slr_justificacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'Justificacion de la solicitud',
  `slr_comentarios` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Comentarios de la Solicitud',
  `slr_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `slr_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `slr_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `slr_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `slr_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`slr_id`) USING BTREE,
  INDEX `fk_slr_id_per`(`slr_id_per` ASC) USING BTREE,
  INDEX `fk_slr_id_pxu`(`slr_id_pxu` ASC) USING BTREE,
  CONSTRAINT `fk_slr_id_per` FOREIGN KEY (`slr_id_per`) REFERENCES `per_periodo` (`per_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_slr_id_pxu` FOREIGN KEY (`slr_id_pxu`) REFERENCES `pxu_plan_operativoxunidad` (`pxu_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of slr_solicitud_reprogramacion
-- ----------------------------
INSERT INTO `slr_solicitud_reprogramacion` VALUES (1, 1, 4, 9, 1, '2023-09-12 13:47:30', 'Justificación ', 'Comentario', 1, 1, '2023-03-08 18:41:19', 1, '2023-09-12 13:47:30');
INSERT INTO `slr_solicitud_reprogramacion` VALUES (2, 13, 2, 9, 1, '2024-09-27 14:17:30', 'no se  termino', 'no hay recursos disponibles', 1, 1, '2024-09-27 14:17:30', 1, '2024-09-27 14:17:30');

-- ----------------------------
-- Table structure for slt_solicitud_activos
-- ----------------------------
CREATE TABLE `slt_solicitud_activos`  (
  `slt_id` int(11) NOT NULL AUTO_INCREMENT,
  `slt_id_emp` int(11) NOT NULL COMMENT 'Llave con el empleado',
  `slt_id_suc` int(11) NULL DEFAULT NULL COMMENT 'LLave con la sucursal',
  `slt_id_are` int(11) NULL DEFAULT NULL COMMENT 'Llave con el Area',
  `slt_fecha` datetime NOT NULL COMMENT 'Fecha realizado',
  `slt_tipo_solicitud` int(11) NULL DEFAULT NULL COMMENT 'Es asignacion = 0 / o traslado = 1',
  `slt_usu_aprueba` int(11) NULL DEFAULT NULL COMMENT 'Usuario Aprueba',
  `slt_fecha_aprobacion` datetime NULL DEFAULT NULL COMMENT 'Fecha aprobacion',
  `slt_usu_rechaza` int(11) NULL DEFAULT NULL COMMENT 'Usuario rechaza',
  `slt_fecha_denegado` datetime NULL DEFAULT NULL COMMENT 'Fecha Rechazo',
  `slt_observacion` varchar(500) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Observacion del Proceso',
  `slt_estado` int(11) NOT NULL COMMENT '0=inactivo o rechazado | 1=vigente | 2=aprobado',
  `slt_usu_creacion` int(11) NULL DEFAULT NULL,
  `slt_usu_modifica` int(11) NULL DEFAULT NULL,
  `slt_fecha_creacion` datetime NULL DEFAULT NULL,
  `slt_fecha_modifica` datetime NULL DEFAULT NULL,
  PRIMARY KEY (`slt_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of slt_solicitud_activos
-- ----------------------------

-- ----------------------------
-- Table structure for slv_solicitud_vacacion
-- ----------------------------
CREATE TABLE `slv_solicitud_vacacion`  (
  `slv_id` int(11) NOT NULL AUTO_INCREMENT,
  `slv_id_emp` int(11) NOT NULL COMMENT 'Llave del empleado',
  `slv_id_vac` int(11) NOT NULL COMMENT 'Llave del periodo de vacacion',
  `slv_id_gva` int(11) NULL DEFAULT NULL COMMENT 'Llave del goce',
  `slv_fecha_desde` date NOT NULL,
  `slv_fecha_hasta` date NOT NULL,
  `slv_cantidad_dias` int(11) NOT NULL,
  `slv_id_usu_autoriza` int(11) NULL DEFAULT NULL,
  `slv_id_usu_rechaza` int(11) NULL DEFAULT NULL,
  `slv_comentario_autoriza` varchar(500) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `slv_comentario_rechaza` varchar(500) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `slv_estado` tinyint(4) NOT NULL COMMENT '0=anulado|1=activo|2=autorizado (crear gva)',
  `slv_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `slv_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `slv_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `slv_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`slv_id`) USING BTREE,
  INDEX `fk_slv_id_emp`(`slv_id_emp` ASC) USING BTREE,
  INDEX `fk_slv_id_vac`(`slv_id_vac` ASC) USING BTREE,
  INDEX `fk_slv_id_gva`(`slv_id_gva` ASC) USING BTREE,
  CONSTRAINT `fk_slv_id_emp` FOREIGN KEY (`slv_id_emp`) REFERENCES `emp_empleado` (`emp_id`) ON DELETE RESTRICT ON UPDATE NO ACTION,
  CONSTRAINT `fk_slv_id_gva` FOREIGN KEY (`slv_id_gva`) REFERENCES `gva_goce_vacacion` (`gva_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_slv_id_vac` FOREIGN KEY (`slv_id_vac`) REFERENCES `vac_vacacion` (`vac_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Records of slv_solicitud_vacacion
-- ----------------------------
INSERT INTO `slv_solicitud_vacacion` VALUES (1, 5, 402, NULL, '2025-08-17', '2025-08-31', 15, NULL, NULL, NULL, NULL, 1, 1, '2025-08-11 11:28:57', 1, '2025-08-11 11:28:57');
INSERT INTO `slv_solicitud_vacacion` VALUES (2, 21, 677, 21, '2025-08-02', '2025-08-31', 30, 1, NULL, 'OK', NULL, 2, 1, '2025-08-18 08:26:53', 1, '2025-08-18 08:29:26');

-- ----------------------------
-- Table structure for smv_seguimiento_mtto_veh
-- ----------------------------
CREATE TABLE `smv_seguimiento_mtto_veh`  (
  `smv_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave primaria de seguimiento mantenimiento.',
  `smv_id_gmt` int(11) NOT NULL COMMENT 'Id de mantenimiento vehiculo',
  `smv_id_emt` int(11) NOT NULL COMMENT 'Id de estado de Seguimiento',
  `smv_seguimiento` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Descripción de seguimiento',
  `smv_fecha` date NULL DEFAULT NULL COMMENT 'Fecha seguimiento',
  `smv_fecha_prox` date NULL DEFAULT NULL COMMENT 'Fecha prox. seguimiento',
  `smv_anexo` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Url anexo',
  `smv_estado` tinyint(4) NOT NULL COMMENT 'Estado de registro',
  `smv_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `smv_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `smv_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `smv_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`smv_id`) USING BTREE,
  INDEX `fk_smv_id_gmt`(`smv_id_gmt` ASC) USING BTREE,
  INDEX `fk_smv_id_emt`(`smv_id_emt` ASC) USING BTREE,
  CONSTRAINT `fk_smv_id_emt` FOREIGN KEY (`smv_id_emt`) REFERENCES `emt_estado_mantenimiento` (`emt_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_smv_id_gmt` FOREIGN KEY (`smv_id_gmt`) REFERENCES `gmt_gestion_mantto` (`gmt_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Seguimiento de mantenimiento' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of smv_seguimiento_mtto_veh
-- ----------------------------
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (1, 1, 2, 'Se agenda cita para el 20-enero', '2023-01-19', '2024-02-08', NULL, 1, 1, '2024-02-08 11:25:44', 1, '2024-02-08 11:25:44');
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (2, 2, 1, 'Se solicito agendar el cambio de aceite', '2023-01-19', NULL, NULL, 1, 1, '2023-01-19 08:45:40', 1, '2023-01-19 08:45:40');
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (3, 2, 1, 'Se solicito agendar el cambio de aceite', '2023-01-19', NULL, NULL, 1, 1, '2023-01-19 08:46:22', 1, '2023-01-19 08:46:22');
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (4, 3, 2, 'Ajuste de pastillas de freno', '2023-01-19', NULL, NULL, 1, 1, '2023-01-19 10:19:56', 1, '2023-01-19 10:19:56');
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (5, 4, 1, 'Se agenda por llegar a millaje recomendado', '2024-02-08', NULL, NULL, 1, 1, '2024-02-08 11:25:19', 1, '2024-02-08 11:25:19');
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (6, 1, 2, 'Se llevo a taller por la mañana', '2024-02-08', '2024-02-08', NULL, 1, 1, '2024-02-08 11:26:20', 1, '2024-02-08 11:26:20');
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (7, 5, 1, 'Deterioro', '2024-02-08', NULL, NULL, 1, 1, '2024-02-08 12:28:46', 1, '2024-02-08 12:28:46');
INSERT INTO `smv_seguimiento_mtto_veh` VALUES (8, 6, 2, 'Reporte ', '2024-07-11', NULL, NULL, 1, 1, '2024-07-11 17:08:20', 1, '2024-07-11 17:08:20');

-- ----------------------------
-- Table structure for spp_subpartida_plaza
-- ----------------------------
CREATE TABLE `spp_subpartida_plaza`  (
  `spp_id` int(11) NOT NULL AUTO_INCREMENT,
  `spp_codigo` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL,
  `spp_nombre` varchar(300) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `spp_estado` tinyint(4) NOT NULL,
  `spp_usu_creacion` int(11) NOT NULL,
  `spp_fecha_creacion` datetime NOT NULL,
  `spp_usu_modifiacion` int(11) NOT NULL,
  `spp_fecha_modificacion` datetime NOT NULL,
  PRIMARY KEY (`spp_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of spp_subpartida_plaza
-- ----------------------------

-- ----------------------------
-- Table structure for spr_seguimiento_reprogramacion
-- ----------------------------
CREATE TABLE `spr_seguimiento_reprogramacion`  (
  `spr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'LLave Principal - Seguimiento Formulación',
  `spr_id_rpr` int(11) NOT NULL COMMENT 'LLave Principal - Reprogramacion Resumen',
  `spr_id_psf` int(11) NOT NULL COMMENT 'codigo de paso de  flujo',
  `spr_usu_apertura` int(11) NOT NULL COMMENT 'Usuario crea el Paso',
  `spr_usu_cierra` int(11) NULL DEFAULT NULL COMMENT 'Usuario Cierra el paso',
  `spr_fecha_entrada` datetime NOT NULL COMMENT 'Fecha de Entrada del paso',
  `spr_fecha_salida` datetime NULL DEFAULT NULL COMMENT 'Fecha de Salida del paso',
  `spr_observacion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Comentario del paso',
  `spr_anexo` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Anexo del paso',
  `spr_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `spr_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `spr_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `spr_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `spr_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`spr_id`) USING BTREE,
  INDEX `fk_spr_id_rpr`(`spr_id_rpr` ASC) USING BTREE,
  INDEX `fk_spr_id_psf`(`spr_id_psf` ASC) USING BTREE,
  CONSTRAINT `fk_spr_id_psf` FOREIGN KEY (`spr_id_psf`) REFERENCES `psf_paso_flujo` (`psf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_spr_id_rpr` FOREIGN KEY (`spr_id_rpr`) REFERENCES `rpr_reprogramacion_resumen` (`rpr_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of spr_seguimiento_reprogramacion
-- ----------------------------

-- ----------------------------
-- Table structure for srb_servicio_basico
-- ----------------------------
CREATE TABLE `srb_servicio_basico`  (
  `srb_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de servicio basicos',
  `srb_nombre` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre',
  `srb_descripcion` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Descripción general del registro',
  `srb_estado` int(11) NOT NULL COMMENT 'Estado de registro (1=activo, 0=inactivo)',
  `srb_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `srb_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `srb_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `srb_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`srb_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of srb_servicio_basico
-- ----------------------------
INSERT INTO `srb_servicio_basico` VALUES (1, 'Mantenimiento de equipos ', 'Equipos informáticos', 1, 1, '2025-08-20 10:52:31', 1, '2025-08-20 10:52:31');

-- ----------------------------
-- Table structure for sre_servicio_empleado
-- ----------------------------
CREATE TABLE `sre_servicio_empleado`  (
  `sre_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de servicio basicos del empleado',
  `sre_id_srb` int(11) NOT NULL COMMENT 'Llave principal de servicio basicos',
  `sre_id_emp` int(11) NOT NULL COMMENT 'Id de Empleado',
  `sre_estado` int(11) NOT NULL COMMENT 'Estado de registro (1=activo, 0=inactivo)',
  `sre_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sre_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sre_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sre_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sre_id`) USING BTREE,
  INDEX `fk_sre_id_srb`(`sre_id_srb` ASC) USING BTREE,
  INDEX `fk_sre_id_emp`(`sre_id_emp` ASC) USING BTREE,
  CONSTRAINT `fk_sre_id_emp` FOREIGN KEY (`sre_id_emp`) REFERENCES `emp_empleado` (`emp_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sre_id_srb` FOREIGN KEY (`sre_id_srb`) REFERENCES `srb_servicio_basico` (`srb_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sre_servicio_empleado
-- ----------------------------

-- ----------------------------
-- Table structure for srs_servicio_solicitante
-- ----------------------------
CREATE TABLE `srs_servicio_solicitante`  (
  `srs_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de servicio basicos del solicitante empleo',
  `srs_id_sle` int(11) NOT NULL COMMENT 'Llave principal de Solicitante Empleo',
  `srs_id_srb` int(11) NOT NULL COMMENT 'Llave principal de servicio basicos',
  `srs_estado` int(11) NOT NULL COMMENT 'Estado de registro (1=activo, 0=inactivo)',
  `srs_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `srs_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `srs_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `srs_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`srs_id`) USING BTREE,
  INDEX `fk_srs_id_sle`(`srs_id_sle` ASC) USING BTREE,
  INDEX `fk_srs_id_srb`(`srs_id_srb` ASC) USING BTREE,
  CONSTRAINT `fk_srs_id_sle` FOREIGN KEY (`srs_id_sle`) REFERENCES `sle_solicitante_empleo` (`sle_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_srs_id_srb` FOREIGN KEY (`srs_id_srb`) REFERENCES `srb_servicio_basico` (`srb_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Servicios basicos del solicitante empleo' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of srs_servicio_solicitante
-- ----------------------------

-- ----------------------------
-- Table structure for srv_serie_vale
-- ----------------------------
CREATE TABLE `srv_serie_vale`  (
  `srv_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal - serie vales',
  `srv_id_con` int(11) NOT NULL COMMENT 'Llave primaria de contrato',
  `srv_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre de la serie',
  `srv_valor` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Valor del vale',
  `srv_fecha_emision` date NOT NULL COMMENT 'Fecha de emision del vale',
  `srv_fecha_vencimiento` date NOT NULL COMMENT 'Fecha de venicmiento del vale',
  `srv_fecha_recibido` date NOT NULL COMMENT 'Fecha de recibido de series',
  `srv_inicio` int(11) NOT NULL COMMENT 'Inicio de correlativos de vale',
  `srv_fin` int(11) NOT NULL COMMENT 'Fin de correlativo de vales',
  `srv_cantidad` int(11) NOT NULL COMMENT 'Cantidad de vales',
  `srv_observaciones` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `srv_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `srv_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `srv_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `srv_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `srv_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`srv_id`) USING BTREE,
  INDEX `fk_srv_id_con`(`srv_id_con` ASC) USING BTREE,
  CONSTRAINT `fk_srv_id_con` FOREIGN KEY (`srv_id_con`) REFERENCES `con_contrato_gasol` (`con_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Catalogo de series de vales' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of srv_serie_vale
-- ----------------------------
INSERT INTO `srv_serie_vale` VALUES (1, 1, 'VG', 500.00, '2023-01-19', '2023-01-19', '2023-01-19', 1, 5000, 5000, NULL, 1, 1, 1, '2023-01-19 08:40:31', '2024-02-08 12:53:03');

-- ----------------------------
-- Table structure for stl_estado_logro
-- ----------------------------
CREATE TABLE `stl_estado_logro`  (
  `stl_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal',
  `stl_nombre` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'Nombre del estado',
  `stl_descripcion` varchar(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL COMMENT 'Descripcion del estado',
  `stl_estado` int(11) NOT NULL COMMENT '1 Activo / 0 Inactivo',
  `stl_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `stl_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `stl_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `stl_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`stl_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of stl_estado_logro
-- ----------------------------
INSERT INTO `stl_estado_logro` VALUES (1, 'Iniciado', NULL, 1, 1, '2023-03-08 17:18:05', 1, '2023-03-08 17:18:05');
INSERT INTO `stl_estado_logro` VALUES (2, 'En proceso', NULL, 1, 1, '2023-03-08 17:18:05', 1, '2023-03-08 17:18:05');
INSERT INTO `stl_estado_logro` VALUES (3, 'Finalizado', NULL, 1, 1, '2023-03-08 17:18:05', 1, '2023-03-08 17:18:05');

-- ----------------------------
-- Table structure for stm_sustituto_maestro
-- ----------------------------
CREATE TABLE `stm_sustituto_maestro`  (
  `stm_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave primaria de sustitución maestro',
  `stm_id_tbe` int(11) NULL DEFAULT NULL COMMENT 'Llave primaria de tabla de escalafon',
  `stm_id_dct_titular` int(11) NOT NULL COMMENT 'codigo de docente (id docente titular)',
  `stm_id_dct_sustituto` int(11) NOT NULL COMMENT 'codigo de docente (id docente sustituto)',
  `stm_id_gra` int(11) NOT NULL COMMENT 'codigo de grupo academica',
  `stm_id_pla` int(11) NULL DEFAULT NULL COMMENT 'Identificador unico de planilla',
  `stm_id_inn` int(11) NULL DEFAULT NULL COMMENT 'Identificador Unico de ingreso planilla',
  `stm_n_alumnos` int(11) NOT NULL COMMENT 'Número de alumnos inscritos en el grupo (al momento de generar el registro)',
  `stm_fecha_inicio` datetime NOT NULL COMMENT 'Fecha inicio sustitución.',
  `stm_fecha_fin` datetime NOT NULL COMMENT 'Fecha fin sustitución.',
  `stm_pago_titular` tinyint(4) NOT NULL COMMENT 'Se pagará al docente titular 0=no, 1=si',
  `stm_pago_sustituto` tinyint(4) NOT NULL COMMENT 'Se pagará al docente sustituto 0=no, 1=si',
  `stm_tipo_pago` tinyint(4) NULL DEFAULT NULL COMMENT 'Tipo de pago 0 o null = no pago, 1=Según grupo, 2=Según Escalafon de docente',
  `stm_observacion` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observaciones generales',
  `stm_numero_horas` decimal(19, 2) NOT NULL COMMENT 'Número de horas a sustituir',
  `stm_pago_hora_titular` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Valor de pago de la hora al dodente titular',
  `stm_pago_hora_sustituto` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Valor de pago de la hora al docente sustituto',
  `stm_pagado_planilla` tinyint(4) NULL DEFAULT NULL COMMENT 'Se encuentra pago procesado en planilla 0 o null=no, 1=si',
  `stm_estado` tinyint(4) NOT NULL COMMENT 'estado del registro 0=inactivo, 1=activo',
  `stm_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `stm_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `stm_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `stm_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`stm_id`) USING BTREE,
  INDEX `fk_stm_id_dct_sustituto`(`stm_id_dct_sustituto` ASC) USING BTREE,
  INDEX `fk_stm_id_dct_titular`(`stm_id_dct_titular` ASC) USING BTREE,
  INDEX `fk_stm_id_gra`(`stm_id_gra` ASC) USING BTREE,
  INDEX `fk_stm_id_tbe`(`stm_id_tbe` ASC) USING BTREE,
  INDEX `fk_stm_id_pla`(`stm_id_pla` ASC) USING BTREE,
  INDEX `fk_stm_id_inn`(`stm_id_inn` ASC) USING BTREE,
  CONSTRAINT `fk_stm_id_dct_sustituto` FOREIGN KEY (`stm_id_dct_sustituto`) REFERENCES `dct_docente` (`dct_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_stm_id_dct_titular` FOREIGN KEY (`stm_id_dct_titular`) REFERENCES `dct_docente` (`dct_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_stm_id_gra` FOREIGN KEY (`stm_id_gra`) REFERENCES `gra_grupo_academico` (`gra_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_stm_id_inn` FOREIGN KEY (`stm_id_inn`) REFERENCES `inn_ingreso` (`inn_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_stm_id_pla` FOREIGN KEY (`stm_id_pla`) REFERENCES `pla_planilla` (`pla_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_stm_id_tbe` FOREIGN KEY (`stm_id_tbe`) REFERENCES `tbe_tabla_escalafon` (`tbe_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of stm_sustituto_maestro
-- ----------------------------

-- ----------------------------
-- Table structure for stv_status_vehiculo
-- ----------------------------
CREATE TABLE `stv_status_vehiculo`  (
  `stv_id` int(11) NOT NULL AUTO_INCREMENT,
  `stv_nombre` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `stv_estado` int(11) NOT NULL,
  `stv_usu_creacion` int(11) NOT NULL,
  `stv_usu_modificacion` int(11) NOT NULL,
  `stv_fecha_creacion` datetime NOT NULL,
  `stv_fecha_modificacion` datetime NOT NULL,
  PRIMARY KEY (`stv_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of stv_status_vehiculo
-- ----------------------------

-- ----------------------------
-- Table structure for suc_sucursal
-- ----------------------------
CREATE TABLE `suc_sucursal`  (
  `suc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificador de la sucursal',
  `suc_id_mun` int(11) NULL DEFAULT NULL COMMENT 'Identificador de sucursales por municipios',
  `suc_id_dis` int(11) NULL DEFAULT NULL COMMENT 'Llave con Distrito',
  `suc_id_emr` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de empresa',
  `suc_codigo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Codigo de sucursal',
  `suc_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre de la sucursal',
  `suc_direccion` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Direccion de la sucursal',
  `suc_defecto` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'Sucursal por defecto',
  `suc_codigo_fact_elect` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Codigo para facturacion electronica',
  `suc_usu_mod` int(11) NOT NULL COMMENT 'Auditoria',
  `suc_fecha_mod` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`suc_id`) USING BTREE,
  UNIQUE INDEX `ix_suc_codigo`(`suc_codigo` ASC, `suc_id_emr` ASC) USING BTREE,
  INDEX `fk_suc_id_mun`(`suc_id_mun` ASC) USING BTREE,
  INDEX `fk_suc_id_emr`(`suc_id_emr` ASC) USING BTREE,
  INDEX `fk_suc_id_dis`(`suc_id_dis` ASC) USING BTREE,
  CONSTRAINT `fk_suc_id_emr` FOREIGN KEY (`suc_id_emr`) REFERENCES `emr_empresa` (`emr_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_suc_id_mun` FOREIGN KEY (`suc_id_mun`) REFERENCES `mun_municipio` (`mun_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Entidad - Sucursales desentralizadas de CONAMYPE' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of suc_sucursal
-- ----------------------------
INSERT INTO `suc_sucursal` VALUES (1, 105, NULL, 1, '1', 'Casa Matriz', 'San Salvador', 0, 'M001', 1, '2023-10-12 00:00:00');
INSERT INTO `suc_sucursal` VALUES (2, 119, NULL, 1, '0002', 'Sucursal Santa Tecla', 'Santa Tecla', 0, NULL, 1, '2024-01-25 00:00:00');
INSERT INTO `suc_sucursal` VALUES (3, 40, NULL, 1, '3', 'Sucursal Sonsonate', 'Sonsonate', 0, NULL, 1, '2019-02-19 15:16:30');
INSERT INTO `suc_sucursal` VALUES (4, 215, NULL, 1, '4', 'Sucursal  San Miguel', 'San Miguel', 0, NULL, 1, '2019-02-19 15:16:30');
INSERT INTO `suc_sucursal` VALUES (5, 22, NULL, 1, '0005', 'Sucursal Santa Ana', 'Santa Ana', 0, NULL, 1, '2024-01-25 00:00:00');
INSERT INTO `suc_sucursal` VALUES (6, NULL, NULL, 1, 'C001', 'San Miguel ', NULL, 0, NULL, 1, '2024-07-09 09:51:18');

-- ----------------------------
-- Table structure for sue_sub_especialidad
-- ----------------------------
CREATE TABLE `sue_sub_especialidad`  (
  `sue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'codigo de sub-especialidad',
  `sue_id_esp` int(11) NOT NULL COMMENT 'codigo de especialidades',
  `sue_nombre` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL COMMENT 'nombre de la especialidad ',
  `sue_estado` int(11) NOT NULL COMMENT 'estado de registro',
  `sue_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sue_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sue_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sue_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sue_id`) USING BTREE,
  INDEX `fk_sue_id_esp`(`sue_id_esp` ASC) USING BTREE,
  CONSTRAINT `fk_sue_id_esp` FOREIGN KEY (`sue_id_esp`) REFERENCES `esp_especialidad` (`esp_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'catalogo de subespecialidades' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sue_sub_especialidad
-- ----------------------------
INSERT INTO `sue_sub_especialidad` VALUES (1, 1, 'Sub-especialidad #1', 1, 1, 1, '2023-01-19 08:41:35', '2023-01-19 08:41:35');

-- ----------------------------
-- Table structure for sug_supervisor_grupo
-- ----------------------------
CREATE TABLE `sug_supervisor_grupo`  (
  `sug_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de Supervisor Grupo',
  `sug_id_emp` int(11) NOT NULL COMMENT 'Id de Empleado',
  `sug_id_suc` int(11) NULL DEFAULT NULL COMMENT 'Identificador de la sucursal',
  `sug_estado` tinyint(4) NOT NULL COMMENT '0=inactivo, 1=activo',
  `sug_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sug_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sug_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sug_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sug_id`) USING BTREE,
  INDEX `fk_sug_id_emp`(`sug_id_emp` ASC) USING BTREE,
  CONSTRAINT `fk_sug_id_emp` FOREIGN KEY (`sug_id_emp`) REFERENCES `emp_empleado` (`emp_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sug_supervisor_grupo
-- ----------------------------
INSERT INTO `sug_supervisor_grupo` VALUES (1, 51, NULL, 1, 1, '2024-01-18 19:45:44', 1, '2024-01-18 19:45:44');

-- ----------------------------
-- Table structure for sup_supervisor
-- ----------------------------
CREATE TABLE `sup_supervisor`  (
  `sup_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'codigo de supervisor',
  `sup_id_usu` int(11) NULL DEFAULT NULL COMMENT 'codigo del usuario',
  `sup_codigo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `sup_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombres de supervisor',
  `sup_apellido` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Apellidos de supervisor',
  `sup_extension` int(11) NULL DEFAULT NULL,
  `sup_telefono` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL,
  `sup_email` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Email del supervisor',
  `sup_estado` tinyint(4) NOT NULL COMMENT 'Estado de supervisor',
  `sup_usu_mod` int(11) NOT NULL COMMENT 'Ultimo usuario de modificacion',
  `sup_fecha_mod` datetime NOT NULL COMMENT 'ultima fecha de modificacion',
  PRIMARY KEY (`sup_id`) USING BTREE,
  INDEX `fk_sup_id_usu`(`sup_id_usu` ASC) USING BTREE,
  CONSTRAINT `fk_sup_id_usu` FOREIGN KEY (`sup_id_usu`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Catalogo de supervisores' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sup_supervisor
-- ----------------------------
INSERT INTO `sup_supervisor` VALUES (1, 1, 'LS9', 'Liam', 'Seat', 1, '', 'Liam Seat@gruposatelite.net', 1, 1, '2021-12-28 07:46:29');
INSERT INTO `sup_supervisor` VALUES (2, 7, 'CH6', 'Chloe', 'Hyundai', NULL, '', 'Chloe Hyundai@gruposatelite.net', 1, 1, '2021-12-28 07:45:44');
INSERT INTO `sup_supervisor` VALUES (3, 19, 'CB66', 'Chloe', 'BMV', NULL, '', 'Chloe BMV@gruposatelite.net', 1, 1, '2021-12-28 07:46:03');
INSERT INTO `sup_supervisor` VALUES (4, 35, 'EA65', 'Emily', 'Audi', NULL, '', 'Emily Audi@gruposatelite.net', 0, 1, '2021-12-28 07:45:53');
INSERT INTO `sup_supervisor` VALUES (5, 30, 'CV46', 'Carolina', 'Valladares', NULL, '', 'William Lotus@gruposatelite.net', 1, 1, '2021-12-28 07:46:44');
INSERT INTO `sup_supervisor` VALUES (6, 9, 'EF8', 'Emily', 'Ferrari', NULL, '', 'Emily Ferrari@gruposatelite.net', 1, 1, '2021-12-28 07:45:32');
INSERT INTO `sup_supervisor` VALUES (7, 2, 'RA1', 'Rigoberto', 'Alvarenga', NULL, '', 'rigoberto.alvarenga@gruposatelite.net', 1, 1, '2021-12-28 07:45:22');
INSERT INTO `sup_supervisor` VALUES (8, 37, 'MR10', 'Mia', 'Renault', 122, '2264-8310', ' Renault@gruposatelite.net', 1, 1, '2022-02-14 14:38:07');
INSERT INTO `sup_supervisor` VALUES (9, 59, 'MC79', 'Michael', 'Chrysler', NULL, '', 'Michael Chrysler@gruposatelite.net', 1, 1, '2024-07-29 13:09:14');

-- ----------------------------
-- Table structure for sxb_sectorxbodega
-- ----------------------------
CREATE TABLE `sxb_sectorxbodega`  (
  `sxb_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'llave principal de sectores por bodega',
  `sxb_id_seb` int(11) NOT NULL COMMENT 'Llave principal de sector',
  `sxb_id_bod` int(11) NOT NULL COMMENT 'Codigo de bodega',
  `sxb_estado` int(11) NOT NULL COMMENT '0=inactivo, 1=activo',
  `sxb_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxb_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  `sxb_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxb_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sxb_id`) USING BTREE,
  INDEX `fk_sxb_id_bod`(`sxb_id_bod` ASC) USING BTREE,
  INDEX `fk_sxb_id_seb`(`sxb_id_seb` ASC) USING BTREE,
  CONSTRAINT `fk_sxb_id_bod` FOREIGN KEY (`sxb_id_bod`) REFERENCES `bod_bodega` (`bod_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sxb_id_seb` FOREIGN KEY (`sxb_id_seb`) REFERENCES `seb_sector_bodega` (`seb_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Sectores por bodega' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sxb_sectorxbodega
-- ----------------------------
INSERT INTO `sxb_sectorxbodega` VALUES (1, 1, 1, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (2, 2, 1, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (3, 3, 1, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (4, 4, 1, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (5, 5, 2, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (6, 6, 2, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (7, 7, 2, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (8, 8, 2, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (9, 9, 3, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (10, 10, 4, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (21, 21, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (22, 22, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (23, 23, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (24, 24, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (25, 25, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (26, 26, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (27, 27, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (28, 28, 7, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (29, 29, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (30, 30, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (31, 31, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (32, 32, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (33, 33, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (34, 34, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (35, 35, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (36, 36, 8, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (37, 37, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (38, 38, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (39, 39, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (40, 40, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (41, 41, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (42, 42, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (43, 43, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (44, 44, 9, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (45, 45, 10, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (46, 46, 11, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (47, 47, 12, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (48, 48, 13, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (49, 49, 14, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (50, 50, 15, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (51, 51, 16, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (52, 52, 17, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `sxb_sectorxbodega` VALUES (53, 53, 18, 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');

-- ----------------------------
-- Table structure for sxc_servicioxcliente
-- ----------------------------
CREATE TABLE `sxc_servicioxcliente`  (
  `sxc_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal  - Productos por cliente',
  `sxc_id_cli` int(11) NOT NULL COMMENT 'Llave primaria - Clientes',
  `sxc_id_pcn` int(11) NOT NULL COMMENT 'Llave principal  - periodos contratos telefonia',
  `sxc_id_art` int(11) NULL DEFAULT NULL COMMENT 'Llave principal de articulos',
  `sxc_fecha_contrato` datetime NOT NULL COMMENT 'Fecha de contrato',
  `sxc_observacion_inactivo` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Observación de registro inactivo',
  `sxc_fecha_inactivo` datetime NULL DEFAULT NULL COMMENT 'fecha de inactivación',
  `sxc_estado` int(11) NOT NULL COMMENT 'estado de registro',
  `sxc_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxc_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sxc_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxc_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sxc_id`) USING BTREE,
  INDEX `fk_sxc_id_cli`(`sxc_id_cli` ASC) USING BTREE,
  INDEX `fk_sxc_id_pcn`(`sxc_id_pcn` ASC) USING BTREE,
  INDEX `fk_sxc_id_art`(`sxc_id_art` ASC) USING BTREE,
  CONSTRAINT `fk_sxc_id_art` FOREIGN KEY (`sxc_id_art`) REFERENCES `art_articulo` (`art_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_sxc_id_cli` FOREIGN KEY (`sxc_id_cli`) REFERENCES `cli_cliente` (`cli_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sxc_id_pcn` FOREIGN KEY (`sxc_id_pcn`) REFERENCES `pcn_periodo_contrato` (`pcn_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Servicios  por cliente' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sxc_servicioxcliente
-- ----------------------------
INSERT INTO `sxc_servicioxcliente` VALUES (1, 22, 3, 71, '2025-02-05 00:00:00', NULL, NULL, 1, 1, '2025-02-05 09:41:42', 1, '2025-02-05 09:41:42');
INSERT INTO `sxc_servicioxcliente` VALUES (2, 91, 1, 119, '2025-02-05 00:00:00', NULL, NULL, 1, 1, '2025-02-05 10:37:23', 1, '2025-02-05 10:37:23');
INSERT INTO `sxc_servicioxcliente` VALUES (3, 21, 1, 119, '2025-02-05 00:00:00', NULL, NULL, 1, 1, '2025-02-05 13:36:55', 1, '2025-02-05 13:36:55');

-- ----------------------------
-- Table structure for sxd_saldo_artxdetalle_pendiente
-- ----------------------------
CREATE TABLE `sxd_saldo_artxdetalle_pendiente`  (
  `sxd_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de saldo articulo por detalle traslado pendiente',
  `sxd_id_dtr` int(11) NOT NULL COMMENT 'Llave principal de detalle de traslado',
  `sxd_id_sar` int(11) NOT NULL COMMENT 'Id de saldo',
  `sxd_cantidad` decimal(19, 10) NULL DEFAULT NULL COMMENT 'cantidad',
  `sxd_precio` decimal(19, 10) NULL DEFAULT NULL COMMENT 'Precio',
  `sxd_subtotal` decimal(19, 10) NULL DEFAULT NULL COMMENT 'Sub-total',
  `sxd_fecha_caducidad` datetime NULL DEFAULT NULL COMMENT 'Fecha de caducidad/vencimiento',
  `sxd_estado` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'Estado del Registro',
  `sxd_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxd_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sxd_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxd_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sxd_id`) USING BTREE,
  INDEX `fk_sxd_id_dtr`(`sxd_id_dtr` ASC) USING BTREE,
  INDEX `fk_sxd_id_sar`(`sxd_id_sar` ASC) USING BTREE,
  CONSTRAINT `fk_sxd_id_dtr` FOREIGN KEY (`sxd_id_dtr`) REFERENCES `dtr_detalle_traslado_pendiente` (`dtr_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sxd_id_sar` FOREIGN KEY (`sxd_id_sar`) REFERENCES `sar_saldo_articulo` (`sar_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Detalle de traslado pendiente' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sxd_saldo_artxdetalle_pendiente
-- ----------------------------

-- ----------------------------
-- Table structure for sxe_seguroxempleado
-- ----------------------------
CREATE TABLE `sxe_seguroxempleado`  (
  `sxe_id` int(11) NOT NULL AUTO_INCREMENT,
  `sxe_id_seg` int(11) NOT NULL,
  `sxe_id_emp` int(11) NOT NULL,
  `sxe_estado` tinyint(4) NOT NULL,
  `sxe_fecha_mod` datetime NOT NULL,
  `sxe_usu_mod` int(11) NOT NULL,
  PRIMARY KEY (`sxe_id`) USING BTREE,
  INDEX `fk_seg_id_sxe`(`sxe_id_seg` ASC) USING BTREE,
  INDEX `fk_emp_id_sxe`(`sxe_id_emp` ASC) USING BTREE,
  CONSTRAINT `fk_emp_id_sxe` FOREIGN KEY (`sxe_id_emp`) REFERENCES `emp_empleado` (`emp_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_seg_id_sxe` FOREIGN KEY (`sxe_id_seg`) REFERENCES `seg_seguro` (`seg_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sxe_seguroxempleado
-- ----------------------------
INSERT INTO `sxe_seguroxempleado` VALUES (1, 2, 2, 1, '2020-09-02 17:20:34', 1);
INSERT INTO `sxe_seguroxempleado` VALUES (2, 2, 4, 1, '2020-09-02 12:08:40', 1);
INSERT INTO `sxe_seguroxempleado` VALUES (3, 1, 87, 1, '2020-11-03 13:32:59', 42);
INSERT INTO `sxe_seguroxempleado` VALUES (4, 1, 86, 1, '2020-11-03 13:45:21', 42);
INSERT INTO `sxe_seguroxempleado` VALUES (5, 2, 86, 1, '2020-11-03 13:45:21', 42);
INSERT INTO `sxe_seguroxempleado` VALUES (6, 1, 94, 1, '2024-07-30 11:04:09', 49);

-- ----------------------------
-- Table structure for sxk_saldo_artxdetalle_picking_list
-- ----------------------------
CREATE TABLE `sxk_saldo_artxdetalle_picking_list`  (
  `sxk_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de saldo articulo por detalle picking list',
  `sxk_id_sar` int(11) NOT NULL COMMENT 'Id de saldo artículo',
  `sxk_id_dxk` int(11) NOT NULL COMMENT 'Llave principal de orden de venta por piking list',
  `sxk_cantidad_reserva` decimal(19, 6) NOT NULL COMMENT 'Cantidad de articulos que se reserva a inventarios',
  `sxk_cantidad_solicita` decimal(19, 6) NOT NULL COMMENT 'Cantidad de articulos que se solicita de detalle de orden',
  `sxk_cantidad_restante` decimal(19, 6) NOT NULL COMMENT 'Cantidad de articulos que se restan del lote',
  `sxk_estado` tinyint(4) NOT NULL COMMENT 'estado del registro 1=activo, 0=inactivo',
  `sxk_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sxk_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sxk_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sxk_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sxk_id`) USING BTREE,
  INDEX `fk_sxk_id_dxk`(`sxk_id_dxk` ASC) USING BTREE,
  INDEX `fk_sxk_id_sar`(`sxk_id_sar` ASC) USING BTREE,
  CONSTRAINT `fk_sxk_id_dxk` FOREIGN KEY (`sxk_id_dxk`) REFERENCES `dxk_detalle_ordenxpicking_list` (`dxk_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sxk_id_sar` FOREIGN KEY (`sxk_id_sar`) REFERENCES `sar_saldo_articulo` (`sar_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Detalle de lotes de producción por detalle de picking list' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sxk_saldo_artxdetalle_picking_list
-- ----------------------------

-- ----------------------------
-- Table structure for sxm_seguimiento_mano_obraxarticulo_ord
-- ----------------------------
CREATE TABLE `sxm_seguimiento_mano_obraxarticulo_ord`  (
  `sxm_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal del registro',
  `sxm_id_mxo` int(11) NOT NULL COMMENT 'Id del detalle de mano de obra al que pertenece el registro de seguimiento',
  `sxm_id_pla` int(11) NULL DEFAULT NULL COMMENT 'Identificador unico de planilla',
  `sxm_fecha` datetime NULL DEFAULT NULL COMMENT 'fecha en la que se aplica dicho porcentaje',
  `sxm_porcentaje` decimal(19, 2) NOT NULL COMMENT 'porcentaje del avance de la actividad que se esta realizando',
  `sxm_precio` decimal(19, 2) NOT NULL COMMENT 'precio correspondiente segun el porcentaje escrito (calculado en base al precio del registro mxo_id correspondiente)',
  `sxm_porcentaje_avance` decimal(19, 2) NOT NULL COMMENT 'porcentaje del avance total de la actividad que se realiza, sumatoria de los porcentajes ingresados anteriormente. contra este campo se debe validar que su sumatoria no sobrepase el 100%',
  `sxm_observacion` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'agregar alguna observación complementaria al registro.',
  `sxm_id_inn` int(11) NULL DEFAULT NULL COMMENT 'este campo estará null en un inicio y se actualizará cuando se cargue el respectivo ingreso en planilla, con ello se validará que no se procese mas de un ingreso por detalle.',
  `sxm_precio_aprobado` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Precio aprobado de abono a planilla',
  `sxm_estado` tinyint(4) NOT NULL COMMENT '0=inactivo, 1=activo',
  `sxm_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxm_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `sxm_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `sxm_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`sxm_id`) USING BTREE,
  INDEX `fk_sxm_id_pla`(`sxm_id_pla` ASC) USING BTREE,
  CONSTRAINT `fk_sxm_id_pla` FOREIGN KEY (`sxm_id_pla`) REFERENCES `pla_planilla` (`pla_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sxm_seguimiento_mano_obraxarticulo_ord
-- ----------------------------
INSERT INTO `sxm_seguimiento_mano_obraxarticulo_ord` VALUES (1, 1, NULL, '2019-01-01 21:44:25', 20.00, 10.00, 20.00, '', NULL, NULL, 1, 1, '2019-10-27 21:44:25', 0, '0000-00-00 00:00:00');
INSERT INTO `sxm_seguimiento_mano_obraxarticulo_ord` VALUES (2, 38, 2, '2020-08-01 20:44:40', 50.00, 25.39, 50.00, '', 16, NULL, 1, 1, '2020-08-01 20:44:40', 1, '2020-08-01 20:44:40');
INSERT INTO `sxm_seguimiento_mano_obraxarticulo_ord` VALUES (3, 47, NULL, '2020-08-10 17:29:18', 20.00, 10.16, 20.00, '20%', NULL, NULL, 1, 1, '2020-08-10 17:29:18', 1, '2020-08-10 17:29:18');

-- ----------------------------
-- Table structure for sxp_sucursalesxpresupuesto
-- ----------------------------
CREATE TABLE `sxp_sucursalesxpresupuesto`  (
  `sxp_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de sucursal por presupuesto',
  `sxp_id_psp` int(11) NOT NULL COMMENT 'Llave principal de tipo de presupuesto',
  `sxp_id_suc` int(11) NOT NULL COMMENT 'Identificador de la sucursal',
  `sxp_estado` tinyint(4) NOT NULL COMMENT 'Estado de registro 0=inactivo, 1=activo',
  `sxp_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sxp_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `sxp_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `sxp_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`sxp_id`) USING BTREE,
  INDEX `fk_sxp_id_psp`(`sxp_id_psp` ASC) USING BTREE,
  INDEX `fk_sxp_id_suc`(`sxp_id_suc` ASC) USING BTREE,
  CONSTRAINT `fk_sxp_id_psp` FOREIGN KEY (`sxp_id_psp`) REFERENCES `psp_presupuesto` (`psp_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_sxp_id_suc` FOREIGN KEY (`sxp_id_suc`) REFERENCES `suc_sucursal` (`suc_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Sucursales por presupuesto' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of sxp_sucursalesxpresupuesto
-- ----------------------------

-- ----------------------------
-- Table structure for tab_tabla
-- ----------------------------
CREATE TABLE `tab_tabla`  (
  `tab_id` int(11) NOT NULL AUTO_INCREMENT,
  `tab_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  PRIMARY KEY (`tab_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tab_tabla
-- ----------------------------
INSERT INTO `tab_tabla` VALUES (1, 'rte_retiro_empleado');

-- ----------------------------
-- Table structure for tac_tipo_accion
-- ----------------------------
CREATE TABLE `tac_tipo_accion`  (
  `tac_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'llave principal del registro',
  `tac_id_tdc` int(11) NULL DEFAULT NULL COMMENT 'Llave de tipo de descuento',
  `tac_nombre` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Nombre del tipo de acción',
  `tac_observacion` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'observaciones del registro',
  `tac_estado` tinyint(4) NOT NULL COMMENT 'estado del registro 1=activo, 0=inactivo',
  `tac_usu_crea` int(11) NULL DEFAULT NULL COMMENT 'auditoria',
  `tac_fecha_crea` datetime NULL DEFAULT NULL COMMENT 'auditoria',
  `tac_usu_mod` int(11) NOT NULL COMMENT 'auditoria',
  `tac_fecha_mod` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`tac_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'tabla que almacenara todos las acciones posibles para ser aplicadas al personal' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tac_tipo_accion
-- ----------------------------
INSERT INTO `tac_tipo_accion` VALUES (1, 4, 'Permisos sin Goce de Sueldo', 'Permisos sin Goce de Sueldo', 1, 1, '2020-03-31 00:00:00', 1, '2020-03-31 00:00:00');
INSERT INTO `tac_tipo_accion` VALUES (2, NULL, 'Permiso con Goce de Sueldo', 'Permiso con Goce de Sueldo', 1, 1, '2020-03-31 00:00:00', 1, '2020-03-31 00:00:00');
INSERT INTO `tac_tipo_accion` VALUES (3, NULL, 'Permiso con Reposicion de Horas', 'Permiso con Reposicion de Horas', 1, 5, '2020-03-31 00:00:00', 1, '2020-03-31 00:00:00');
INSERT INTO `tac_tipo_accion` VALUES (4, 4, 'Suspension por Falta Grave', 'Suspension por Falta Grave', 1, 1, '2020-03-31 00:00:00', 1, '2020-03-31 00:00:00');
INSERT INTO `tac_tipo_accion` VALUES (5, NULL, 'Reconocimiento Empleado del Mes', 'No aplica descuento de planilla', 1, 1, '2020-09-03 17:33:46', 1, '2020-09-03 17:33:46');
INSERT INTO `tac_tipo_accion` VALUES (6, NULL, 'AUDIT EN FCIA - Atraso en archivo de reportes operac (2-3 días)', 'Se  asigana en el caso que no sean enviados los archivos de reporte', 1, 1, '2023-09-26 15:18:34', 1, '2023-09-26 15:18:34');
INSERT INTO `tac_tipo_accion` VALUES (7, NULL, 'CONVENIENCIA - Traslado para stock de productos no habilitados en sucursal (cada vez)', 'Traslados', 1, 1, '2023-09-26 15:48:16', 1, '2023-09-26 15:48:16');

-- ----------------------------
-- Table structure for tac_tipo_activofijo
-- ----------------------------
CREATE TABLE `tac_tipo_activofijo`  (
  `tac_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificador',
  `tac_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre del tipo de activo fijo',
  `tac_codigo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Segmento del Codigo',
  `tac_depreciacion` decimal(19, 2) NULL DEFAULT NULL COMMENT 'Depreciacion del activo fijo',
  `tac_vida_util` int(11) NOT NULL COMMENT 'Vida util del activo fijo',
  `tac_estado` tinyint(4) NOT NULL COMMENT 'Estado de registro',
  `tac_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `tac_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `tac_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `tac_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`tac_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Tipos de activos fijos' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tac_tipo_activofijo
-- ----------------------------
INSERT INTO `tac_tipo_activofijo` VALUES (1, 'BIENES MUEBLES DIVERSOS', '001', 20.00, 5, 1, 1, '2022-01-18 00:00:00', 1, '2022-01-18 00:00:00');
INSERT INTO `tac_tipo_activofijo` VALUES (2, 'EDIFICIOS E INSTALACIONES', '004', 5.00, 40, 1, 1, '2018-08-16 00:00:00', 1, '2022-01-18 00:00:00');
INSERT INTO `tac_tipo_activofijo` VALUES (3, 'EQUIPO INFORMATICO', '002', 20.00, 5, 1, 1, '2018-08-16 00:00:00', 1, '2022-01-18 00:00:00');
INSERT INTO `tac_tipo_activofijo` VALUES (4, 'MAQUINARIA Y EQUIPO', '003', 10.00, 10, 1, 1, '2018-08-16 00:00:00', 1, '2022-01-18 00:00:00');
INSERT INTO `tac_tipo_activofijo` VALUES (5, 'MOBILIARIO DE OFICINA', '006', 20.00, 5, 1, 1, '2018-08-16 00:00:00', 1, '2022-01-18 00:00:00');
INSERT INTO `tac_tipo_activofijo` VALUES (6, 'VEHICULO DE TRANSPORTE', '007', 10.00, 10, 1, 1, '2018-08-16 00:00:00', 1, '2024-07-04 00:00:00');

-- ----------------------------
-- Table structure for tac_tipo_carga
-- ----------------------------
CREATE TABLE `tac_tipo_carga`  (
  `tac_id` int(11) NOT NULL AUTO_INCREMENT,
  `tac_nombre` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `tac_estado` tinyint(4) NOT NULL,
  `tac_fecha_mod` datetime NOT NULL,
  `tac_usu_mod` int(11) NOT NULL,
  PRIMARY KEY (`tac_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tac_tipo_carga
-- ----------------------------
INSERT INTO `tac_tipo_carga` VALUES (1, 'INGRESOS', 1, '2019-05-29 00:00:00', 1);
INSERT INTO `tac_tipo_carga` VALUES (2, 'DESCUENTOS', 1, '2019-05-29 00:00:00', 1);

-- ----------------------------
-- Table structure for tad_tipo_adquisicion
-- ----------------------------
CREATE TABLE `tad_tipo_adquisicion`  (
  `tad_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identificador unico',
  `tad_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Nombre del tipo de adquisicion',
  `tad_codigo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'codigo de tipo de adquisición.',
  `tad_estado` int(11) NULL DEFAULT NULL COMMENT '0- Inactivo  1- Activo',
  `tad_usr_mod` int(11) NULL DEFAULT NULL COMMENT 'Modo de tipo de adquisicion por usuario',
  `tad_fecha_mod` datetime NULL DEFAULT NULL COMMENT 'Fecha de la adquisicion',
  PRIMARY KEY (`tad_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Tipo de adquisicion' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tad_tipo_adquisicion
-- ----------------------------
INSERT INTO `tad_tipo_adquisicion` VALUES (1, 'Fondos Propios', '001', 1, NULL, NULL);
INSERT INTO `tad_tipo_adquisicion` VALUES (2, 'Donaciones', '002', 1, NULL, NULL);
INSERT INTO `tad_tipo_adquisicion` VALUES (3, 'Financiamiento', '003', 1, NULL, NULL);

-- ----------------------------
-- Table structure for tag_tipo_agrupador
-- ----------------------------
CREATE TABLE `tag_tipo_agrupador`  (
  `tag_id` int(11) NOT NULL AUTO_INCREMENT,
  `tag_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `tag_tipo` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT '\"C\" = agrupador manipulable por usuario, \"R\" = agrupador restringido de sistema',
  `tag_estado` tinyint(4) NOT NULL,
  PRIMARY KEY (`tag_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Tabla de  bases para calcular descuentos' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tag_tipo_agrupador
-- ----------------------------
INSERT INTO `tag_tipo_agrupador` VALUES (1, 'ISSS', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (2, 'Renta 10%', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (3, 'Impuesto Sobre la Renta', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (4, 'Salario Devengado', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (5, 'Seguro Social', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (6, 'AFP', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (7, 'Vacacion', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (8, 'REPORTE PLANILLA', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (9, 'Aguinaldo', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (10, 'Indemnizacion', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (11, 'Salario Promediado', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (12, 'Aguinaldo Variable', 'R', 1);
INSERT INTO `tag_tipo_agrupador` VALUES (13, 'Reporte de planilla catorcenal', 'R', 1);

-- ----------------------------
-- Table structure for tal_telefonoxalumno
-- ----------------------------
CREATE TABLE `tal_telefonoxalumno`  (
  `tal_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal - Telefono x alumno',
  `tal_id_alm` int(11) NOT NULL COMMENT 'Codigo de alumno',
  `tal_id_tit` int(11) NOT NULL COMMENT 'Llave primaria - Tipo de Telefono',
  `tal_numero` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Numero telefonico',
  `tal_estado` int(11) NOT NULL COMMENT 'Estado de registro',
  `tal_usu_crea` int(11) NOT NULL COMMENT 'Auditoría',
  `tal_usu_mod` int(11) NOT NULL COMMENT 'Auditoría',
  `tal_fecha_crea` datetime NOT NULL COMMENT 'Auditoría',
  `tal_fecha_mod` datetime NOT NULL COMMENT 'Auditoría',
  PRIMARY KEY (`tal_id`) USING BTREE,
  INDEX `FK_Reference_310`(`tal_id_alm` ASC) USING BTREE,
  INDEX `FK_Reference_315`(`tal_id_tit` ASC) USING BTREE,
  CONSTRAINT `FK_Reference_310` FOREIGN KEY (`tal_id_alm`) REFERENCES `alm_alumno` (`alm_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `FK_Reference_315` FOREIGN KEY (`tal_id_tit`) REFERENCES `tit_tipo_telefono` (`tit_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'Telefonos por alumno' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tal_telefonoxalumno
-- ----------------------------

-- ----------------------------
-- Table structure for tan_tipo_anestesia
-- ----------------------------
CREATE TABLE `tan_tipo_anestesia`  (
  `tan_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave principal de tipo de anestesia',
  `tan_nombre` varchar(300) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre',
  `tan_descripcion` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT NULL COMMENT 'Descripcion',
  `tan_estado` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'estado del registro 1=activo, 0=inactivo',
  `tan_usu_creacion` int(11) NOT NULL COMMENT 'Auditoria',
  `tan_fecha_creacion` datetime NOT NULL COMMENT 'Auditoria',
  `tan_usu_modificacion` int(11) NOT NULL COMMENT 'Auditoria',
  `tan_fecha_modificacion` datetime NOT NULL COMMENT 'Auditoria',
  PRIMARY KEY (`tan_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = latin1 COLLATE = latin1_swedish_ci COMMENT = 'Entidad - Tipo de anestesia' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tan_tipo_anestesia
-- ----------------------------

-- ----------------------------
-- Table structure for tap_tamano_prov
-- ----------------------------
CREATE TABLE `tap_tamano_prov`  (
  `tap_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'llave principal de proveedor',
  `tap_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'nombre de proveedor',
  `tap_estado` int(11) NOT NULL COMMENT 'estado de registro',
  `tap_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `tap_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `tap_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `tap_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`tap_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci COMMENT = 'catalogo de tamanos de proveedores' ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tap_tamano_prov
-- ----------------------------
INSERT INTO `tap_tamano_prov` VALUES (1, 'Grande', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `tap_tamano_prov` VALUES (2, 'Mediano', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `tap_tamano_prov` VALUES (3, 'Pequeño', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');
INSERT INTO `tap_tamano_prov` VALUES (4, 'Micro', 1, 1, '2019-02-19 15:16:30', 1, '2019-02-19 15:16:30');

-- ----------------------------
-- Table structure for tar_tarea
-- ----------------------------
CREATE TABLE `tar_tarea`  (
  `tar_id` int(11) NOT NULL AUTO_INCREMENT,
  `tar_id_tab` int(11) NULL DEFAULT NULL,
  `tar_nombre` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Nombre del Proceso',
  `tar_duracion` int(11) NOT NULL DEFAULT 1 COMMENT 'Duraci�n estimada del proceso (d�as)',
  PRIMARY KEY (`tar_id`) USING BTREE,
  INDEX `FK_tar_x_tab`(`tar_id_tab` ASC) USING BTREE,
  CONSTRAINT `tar_tarea_ibfk_1` FOREIGN KEY (`tar_id_tab`) REFERENCES `tab_tabla` (`tab_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tar_tarea
-- ----------------------------

-- ----------------------------
-- Table structure for tbe_tabla_escalafon
-- ----------------------------
CREATE TABLE `tbe_tabla_escalafon`  (
  `tbe_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Llave primaria de tabla de escalafon',
  `tbe_id_ctf` int(11) NOT NULL COMMENT 'Llave primaria de categoria de escalafon',
  `tbe_codigo` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Codigo de escalafón',
  `tbe_clase` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL COMMENT 'Clase de escalafón',
  `tbe_monto` decimal(19, 2) NOT NULL COMMENT 'Monto de escalafón (valor por hora)',
  `tbe_estado` tinyint(4) NOT NULL COMMENT 'estado del registro 0=inactivo, 1=activo',
  `tbe_usu_creacion` int(11) NOT NULL COMMENT 'auditoria',
  `tbe_fecha_creacion` datetime NOT NULL COMMENT 'auditoria',
  `tbe_usu_modificacion` int(11) NOT NULL COMMENT 'auditoria',
  `tbe_fecha_modificacion` datetime NOT NULL COMMENT 'auditoria',
  PRIMARY KEY (`tbe_id`) USING BTREE,
  INDEX `fk_tbe_id_ctf`(`tbe_id_ctf` ASC) USING BTREE,
  CONSTRAINT `fk_tbe_id_ctf` FOREIGN KEY (`tbe_id_ctf`) REFERENCES `ctf_categoria_escalafon` (`ctf_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb3 COLLATE = utf8mb3_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tbe_tabla_escalafon
-- ----------------------------

-- ----------------------------
-- Table structure for tbf_tipo_beneficio
-- ----------------------------
