[BLOB]\\\"></p>\",\"igv\":3.78,\"costo\":24.78},{\"v\":0,\"m\":0,\"can\":1,\"km\":0,\"fini\":\"\",\"ffin\":\"\",\"emp\":\"\",\"marca\":\"\",\"desc\":\"\",\"files\":[],\"cmt\":\"\",\"igv\":0,\"costo\":0},{\"v\":0,\"m\":0,\"can\":1,\"km\":0,\"fini\":\"\",\"ffin\":\"\",\"emp\":\"\",\"marca\":\"\",\"desc\":\"\",\"files\":[],\"cmt\":\"\",\"igv\":0,\"costo\":0},{\"v\":0,\"m\":0,\"can\":1,\"km\":0,\"fini\":\"\",\"ffin\":\"\",\"emp\":\"\",\"marca\":\"\",\"desc\":\"\",\"files\":[],\"cmt\":\"\",\"igv\":0,\"costo\":0},{\"v\":0,\"m\":0,\"can\":1,\"km\":0,\"fini\":\"\",\"ffin\":\"\",\"emp\":\"\",\"marca\":\"\",\"desc\":\"\",\"files\":[],\"cmt\":\"\",\"igv\":0,\"costo\":0}]]}','2025-12-30 17:47:15');
INSERT INTO `vehiculo_tabla_mant` VALUES (2,'{\"cols\":[\"NRO\",\"CANTIDAD\",\"KILOMETRO\",\"PIEZA\",\"FEC. INICIO\",\"FEC. FIN\",\"COMPROBANTE\",\"SERVICIO / PRODUCTO\",\"COSTO\",\"MANO DE OBRA\",\"TOTAL\"],\"rows\":[[\"1\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"0.00\"]]}','2025-10-21 14:31:52');

--
-- Table structure for table `video_jobs`
--

