
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `auditoria`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `auditoria` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `usuario_id` int(11) DEFAULT NULL,
  `accion` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tabla_afectada` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `registro_id` int(11) DEFAULT NULL,
  `detalle` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `creado_en` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `auditoria` WRITE;
/*!40000 ALTER TABLE `auditoria` DISABLE KEYS */;
INSERT INTO `auditoria` VALUES (1,1,'LOGIN','',NULL,'','::1','2026-08-17 19:47:28'),(2,1,'LOGIN','',NULL,'','::1','2026-08-17 19:56:48'),(3,1,'LOGIN','',NULL,'','::1','2026-08-17 19:57:19'),(4,1,'EDITAR','garantias',1,'','::1','2026-08-17 19:58:25'),(5,1,'CREAR','vendedores',1,'','::1','2026-08-18 02:36:24'),(6,1,'EDITAR','canales_venta',1,'','::1','2026-08-18 02:36:34'),(7,1,'CREAR','bancos',1,'','::1','2026-08-18 02:37:20'),(8,1,'CREAR','bancos',2,'','::1','2026-08-18 02:37:27'),(9,1,'CREAR','bancos',3,'','::1','2026-08-18 02:37:32'),(10,1,'CREAR','bancos',4,'','::1','2026-08-18 02:37:36'),(11,1,'EDITAR','clases_prestamo',2,'','::1','2026-08-18 02:37:52'),(12,1,'EDITAR','clases_prestamo',1,'','::1','2026-08-18 02:37:59'),(13,1,'LOGIN','',NULL,'','::1','2026-08-18 02:58:46'),(14,1,'CREAR','clientes',1,'','::1','2026-08-18 03:00:46'),(15,1,'LOGIN','',NULL,'','::1','2026-08-18 03:07:55'),(16,1,'LOGIN','',NULL,'','::1','2026-08-18 03:08:43'),(17,1,'CREAR','operaciones',1,'','::1','2026-08-18 03:10:06'),(18,1,'LOGIN','',NULL,'','::1','2026-08-18 03:16:00'),(19,1,'LOGIN','',NULL,'','::1','2026-08-18 03:25:58'),(20,1,'LOGIN','',NULL,'','::1','2026-08-18 03:30:50'),(21,1,'LOGIN','',NULL,'','::1','2026-08-18 03:40:53'),(22,1,'CREAR','operaciones',2,'','::1','2026-08-18 09:21:53'),(23,1,'LOGIN','',NULL,'','::1','2026-08-18 09:36:51'),(24,1,'LOGIN','',NULL,'','::1','2026-08-18 09:40:40'),(25,1,'LOGIN','',NULL,'','::1','2026-08-18 09:42:22'),(26,1,'LOGIN','',NULL,'','::1','2026-08-18 09:48:22'),(27,1,'CREAR','operaciones',3,'','::1','2026-08-18 09:50:38'),(28,1,'LOGIN','',NULL,'','::1','2026-08-18 09:52:59'),(29,1,'LOGIN','',NULL,'','::1','2026-08-18 10:00:58'),(30,1,'LOGIN','',NULL,'','::1','2026-08-18 10:01:14'),(31,1,'LOGIN','',NULL,'','::1','2026-08-18 10:03:19'),(32,1,'LOGIN','',NULL,'','::1','2026-08-18 10:03:31'),(33,1,'LOGIN','',NULL,'','::1','2026-08-18 10:04:18'),(34,1,'LOGIN','',NULL,'','::1','2026-08-18 10:05:27'),(35,1,'LOGIN','',NULL,'','::1','2026-08-18 10:05:37'),(36,1,'LOGIN','',NULL,'','::1','2026-08-18 10:06:34'),(37,1,'LOGIN','',NULL,'','::1','2026-08-18 10:09:17'),(38,1,'CREAR','operaciones',4,'','::1','2026-08-18 12:21:51'),(39,1,'CREAR','clientes',2,'','::1','2026-08-18 12:26:53'),(40,1,'CREAR','clientes',3,'','::1','2026-08-18 12:27:13'),(41,1,'EDITAR','vendedores',1,'','::1','2026-08-18 12:28:39'),(42,1,'CREAR','operaciones',5,'','::1','2026-08-18 12:31:12'),(46,1,'CREAR','operaciones',6,'','::1','2026-08-18 23:25:27'),(47,1,'CREAR','capitales',3,'','::1','2026-08-18 23:27:21'),(48,1,'BORRADO ESPECIAL','operaciones',6,'Operación, detalles y pagos eliminados','::1','2026-08-18 23:28:51'),(49,1,'BORRADO ESPECIAL','operaciones',4,'Operación, detalles y pagos eliminados','::1','2026-08-19 00:09:46'),(50,1,'BORRADO ESPECIAL','operaciones',3,'Operación, detalles y pagos eliminados','::1','2026-08-19 00:09:55'),(51,1,'BORRADO ESPECIAL','operaciones',2,'Operación, detalles y pagos eliminados','::1','2026-08-19 00:09:59'),(52,1,'BORRADO ESPECIAL','operaciones',1,'Operación, detalles y pagos eliminados','::1','2026-08-19 00:10:03'),(53,1,'ELIMINAR','capitales',3,'Capital, cuotas y pagos eliminados','::1','2026-08-19 00:10:22'),(54,1,'CREAR','clientes',4,'','::1','2026-08-19 00:11:13'),(55,1,'CREAR','clientes',5,'','::1','2026-08-19 00:11:37'),(56,1,'CREAR','clientes',6,'','::1','2026-08-19 00:13:11'),(57,1,'CREAR','clientes',7,'','::1','2026-08-19 00:13:38'),(58,1,'EDITAR','clientes',5,'','::1','2026-08-19 00:14:11'),(59,1,'EDITAR','clientes',3,'','::1','2026-08-19 00:14:42'),(60,1,'EDITAR','clientes',4,'','::1','2026-08-19 00:15:13'),(61,1,'CREAR','clientes',8,'','::1','2026-08-19 00:16:02'),(62,1,'CREAR','clientes',9,'','::1','2026-08-19 00:16:23'),(63,1,'CREAR','clientes',10,'','::1','2026-08-19 00:16:42'),(64,1,'BORRADO ESPECIAL','operaciones',5,'Operación, detalles y pagos eliminados','::1','2026-08-19 00:22:53'),(65,1,'LOGIN','',NULL,'','::1','2026-08-19 00:25:17'),(66,1,'LOGIN','',NULL,'','::1','2026-08-19 00:25:46'),(68,1,'LOGIN','',NULL,'','::1','2026-08-19 00:26:17'),(70,1,'IMPORTAR','operaciones',9,'Importación TXT','::1','2026-08-19 00:29:22'),(71,1,'IMPORTAR','operaciones',10,'Importación TXT','::1','2026-08-19 00:29:22'),(72,1,'IMPORTAR','operaciones',11,'Importación TXT','::1','2026-08-19 00:29:22'),(73,1,'IMPORTAR','operaciones',12,'Importación TXT','::1','2026-08-19 00:29:22'),(74,1,'IMPORTAR','operaciones',13,'Importación TXT','::1','2026-08-19 00:29:22'),(75,1,'IMPORTAR','operaciones',14,'Importación TXT','::1','2026-08-19 00:29:22'),(76,1,'IMPORTAR','operaciones',15,'Importación TXT','::1','2026-08-19 00:29:22'),(77,1,'IMPORTAR','operaciones',16,'Importación TXT','::1','2026-08-19 00:29:22'),(78,1,'IMPORTAR','operaciones',17,'Importación TXT','::1','2026-08-19 00:29:22'),(79,1,'IMPORTAR','operaciones',18,'Importación TXT','::1','2026-08-19 00:29:22'),(80,1,'IMPORTAR','operaciones',19,'Importación TXT','::1','2026-08-19 00:29:22'),(81,1,'IMPORTAR','operaciones',20,'Importación TXT','::1','2026-08-19 00:29:22'),(82,1,'IMPORTAR','operaciones',21,'Importación TXT','::1','2026-08-19 00:29:22');
/*!40000 ALTER TABLE `auditoria` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `bancos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bancos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `codigo` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `bancos` WRITE;
/*!40000 ALTER TABLE `bancos` DISABLE KEYS */;
INSERT INTO `bancos` VALUES (1,'Familiar','',1),(2,'Ueno Bank','',1),(3,'Basa','',1),(4,'BNF','',1),(7,'Banco Familiar',NULL,1),(8,'Banco Continental',NULL,1),(9,'Itaú',NULL,1),(10,'Banco Atlas',NULL,1);
/*!40000 ALTER TABLE `bancos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `canales_venta`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `canales_venta` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `canales_venta` WRITE;
/*!40000 ALTER TABLE `canales_venta` DISABLE KEYS */;
INSERT INTO `canales_venta` VALUES (1,'Venta Directa','',1);
/*!40000 ALTER TABLE `canales_venta` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `capital_detalles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `capital_detalles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `capital_id` int(11) NOT NULL,
  `numero_cuota` int(11) NOT NULL,
  `vencimiento` date NOT NULL,
  `plazo_dias` int(11) NOT NULL,
  `interes` decimal(18,2) NOT NULL DEFAULT 0.00,
  `capital` decimal(18,2) NOT NULL DEFAULT 0.00,
  `cobrado_interes` decimal(18,2) NOT NULL DEFAULT 0.00,
  `cobrado_capital` decimal(18,2) NOT NULL DEFAULT 0.00,
  `ultima_fecha_pago` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `capital_id` (`capital_id`,`numero_cuota`),
  CONSTRAINT `capital_detalles_ibfk_1` FOREIGN KEY (`capital_id`) REFERENCES `capitales` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `capital_detalles` WRITE;
/*!40000 ALTER TABLE `capital_detalles` DISABLE KEYS */;
/*!40000 ALTER TABLE `capital_detalles` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `capital_pagos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `capital_pagos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` datetime NOT NULL DEFAULT current_timestamp(),
  `cliente_id` int(11) NOT NULL,
  `capital_detalle_id` int(11) NOT NULL,
  `monto` decimal(18,2) NOT NULL,
  `interes_aplicado` decimal(18,2) NOT NULL DEFAULT 0.00,
  `capital_aplicado` decimal(18,2) NOT NULL DEFAULT 0.00,
  `recibo` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `observacion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `usuario_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cliente_id` (`cliente_id`),
  KEY `capital_detalle_id` (`capital_detalle_id`),
  CONSTRAINT `capital_pagos_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`),
  CONSTRAINT `capital_pagos_ibfk_2` FOREIGN KEY (`capital_detalle_id`) REFERENCES `capital_detalles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `capital_pagos` WRITE;
/*!40000 ALTER TABLE `capital_pagos` DISABLE KEYS */;
/*!40000 ALTER TABLE `capital_pagos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `capitales`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `capitales` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `cliente_id` int(11) NOT NULL,
  `origen_capital_id` int(11) NOT NULL,
  `moneda_id` tinyint(4) NOT NULL DEFAULT 1,
  `monto` decimal(18,2) NOT NULL,
  `tasa` decimal(10,4) NOT NULL DEFAULT 24.0000,
  `cantidad_cuotas` int(11) NOT NULL,
  `periodicidad` enum('Mensual','Bimestral','Semestral','Anual','Al vencimiento') COLLATE utf8mb4_unicode_ci NOT NULL,
  `primer_vencimiento` date NOT NULL,
  `total_interes` decimal(18,2) NOT NULL DEFAULT 0.00,
  `total_capital` decimal(18,2) NOT NULL DEFAULT 0.00,
  `estado` enum('Vigente','Cancelado','Anulado') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Vigente',
  `observaciones` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `creado_por` int(11) DEFAULT NULL,
  `creado_en` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `cliente_id` (`cliente_id`),
  KEY `origen_capital_id` (`origen_capital_id`),
  KEY `moneda_id` (`moneda_id`),
  CONSTRAINT `capitales_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`),
  CONSTRAINT `capitales_ibfk_2` FOREIGN KEY (`origen_capital_id`) REFERENCES `origenes_capital` (`id`),
  CONSTRAINT `capitales_ibfk_3` FOREIGN KEY (`moneda_id`) REFERENCES `monedas` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `capitales` WRITE;
/*!40000 ALTER TABLE `capitales` DISABLE KEYS */;
/*!40000 ALTER TABLE `capitales` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `clases_prestamo`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clases_prestamo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `clases_prestamo` WRITE;
/*!40000 ALTER TABLE `clases_prestamo` DISABLE KEYS */;
INSERT INTO `clases_prestamo` VALUES (1,'Refinanciacion','',1),(2,'Nuevos','Clase predeterminada para nuevas operaciones',1),(3,'Nuevos','Clase predeterminada para nuevas operaciones',0);
/*!40000 ALTER TABLE `clases_prestamo` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `cliente_archivos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cliente_archivos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cliente_id` int(11) NOT NULL,
  `nombre_original` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `archivo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mime` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha_vencimiento` date DEFAULT NULL,
  `creado_en` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `cliente_id` (`cliente_id`),
  CONSTRAINT `cliente_archivos_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `cliente_archivos` WRITE;
/*!40000 ALTER TABLE `cliente_archivos` DISABLE KEYS */;
/*!40000 ALTER TABLE `cliente_archivos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `cliente_referencias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cliente_referencias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cliente_id` int(11) NOT NULL,
  `tipo` enum('Personal','Comercial') COLLATE utf8mb4_unicode_ci NOT NULL,
  `nombre` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `relacion` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `observacion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cliente_id` (`cliente_id`),
  CONSTRAINT `cliente_referencias_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `cliente_referencias` WRITE;
/*!40000 ALTER TABLE `cliente_referencias` DISABLE KEYS */;
/*!40000 ALTER TABLE `cliente_referencias` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `clientes`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clientes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tipo_persona` enum('Física','Jurídica') COLLATE utf8mb4_unicode_ci DEFAULT 'Física',
  `documento` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nombres` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apellidos` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `razon_social` varchar(180) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fecha_nacimiento` date DEFAULT NULL,
  `nacionalidad` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `estado_civil` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ciudad` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `actividad` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `empresa` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ingreso_mensual` decimal(18,2) DEFAULT 0.00,
  `observaciones` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  `creado_en` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `documento` (`documento`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `clientes` WRITE;
/*!40000 ALTER TABLE `clientes` DISABLE KEYS */;
INSERT INTO `clientes` VALUES (1,'Física','1072195','Hermes','Montania','',NULL,'','','','','','','','',0.00,'',1,'2026-08-18 03:00:46'),(2,'Física','Colaso','Colaso Bo','','',NULL,'','','','','','','','',0.00,'',1,'2026-08-18 12:26:53'),(3,'Jurídica','80088141-9','Universal Company S.A.','','',NULL,'','','','','','','','',0.00,'',1,'2026-08-18 12:27:13'),(4,'Jurídica','80106882-7','Newman S.A.','','',NULL,'','','','','','','','',0.00,'',1,'2026-08-19 00:11:13'),(5,'Jurídica','80091507-0','Frigosato S.A.','','',NULL,'','','','','','','','',0.00,'',1,'2026-08-19 00:11:37'),(6,'Física','4795849','Wilma Paola','Herrero','',NULL,'','','','','','','','',0.00,'',1,'2026-08-19 00:13:11'),(7,'Física','3979686','Carlos Dario','Coronel Villalba','',NULL,'','','','','','','','',0.00,'',1,'2026-08-19 00:13:38'),(8,'Física','Dimas','Dimas','Parquet','',NULL,'','','','','','','','',0.00,'',1,'2026-08-19 00:16:02'),(9,'Física','Sebastian','Sebastian','Pizarro','',NULL,'','','','','','','','',0.00,'',1,'2026-08-19 00:16:23'),(10,'Física','Jani','Jani','Delmas','',NULL,'','','','','','','','',0.00,'',1,'2026-08-19 00:16:42'),(11,'Física','IMP-3CE9FF9AF0A1','CLIENTE QA IMPORT',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00,'Creado automáticamente mediante Importar Datos',1,'2026-08-19 00:25:46'),(12,'Física','IMP-33339C6E33F0','LIBRADOR QA IMPORT',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00,'Creado automáticamente mediante Importar Datos',1,'2026-08-19 00:25:46');
/*!40000 ALTER TABLE `clientes` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `cobro_aplicaciones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cobro_aplicaciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cobro_id` int(11) DEFAULT NULL,
  `concepto` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `monto` decimal(18,2) DEFAULT NULL,
  `orden_aplicacion` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cobro_id` (`cobro_id`),
  CONSTRAINT `cobro_aplicaciones_ibfk_1` FOREIGN KEY (`cobro_id`) REFERENCES `cobros` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `cobro_aplicaciones` WRITE;
/*!40000 ALTER TABLE `cobro_aplicaciones` DISABLE KEYS */;
/*!40000 ALTER TABLE `cobro_aplicaciones` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `cobros`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cobros` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` datetime DEFAULT current_timestamp(),
  `cliente_id` int(11) DEFAULT NULL,
  `operacion_detalle_id` int(11) DEFAULT NULL,
  `monto` decimal(18,2) DEFAULT NULL,
  `recibo` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `observacion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `usuario_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `cliente_id` (`cliente_id`),
  KEY `operacion_detalle_id` (`operacion_detalle_id`),
  CONSTRAINT `cobros_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`),
  CONSTRAINT `cobros_ibfk_2` FOREIGN KEY (`operacion_detalle_id`) REFERENCES `operacion_detalles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `cobros` WRITE;
/*!40000 ALTER TABLE `cobros` DISABLE KEYS */;
/*!40000 ALTER TABLE `cobros` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `detalle_saldos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `detalle_saldos` (
  `operacion_detalle_id` int(11) NOT NULL,
  `gastos_cobranza` decimal(18,2) DEFAULT 0.00,
  `interes_moratorio` decimal(18,2) DEFAULT 0.00,
  `interes_punitorio` decimal(18,2) DEFAULT 0.00,
  `seguro` decimal(18,2) DEFAULT 0.00,
  `gastos_administrativos` decimal(18,2) DEFAULT 0.00,
  `gastos_operativos` decimal(18,2) DEFAULT 0.00,
  `interes` decimal(18,2) DEFAULT 0.00,
  `capital` decimal(18,2) DEFAULT 0.00,
  `monto_abonado` decimal(18,2) DEFAULT 0.00,
  PRIMARY KEY (`operacion_detalle_id`),
  CONSTRAINT `detalle_saldos_ibfk_1` FOREIGN KEY (`operacion_detalle_id`) REFERENCES `operacion_detalles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `detalle_saldos` WRITE;
/*!40000 ALTER TABLE `detalle_saldos` DISABLE KEYS */;
INSERT INTO `detalle_saldos` VALUES (13,0.00,0.00,0.00,0.00,0.00,0.00,0.00,370000000.00,0.00),(14,0.00,0.00,0.00,0.00,0.00,0.00,443835.62,8556164.38,0.00),(15,0.00,0.00,0.00,0.00,0.00,0.00,917260.27,8082739.73,0.00),(16,0.00,0.00,0.00,0.00,0.00,0.00,256438.36,5743561.64,0.00),(17,0.00,0.00,0.00,0.00,0.00,0.00,780657.53,15049342.47,0.00),(18,0.00,0.00,0.00,0.00,0.00,0.00,715068.49,14284931.51,0.00),(19,0.00,0.00,0.00,0.00,0.00,0.00,276164.38,16523835.62,0.00),(20,0.00,0.00,0.00,0.00,0.00,0.00,345205.48,9654794.52,0.00),(21,0.00,0.00,0.00,0.00,0.00,0.00,1075.07,4924.93,0.00),(22,0.00,0.00,0.00,0.00,0.00,0.00,18904.11,96095.89,0.00),(23,0.00,0.00,0.00,0.00,0.00,0.00,473.42,5526.58,0.00),(24,0.00,0.00,0.00,0.00,0.00,0.00,6904.11,143095.89,0.00),(25,0.00,0.00,0.00,0.00,0.00,0.00,1044.49,30725.51,0.00);
/*!40000 ALTER TABLE `detalle_saldos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `garantias`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `garantias` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `garantias` WRITE;
/*!40000 ALTER TABLE `garantias` DISABLE KEYS */;
INSERT INTO `garantias` VALUES (1,'A Sola Firma','',1),(2,'Prendaria',NULL,1),(3,'Hipotecaria',NULL,1);
/*!40000 ALTER TABLE `garantias` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `gastos_administrativos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gastos_administrativos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monto_desde` decimal(18,2) DEFAULT NULL,
  `monto_hasta` decimal(18,2) DEFAULT NULL,
  `tasa` decimal(10,4) DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `gastos_administrativos` WRITE;
/*!40000 ALTER TABLE `gastos_administrativos` DISABLE KEYS */;
/*!40000 ALTER TABLE `gastos_administrativos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `gastos_cobranza`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gastos_cobranza` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dias_desde` int(11) DEFAULT NULL,
  `dias_hasta` int(11) DEFAULT NULL,
  `tasa` decimal(10,4) DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `gastos_cobranza` WRITE;
/*!40000 ALTER TABLE `gastos_cobranza` DISABLE KEYS */;
/*!40000 ALTER TABLE `gastos_cobranza` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `limites_operativos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `limites_operativos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha_desde` date DEFAULT NULL,
  `fecha_hasta` date DEFAULT NULL,
  `jornal_minimo` decimal(18,2) DEFAULT NULL,
  `salario_minimo` decimal(18,2) DEFAULT NULL,
  `max_jornales` decimal(10,2) DEFAULT 5.00,
  `porcentaje_neto` decimal(10,4) DEFAULT 25.0000,
  `max_salarios_credito` decimal(10,2) DEFAULT 25.00,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `limites_operativos` WRITE;
/*!40000 ALTER TABLE `limites_operativos` DISABLE KEYS */;
INSERT INTO `limites_operativos` VALUES (1,'2026-08-17','2099-12-31',111502.00,2899048.00,5.00,25.0000,25.00,1);
/*!40000 ALTER TABLE `limites_operativos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `monedas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `monedas` (
  `id` tinyint(4) NOT NULL,
  `codigo` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nombre` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `simbolo` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `decimales` tinyint(4) NOT NULL DEFAULT 0,
  `orden` tinyint(4) NOT NULL DEFAULT 1,
  `activo` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `codigo` (`codigo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `monedas` WRITE;
/*!40000 ALTER TABLE `monedas` DISABLE KEYS */;
INSERT INTO `monedas` VALUES (1,'PYG','Guaranies','PYG',0,1,1),(2,'USD','Dolares','USD',2,2,1);
/*!40000 ALTER TABLE `monedas` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `operacion_detalles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `operacion_detalles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `operacion_id` int(11) NOT NULL,
  `tipo_documento_id` int(11) NOT NULL,
  `importe` decimal(18,2) NOT NULL,
  `vencimiento` date NOT NULL,
  `banco_id` int(11) DEFAULT NULL,
  `nro_cheque` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cuenta_corriente` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `firmante_id` int(11) DEFAULT NULL,
  `plazo_dias` int(11) NOT NULL,
  `tasa_aplicada` decimal(10,4) NOT NULL,
  `interes` decimal(18,2) DEFAULT 0.00,
  `seguro` decimal(18,2) DEFAULT 0.00,
  `comision` decimal(18,2) DEFAULT 0.00,
  `gasto` decimal(18,2) DEFAULT 0.00,
  `gasto_administrativo` decimal(18,2) DEFAULT 0.00,
  `gasto_operativo` decimal(18,2) DEFAULT 0.00,
  `descuento` decimal(18,2) NOT NULL,
  `neto` decimal(18,2) NOT NULL,
  `cobrado_gastos_cobranza` decimal(18,2) DEFAULT 0.00,
  `cobrado_punitorio` decimal(18,2) DEFAULT 0.00,
  `cobrado_moratorio` decimal(18,2) DEFAULT 0.00,
  `cobrado_gastos_administrativos` decimal(18,2) DEFAULT 0.00,
  `cobrado_gastos_operativos` decimal(18,2) DEFAULT 0.00,
  `cobrado_comision` decimal(18,2) DEFAULT 0.00,
  `cobrado_seguro` decimal(18,2) DEFAULT 0.00,
  `cobrado_interes` decimal(18,2) DEFAULT 0.00,
  `cobrado_capital` decimal(18,2) DEFAULT 0.00,
  `ultima_fecha_cobro` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `operacion_id` (`operacion_id`),
  KEY `tipo_documento_id` (`tipo_documento_id`),
  KEY `banco_id` (`banco_id`),
  KEY `firmante_id` (`firmante_id`),
  CONSTRAINT `operacion_detalles_ibfk_1` FOREIGN KEY (`operacion_id`) REFERENCES `operaciones` (`id`) ON DELETE CASCADE,
  CONSTRAINT `operacion_detalles_ibfk_2` FOREIGN KEY (`tipo_documento_id`) REFERENCES `tipos_documento` (`id`),
  CONSTRAINT `operacion_detalles_ibfk_3` FOREIGN KEY (`banco_id`) REFERENCES `bancos` (`id`),
  CONSTRAINT `operacion_detalles_ibfk_4` FOREIGN KEY (`firmante_id`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `operacion_detalles` WRITE;
/*!40000 ALTER TABLE `operacion_detalles` DISABLE KEYS */;
INSERT INTO `operacion_detalles` VALUES (13,9,1,370000000.00,'2026-01-15',7,'19410676','37-004012935',5,0,60.0000,0.00,0.00,0.00,0.00,0.00,0.00,0.00,370000000.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(14,10,1,9000000.00,'2026-09-17',8,'517053','16-00172580-06',6,30,60.0000,443835.62,0.00,0.00,0.00,0.00,0.00,443835.62,8556164.38,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(15,11,1,9000000.00,'2026-10-19',8,'517054','16-00172580-06',6,62,60.0000,917260.27,0.00,0.00,0.00,0.00,0.00,917260.27,8082739.73,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(16,12,1,6000000.00,'2026-09-13',9,'5532074','4.0.00054179',7,26,60.0000,256438.36,0.00,0.00,0.00,0.00,0.00,256438.36,5743561.64,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(17,13,1,15830000.00,'2026-09-17',10,'13664467','000001432936',3,30,60.0000,780657.53,0.00,0.00,0.00,0.00,0.00,780657.53,15049342.47,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(18,14,1,15000000.00,'2026-09-16',10,'13641245','000001432936',3,29,60.0000,715068.49,0.00,0.00,0.00,0.00,0.00,715068.49,14284931.51,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(19,15,1,16800000.00,'2026-08-28',10,'13664434','000001432936',3,10,60.0000,276164.38,0.00,0.00,0.00,0.00,0.00,276164.38,16523835.62,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(20,16,1,10000000.00,'2026-09-08',7,'26281849','37-007292590',4,21,60.0000,345205.48,0.00,0.00,0.00,0.00,0.00,345205.48,9654794.52,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(21,17,1,6000.00,'2026-12-05',7,'00600472','37-007292600',4,109,60.0000,1075.07,0.00,0.00,0.00,0.00,0.00,1075.07,4924.93,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(22,18,1,115000.00,'2026-11-26',7,'00600466','37-007292600',4,100,60.0000,18904.11,0.00,0.00,0.00,0.00,0.00,18904.11,96095.89,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(23,19,1,6000.00,'2026-10-05',7,'00600470','37-007292600',4,48,60.0000,473.42,0.00,0.00,0.00,0.00,0.00,473.42,5526.58,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(24,20,1,150000.00,'2026-09-15',7,'00603809','37-007292600',4,28,60.0000,6904.11,0.00,0.00,0.00,0.00,0.00,6904.11,143095.89,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL),(25,21,1,31770.00,'2026-09-07',7,'00603799','37-007292600',4,20,60.0000,1044.49,0.00,0.00,0.00,0.00,0.00,1044.49,30725.51,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,NULL);
/*!40000 ALTER TABLE `operacion_detalles` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `operaciones`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `operaciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `cliente_id` int(11) NOT NULL,
  `vendedor_id` int(11) NOT NULL,
  `canal_id` int(11) NOT NULL,
  `garantia_id` int(11) NOT NULL,
  `codeudor_id` int(11) DEFAULT NULL,
  `clase_prestamo_id` int(11) DEFAULT NULL,
  `moneda_id` tinyint(4) NOT NULL DEFAULT 1,
  `origen_capital_id` int(11) DEFAULT NULL,
  `tasa_interes` decimal(10,4) NOT NULL,
  `total_importe` decimal(18,2) DEFAULT 0.00,
  `total_descuento` decimal(18,2) DEFAULT 0.00,
  `total_seguro` decimal(18,2) DEFAULT 0.00,
  `total_comision` decimal(18,2) DEFAULT 0.00,
  `total_gastos` decimal(18,2) DEFAULT 0.00,
  `total_gastos_administrativos` decimal(18,2) DEFAULT 0.00,
  `gastos_operativos` decimal(18,2) DEFAULT 0.00,
  `total_neto` decimal(18,2) DEFAULT 0.00,
  `estado` enum('Borrador','Calculada','Aprobada','Anulada') COLLATE utf8mb4_unicode_ci DEFAULT 'Calculada',
  `observaciones` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `creado_por` int(11) DEFAULT NULL,
  `creado_en` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `cliente_id` (`cliente_id`),
  KEY `vendedor_id` (`vendedor_id`),
  KEY `canal_id` (`canal_id`),
  KEY `garantia_id` (`garantia_id`),
  KEY `codeudor_id` (`codeudor_id`),
  KEY `clase_prestamo_id` (`clase_prestamo_id`),
  CONSTRAINT `operaciones_ibfk_1` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`),
  CONSTRAINT `operaciones_ibfk_2` FOREIGN KEY (`vendedor_id`) REFERENCES `vendedores` (`id`),
  CONSTRAINT `operaciones_ibfk_3` FOREIGN KEY (`canal_id`) REFERENCES `canales_venta` (`id`),
  CONSTRAINT `operaciones_ibfk_4` FOREIGN KEY (`garantia_id`) REFERENCES `garantias` (`id`),
  CONSTRAINT `operaciones_ibfk_5` FOREIGN KEY (`codeudor_id`) REFERENCES `clientes` (`id`),
  CONSTRAINT `operaciones_ibfk_6` FOREIGN KEY (`clase_prestamo_id`) REFERENCES `clases_prestamo` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `operaciones` WRITE;
/*!40000 ALTER TABLE `operaciones` DISABLE KEYS */;
INSERT INTO `operaciones` VALUES (9,'2026-08-18',10,1,1,1,NULL,2,1,1,60.0000,370000000.00,0.00,0.00,0.00,0.00,0.00,0.00,370000000.00,'Calculada','Importado desde TXT · Línea 2',1,'2026-08-19 00:29:22'),(10,'2026-08-18',9,1,1,1,NULL,2,1,1,60.0000,9000000.00,443835.62,0.00,0.00,0.00,0.00,0.00,8556164.38,'Calculada','Importado desde TXT · Línea 3',1,'2026-08-19 00:29:22'),(11,'2026-08-18',9,1,1,1,NULL,2,1,1,60.0000,9000000.00,917260.27,0.00,0.00,0.00,0.00,0.00,8082739.73,'Calculada','Importado desde TXT · Línea 4',1,'2026-08-19 00:29:22'),(12,'2026-08-18',9,1,1,1,NULL,2,1,1,60.0000,6000000.00,256438.36,0.00,0.00,0.00,0.00,0.00,5743561.64,'Calculada','Importado desde TXT · Línea 5',1,'2026-08-19 00:29:22'),(13,'2026-08-18',2,1,1,1,NULL,2,1,1,60.0000,15830000.00,780657.53,0.00,0.00,0.00,0.00,0.00,15049342.47,'Calculada','Importado desde TXT · Línea 6',1,'2026-08-19 00:29:22'),(14,'2026-08-18',2,1,1,1,NULL,2,1,1,60.0000,15000000.00,715068.49,0.00,0.00,0.00,0.00,0.00,14284931.51,'Calculada','Importado desde TXT · Línea 7',1,'2026-08-19 00:29:22'),(15,'2026-08-18',2,1,1,1,NULL,2,1,1,60.0000,16800000.00,276164.38,0.00,0.00,0.00,0.00,0.00,16523835.62,'Calculada','Importado desde TXT · Línea 8',1,'2026-08-19 00:29:22'),(16,'2026-08-18',8,1,1,1,NULL,2,1,1,60.0000,10000000.00,345205.48,0.00,0.00,0.00,0.00,0.00,9654794.52,'Calculada','Importado desde TXT · Línea 9',1,'2026-08-19 00:29:22'),(17,'2026-08-18',8,1,1,1,NULL,2,2,1,60.0000,6000.00,1075.07,0.00,0.00,0.00,0.00,0.00,4924.93,'Calculada','Importado desde TXT · Línea 10',1,'2026-08-19 00:29:22'),(18,'2026-08-18',8,1,1,1,NULL,2,2,1,60.0000,115000.00,18904.11,0.00,0.00,0.00,0.00,0.00,96095.89,'Calculada','Importado desde TXT · Línea 11',1,'2026-08-19 00:29:22'),(19,'2026-08-18',8,1,1,1,NULL,2,2,1,60.0000,6000.00,473.42,0.00,0.00,0.00,0.00,0.00,5526.58,'Calculada','Importado desde TXT · Línea 12',1,'2026-08-19 00:29:22'),(20,'2026-08-18',8,1,1,1,NULL,2,2,1,60.0000,150000.00,6904.11,0.00,0.00,0.00,0.00,0.00,143095.89,'Calculada','Importado desde TXT · Línea 13',1,'2026-08-19 00:29:22'),(21,'2026-08-18',8,1,1,1,NULL,2,2,1,60.0000,31770.00,1044.49,0.00,0.00,0.00,0.00,0.00,30725.51,'Calculada','Importado desde TXT · Línea 14',1,'2026-08-19 00:29:22');
/*!40000 ALTER TABLE `operaciones` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `origenes_capital`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `origenes_capital` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `activo` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `origenes_capital` WRITE;
/*!40000 ALTER TABLE `origenes_capital` DISABLE KEYS */;
INSERT INTO `origenes_capital` VALUES (1,'Propio',1),(2,'Terceros',1);
/*!40000 ALTER TABLE `origenes_capital` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `parametros_empresa`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `parametros_empresa` (
  `id` tinyint(4) NOT NULL DEFAULT 1,
  `nombre` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Grupo de Inversiones S.A.',
  `ruc` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `direccion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ciudad` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pais` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'Paraguay',
  `sitio_web` varchar(180) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `representante_legal` varchar(180) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `observaciones` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `actualizado_en` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `parametros_empresa` WRITE;
/*!40000 ALTER TABLE `parametros_empresa` DISABLE KEYS */;
INSERT INTO `parametros_empresa` VALUES (1,'Grupo de Inversiones S.A.',NULL,NULL,NULL,NULL,NULL,'Paraguay',NULL,NULL,NULL,'2026-08-18 21:29:32');
/*!40000 ALTER TABLE `parametros_empresa` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `parametros_generales`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `parametros_generales` (
  `id` tinyint(4) NOT NULL DEFAULT 1,
  `calcula_gastos_bcp` tinyint(4) NOT NULL DEFAULT 1,
  `salario_minimo` decimal(18,2) NOT NULL DEFAULT 2899048.00,
  `divisor_prestamo` decimal(10,2) NOT NULL DEFAULT 365.00,
  `moneda_guaranies_descripcion` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Guaran├¡es',
  `moneda_guaranies_simbolo` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Gs.',
  `moneda_dolares_descripcion` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'D├│lares',
  `moneda_dolares_simbolo` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'US$',
  `actualizado_en` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `parametros_generales` WRITE;
/*!40000 ALTER TABLE `parametros_generales` DISABLE KEYS */;
INSERT INTO `parametros_generales` VALUES (1,0,2899048.00,365.00,'Guaranies','PYG','Dolares','USD','2026-08-18 22:51:29');
/*!40000 ALTER TABLE `parametros_generales` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `permisos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permisos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `clave` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nombre` varchar(120) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `grupo_menu` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ruta` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `clave` (`clave`)
) ENGINE=InnoDB AUTO_INCREMENT=17162 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `permisos` WRITE;
/*!40000 ALTER TABLE `permisos` DISABLE KEYS */;
INSERT INTO `permisos` VALUES (1,'dashboard','Inicio','Inicio','index.php',1),(2,'clientes','Clientes','Mantenimiento','app.php?p=clientes',1),(3,'vendedores','Vendedores','Mantenimiento','app.php?p=catalogo&t=vendedores',1),(4,'canales','Canales de Venta','Mantenimiento','app.php?p=catalogo&t=canales_venta',1),(5,'tipos_documento','Tipos de Documento','Mantenimiento','app.php?p=catalogo&t=tipos_documento',1),(6,'garantias','Garantías','Mantenimiento','app.php?p=catalogo&t=garantias',1),(7,'tasas_descuento','Tasas Descuento','Parámetros','app.php?p=tasas&t=tasas_descuento',1),(8,'tasas_cuotas','Tasas Préstamo Cuotas','Parámetros','app.php?p=tasas&t=tasas_cuotas',1),(9,'bancos','Bancos','Mantenimiento','app.php?p=catalogo&t=bancos',1),(10,'clases_prestamo','Clases de Préstamo','Mantenimiento','app.php?p=catalogo&t=clases_prestamo',1),(11,'tae_limites','TAE Límite','Parámetros','app.php?p=tae',1),(12,'operaciones','Descuento de Documento','Operaciones','app.php?p=operaciones',1),(13,'usuarios','Usuarios','Seguridad','app.php?p=usuarios',1),(14,'roles','Roles y Permisos','Seguridad','app.php?p=roles',1),(1020,'tasa_seguro','Tasa Seguro','Parámetros','app.php?p=rangos&t=tasa_seguro',1),(1021,'tasa_gastos','Tasa Gastos','Mantenimiento','app.php?p=rangos&t=tasa_gastos',0),(1022,'gastos_administrativos','Tasa Gastos Administrativos','Parámetros','app.php?p=rangos&t=gastos_administrativos',1),(1023,'gastos_cobranza','Tasa Gastos de Cobranza','Parámetros','app.php?p=rangos&t=gastos_cobranza',1),(1024,'limite_operativo','Límite Gastos Operativos BCP','Parámetros','app.php?p=limite_operativo',1),(1026,'informe_clientes','Informe de Clientes','Informes','app.php?p=informe_clientes',1),(1027,'caja','Caja / Cobros','Caja','app.php?p=caja',1),(5626,'inventario_cartera','Inventario de Cartera','Informes','app.php?p=inventario_cartera',1),(9693,'parametros_generales','Parámetros Generales','Parámetros','app.php?p=parametros_generales',1),(9694,'parametros_empresa','Parámetros Empresa','Parámetros','app.php?p=parametros_empresa',1),(9695,'borrado_especial','Eliminar Operación','Mantenimiento','app.php?p=borrado_especial',1),(9699,'cheques_depositar','Lista de Cheques a Depositar','Informes','app.php?p=cheques_depositar',1),(12022,'carga_capital','Carga Capital','Operaciones','app.php?p=carga_capital',1),(12026,'reporte_capitales','Reporte Capitales','Informes','app.php?p=reporte_capitales',1),(12027,'detalle_capitales','Detalle Capitales','Informes','app.php?p=detalle_capitales',1),(12029,'pago_capitales','Pago Capitales','Caja','app.php?p=pago_capitales',1),(13703,'eliminar_capital','Eliminar Capital','Mantenimiento','app.php?p=eliminar_capital',1),(16344,'importar_datos','Importar Datos','Mantenimiento','app.php?p=importar_datos',1);
/*!40000 ALTER TABLE `permisos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `rol_permisos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rol_permisos` (
  `rol_id` int(11) NOT NULL,
  `permiso_id` int(11) NOT NULL,
  PRIMARY KEY (`rol_id`,`permiso_id`),
  KEY `permiso_id` (`permiso_id`),
  CONSTRAINT `rol_permisos_ibfk_1` FOREIGN KEY (`rol_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
  CONSTRAINT `rol_permisos_ibfk_2` FOREIGN KEY (`permiso_id`) REFERENCES `permisos` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `rol_permisos` WRITE;
/*!40000 ALTER TABLE `rol_permisos` DISABLE KEYS */;
INSERT INTO `rol_permisos` VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),(1,14),(1,1020),(1,1021),(1,1022),(1,1023),(1,1024),(1,1026),(1,1027),(1,5626),(1,9693),(1,9694),(1,9695),(1,9699),(1,12022),(1,12026),(1,12027),(1,12029),(1,13703),(1,16344);
/*!40000 ALTER TABLE `rol_permisos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `roles`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `es_admin` tinyint(4) DEFAULT 0,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `roles` WRITE;
/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
INSERT INTO `roles` VALUES (1,'Administrador','Acceso total permanente',1,1);
/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tae_limites`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tae_limites` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha_desde` date NOT NULL,
  `fecha_hasta` date NOT NULL,
  `tae` decimal(10,4) NOT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`),
  CONSTRAINT `CONSTRAINT_1` CHECK (`fecha_hasta` >= `fecha_desde`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tae_limites` WRITE;
/*!40000 ALTER TABLE `tae_limites` DISABLE KEYS */;
/*!40000 ALTER TABLE `tae_limites` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tasa_gastos`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasa_gastos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dias_desde` int(11) DEFAULT NULL,
  `dias_hasta` int(11) DEFAULT NULL,
  `monto_fijo` decimal(18,2) DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tasa_gastos` WRITE;
/*!40000 ALTER TABLE `tasa_gastos` DISABLE KEYS */;
/*!40000 ALTER TABLE `tasa_gastos` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tasa_seguro`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasa_seguro` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monto_desde` decimal(18,2) DEFAULT NULL,
  `monto_hasta` decimal(18,2) DEFAULT NULL,
  `tasa` decimal(10,4) DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tasa_seguro` WRITE;
/*!40000 ALTER TABLE `tasa_seguro` DISABLE KEYS */;
/*!40000 ALTER TABLE `tasa_seguro` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tasas_cuotas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasas_cuotas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monto_desde` decimal(18,2) NOT NULL,
  `monto_hasta` decimal(18,2) NOT NULL,
  `tasa` decimal(10,4) NOT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`),
  CONSTRAINT `CONSTRAINT_1` CHECK (`monto_hasta` >= `monto_desde`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tasas_cuotas` WRITE;
/*!40000 ALTER TABLE `tasas_cuotas` DISABLE KEYS */;
/*!40000 ALTER TABLE `tasas_cuotas` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tasas_descuento`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasas_descuento` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monto_desde` decimal(18,2) NOT NULL,
  `monto_hasta` decimal(18,2) NOT NULL,
  `tasa` decimal(10,4) NOT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`),
  CONSTRAINT `CONSTRAINT_1` CHECK (`monto_hasta` >= `monto_desde`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tasas_descuento` WRITE;
/*!40000 ALTER TABLE `tasas_descuento` DISABLE KEYS */;
INSERT INTO `tasas_descuento` VALUES (1,0.00,999999999999.00,60.0000,1);
/*!40000 ALTER TABLE `tasas_descuento` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `tipos_documento`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tipos_documento` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `descripcion` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `tipos_documento` WRITE;
/*!40000 ALTER TABLE `tipos_documento` DISABLE KEYS */;
INSERT INTO `tipos_documento` VALUES (1,'Cheque',NULL,1),(2,'Pagaré',NULL,1),(3,'Factura',NULL,1);
/*!40000 ALTER TABLE `tipos_documento` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `usuarios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rol_id` int(11) NOT NULL,
  `nombre` varchar(120) COLLATE utf8mb4_unicode_ci NOT NULL,
  `usuario` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `activo` tinyint(4) DEFAULT 1,
  `creado_en` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `usuario` (`usuario`),
  KEY `rol_id` (`rol_id`),
  CONSTRAINT `usuarios_ibfk_1` FOREIGN KEY (`rol_id`) REFERENCES `roles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `usuarios` WRITE;
/*!40000 ALTER TABLE `usuarios` DISABLE KEYS */;
INSERT INTO `usuarios` VALUES (1,1,'Administrador','admin',NULL,'$2y$10$W/52sMWyzK5fWBjeJfX9fOIfaQg7medXNs5XClATclLSsSlv0zoW.',1,'2026-08-17 19:47:01');
/*!40000 ALTER TABLE `usuarios` ENABLE KEYS */;
UNLOCK TABLES;
DROP TABLE IF EXISTS `vendedores`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vendedores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `documento` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tasa_comision` decimal(10,4) DEFAULT 0.0000,
  `activo` tinyint(4) DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

LOCK TABLES `vendedores` WRITE;
/*!40000 ALTER TABLE `vendedores` DISABLE KEYS */;
INSERT INTO `vendedores` VALUES (1,'Hermes Montania','','','',0.0000,1);
/*!40000 ALTER TABLE `vendedores` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

