/*M!999999\- enable the sandbox mode */ 

/*!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 */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `almacen` (
  `id_almacen` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(200) NOT NULL,
  `encargado` varchar(200) NOT NULL,
  PRIMARY KEY (`id_almacen`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `apertura_caja` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha_apertura` date NOT NULL,
  `hora_apertura` datetime NOT NULL,
  `usuario` text NOT NULL,
  `monto_apertura` float(19,2) NOT NULL,
  `balance` float(19,2) NOT NULL,
  `contado` float(19,2) NOT NULL,
  `diferencia` float(19,2) NOT NULL,
  `hora_cierre` text NOT NULL,
  `fecha_cierre` date NOT NULL,
  `caja` text NOT NULL,
  `estado` text NOT NULL,
  `ingreso_venta` float(19,2) NOT NULL,
  `venta_tarjeta` float(19,2) NOT NULL,
  `transferencia` float(19,2) NOT NULL,
  `devoluciones` float(19,2) NOT NULL,
  `pagos_credito` float(19,2) NOT NULL,
  `otros_ingresos` float(19,2) NOT NULL,
  `pagos_proveedores` float(19,2) NOT NULL,
  `usuario_cierre` text NOT NULL,
  `prestamos` float(19,2) NOT NULL,
  `cobros` float(19,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `articulo` (
  `codigo_articulo` varchar(50) NOT NULL,
  `des_articulo` varchar(100) NOT NULL,
  `cant_existen` decimal(12,2) NOT NULL,
  `precio_compra` decimal(12,2) NOT NULL,
  `precio_venta` decimal(12,2) NOT NULL,
  `punto_reorden` int(5) NOT NULL,
  `itbis` decimal(6,2) NOT NULL,
  `id_tipo_articulo` int(5) NOT NULL,
  `porciento_ganancia` float(10,2) NOT NULL,
  `refpro` varchar(100) DEFAULT NULL,
  `registro` int(10) NOT NULL AUTO_INCREMENT,
  `servicio` varchar(20) DEFAULT NULL,
  `ubicacion` varchar(200) DEFAULT NULL,
  `id_interno` varchar(100) DEFAULT NULL,
  `marca` varchar(100) DEFAULT NULL,
  `costo_dolar` float NOT NULL DEFAULT 0,
  `venta_dolar` float NOT NULL DEFAULT 0,
  `costo_peso` float NOT NULL DEFAULT 0,
  `venta_peso` float NOT NULL DEFAULT 0,
  `id_suplidor` int(11) NOT NULL DEFAULT 0,
  `porciento_minimo_venta` float NOT NULL DEFAULT 0,
  `ultima_cantidad` float NOT NULL DEFAULT 0,
  `es_paquete` int(11) NOT NULL DEFAULT 0,
  `codigo_paquete` varchar(100) NOT NULL DEFAULT '0',
  `cant_paquete` float NOT NULL DEFAULT 0,
  PRIMARY KEY (`registro`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cajas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` text NOT NULL,
  `estado` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `catalogo_renta` (
  `idcatalogo_renta` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(45) DEFAULT NULL,
  `precio` float(19,2) DEFAULT NULL,
  `costo` float(19,2) DEFAULT NULL,
  `stock` int(11) DEFAULT NULL,
  PRIMARY KEY (`idcatalogo_renta`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cheques` (
  `id_cheque` int(11) NOT NULL AUTO_INCREMENT,
  `numero_cheque` varchar(12) NOT NULL DEFAULT '..',
  `pagado_a` varchar(75) NOT NULL DEFAULT '..',
  `fecha_emision` date NOT NULL,
  `fecha_limit` date NOT NULL,
  `referencia` varchar(100) NOT NULL DEFAULT '..',
  `monto` double NOT NULL,
  `estado` varchar(25) NOT NULL DEFAULT '..',
  `cuenta` varchar(65) NOT NULL DEFAULT '..',
  `usuario` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id_cheque`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `choferes` (
  `id_chofer` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` text NOT NULL,
  `cedula` text NOT NULL,
  `telefono` text NOT NULL,
  `direccion` text NOT NULL,
  `tipo` text NOT NULL,
  PRIMARY KEY (`id_chofer`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cierres` (
  `id_cierre` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` text NOT NULL,
  `datos` text NOT NULL,
  `usuario` text NOT NULL,
  `caja` text NOT NULL,
  PRIMARY KEY (`id_cierre`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `clientes` (
  `id_cliente` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(100) NOT NULL DEFAULT '[..]',
  `balance` double NOT NULL DEFAULT 0,
  `alow_vencidas` int(11) NOT NULL DEFAULT 0,
  `ultimo_pago` date DEFAULT NULL,
  `telefono` varchar(20) NOT NULL DEFAULT '..',
  `direccion` varchar(150) NOT NULL DEFAULT '[..]',
  `cedula` varchar(45) NOT NULL DEFAULT '..',
  `clave` varchar(45) NOT NULL DEFAULT '..',
  `max_credito` double NOT NULL DEFAULT 0,
  `max_dias` int(11) NOT NULL DEFAULT 0,
  `precio` int(2) NOT NULL DEFAULT 1,
  `enviado` int(11) NOT NULL,
  `termino_venta` varchar(25) DEFAULT NULL,
  `termino` varchar(25) NOT NULL,
  `tipo_ncf` varchar(35) NOT NULL,
  `garante` text NOT NULL,
  `apodo` text NOT NULL,
  `telefono_garante` text NOT NULL,
  `direccion_garante` text NOT NULL,
  `cedula_garante` text NOT NULL,
  PRIMARY KEY (`id_cliente`)
) ENGINE=MyISAM AUTO_INCREMENT=798 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cobros` (
  `id_cobro` int(11) NOT NULL AUTO_INCREMENT,
  `capital` float(19,2) NOT NULL,
  `interes` float(19,2) NOT NULL,
  `mora` float(19,2) NOT NULL,
  `cargo` float(19,2) NOT NULL,
  `total` float(19,2) NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `cliente` text NOT NULL,
  `id_prestamo` int(11) NOT NULL,
  `usuario` text NOT NULL,
  `fecha` date NOT NULL,
  `hora` text NOT NULL,
  `estado` text NOT NULL,
  `cuota` int(11) NOT NULL,
  `id_cuota` int(11) NOT NULL,
  `ruta` text NOT NULL,
  `tipo` text NOT NULL,
  `cartera` text NOT NULL,
  `cuenta` text NOT NULL,
  `ncf` varchar(100) NOT NULL,
  `tipo_ncf` varchar(35) NOT NULL,
  `impuestos` float(19,2) NOT NULL,
  `estado_caja` text NOT NULL,
  PRIMARY KEY (`id_cobro`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cobros_renta` (
  `idcobros_renta` int(11) NOT NULL AUTO_INCREMENT,
  `idrenta` int(11) DEFAULT NULL,
  `cliente` text DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `monto` float(19,2) NOT NULL,
  `hora` datetime DEFAULT NULL,
  PRIMARY KEY (`idcobros_renta`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `compra_factoria` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `folio` text NOT NULL,
  `variedad` text NOT NULL,
  `sacos` float(19,2) NOT NULL,
  `tara` float(19,2) NOT NULL,
  `fanega` float(19,2) NOT NULL,
  `per_descuento` float(19,2) NOT NULL,
  `descuento_saco` float(19,2) NOT NULL,
  `neto` float(19,2) NOT NULL,
  `precio` float(19,2) NOT NULL,
  `produccion` float(19,2) NOT NULL,
  `fecha_entrega` date NOT NULL,
  `hora` datetime NOT NULL,
  `usuario` text NOT NULL,
  `sacos_devueltos` float(19,2) NOT NULL,
  `chofer` text NOT NULL,
  `tipo_chofer` text NOT NULL,
  `pago_flete` text NOT NULL,
  `productor` text NOT NULL,
  `nota` text NOT NULL,
  `ncf` text NOT NULL,
  `balance` float(19,2) NOT NULL,
  `pagado` float NOT NULL,
  `fecha_pago` date NOT NULL,
  `estado` text NOT NULL,
  `placa` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `compras` (
  `id_venta` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` datetime NOT NULL,
  `proveedor` text NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` float(19,2) NOT NULL,
  `impuesto` float(19,2) NOT NULL,
  `impuesto_16` float(19,2) NOT NULL,
  `impuesto_13` float(19,2) NOT NULL,
  `impuesto_10` float(19,2) NOT NULL,
  `impuesto_exento` float NOT NULL,
  `descuento` float(19,2) NOT NULL,
  `total` float(19,2) NOT NULL,
  `pagado` float(19,2) NOT NULL,
  `balance` float(19,2) NOT NULL,
  `usuario` text NOT NULL,
  `folio` text NOT NULL,
  `termino` text NOT NULL,
  `pago_con` float(19,2) NOT NULL,
  `devuelta` float(19,2) NOT NULL,
  `ncf` text NOT NULL,
  `tipo_ncf` text NOT NULL,
  `nota` text NOT NULL,
  `fecha_pago` date NOT NULL,
  `estado` text NOT NULL,
  `recibida` int(11) NOT NULL,
  PRIMARY KEY (`id_venta`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cuadres` (
  `usuario` text NOT NULL,
  `monto_inicio` float NOT NULL,
  `fecha_inicio` date NOT NULL,
  `hora_inicio` text NOT NULL,
  `ventas` int(11) NOT NULL,
  `total_ventas` float(19,2) NOT NULL,
  `total_ventas_efectivo` float(19,2) NOT NULL,
  `total_ventas_tarjeta` float(19,2) NOT NULL,
  `total_ventas_credito` float(19,2) NOT NULL,
  `balance_efectivo` float(19,2) NOT NULL,
  `fecha_cierre` date NOT NULL,
  `hora_cierre` text NOT NULL,
  `usuario_cierre` text NOT NULL,
  `estado` text NOT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `conteo` float(19,2) NOT NULL,
  `diferencia` float(19,2) NOT NULL,
  `id2` int(11) DEFAULT NULL,
  `anulaciones` float(19,2) NOT NULL,
  `pago` float(19,2) NOT NULL,
  `balance_ventas_pendiente` float(19,2) NOT NULL,
  `total_ventas_transferencia` float NOT NULL,
  `ingresos` float(19,2) NOT NULL,
  `egresos` float(19,2) NOT NULL,
  `desglose_apertura` text DEFAULT NULL,
  `desglose_cierre` text DEFAULT NULL,
  `devoluciones` double DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cuentas` (
  `id_cuenta` int(11) NOT NULL AUTO_INCREMENT,
  `numero_cuenta` text NOT NULL,
  `descripcion` text NOT NULL,
  `total_ingreso` float(19,2) NOT NULL,
  `total_egreso` float(19,2) NOT NULL,
  `balance` float(19,2) NOT NULL,
  PRIMARY KEY (`id_cuenta`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cuentas_corrientes` (
  `id_cuenta` int(11) NOT NULL AUTO_INCREMENT,
  `numero_cuenta` varchar(55) NOT NULL,
  `banco` varchar(55) NOT NULL,
  `concepto` varchar(55) NOT NULL,
  `siguiente_cheque` int(11) NOT NULL,
  `saldo` double NOT NULL,
  `fecha_apertura` date NOT NULL,
  `saldo_inicial` double DEFAULT NULL,
  PRIMARY KEY (`id_cuenta`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `cuotas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `numero` int(11) NOT NULL,
  `capital` float(19,2) NOT NULL,
  `interes` float(19,2) NOT NULL,
  `balance_capital` float(19,2) NOT NULL,
  `balance_interes` float(19,2) NOT NULL,
  `mora` double NOT NULL,
  `fultimo_pago` date NOT NULL,
  `multimo_pago` float(19,2) NOT NULL,
  `pagado` float(19,2) NOT NULL,
  `balance` double NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `id_prestamo` int(11) NOT NULL,
  `vence` date NOT NULL,
  `total` float(19,2) NOT NULL,
  `cliente` text NOT NULL,
  `ruta` text NOT NULL,
  `cobrador` text NOT NULL,
  `cartera` text NOT NULL,
  `usuario` text NOT NULL,
  `descuento` float NOT NULL,
  `telefono` text NOT NULL,
  `dias_atraso` int(11) DEFAULT NULL,
  `id_venta` int(11) NOT NULL,
  `alow_mora` varchar(1) NOT NULL,
  `balance2` double NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `depo_reti` (
  `id_transaccion` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `tipo` varchar(45) NOT NULL,
  `referencia` varchar(65) NOT NULL,
  `monto` double NOT NULL,
  `id_cuenta` int(12) NOT NULL,
  `por_quien` varchar(65) NOT NULL,
  PRIMARY KEY (`id_transaccion`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `detalle_compra` (
  `id_detalle` int(11) NOT NULL AUTO_INCREMENT,
  `folio` text NOT NULL,
  `codigo` text NOT NULL,
  `descripcion` text NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` double(19,2) NOT NULL,
  `precio2` double NOT NULL,
  `precio3` double NOT NULL,
  `precio4` double NOT NULL,
  `total_costo` float(19,2) NOT NULL,
  `total_precio` float(19,2) NOT NULL,
  `importe` float(19,2) NOT NULL,
  `usuario` text DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `cantidad` float(19,2) DEFAULT NULL,
  `tipo_impuesto` float(19,2) NOT NULL,
  `valor_impuesto` float(19,2) NOT NULL,
  `total_impuesto` float(19,2) NOT NULL,
  `devuelto` int(11) NOT NULL,
  `proveedor` text NOT NULL,
  `unidad` text NOT NULL,
  `variedad` text NOT NULL,
  `razon_social` text NOT NULL,
  `recibida` int(11) NOT NULL,
  `codigo2` text NOT NULL,
  `color` text NOT NULL,
  PRIMARY KEY (`id_detalle`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `detalle_compra_factoria` (
  `id_detalle` int(11) NOT NULL AUTO_INCREMENT,
  `folio` text NOT NULL,
  `codigo` text NOT NULL,
  `descripcion` text NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` double(19,2) NOT NULL,
  `total_costo` float(19,2) NOT NULL,
  `total_precio` float(19,2) NOT NULL,
  `importe` float(19,2) NOT NULL,
  `usuario` text DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `cantidad` float(19,2) DEFAULT NULL,
  `tipo_impuesto` float(19,2) NOT NULL,
  `valor_impuesto` float(19,2) NOT NULL,
  `total_impuesto` float(19,2) NOT NULL,
  `devuelto` int(11) NOT NULL,
  PRIMARY KEY (`id_detalle`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `detalle_consumo_taller` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` varchar(100) NOT NULL,
  `descripcion` text NOT NULL,
  `costo` double NOT NULL,
  `precio` double NOT NULL,
  `total_precio` double NOT NULL,
  `total_costo` double NOT NULL,
  `id_taller` int(11) NOT NULL,
  `cantidad` double NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `detalle_costo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` text NOT NULL,
  `costo` double NOT NULL,
  `cantidad` double NOT NULL,
  `total` double NOT NULL,
  `concepto` text NOT NULL,
  `nota` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `detalle_pendiente` (
  `caja` text NOT NULL,
  `id_detalle` int(11) DEFAULT NULL,
  `folio` text NOT NULL,
  `codigo` text NOT NULL,
  `descripcion` text NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` double(19,2) NOT NULL,
  `total_costo` float(19,2) NOT NULL,
  `total_precio` float(19,2) NOT NULL,
  `importe` float(19,2) NOT NULL,
  `usuario` text DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `cantidad` float(19,2) DEFAULT NULL,
  `tipo_impuesto` float(19,2) NOT NULL,
  `valor_impuesto` float(19,2) NOT NULL,
  `total_impuesto` float(19,2) NOT NULL,
  `devuelto` int(11) NOT NULL,
  `id_venta` int(11) NOT NULL,
  `precio2` double(19,2) NOT NULL,
  `anulado` int(11) NOT NULL,
  `nombre` text NOT NULL,
  `secuencia` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `detalle_renta` (
  `iddetalle_renta` int(11) NOT NULL AUTO_INCREMENT,
  `cliente` text NOT NULL,
  `producto` text DEFAULT NULL,
  `cantidad` int(11) DEFAULT NULL,
  `precio` float(19,2) DEFAULT NULL,
  PRIMARY KEY (`iddetalle_renta`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `detalle_venta` (
  `caja` varchar(200) NOT NULL,
  `id_detalle` int(11) NOT NULL AUTO_INCREMENT,
  `folio` varchar(200) NOT NULL,
  `codigo` varchar(200) NOT NULL,
  `descripcion` varchar(200) NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` double(19,2) NOT NULL,
  `total_costo` float(19,2) NOT NULL,
  `total_precio` float(19,2) NOT NULL,
  `importe` float(19,2) NOT NULL,
  `usuario` text DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `cantidad` float(19,2) DEFAULT NULL,
  `tipo_impuesto` float(19,2) NOT NULL,
  `valor_impuesto` float(19,2) NOT NULL,
  `total_impuesto` float(19,2) NOT NULL,
  `devuelto` int(11) NOT NULL,
  `id_venta` int(11) NOT NULL,
  `precio2` double(19,2) NOT NULL,
  `anulado` int(11) NOT NULL,
  `nombre` varchar(200) NOT NULL,
  `secuencia` varchar(200) NOT NULL,
  `estado` varchar(25) NOT NULL,
  `nota` text NOT NULL,
  `imei` text NOT NULL,
  `pedido` int(11) NOT NULL,
  `unidad` text NOT NULL,
  `medida` float(19,2) NOT NULL,
  `razon_social` text NOT NULL,
  `termino` text DEFAULT NULL,
  `variedad` text NOT NULL DEFAULT '',
  `codigo2` text NOT NULL DEFAULT '',
  PRIMARY KEY (`id_detalle`),
  KEY `index_folio` (`folio`),
  KEY `index_fecha` (`fecha`),
  KEY `index_codigo` (`codigo`)
) ENGINE=InnoDB AUTO_INCREMENT=266722 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `devoluciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` text NOT NULL,
  `folio` text NOT NULL,
  `codigo` text NOT NULL,
  `descripcion` text NOT NULL,
  `cantidad` float(19,2) NOT NULL,
  `importe` float(19,2) NOT NULL,
  `usuario` text NOT NULL,
  `nota` text NOT NULL,
  `cliente` text NOT NULL,
  `secuencia` text NOT NULL,
  `impuestos` float(19,2) NOT NULL,
  `costo` float(19,2) NOT NULL,
  `estado_caja` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=196 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `egresos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` datetime NOT NULL,
  `monto` float(19,2) NOT NULL,
  `cliente` text NOT NULL,
  `tipo` text NOT NULL,
  `concepto` text NOT NULL,
  `usuario` text NOT NULL,
  `secuencia` text NOT NULL,
  `chofer` text NOT NULL,
  `efectivo` float(19,2) NOT NULL,
  `cheque` float(19,2) NOT NULL,
  `numero_cheque` text NOT NULL,
  `tarjeta` float(19,2) NOT NULL,
  `folio_egreso` text NOT NULL,
  `proveedor` text NOT NULL,
  `pagado_a` text NOT NULL,
  `estado_caja` text NOT NULL,
  `ingresos` double(19,2) NOT NULL,
  `transferencia` double(19,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `empleados` (
  `id_empleado` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` text NOT NULL,
  `cedula` text NOT NULL,
  `telefono` text NOT NULL,
  `direccion` text NOT NULL,
  `cargo` text NOT NULL,
  `salario` text NOT NULL,
  PRIMARY KEY (`id_empleado`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `empresa` (
  `id` int(11) NOT NULL,
  `nombre` text NOT NULL,
  `telefono` text NOT NULL,
  `direccion` text NOT NULL,
  `rnc` text NOT NULL,
  `email` text NOT NULL,
  `logo` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `enlace_cuentas` (
  `ventas` text NOT NULL,
  `compras` text NOT NULL,
  `pagos_clientes` text NOT NULL,
  `pagos_proveedores` text NOT NULL,
  `otros_ingresos` text NOT NULL,
  `otros_egresos` text NOT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `factura` (
  `num_factura` varchar(20) NOT NULL,
  `itbis` float(10,2) NOT NULL,
  `sub_total` float(10,2) NOT NULL,
  `total_factura` float(10,2) NOT NULL,
  `fecha_factura` datetime NOT NULL,
  `forma_pago` varchar(25) NOT NULL,
  `descuento` float(10,2) NOT NULL,
  `tipo_factura` varchar(30) NOT NULL,
  `id_empleado` int(5) NOT NULL,
  `costo_factura` float(10,2) NOT NULL,
  `id_cliente` varchar(30) NOT NULL,
  `balance` float(10,2) NOT NULL,
  `nom_cliente` varchar(100) NOT NULL,
  `rnc` varchar(20) NOT NULL,
  `ncf` varchar(100) NOT NULL,
  `id_tipo_ncf` varchar(20) DEFAULT NULL,
  `registro` int(15) NOT NULL AUTO_INCREMENT,
  `fecha_pago` date NOT NULL,
  `id_vendedor` varchar(20) NOT NULL DEFAULT '0',
  `nota` varchar(200) NOT NULL DEFAULT 'N/A',
  `tel_cliente` varchar(50) DEFAULT NULL,
  `id_tipo_moneda` varchar(20) DEFAULT '0',
  `factura_orden` int(5) NOT NULL DEFAULT 0,
  `estatus_comision` varchar(30) NOT NULL DEFAULT 'SIN CERRAR',
  PRIMARY KEY (`registro`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `folio_ventas` (
  `id_folio` int(11) NOT NULL AUTO_INCREMENT,
  `id_venta` int(11) NOT NULL,
  PRIMARY KEY (`id_folio`)
) ENGINE=InnoDB AUTO_INCREMENT=134547 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `historico_cuadres` (
  `usuario` text NOT NULL,
  `monto_inicio` float NOT NULL,
  `fecha_inicio` date NOT NULL,
  `hora_inicio` text NOT NULL,
  `ventas` int(11) NOT NULL,
  `total_ventas` float(19,2) NOT NULL,
  `total_ventas_efectivo` float(19,2) NOT NULL,
  `total_ventas_tarjeta` float(19,2) NOT NULL,
  `total_ventas_credito` float(19,2) NOT NULL,
  `balance_efectivo` float(19,2) NOT NULL,
  `fecha_cierre` date NOT NULL,
  `hora_cierre` text NOT NULL,
  `usuario_cierre` text NOT NULL,
  `estado` text NOT NULL,
  `id` int(11) NOT NULL,
  `conteo` float(19,2) NOT NULL,
  `diferencia` float(19,2) NOT NULL,
  `id2` int(11) NOT NULL AUTO_INCREMENT,
  `anulaciones` float(19,2) NOT NULL,
  `pago` float(19,2) NOT NULL,
  `balance_ventas_pendiente` float NOT NULL,
  `total_ventas_transferencia` float NOT NULL,
  `ingresos` float(19,2) NOT NULL,
  `egresos` float(19,2) NOT NULL,
  `desglose_apertura` text DEFAULT NULL,
  `desglose_cierre` text DEFAULT NULL,
  `devoluciones` double DEFAULT NULL,
  PRIMARY KEY (`id2`)
) ENGINE=InnoDB AUTO_INCREMENT=787 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `imei` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` text NOT NULL,
  `imei` text NOT NULL,
  `vendido` int(11) NOT NULL,
  `fecha_recibido` date NOT NULL,
  `fecha_vendido` date NOT NULL,
  `factura` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `impuestos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` text NOT NULL,
  `valor` float(19,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ingresos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` text NOT NULL,
  `monto` float(19,2) NOT NULL,
  `cliente` text NOT NULL,
  `tipo` text NOT NULL,
  `concepto` text NOT NULL,
  `usuario` text NOT NULL,
  `secuencia` text NOT NULL,
  `efectivo` float(19,2) NOT NULL,
  `tarjeta` float(19,2) NOT NULL,
  `cheque` float(19,2) NOT NULL,
  `numero_cheque` text NOT NULL,
  `folio_ingreso` text NOT NULL,
  `ref_tarjeta` text NOT NULL,
  `estado_caja` text NOT NULL,
  `transferencia` double(19,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3168 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `inventario` (
  `id_inventario` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` varchar(200) NOT NULL,
  `descripcion` varchar(200) NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` float(19,2) NOT NULL,
  `impuesto` float(19,2) NOT NULL,
  `almacen` varchar(200) NOT NULL,
  `cantidad` float(19,2) NOT NULL,
  `pxp` int(11) NOT NULL,
  `tipo_impuestos` float(19,2) NOT NULL,
  `valor_impuestos` float(19,2) NOT NULL,
  `precio2` double(19,2) NOT NULL,
  `relacion_detalle` varchar(25) NOT NULL,
  `tipo` text NOT NULL,
  `precio3` float(19,2) NOT NULL,
  `precio4` float(19,2) NOT NULL,
  `size` text NOT NULL,
  `foto` text NOT NULL,
  PRIMARY KEY (`id_inventario`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cod` varchar(25) DEFAULT '..',
  `des` varchar(200) DEFAULT '..',
  `costo` decimal(19,2) DEFAULT 0.00,
  `precio` decimal(19,2) DEFAULT 0.00,
  `precio2` decimal(19,2) DEFAULT 0.00,
  `precio3` decimal(19,2) DEFAULT 0.00,
  `stock` decimal(19,2) DEFAULT 0.00,
  `les_stoc` int(1) DEFAULT 0,
  `ult_ven` date DEFAULT NULL,
  `cant_min` double DEFAULT 0,
  `cant_vendidas` double DEFAULT 0,
  `id_prov` varchar(25) DEFAULT '[..]',
  `itebis` double DEFAULT 0,
  `valorItebis` double DEFAULT 0,
  `procesado` int(11) DEFAULT 0,
  `medida` varchar(15) DEFAULT '..',
  `categoria` varchar(35) DEFAULT '..',
  `tipo_paq` int(11) DEFAULT 0,
  `referencia` varchar(55) DEFAULT '...',
  `tipo` varchar(25) DEFAULT '..',
  `auto_impuesto` int(11) DEFAULT 0,
  `impuesto` double DEFAULT 0,
  `propina` double DEFAULT 0,
  `t_impuesto` double DEFAULT 0,
  `t_propina` double DEFAULT 0,
  `precio4` double DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kardex` (
  `id_kardex` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` text NOT NULL,
  `descripcion` text NOT NULL,
  `fecha` date NOT NULL,
  `tipo` text NOT NULL,
  `cantidad` float(19,2) NOT NULL,
  `concepto` text NOT NULL,
  `hora` text NOT NULL,
  `almacen` text NOT NULL,
  `usuario` text NOT NULL,
  `razon_social` text NOT NULL,
  `costo` double NOT NULL,
  `precio` double NOT NULL,
  PRIMARY KEY (`id_kardex`)
) ENGINE=InnoDB AUTO_INCREMENT=260565 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `login` (
  `id_usuario` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` text NOT NULL,
  `clave` text NOT NULL,
  `nivel` text NOT NULL,
  `estado_caja` text NOT NULL,
  PRIMARY KEY (`id_usuario`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `movimientos_cuenta` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cuenta` text NOT NULL,
  `fecha` date NOT NULL,
  `hora` datetime NOT NULL,
  `concepto` text NOT NULL,
  `monto` float(19,2) NOT NULL,
  `balance` float(19,2) NOT NULL,
  `usuario` text NOT NULL,
  `tipo` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ncf` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tipo` text NOT NULL,
  `prefijo` text NOT NULL,
  `secuencia` int(11) NOT NULL,
  `hasta` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `oferta` (
  `codigo` varchar(25) DEFAULT NULL,
  `descripcion` varchar(200) DEFAULT NULL,
  `precio_oferta` double NOT NULL DEFAULT 0,
  `desde` date DEFAULT NULL,
  `hasta` date DEFAULT NULL,
  `fecha_registro` date DEFAULT NULL,
  `estado` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pagos_compra` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monto` float NOT NULL,
  `id_compra` int(11) NOT NULL,
  `folio` text NOT NULL,
  `proveedor` text NOT NULL,
  `secuencia` text NOT NULL,
  `usuario` text NOT NULL,
  `fecha` date NOT NULL,
  `hora` datetime NOT NULL,
  `efectivo` float NOT NULL,
  `tarjeta` float NOT NULL,
  `cheque` float NOT NULL,
  `numero_cheque` text NOT NULL,
  `folio_egreso` text NOT NULL,
  `estado_caja` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pagos_credito` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `monto` float NOT NULL,
  `id_factura` int(11) NOT NULL,
  `folio` text NOT NULL,
  `cliente` text NOT NULL,
  `secuencia` text NOT NULL,
  `usuario` text NOT NULL,
  `fecha` date NOT NULL,
  `hora` text NOT NULL,
  `efectivo` float NOT NULL,
  `tarjeta` float NOT NULL,
  `cheque` float NOT NULL,
  `numero_cheque` text NOT NULL,
  `folio_ingreso` text NOT NULL,
  `ref_tarjeta` text NOT NULL,
  `estado_caja` text NOT NULL,
  `transferencia` double(19,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12418 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `pagos_producciones` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `efectivo` float(19,2) NOT NULL,
  `cheque` float(19,2) NOT NULL,
  `tarjeta` float(19,2) NOT NULL,
  `monto` float(19,2) NOT NULL,
  `fecha` date NOT NULL,
  `hora` datetime NOT NULL,
  `numero_cheque` text NOT NULL,
  `usuario` text NOT NULL,
  `productor` text NOT NULL,
  `id_compra` int(11) NOT NULL,
  `folio` text NOT NULL,
  `secuencia` text NOT NULL,
  `folio_egreso` text NOT NULL,
  `estado_caja` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `parametros` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `folio_ventas` int(11) NOT NULL,
  `folio_compra` int(11) NOT NULL,
  `folio_compra_factoria` int(11) NOT NULL,
  `folio_ingreso` int(11) NOT NULL,
  `folio_egreso` int(11) NOT NULL,
  `mostrar_menu_pos` int(11) NOT NULL,
  `default_menu_pos` text NOT NULL,
  `impuestos_no_incluido` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `persona` (
  `idper` varchar(100) NOT NULL,
  `nomper` varchar(50) NOT NULL,
  `apeper` varchar(50) NOT NULL,
  `cedula` varchar(100) NOT NULL,
  `sexo` varchar(10) NOT NULL,
  `fecha_naci` date NOT NULL,
  `nacionalidad` varchar(15) NOT NULL,
  `estatuscivil` varchar(11) NOT NULL,
  `fecha_ingreso` date NOT NULL,
  `ocupacion` varchar(100) NOT NULL,
  `idusuario` int(5) NOT NULL,
  `apodo` varchar(50) NOT NULL,
  `celular` varchar(20) NOT NULL,
  `tel_residencial` varchar(20) NOT NULL,
  `sector` varchar(50) NOT NULL,
  `calle` varchar(50) NOT NULL,
  `pais` varchar(50) NOT NULL,
  `rnc` varchar(20) NOT NULL,
  `lugar_trabajo` varchar(100) NOT NULL,
  `balance` float(12,2) NOT NULL,
  `limite_credito` float(12,2) NOT NULL,
  `ciudad` varchar(100) DEFAULT NULL,
  `nombre_representante` varchar(200) DEFAULT NULL,
  `tel_representante` varchar(100) DEFAULT NULL,
  `correo_representante` varchar(100) DEFAULT NULL,
  `direccion_representante` varchar(250) DEFAULT NULL,
  `cedula_representante` varchar(100) DEFAULT NULL,
  `id_vendedor` varchar(50) NOT NULL DEFAULT '0',
  `id_ruta` varchar(100) NOT NULL DEFAULT 'NA',
  PRIMARY KEY (`idper`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `prestamos` (
  `id_solicitud` int(11) NOT NULL,
  `fecha_prestamo` date NOT NULL,
  `monto_prestado` float(19,2) NOT NULL,
  `monto_desembolsado` float(19,2) NOT NULL,
  `balance` float(19,2) NOT NULL,
  `c_cuotas` int(11) NOT NULL,
  `tasa` float(19,2) NOT NULL,
  `tipo` text NOT NULL,
  `usuario` text NOT NULL,
  `estado_prestamo` text NOT NULL,
  `condicion_prestamo` text NOT NULL,
  `total` float(19,2) NOT NULL,
  `balance_capital` float(19,2) NOT NULL,
  `balance_interes` float(19,2) NOT NULL,
  `monto_cuota` float(19,2) NOT NULL,
  `capital_pagado` float(19,2) NOT NULL,
  `interes_pagado` float(19,2) NOT NULL,
  `mora_pagada` float(19,2) NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `id_prestamo` int(11) NOT NULL AUTO_INCREMENT,
  `cantidad_aprobada` float(19,2) NOT NULL,
  `cartera` text NOT NULL,
  `cliente` text NOT NULL,
  `ruta` text NOT NULL,
  `cobrador` text NOT NULL,
  `creado_por` text NOT NULL,
  `hora` text NOT NULL,
  `cuenta` text NOT NULL,
  `estado_caja` text NOT NULL,
  `id_venta` text NOT NULL,
  `referido` text NOT NULL DEFAULT '',
  `comision_referido` double NOT NULL DEFAULT 0,
  PRIMARY KEY (`id_prestamo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `productos` (
  `id_producto` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` text NOT NULL,
  `codigo` text NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` float(19,2) NOT NULL,
  `proveedor` text NOT NULL,
  `stock` float(19,2) NOT NULL,
  `pxp` int(11) NOT NULL,
  `usuario` text DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `tipo_impuestos` varchar(25) NOT NULL,
  `valor_impuestos` float(19,2) NOT NULL,
  `variedad` text NOT NULL,
  `unidad` text NOT NULL,
  `medida` float(19,2) NOT NULL,
  `relacion_detalle` varchar(25) NOT NULL,
  `precio2` float(19,2) NOT NULL,
  `tipo_producto` text NOT NULL,
  `precio3` float(19,2) NOT NULL,
  `precio4` float(19,2) NOT NULL,
  `cantidad_minima` float(19,0) NOT NULL,
  `ubicacion` text NOT NULL,
  `referencia` text NOT NULL,
  `size` text NOT NULL,
  `foto` text NOT NULL,
  `telefono` int(11) NOT NULL,
  `imei` text NOT NULL,
  `codigo2` text NOT NULL,
  `vendido` int(11) NOT NULL DEFAULT 0,
  `oferta` int(11) NOT NULL,
  `oferta_desde` date NOT NULL,
  `oferta_hasta` date NOT NULL,
  `precio_oferta` double NOT NULL,
  `marca` text NOT NULL,
  `color` text NOT NULL,
  PRIMARY KEY (`id_producto`),
  KEY `index_codigo` (`codigo`(1024)),
  KEY `index_descripcion` (`descripcion`(1024))
) ENGINE=InnoDB AUTO_INCREMENT=8986 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `proveedores` (
  `id_proveedor` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` text NOT NULL,
  `cedula` text NOT NULL,
  `telefono` text NOT NULL,
  `direccion` text NOT NULL,
  `tipo` text NOT NULL,
  PRIMARY KEY (`id_proveedor`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `recetas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` varchar(25) NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `tipo_lentes` varchar(100) NOT NULL,
  `observaciones` text NOT NULL,
  `color` varchar(25) NOT NULL,
  `esfera` varchar(25) NOT NULL,
  `cilindro` varchar(25) NOT NULL,
  `eje` varchar(25) NOT NULL,
  `add1` varchar(25) NOT NULL,
  `alt` varchar(25) NOT NULL,
  `edad` int(11) NOT NULL,
  `esfera2` varchar(25) NOT NULL,
  `cilindro2` varchar(25) NOT NULL,
  `eje2` varchar(25) NOT NULL,
  `add2` varchar(25) NOT NULL,
  `dp` varchar(25) NOT NULL,
  `cliente` varchar(150) NOT NULL,
  `telefono` text NOT NULL,
  `usuario` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `recibos` (
  `id_recibo` int(11) NOT NULL AUTO_INCREMENT,
  `datos` text NOT NULL,
  `cliente` text NOT NULL,
  `usuario` text NOT NULL,
  `monto` float(19,2) NOT NULL,
  `fecha` date NOT NULL,
  PRIMARY KEY (`id_recibo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `rentas` (
  `idrentas` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `id_cliente` int(11) NOT NULL,
  `cliente` text NOT NULL,
  `monto` float(19,2) NOT NULL,
  `pagado` float(19,2) NOT NULL,
  `balance` float(19,2) NOT NULL,
  `vence` date NOT NULL,
  `estado` varchar(45) NOT NULL,
  PRIMARY KEY (`idrentas`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `stock_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` text NOT NULL,
  `datos` mediumtext NOT NULL,
  `items` text NOT NULL,
  `costo` double NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `taller` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cliente` text NOT NULL,
  `telefono` text NOT NULL,
  `fecha` date NOT NULL,
  `hora` text NOT NULL,
  `servicio` text NOT NULL,
  `costo` float(19,2) NOT NULL,
  `consumo` float(19,2) NOT NULL,
  `serviciotecnico` float(19,2) NOT NULL,
  `total` float(19,2) NOT NULL,
  `totaltienda` float(19,2) NOT NULL,
  `totaltecnico` float(19,2) NOT NULL,
  `estado` text NOT NULL,
  `pagado` float(19,2) NOT NULL,
  `descripcion` text NOT NULL,
  `balance` double NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `transferencias_almacen` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` datetime NOT NULL,
  `mercancia` text NOT NULL,
  `desde` text NOT NULL,
  `hasta` text NOT NULL,
  `cantidad` float(19,2) NOT NULL,
  `usuario` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `variedad_productos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `variedad` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_german2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `vencimiento` (
  `lote` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` text NOT NULL,
  `descripcion` text NOT NULL,
  `cantidad` float(19,2) NOT NULL,
  `fecha` date NOT NULL,
  `suplidor` text NOT NULL,
  `estatus` text NOT NULL,
  PRIMARY KEY (`lote`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `ventas` (
  `id_venta` int(11) NOT NULL AUTO_INCREMENT,
  `fecha` date NOT NULL,
  `hora` varchar(200) NOT NULL,
  `cliente` varchar(200) NOT NULL,
  `costo` float(19,2) NOT NULL,
  `precio` float(19,2) NOT NULL,
  `impuesto` float(19,2) NOT NULL,
  `impuesto_10` float(19,2) NOT NULL,
  `impuesto_13` float(19,2) NOT NULL,
  `impuesto_16` float(19,2) NOT NULL,
  `impuesto_exento` float(19,2) NOT NULL,
  `descuento` float(19,2) NOT NULL,
  `total` float(19,2) NOT NULL,
  `pagado` float(19,2) NOT NULL,
  `balance` float(19,2) NOT NULL,
  `usuario` varchar(200) NOT NULL,
  `folio` varchar(200) NOT NULL,
  `termino` varchar(200) NOT NULL,
  `pago_con` float(19,2) NOT NULL,
  `devuelta` float(19,2) NOT NULL,
  `ncf` varchar(200) NOT NULL,
  `tipo_ncf` varchar(200) NOT NULL,
  `nota` varchar(200) NOT NULL,
  `secuencia` varchar(200) NOT NULL,
  `fecha_pago` date NOT NULL,
  `concepto` varchar(200) NOT NULL,
  `cheque` float NOT NULL,
  `efectivo` float NOT NULL,
  `monto_tarjeta` double(19,2) NOT NULL,
  `referencia_tarjeta` varchar(200) NOT NULL,
  `numero_cheque` varchar(200) NOT NULL,
  `estado` varchar(200) NOT NULL,
  `ticket` varchar(200) NOT NULL,
  `caja` varchar(200) NOT NULL,
  `usuario_anula` varchar(25) NOT NULL,
  `fecha_anula` date NOT NULL,
  `hora_anula` text NOT NULL,
  `vendedor` text NOT NULL,
  `motivo_anulacion` text NOT NULL,
  `imei` text NOT NULL,
  `estado_caja` text NOT NULL,
  `vence` date NOT NULL,
  `transferencia` float(19,2) NOT NULL,
  `financiado` text DEFAULT '',
  PRIMARY KEY (`id_venta`),
  KEY `index_cliente` (`cliente`),
  KEY `index_fecha` (`fecha`),
  KEY `index_folio` (`folio`),
  KEY `index_termino` (`termino`),
  KEY `index_usuario` (`usuario`),
  KEY `index_estado` (`estado`),
  KEY `index_estado_caja` (`estado_caja`(1024)),
  KEY `index_ncf` (`ncf`),
  KEY `index_tipo_ncf` (`tipo_ncf`)
) ENGINE=InnoDB AUTO_INCREMENT=229603 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_spanish2_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!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 */;