CREATE TABLE `video_jobs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `file_id` int NOT NULL,
  `file_path` varchar(1024) NOT NULL,
  `parent_id` int NOT NULL DEFAULT '0',
  `want_mp4_720p` tinyint(1) NOT NULL DEFAULT '0',
  `want_hls` tinyint(1) NOT NULL DEFAULT '0',
  `delete_original` tinyint(1) NOT NULL DEFAULT '0',
  `status` enum('pending','running','done','error') DEFAULT 'pending',
  `attempts` tinyint unsigned NOT NULL DEFAULT '0',
  `error_text` text,
  `log_path` varchar(1024) DEFAULT NULL,
  `priority` tinyint unsigned NOT NULL DEFAULT '5',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `started_at` datetime DEFAULT NULL,
  `finished_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_vjobs_status_created` (`status`,`created_at`),
  KEY `idx_vjobs_file` (`file_id`),
  KEY `idx_vjobs_parent` (`parent_id`),
  CONSTRAINT `fk_vjobs_file` FOREIGN KEY (`file_id`) REFERENCES `archivos_video` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `video_jobs`
--

INSERT INTO `video_jobs` VALUES (10,43,'/var/www/html/portafolio/notexprov2/uploads/drive/1/2025/09/d502b57b564a31f0fcb9d69803e5c235.mp4',15,1,1,0,'pending',0,NULL,'/var/www/html/portafolio/notexprov2/storage/logs/ffmpeg_1758045227_09e8ed01.log',5,'2025-09-16 17:53:47',NULL,NULL),(11,44,'/var/www/html/portafolio/notexprov2/uploads/drive/1/2025/09/51e25212c9b35185b1519c9c63b413cd.mp4',15,1,1,0,'pending',0,NULL,'/var/www/html/portafolio/notexprov2/storage/logs/ffmpeg_1758045441_4501ce8f.log',5,'2025-09-16 17:57:21',NULL,NULL),(12,45,'/var/www/html/portafolio/notexprov2/uploads/drive/1/2025/09/69db6324d27c0d26788444a2099c81ff.mp4',16,1,1,0,'pending',0,NULL,'/var/www/html/portafolio/notexprov2/storage/logs/ffmpeg_1758045474_33eaad76.log',5,'2025-09-16 17:57:54',NULL,NULL),(13,46,'/var/www/html/portafolio/notexprov2/uploads/drive/1/2025/09/109d47b016c7990655c30f23af0247e7.mp4',15,1,1,0,'pending',0,NULL,'/var/www/html/portafolio/notexprov2/storage/logs/ffmpeg_1758067091_059f131b.log',5,'2025-09-16 23:58:11',NULL,NULL),(14,51,'/var/www/html/portafolio/notexprov2/uploads/drive/1/2025/10/97fdc4f099d481f16150d80cca55aee6.mkv',20,1,1,0,'pending',0,NULL,'/var/www/html/portafolio/notexprov2/storage/logs/ffmpeg_1760702137_59373585.log',5,'2025-10-17 11:55:37',NULL,NULL),(15,52,'/var/www/html/portafolio/notexprov2/uploads/drive/1/2025/10/271fdb6104cc1a3b157e6a5ffdd9ea92.mkv',21,1,1,0,'pending',0,NULL,'/var/www/html/portafolio/notexprov2/storage/logs/ffmpeg_1760702388_d0838801.log',5,'2025-10-17 11:59:48',NULL,NULL),(16,118,'/var/www/html/portafolio/notexprov2/uploads/drive/1/2025/10/3e46a2a6c36a44900828b241f6e99ae4.pptx',23,1,1,0,'pending',0,NULL,'/var/www/html/portafolio/notexprov2/storage/logs/ffmpeg_1761776324_aaa5980f.log',5,'2025-10-29 22:18:44',NULL,NULL);

--
-- Table structure for table `vouchers`
--

CREATE TABLE `vouchers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `item_id` int NOT NULL,
  `anio` int NOT NULL,
  `mes` tinyint unsigned NOT NULL COMMENT '1–12 = meses reales, 13 = columna adicional/vouchers',
  `numero` varchar(64) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `monto` decimal(12,2) DEFAULT NULL,
  `archivo` varchar(512) DEFAULT NULL,
  `notas` text,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_item_anio_mes` (`item_id`,`anio`,`mes`),
  CONSTRAINT `fk_vouchers_item` FOREIGN KEY (`item_id`) REFERENCES `presupuesto_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `vouchers`
--

INSERT INTO `vouchers` VALUES (1,1,2025,1,'14','2025-10-16',160.00,'https://drive.google.com/file/d/1Lg-kuZbMe6csMoVfqS6qA39_AEV4ipqq/view?usp=drivesdk','',1,'2025-10-17 01:02:13'),(2,3,2025,1,'1','2025-10-16',150.00,'https://drive.google.com/file/d/1msoczTkY6Vh74-OPJYWREjvhKmYawmeH/view?usp=drivesdk','',1,'2025-10-17 01:05:25'),(3,1,2025,13,'1','2025-10-16',220.00,'https://drive.google.com/file/d/1jGZj3Mk8m9q8veRXE_RJDizd_y7IxaH8/view?usp=drivesdk','',1,'2025-10-17 04:06:38');

--
-- Temporary view structure for view `vw_etiquetas_uso`
--

/*!50001 DROP VIEW IF EXISTS `vw_etiquetas_uso`*/;
/*!50001 CREATE VIEW `vw_etiquetas_uso` AS SELECT 
 1 AS `etiqueta_id`,
 1 AS `empresa_id`,
 1 AS `usados_en_documentos`,
 1 AS `usados_en_contenedores`,
 1 AS `usados_total`*/;

--
-- Table structure for table `webpush_subscriptions`
--

CREATE TABLE `webpush_subscriptions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `subscription` json NOT NULL,
  `endpoint` varchar(1024) GENERATED ALWAYS AS (json_unquote(json_extract(`subscription`,_utf8mb4'$.endpoint'))) STORED,
  `endpoint_sha` varbinary(32) GENERATED ALWAYS AS (unhex(sha2(json_unquote(json_extract(`subscription`,_utf8mb4'$.endpoint')),256))) STORED,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uniq_user_endpoint_sha` (`user_id`,`endpoint_sha`),
  CONSTRAINT `fk_webpush_user` FOREIGN KEY (`user_id`) REFERENCES `usuarios` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `webpush_subscriptions`
