CREATE DATABASE  IF NOT EXISTS `bdisteneabastecimiento` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `bdisteneabastecimiento`;
--
-- Host: 127.0.0.1    Database: bdisteneabastecimiento
-- ------------------------------------------------------


--
-- Table structure for table `almacen`
--

CREATE TABLE `almacen` (
  `id` int NOT NULL AUTO_INCREMENT,
  `alm_nombre` varchar(50) DEFAULT NULL,
  `alm_estado` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `almacen`
--

INSERT INTO `almacen` VALUES (1,'CENTRAL',_binary ''),(2,'APROLAB',_binary '');

--
-- Table structure for table `area_solicitante`
--

CREATE TABLE `area_solicitante` (
  `id` int NOT NULL AUTO_INCREMENT,
  `area_nombre` varchar(100) DEFAULT NULL,
  `area_estado` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `area_solicitante`
--

INSERT INTO `area_solicitante` VALUES (1,'Arquitectura de Plataformas y Servicios TI',_binary ''),(2,'Contabilidad',_binary ''),(3,'Construcción Civil',_binary ''),(4,'Electricidad Industrial',_binary ''),(5,'Electrónica Industrial',_binary ''),(6,'Mecánica de producción industrial',_binary ''),(7,'Mecánica Autmotriz',_binary ''),(8,'Química Industrial',_binary ''),(9,'Arquitectura de Plataformas y Servicios TI',_binary ''),(10,'Contabilidad',_binary ''),(11,'Construcción Civil',_binary ''),(12,'Electricidad Industrial',_binary ''),(13,'Electrónica Industrial',_binary ''),(14,'Mecánica de producción industrial',_binary ''),(15,'Mecánica Autmotriz',_binary ''),(16,'Química Industrial',_binary '');

--
-- Table structure for table `compra`
--

CREATE TABLE `compra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `com_cod_expediente` varchar(50) NOT NULL,
  `com_cod_requerimiento` varchar(100) NOT NULL,
  `com_es_orden_servicio` bit(1) NOT NULL,
  `com_total` decimal(10,2) NOT NULL,
  `com_estado` bit(1) NOT NULL,
  `com_jefe_administracion` varchar(250) DEFAULT NULL,
  `com_director` varchar(250) DEFAULT NULL,
  `com_programa` varchar(100) DEFAULT NULL,
  `com_subprograma` varchar(100) DEFAULT NULL,
  `com_cuenta_por_pagar` decimal(10,2) NOT NULL,
  `com_jefe_almacen` varchar(250) DEFAULT NULL,
  `com_usuario_crea` varchar(100) NOT NULL,
  `com_date_crea` date NOT NULL,
  `com_usuario_edita` varchar(100) DEFAULT NULL,
  `com_date_edita` date NOT NULL,
  `proveedorid` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_compra_proveedor` (`proveedorid`),
  CONSTRAINT `fk_compra_proveedor` FOREIGN KEY (`proveedorid`) REFERENCES `proveedor` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `compra`
--

INSERT INTO `compra` VALUES (1,'EX21','RQ20256',_binary '\0',9.00,_binary '',NULL,NULL,'contabilidad','ddd',0.00,NULL,'1','2025-12-18',NULL,'2025-12-18',9),(2,'jjj4','RQ20256',_binary '\0',17.00,_binary '',NULL,NULL,'contabilidad','ddd',0.00,NULL,'1','2025-12-18',NULL,'2025-12-18',9),(3,'179840','RQ20259',_binary '',1500.00,_binary '',NULL,NULL,NULL,NULL,0.00,NULL,'1','2025-12-19','1','2025-12-19',8),(4,'98858S','RQ202510',_binary '',0.00,_binary '',NULL,NULL,NULL,NULL,0.00,NULL,'1','2025-12-19',NULL,'2025-12-19',14),(5,'98858S','RQ202510',_binary '\0',0.00,_binary '',NULL,NULL,NULL,NULL,0.00,NULL,'1','2025-12-19',NULL,'2025-12-19',9);

--
-- Table structure for table `detalle_compra`
--

CREATE TABLE `detalle_compra` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dcom_cantidad` decimal(10,2) NOT NULL,
  `dcom_precio_unitario` decimal(10,2) NOT NULL,
  `dcom_total` decimal(10,2) NOT NULL,
  `dcom_estado` bit(1) NOT NULL,
  `compraid` int NOT NULL,
  `productoid` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_detallecompra_compra` (`compraid`),
  KEY `fk_detallecompra_producto` (`productoid`),
  CONSTRAINT `fk_detallecompra_compra` FOREIGN KEY (`compraid`) REFERENCES `compra` (`id`),
  CONSTRAINT `fk_detallecompra_producto` FOREIGN KEY (`productoid`) REFERENCES `producto` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `detalle_compra`
--

INSERT INTO `detalle_compra` VALUES (1,1.00,5.00,5.00,_binary '',1,6),(2,1.00,4.00,4.00,_binary '',1,4),(3,1.00,9.00,9.00,_binary '',2,6),(4,1.00,8.00,8.00,_binary '',2,4),(8,1.00,1500.00,1500.00,_binary '',3,7),(9,1.00,0.00,0.00,_binary '',4,2),(10,1.00,0.00,0.00,_binary '',4,6),(11,1.00,0.00,0.00,_binary '',4,8),(12,1.00,0.00,0.00,_binary '',5,2),(13,1.00,0.00,0.00,_binary '',5,6),(14,1.00,0.00,0.00,_binary '',5,8);

--
-- Table structure for table `estado_solicitud`
--

CREATE TABLE `estado_solicitud` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ests_nombre` varchar(50) DEFAULT NULL,
  `ests_estado` bit(1) DEFAULT NULL,
  `ests_codigo` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `estado_solicitud`
--

INSERT INTO `estado_solicitud` VALUES (1,'Espera de atención',_binary '','01'),(2,'Cotización',_binary '','02'),(3,'Cuadro comparativo',_binary '','03'),(4,'VB Dirección',_binary '','04'),(5,'VB Administrador',_binary '','05'),(6,'Asignar documentos',_binary '','06'),(7,'Tesorería',_binary '','07'),(8,'Pagado',_binary '','08'),(9,'Recoger de proveedor',_binary '','09'),(10,'Ingreso a almacén',_binary '','10'),(11,'Entregado a usuario',_binary '','11'),(12,'Entregar PECOSA',_binary '','12'),(13,'Finalizado',_binary '','13'),(14,'Servicio en ejecución',_binary '','14');

--
-- Table structure for table `kardex`
--

CREATE TABLE `kardex` (
  `id` int NOT NULL AUTO_INCREMENT,
  `area_solicitanteid` int DEFAULT NULL,
  `kar_solicito_entregar` varchar(150) DEFAULT NULL,
  `kar_cod_requerimiento` varchar(100) DEFAULT NULL,
  `kar_pedido_nro` int DEFAULT NULL,
  `kar_salida_nro` int DEFAULT NULL,
  `kar_cta_mayor` varchar(50) DEFAULT NULL,
  `kar_programa` varchar(50) DEFAULT NULL,
  `kar_subprograma` varchar(50) DEFAULT NULL,
  `kar_equipo_oficina` decimal(10,2) DEFAULT NULL,
  `kar_equipo_transporte` decimal(10,2) DEFAULT NULL,
  `kar_maquina_equipo` decimal(10,2) DEFAULT NULL,
  `kar_gastos_operacion` decimal(10,2) DEFAULT NULL,
  `kar_reconstruccion` decimal(10,2) DEFAULT NULL,
  `kar_contruccion` decimal(10,2) DEFAULT NULL,
  `kar_bienes_deposito` decimal(10,2) DEFAULT NULL,
  `kar_pedido_transito` decimal(10,2) DEFAULT NULL,
  `kar_date_crea` date DEFAULT NULL,
  `kar_usuario_crea` varchar(100) DEFAULT NULL,
  `kar_date_edita` date DEFAULT NULL,
  `kar_usuario_edita` varchar(100) DEFAULT NULL,
  `kar_estado` bit(1) DEFAULT NULL,
  `kar_almacenid` int DEFAULT NULL,
  `kar_tipomovimientoid` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_kardex_area_solicitante` (`area_solicitanteid`),
  KEY `fk_kardex_almacen` (`kar_almacenid`),
  KEY `fk_kardex_tipomovimiento` (`kar_tipomovimientoid`),
  CONSTRAINT `fk_kardex_almacen` FOREIGN KEY (`kar_almacenid`) REFERENCES `almacen` (`id`),
  CONSTRAINT `fk_kardex_area_solicitante` FOREIGN KEY (`area_solicitanteid`) REFERENCES `area_solicitante` (`id`),
  CONSTRAINT `fk_kardex_tipomovimiento` FOREIGN KEY (`kar_tipomovimientoid`) REFERENCES `tipo_movimiento` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `kardex`
--

INSERT INTO `kardex` VALUES (3,1,'MIGUEL LIZARDO test SANCHEZ DIAZ','RQ20256',43,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',2,1),(4,1,'MIGUEL LIZARDO test SANCHEZ DIAZ','RQ20256',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',2,2),(5,2,'JUANITO TERRONES VARGAS','RQ20257',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',1,2),(6,3,'ERWING ROJAS DIAZ','RQ20258',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',2,2),(7,3,'ERWING ROJAS DIAZ','RQ20258',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',1,1),(8,3,'ERWING ROJAS DIAZ','RQ20258',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',1,3),(9,5,'JUAN APOLINAR CRUZ GALVEZ','RQ20259',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',1,1),(10,5,'JUAN APOLINAR CRUZ GALVEZ','RQ20259',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',2,2),(11,9,'MIGUEL SANCHEZ DIAZ','RQ202510',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',1,3),(12,9,'MIGUEL SANCHEZ DIAZ','RQ202510',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-19','SISTEMA',NULL,NULL,_binary '',1,2),(13,1,'GRETTEL ALMENDRA ACOSTA PLASENCIA','RQ202511',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-22','SISTEMA',NULL,NULL,_binary '',1,3),(14,1,'GRETTEL ALMENDRA ACOSTA PLASENCIA','RQ202511',65,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2025-12-22','SISTEMA',NULL,NULL,_binary '',2,4);

--
-- Table structure for table `kardex_detalle`
--

CREATE TABLE `kardex_detalle` (
  `id` int NOT NULL AUTO_INCREMENT,
  `kardexid` int DEFAULT NULL,
  `almacenid` int DEFAULT NULL,
  `tipo_movimientoid` int DEFAULT NULL,
  `productoid` int DEFAULT NULL,
  `kdet_cantidad` decimal(10,2) DEFAULT NULL,
  `kdet_clasificacion` varchar(20) DEFAULT NULL,
  `kdet_total` decimal(10,2) DEFAULT NULL,
  `kdet_unitario` decimal(12,2) NOT NULL DEFAULT '0.00',
  `kdet_estado` bit(1) DEFAULT NULL,
  `kdet_date_crea` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `kdet_marca` varchar(50) DEFAULT NULL,
  `kdet_modelo` varchar(50) DEFAULT NULL,
  `kdet_serie` varchar(50) DEFAULT NULL,
  `kdet_largo` decimal(10,2) DEFAULT NULL,
  `kdet_ancho` decimal(10,2) DEFAULT NULL,
  `kdet_alto` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_kardexdetalle_kardex` (`kardexid`),
  KEY `fk_kardexdetalle_almacen` (`almacenid`),
  KEY `fk_kardexdetalle_tipomov` (`tipo_movimientoid`),
  KEY `fk_kardexdetalle_producto` (`productoid`),
  CONSTRAINT `fk_kardexdetalle_almacen` FOREIGN KEY (`almacenid`) REFERENCES `almacen` (`id`),
  CONSTRAINT `fk_kardexdetalle_kardex` FOREIGN KEY (`kardexid`) REFERENCES `kardex` (`id`),
  CONSTRAINT `fk_kardexdetalle_producto` FOREIGN KEY (`productoid`) REFERENCES `producto` (`id`),
  CONSTRAINT `fk_kardexdetalle_tipomov` FOREIGN KEY (`tipo_movimientoid`) REFERENCES `tipo_movimiento` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `kardex_detalle`
--

INSERT INTO `kardex_detalle` VALUES (1,3,2,1,6,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(2,3,2,1,4,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(3,4,2,2,6,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(4,4,2,2,4,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(5,5,1,2,4,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(6,5,1,2,3,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(7,5,1,2,8,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(8,5,1,2,9,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(9,6,2,2,4,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(10,6,2,2,9,11.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(11,6,2,2,6,5.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(12,7,1,1,4,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(13,7,1,1,9,11.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(14,7,1,1,6,5.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(15,8,1,3,4,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(16,8,1,3,9,11.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(17,8,1,3,6,5.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(18,9,1,1,7,5.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(19,9,1,1,6,2.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(20,10,2,2,7,1.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(21,11,1,3,2,10.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(22,11,1,3,6,8.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(23,11,1,3,8,5.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(24,12,1,2,2,10.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(25,12,1,2,6,4.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(26,12,1,2,8,5.00,NULL,0.00,0.00,_binary '','2025-12-19 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL),(27,13,1,3,8,15.00,NULL,0.00,0.00,_binary '','2025-12-22 00:00:00','marca1','modelo1','64474747474',5.00,4.00,3.00),(28,13,1,3,7,4.00,NULL,0.00,0.00,_binary '','2025-12-22 00:00:00','hp','modelo2','1124124',1.00,6.00,2.00),(29,13,1,3,6,1.00,NULL,0.00,0.00,_binary '','2025-12-22 00:00:00','canon','modelo3','64456',4.00,3.00,3.00),(30,14,2,4,8,15.00,NULL,0.00,0.00,_binary '','2025-12-22 00:00:00','m1','mo1','554',NULL,NULL,NULL),(31,14,2,4,7,4.00,NULL,0.00,0.00,_binary '','2025-12-22 00:00:00','m2','mo2','344',NULL,NULL,NULL),(32,14,2,4,6,1.00,NULL,0.00,0.00,_binary '','2025-12-22 00:00:00','m3','mo3','567',NULL,NULL,NULL);

--
-- Table structure for table `marca`
--

CREATE TABLE `marca` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mar_nombre` varchar(50) DEFAULT NULL,
  `mar_estado` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `marca`
--

INSERT INTO `marca` VALUES (1,'HP',_binary ''),(2,'GENERICO',_binary '');

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--


--
-- Table structure for table `necesidad`
--

CREATE TABLE `necesidad` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nec_nombre` varchar(50) DEFAULT NULL,
  `nec_estado` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `necesidad`
--

INSERT INTO `necesidad` VALUES (1,'COMPRA',_binary ''),(2,'SERVICIO',_binary '');

--
-- Table structure for table `producto`
--

CREATE TABLE `producto` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pro_codigo` varchar(50) DEFAULT NULL,
  `pro_nombre` varchar(250) DEFAULT NULL,
  `pro_descripcion` varchar(250) DEFAULT NULL,
  `pro_stock_minimo` decimal(10,2) DEFAULT NULL,
  `pro_stock_maximo` decimal(10,2) DEFAULT NULL,
  `pro_estado` bit(1) DEFAULT b'1',
  `unidad_medidaid` int NOT NULL,
  `pro_es_servicio` bit(1) NOT NULL DEFAULT b'0',
  `pro_cod_patrimonial` varchar(100) DEFAULT NULL,
  `pro_largo` decimal(10,2) DEFAULT NULL,
  `pro_ancho` decimal(10,2) DEFAULT NULL,
  `pro_alto` decimal(10,2) DEFAULT NULL,
  `pro_modelo` varchar(100) DEFAULT NULL,
  `pro_serie` varchar(100) DEFAULT NULL,
  `pro_color` varchar(100) DEFAULT NULL,
  `marcaid` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FKproducto157156` (`unidad_medidaid`),
  KEY `fk_producto_marca` (`marcaid`),
  CONSTRAINT `fk_producto_marca` FOREIGN KEY (`marcaid`) REFERENCES `marca` (`id`),
  CONSTRAINT `FKproducto157156` FOREIGN KEY (`unidad_medidaid`) REFERENCES `unidad_medida` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `producto`
--

INSERT INTO `producto` VALUES (1,'A1023','ALCOHOL ISOPROPILICO','demo detalle',4.00,NULL,NULL,3,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'HOJ100','HOJAS BOND','DETALLE PRODUCTO',23.00,NULL,_binary '',1,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'A1023','ALQUILER TOLDO','DDD',23.00,NULL,_binary '',1,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'A1023','ALCOHOL ISOPROPILICO','2333',23.00,NULL,_binary '',7,_binary '',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'sadsad2121','HOJAS BOND','2323',222.00,NULL,_binary '',7,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'PR20256','IMPRESORA CANON G220',NULL,0.00,NULL,_binary '',7,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(7,'PR20257','LAPTOP HP 6564656','NINGUNA',3.00,NULL,_binary '',7,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'PR20258','PINZA AMPERIMETRICA UNIT','NINGUNA',10.00,NULL,_binary '',7,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(9,'PR20259','LAPTOP 15 SA','NA',5.00,NULL,_binary '',7,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,1),(10,'PR202510','CELULAR',NULL,0.00,NULL,_binary '',7,_binary '\0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--
-- Table structure for table `proveedor`
--

CREATE TABLE `proveedor` (
  `id` int NOT NULL AUTO_INCREMENT,
  `prv_nro_documento` varchar(11) DEFAULT NULL,
  `prv_razon_social` varchar(250) DEFAULT NULL,
  `prv_nombre` varchar(250) DEFAULT NULL,
  `prv_esjuridica` bit(1) DEFAULT NULL,
  `prv_rubro` varchar(50) DEFAULT NULL,
  `prv_celular` varchar(15) DEFAULT NULL,
  `prv_email` varchar(150) DEFAULT NULL,
  `prv_historial` int DEFAULT NULL,
  `prv_calificacion` int DEFAULT NULL,
  `prv_estado` bit(1) DEFAULT NULL,
  `prv_es_servicio` bit(1) DEFAULT NULL,
  `prv_direccion` varchar(250) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `proveedor`
--

INSERT INTO `proveedor` VALUES (1,'20123456789','Tech Solutions SAC','Carlos Méndez',_binary '','Tecnología','987654321','contacto@techsolutions.com',3,5,_binary '',NULL,NULL),(2,'10456789123',NULL,'María López',_binary '\0','Servicios Generales','912345678','maria.lopez@gmail.com',2,4,_binary '',NULL,NULL),(3,'20678912345','AgroPeru SRL','Luis Fernández',_binary '','Agricultura','976543210','ventas@agroperu.com',5,5,_binary '',NULL,NULL),(4,'10765432109',NULL,'Jorge Castillo',_binary '\0','Transporte','945678321','jorge.castillo@yahoo.com',1,3,_binary '',NULL,NULL),(5,'20543219876','Construmax SAC','Pedro Ramos',_binary '','Construcción','984321765','info@construmax.com',4,5,_binary '',NULL,NULL),(6,'10876543210',NULL,'Ana Ruiz',_binary '\0','Consultoría','956478321','ana.ruiz@gmail.com',3,4,_binary '',NULL,NULL),(7,'20765439876','MarketLine EIRL','Raúl García',_binary '','Comercio','974563210','ventas@marketline.com',6,5,_binary '',NULL,NULL),(8,'10987654321',NULL,'Lucía Torres',_binary '\0','Diseño Gráfico','987654123','lucia.torres@gmail.com',2,4,_binary '',NULL,NULL),(9,'20876543219','EcoServicios SAC','Diego Morales',_binary '','Limpieza','923456789','contacto@ecoservicios.com',5,5,_binary '',NULL,NULL),(10,'11098765432',NULL,'Ricardo Paredes',_binary '\0','Electricidad','934567890','ricardo.paredes@hotmail.com',3,3,_binary '',NULL,NULL),(11,'20987654322','Industrias Andinas SAC','Sofía Vega',_binary '','Manufactura','965478231','sofia.vega@indandinas.com',4,5,_binary '',NULL,NULL),(12,'11123456789',NULL,'Fernando Díaz',_binary '\0','Transporte','987654789','fernando.diaz@gmail.com',1,4,_binary '',NULL,NULL),(13,'21012345678','MedTech Perú SAC','Gabriela Chávez',_binary '','Salud','976123987','contacto@medtechperu.com',6,5,_binary '',NULL,NULL),(14,'11234567890',NULL,'Claudia Ramos',_binary '\0','Eventos','954321876','claudia.ramos@gmail.com',2,4,_binary '',NULL,NULL),(15,'21123456789','Global Imports EIRL','Javier Soto',_binary '','Importación','999888777','ventas@globalimports.com',5,5,_binary '',NULL,NULL);

--
-- Table structure for table `requerimiento`
--

CREATE TABLE `requerimiento` (
  `id` int NOT NULL AUTO_INCREMENT,
  `req_nro` varchar(250) DEFAULT NULL,
  `req_fecha_solicitud` date DEFAULT NULL,
  `req_fecha_registro` date DEFAULT NULL,
  `req_descripcion` varchar(350) DEFAULT NULL,
  `req_monto_aprox` decimal(10,2) DEFAULT NULL,
  `req_nro_comprobante` varchar(150) DEFAULT NULL,
  `req_estado` int DEFAULT NULL,
  `req_usuario_crea` varchar(100) DEFAULT NULL,
  `req_usuario_edita` varchar(150) DEFAULT NULL,
  `req_date_crea` date DEFAULT NULL,
  `req_date_edita` date DEFAULT NULL,
  `area_solicitanteid` int NOT NULL,
  `necesidadid` int NOT NULL,
  `estado_solicitudid` int NOT NULL,
  `proveedorid` int DEFAULT NULL,
  `req_nombres_solicita` varchar(100) DEFAULT NULL,
  `req_apellidos_solicita` varchar(150) DEFAULT NULL,
  `req_dni_solicita` varchar(150) DEFAULT NULL,
  `req_email_solicita` varchar(150) DEFAULT NULL,
  `req_celular_solicita` varchar(20) DEFAULT NULL,
  `req_apellido_paterno_solicita` varchar(150) DEFAULT NULL,
  `req_apellido_materno_solicita` varchar(150) DEFAULT NULL,
  `req_cod_expediente` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FKrequerimie257029` (`estado_solicitudid`),
  KEY `FKrequerimie155661` (`necesidadid`),
  KEY `FKrequerimie705983` (`area_solicitanteid`),
  KEY `FKrequerimie900794` (`proveedorid`),
  CONSTRAINT `FKrequerimie155661` FOREIGN KEY (`necesidadid`) REFERENCES `necesidad` (`id`),
  CONSTRAINT `FKrequerimie257029` FOREIGN KEY (`estado_solicitudid`) REFERENCES `estado_solicitud` (`id`),
  CONSTRAINT `FKrequerimie705983` FOREIGN KEY (`area_solicitanteid`) REFERENCES `area_solicitante` (`id`),
  CONSTRAINT `FKrequerimie900794` FOREIGN KEY (`proveedorid`) REFERENCES `proveedor` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `requerimiento`
--

INSERT INTO `requerimiento` VALUES (1,'REQ-001-2025','2025-01-10','2025-01-10','Solicitud de compra de suministros de oficina',850.50,'C-2025-001',1,'msanchez',NULL,'2025-01-10',NULL,1,1,1,1,'Carlos',NULL,'74258963','carlos.perez@empresa.com','987654321','Pérez','Gómez',NULL),(2,'REQ-002-2025','2025-01-12','2025-01-12','Servicio de mantenimiento preventivo de equipos',1200.00,'S-2025-010',1,'jrodriguez',NULL,'2025-01-12',NULL,2,2,2,3,'María',NULL,'72845612','maria.lopez@empresa.com','999123456','Lopez','Ramírez',NULL),(3,'REQ-003-2025','2025-01-15','2025-01-15','Compra de herramientas para mantenimiento industrial',3400.75,'C-2025-015',1,'lgarcia',NULL,'2025-01-15',NULL,3,1,1,2,'Luis',NULL,'73124597','luis.garcia@empresa.com','912345678','García','Torres',NULL),(4,'RQ20254','2025-12-10',NULL,'ninguna',NULL,NULL,1,'WEB',NULL,'2025-12-10',NULL,7,1,1,NULL,'nombre test',NULL,'89876765','miguelsanchez261092@gmail.com','987876564','ape test','mat test',NULL),(5,'RQ20255','2025-12-10',NULL,'NINGUNA',NULL,NULL,1,'WEB',NULL,'2025-12-10',NULL,1,1,1,NULL,'MIGUEL',NULL,'70017434','miguelsanchez261092@gmail.com','994771957','SANCHEZ','DIAZ',NULL),(6,'RQ20256','2025-12-10',NULL,NULL,NULL,NULL,1,'WEB',NULL,'2025-12-10',NULL,1,1,1,NULL,'MIGUEL LIZARDO',NULL,'89876765','miguelsanchez261092@gmail.com','987876564','test','SANCHEZ DIAZ',NULL),(7,'RQ20257','2025-12-19',NULL,'nnna',NULL,NULL,1,NULL,NULL,'2025-12-18',NULL,2,2,1,NULL,'JUANITO',NULL,'98877665','miguelsanchez261092@gmail.com','988767564','TERRONES','VARGAS','J3248'),(8,'RQ20258','2025-12-19',NULL,NULL,NULL,NULL,1,NULL,NULL,'2025-12-19',NULL,3,1,1,NULL,'ERWING',NULL,'78768779','miguelsanchez261092@gmail.com','987765567','ROJAS','DIAZ','RQ20256'),(9,'RQ20259','2025-12-19',NULL,'que sea de color negro hhhhnnn',NULL,NULL,1,NULL,NULL,'2025-12-19',NULL,5,1,1,NULL,'JUAN APOLINAR',NULL,'76877687','miguelsanchez261092@gmail.com','987654567','CRUZ','GALVEZ','179840'),(10,'RQ202510','2025-12-19',NULL,'NINGUNA',NULL,NULL,1,NULL,NULL,'2025-12-19',NULL,9,1,1,NULL,'MIGUEL',NULL,'70017434','miguelsanchez261092@gmail.com','994771957','SANCHEZ','DIAZ','98858S'),(11,'RQ202511','2025-12-22',NULL,'NA',NULL,NULL,1,NULL,NULL,'2025-12-22',NULL,1,1,1,NULL,'GRETTEL ALMENDRA',NULL,'70766545','miguelsanchez261092@gmail.com','999999999','ACOSTA','PLASENCIA','exp2025'),(12,'RQ202512','2025-12-22',NULL,'NNN',NULL,NULL,1,NULL,NULL,'2025-12-22',NULL,3,1,1,NULL,'MIGUEL LIZARDO',NULL,'77777777','miguelsanchez261092@gmail.com','994771957','TERRONES','SANCHEZ DIAZ',NULL);

--
-- Table structure for table `requerimiento_detalle`
--

CREATE TABLE `requerimiento_detalle` (
  `id` int NOT NULL AUTO_INCREMENT,
  `reqd_cantidad` decimal(19,0) DEFAULT NULL,
  `reqd_estado` bit(1) DEFAULT NULL,
  `reqd_observacion` varchar(250) DEFAULT NULL,
  `productoid` int NOT NULL,
  `requerimientoid` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `FKrequerimie38923` (`requerimientoid`),
  KEY `FKrequerimie667242` (`productoid`),
  CONSTRAINT `FKrequerimie38923` FOREIGN KEY (`requerimientoid`) REFERENCES `requerimiento` (`id`),
  CONSTRAINT `FKrequerimie667242` FOREIGN KEY (`productoid`) REFERENCES `producto` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `requerimiento_detalle`
--

INSERT INTO `requerimiento_detalle` VALUES (1,3,_binary '',NULL,2,4),(2,1,_binary '',NULL,3,4),(3,1,_binary '',NULL,6,5),(4,6,_binary '',NULL,4,5),(5,1,_binary '',NULL,3,5),(6,1,_binary '',NULL,6,6),(7,1,_binary '',NULL,4,6),(8,1,_binary '',NULL,4,7),(9,1,_binary '',NULL,3,7),(10,1,_binary '',NULL,8,7),(11,1,_binary '',NULL,9,7),(12,1,_binary '',NULL,4,8),(13,11,_binary '',NULL,9,8),(14,5,_binary '',NULL,6,8),(15,5,_binary '','jjj',7,9),(16,2,_binary '',NULL,6,9),(17,10,_binary '',NULL,2,10),(18,4,_binary '',NULL,6,10),(19,5,_binary '',NULL,8,10),(20,15,_binary '',NULL,8,11),(21,4,_binary '','NA',7,11),(22,1,_binary '','NEGRA',6,11),(23,1,_binary '',NULL,10,12);

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--

INSERT INTO `sessions` VALUES ('h1PFrtnAthyFrxCZyuMzjNEqhjOxspbJVPh4nUmN',1,'127.0.0.1','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36','YTo0OntzOjY6Il90b2tlbiI7czo0MDoidkJ5a2dFdXR2RmlpdGVsT0l3eEhRSXFZR1dET0ExazBvUzlldlh3VCI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTtzOjk6Il9wcmV2aW91cyI7YToxOntzOjM6InVybCI7czozNzoiaHR0cDovL2xvY2FsaG9zdDo4MDAwL2FwaS9uZWNlc2lkYWRlcyI7fX0=',1766447044);

--
-- Table structure for table `tipo_movimiento`
--

CREATE TABLE `tipo_movimiento` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tipm_nombre` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `tipo_movimiento`
--

INSERT INTO `tipo_movimiento` VALUES (1,'ENTRADA'),(2,'SALIDA'),(3,'DONACION INGRESO'),(4,'DONACION SALIDA');

--
-- Table structure for table `unidad_medida`
--

CREATE TABLE `unidad_medida` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uni_nombre` varchar(150) NOT NULL,
  `uni_abreviatura` varchar(20) DEFAULT NULL,
  `uni_estado` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `unidad_medida`
--

INSERT INTO `unidad_medida` VALUES (1,'Kilogramo','kg',_binary ''),(2,'Gramo','g',_binary ''),(3,'Litro','L',_binary ''),(4,'Mililitro','ml',_binary ''),(5,'Metro','m',_binary ''),(6,'Centímetro','cm',_binary ''),(7,'Unidad','u',_binary ''),(8,'Docena','dz',_binary ''),(9,'Pulgada','in',_binary ''),(10,'Caja','cj',_binary '\0');

--
-- Dumping events for database 'bdisteneabastecimiento'
--

--
-- Dumping routines for database 'bdisteneabastecimiento'
--