--


--
-- Table structure for table `yoyiss`
--

CREATE TABLE `yoyiss` (
  `id` int NOT NULL AUTO_INCREMENT,
  `usuario_id` int NOT NULL,
  `anio` smallint NOT NULL,
  `nombre` varchar(180) NOT NULL,
  `enero` decimal(14,2) NOT NULL DEFAULT '0.00',
  `febrero` decimal(14,2) NOT NULL DEFAULT '0.00',
  `marzo` decimal(14,2) NOT NULL DEFAULT '0.00',
  `abril` decimal(14,2) NOT NULL DEFAULT '0.00',
  `mayo` decimal(14,2) NOT NULL DEFAULT '0.00',
  `junio` decimal(14,2) NOT NULL DEFAULT '0.00',
  `julio` decimal(14,2) NOT NULL DEFAULT '0.00',
  `agosto` decimal(14,2) NOT NULL DEFAULT '0.00',
  `septiembre` decimal(14,2) NOT NULL DEFAULT '0.00',
  `octubre` decimal(14,2) NOT NULL DEFAULT '0.00',
  `noviembre` decimal(14,2) NOT NULL DEFAULT '0.00',
  `diciembre` decimal(14,2) NOT NULL DEFAULT '0.00',
  `total` decimal(16,2) NOT NULL DEFAULT '0.00',
  `manual_html` longtext,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_yoyiss_usuario_anio` (`usuario_id`,`anio`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `yoyiss`
--

INSERT INTO `yoyiss` VALUES (1,9,2025,'__LABELS__',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,'{\"empresa\":\"YOYISS\",\"enero\":\"LUZ\",\"febrero\":\"FEBRERO\",\"marzo\":\"MARZO\",\"abril\":\"ABRIL\",\"mayo\":\"MAYO\",\"junio\":\"JUNIO\",\"julio\":\"JULIO\",\"agosto\":\"AGOSTO\",\"septiembre\":\"SEPTIEMBRE\",\"octubre\":\"OCTUBRE\",\"noviembre\":\"NOVIEMBRE\",\"diciembre\":\"DICIEMBRE\",\"total\":\"TOTAL\"}','2025-09-19 08:45:52','2025-09-19 08:46:25'),(2,9,2025,'Empresa 1',745.00,222.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,967.00,NULL,'2025-09-19 08:46:02','2025-09-19 08:46:04'),(3,9,2025,'Empresa 2',22.00,541.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,563.00,NULL,'2025-09-19 08:46:07','2025-09-19 08:46:08'),(4,9,2025,'__MANUAL__',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,'<ul class=\"todo\">\n<li data-done=\"0\">SASDSA</li>\n<li style=\"font-weight: bold;\" data-done=\"0\"><strong>dsadsa</strong></li>\n<li data-done=\"0\">dsadasdd</li>\n<li data-done=\"1\">sdadsdsadds</li>\n</ul>\n<p>dasdssad</p>\n<p><img src=\"data:image/png;base64,[BLOB]\"></p>','2025-09-19 08:46:11','2025-09-24 11:59:02'),(5,1,2025,'__SHEET__',0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,'{\"cols\":[{\"name\":\"NORMAS\",\"w\":268},{\"name\":\"TIEMPO\",\"w\":96},{\"name\":\"COSTO\",\"w\":80},{\"name\":\"REQUISITOS\",\"w\":160}],\"rows\":[[\"LIBRO DE RECLAMACIONES - VIRTUAL\",\"\",\"\",\"Copia literal de la empresa \\/ Copia de DNI de gerente \\/ Copia de administrador\"],[\"TERMINOS Y CONDICIONES ADAPTADOS AL CODIGO DE PROTECCION AL CONSUMIDOR\",\"\",\"\",\"Información sobre todo el servicio\"],[\"REGISTRO EN EL SISTEMA DE ARBITRAJE DE CONSUMO\",\"\",\"\",\"Copia literal de la empresa \\/ Copia de DNI de gerente \\/ Copia de administrador\"],[\"PROTECCION DE SECRETOS EMPRESARIALES\",\"\",\"\",\"Lista de colaboradores \\/ Conocimientos del giro denegocio\"],[\"REVISION DE PUBLICIDAD EN PAGINA WEB Y REDES SOCIALES\",\"\",\"\",\"Links de página web \\/ Links de redes sociales\"],[\"REGISTRO DE BANCO DE DATOS Y CODIGO DE CONDUCTA\",\"\",\"\",\"Lista de datos en formato Excel\"],[\"POLITICAS DE PROTECCION DE DATOS\",\"\",\"\",\"Copia literal de la empresa \\/ Copia de DNI de gerente \\/ Copia de administrador\"]]}','2025-09-24 12:31:05','2025-09-24 12:32:28');

--
-- Dumping events for database 'notas_db'
--

--
-- Dumping routines for database 'notas_db'
--

--
-- Final view structure for view `flota_documentos_view`
--

/*!50001 DROP VIEW IF EXISTS `flota_documentos_view`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `flota_documentos_view` AS select `d`.`id` AS `id`,`d`.`vehiculo_id` AS `vehiculo_id`,`d`.`doc_tipo_id` AS `doc_tipo_id`,`d`.`numero` AS `numero`,`d`.`entidad` AS `entidad`,`d`.`fecha_emision` AS `fecha_emision`,`d`.`fecha_vencimiento` AS `fecha_vencimiento`,`d`.`archivo_path` AS `archivo_path`,`d`.`estado` AS `estado`,`d`.`notas` AS `notas`,`d`.`created_by` AS `created_by`,`d`.`updated_by` AS `updated_by`,`d`.`created_at` AS `created_at`,`d`.`updated_at` AS `updated_at`,(case when (`d`.`fecha_vencimiento` < curdate()) then 'VENCIDO' when ((to_days(`d`.`fecha_vencimiento`) - to_days(curdate())) <= 15) then 'POR_VENCER' else 'VIGENTE' end) AS `estado_dyn` from `flota_documentos` `d` */;

--
-- Final view structure for view `v_kardex_simple`
--

/*!50001 DROP VIEW IF EXISTS `v_kardex_simple`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_kardex_simple` AS select `m`.`producto_id` AS `producto_id`,`m`.`sede_id` AS `sede_id`,`m`.`fecha` AS `fecha`,`m`.`tipo` AS `tipo`,`m`.`cantidad` AS `cantidad`,`m`.`nota` AS `nota` from `movimiento` `m` */;

--
-- Final view structure for view `v_stock_total_producto`
--

/*!50001 DROP VIEW IF EXISTS `v_stock_total_producto`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_stock_total_producto` AS select `p`.`producto_id` AS `producto_id`,`p`.`nombre` AS `nombre`,sum(`ps`.`stock`) AS `stock_total` from (`producto` `p` left join `producto_stock` `ps` on((`ps`.`producto_id` = `p`.`producto_id`))) group by `p`.`producto_id`,`p`.`nombre` */;

--
-- Final view structure for view `vw_etiquetas_uso`
--

/*!50001 DROP VIEW IF EXISTS `vw_etiquetas_uso`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vw_etiquetas_uso` AS select `e`.`id` AS `etiqueta_id`,`e`.`empresa_id` AS `empresa_id`,sum((case when (`eo`.`objeto_tipo` = 'documento') then 1 else 0 end)) AS `usados_en_documentos`,sum((case when (`eo`.`objeto_tipo` = 'contenedor') then 1 else 0 end)) AS `usados_en_contenedores`,count(`eo`.`id`) AS `usados_total` from (`etiquetas` `e` left join `etiqueta_objetos` `eo` on((`eo`.`etiqueta_id` = `e`.`id`))) group by `e`.`id`,`e`.`empresa_id` */;


