
--
-- Table structure for table `facturas2021`
--

CREATE TABLE `facturas2021` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `observaciondelcleinte` varchar(200) DEFAULT NULL,
  `diasemana` varchar(200) DEFAULT NULL,
  `ordendia` int DEFAULT '0',
  `MESALIBERADA` int DEFAULT '1',
  `aliado` varchar(25) DEFAULT NULL,
  `IDMINUTA` int DEFAULT '0',
  `direccion` varchar(200) DEFAULT NULL,
  `barrio` varchar(50) DEFAULT NULL,
  `celular` varchar(50) DEFAULT NULL,
  `cliente` varchar(100) DEFAULT NULL,
  `horaentregadoaldomiciliario` datetime DEFAULT NULL,
  `horaentregadoalcliente` datetime DEFAULT NULL,
  `fecharesolucion` date DEFAULT NULL,
  `resolucion` varchar(20) DEFAULT NULL,
  `desde` int DEFAULT '1',
  `hasta` int DEFAULT '1',
  `iddomiciliario` int DEFAULT '0',
  `comandaf` varchar(11) DEFAULT NULL,
  `entregado` int DEFAULT '0',
  `despachado` int DEFAULT '0',
  `ese` int DEFAULT '0',
  `tienenc` int DEFAULT '0',
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `horatotal` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `documento` varchar(2) NOT NULL DEFAULT 'V',
  `saldo` double NOT NULL DEFAULT '0',
  `observacion` text,
  `origen` varchar(25) DEFAULT NULL,
  `entrega` varchar(100) NOT NULL DEFAULT ' ',
  `cobra` varchar(100) NOT NULL DEFAULT ' ',
  `fecha` datetime DEFAULT CURRENT_TIMESTAMP,
  `cc` int DEFAULT '2',
  `idmesa` int DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `descuento` double NOT NULL DEFAULT '0',
  `total` int DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `abonado` int NOT NULL DEFAULT '0',
  `idfacturaqueabona` int NOT NULL DEFAULT '0',
  `cerrado` int NOT NULL DEFAULT '0',
  `recibido` double NOT NULL DEFAULT '0',
  `devuelta` double NOT NULL DEFAULT '0',
  `iva` double DEFAULT '0',
  `vigenciadelcredito` int NOT NULL DEFAULT '0',
  `condicion` int NOT NULL DEFAULT '0',
  `fechavencimiento` date DEFAULT NULL,
  `ultimaedicion` datetime DEFAULT CURRENT_TIMESTAMP,
  `pedidonumero` varchar(50) DEFAULT NULL,
  `base` double NOT NULL DEFAULT '0',
  `inquiry` varchar(23) NOT NULL DEFAULT ' ',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1' COMMENT 'este vendedor no hizo toda la venta, solo abriÃ² la mesa',
  `emailenviado` int NOT NULL DEFAULT '0',
  `escortesia` int NOT NULL DEFAULT '0',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `nota` varchar(25) NOT NULL DEFAULT '',
  `fechaabonado` datetime DEFAULT NULL,
  `servicio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `CODFORMAPAGO` varchar(5) DEFAULT '1',
  `codalmacen` varchar(25) DEFAULT '1',
  `TIPODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `ESTADODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `n` varchar(1) NOT NULL DEFAULT 'B',
  `aliasespera` int NOT NULL DEFAULT '0',
  `codvendedor` int NOT NULL DEFAULT '0',
  `impresiones` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `CODTIPOTASA1` varchar(1) NOT NULL DEFAULT '1',
  `esbarra` varchar(1) NOT NULL DEFAULT 'F',
  `CODTARIFA` varchar(1) NOT NULL DEFAULT '1',
  `ivainc` varchar(1) NOT NULL DEFAULT 'T',
  `codzona` int NOT NULL DEFAULT '1',
  `domicilio` double NOT NULL DEFAULT '0',
  `cedula` varchar(15) NOT NULL DEFAULT '999999',
  `codigociudad` varchar(5) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `codigopostal` varchar(6) DEFAULT NULL,
  `codigodepartamento` varchar(5) DEFAULT NULL,
  `departamento` varchar(25) DEFAULT NULL,
  `ciudad` varchar(25) DEFAULT NULL,
  `cufe` varchar(250) DEFAULT NULL,
  `resoluciondesde` date DEFAULT NULL,
  `resolucionhasta` date DEFAULT NULL,
  `consecutivofe` int DEFAULT '0',
  `prefijofe` varchar(5) DEFAULT NULL,
  `id_tipo_persona` int DEFAULT '0',
  `COD_SATELITE` varchar(25) DEFAULT NULL,
  `notacreditofe` int DEFAULT '0',
  `cufenc` varchar(250) DEFAULT NULL,
  `numlineas` int DEFAULT '0',
  `razonsocial` varchar(200) DEFAULT NULL,
  `nombrecomercial` varchar(200) DEFAULT NULL,
  `tipodepersona` int DEFAULT '0',
  `tipo_identificacion` varchar(5) DEFAULT NULL,
  `dv` int DEFAULT NULL,
  `sfiscalresponsibilities` varchar(10) DEFAULT NULL,
  `regimenfiscal` int DEFAULT NULL,
  `contacto` varchar(100) DEFAULT NULL,
  `prefijo` varchar(5) DEFAULT 'FV',
  `conceptoanulado` varchar(150) DEFAULT NULL,
  `garantiahasta` date DEFAULT NULL,
  `cantidadmediosdepago` int DEFAULT '0',
  `snumsop` varchar(25) DEFAULT NULL,
  `inumoper` varchar(25) DEFAULT NULL,
  `despachadoaifood` int DEFAULT '0',
  `valornc` int DEFAULT '0',
  `domicilioexterno` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'extremabelleza',
  `numeroabajo` int DEFAULT '0',
  `alergenos` varchar(50) DEFAULT '0',
  `facturatienemodificadores` int DEFAULT '0',
  `conseuctivorappi` varchar(11) DEFAULT NULL,
  `delivery_method` varchar(25) DEFAULT NULL,
  `payment_method` varchar(25) DEFAULT NULL,
  `COD_CLIENTE_FRONT` int DEFAULT '0',
  `ID_CLIENTE_CONTROL` int DEFAULT '1',
  `ssignature` text,
  `sqr` text,
  `observacionesnovedad` varchar(150) DEFAULT NULL,
  `horapreparado` datetime DEFAULT NULL,
  `resdianfe` varchar(25) DEFAULT NULL,
  `desdefe` int DEFAULT '0',
  `hastafe` int DEFAULT '0',
  `fecharesfe` date DEFAULT NULL,
  `fechafe` date DEFAULT NULL,
  `placa` varchar(6) DEFAULT NULL,
  `mediodoepagointegracion` varchar(25) DEFAULT NULL,
  `CONFIRMED` datetime DEFAULT NULL,
  `READY_TO_PICKUP` datetime DEFAULT NULL,
  `DISPATCHED` datetime DEFAULT NULL,
  `CONCLUDED` datetime DEFAULT NULL,
  `CANCELLED` datetime DEFAULT NULL,
  `CANCELLATION_REQUESTED` datetime DEFAULT NULL,
  `aceptado` bit(1) DEFAULT b'0',
  `horaaceptado` datetime DEFAULT NULL,
  `fecha_registrofactura` datetime DEFAULT NULL,
  `enviadoataxxa` bit(1) DEFAULT b'0',
  `horanovedad` datetime DEFAULT NULL,
  `novedad` bit(1) DEFAULT b'0',
  `costofactura` double DEFAULT '0',
  `aceptado_domiciliario` bit(1) DEFAULT b'0',
  `hora_aceptado_domiciliario` datetime DEFAULT NULL,
  `prooduco_recibido_domiciliario` bit(1) DEFAULT b'0',
  `hora_prooduco_recibido_domiciliario` datetime DEFAULT NULL,
  `impreso` bit(1) DEFAULT b'0',
  `pedidorechazado` bit(1) DEFAULT b'0',
  `horapedidorechazado` datetime DEFAULT NULL,
  `domicilioconciliado` bit(1) DEFAULT b'0',
  `fechancdian` datetime DEFAULT NULL,
  `tipodevolucion` varchar(25) DEFAULT NULL,
  `deberecoger` datetime DEFAULT NULL,
  `nombrecomercialfactura` varchar(50) DEFAULT NULL,
  `clasificacioncliente` varchar(20) DEFAULT 'CLIENTE FINAL',
  `codeudor` varchar(50) DEFAULT NULL,
  `telefonoocodeudor` varchar(30) DEFAULT NULL,
  `parentescocodeudor` varchar(25) DEFAULT NULL,
  `plazo` int DEFAULT NULL,
  `valorcuota` int DEFAULT NULL,
  `valorcuotainicial` int DEFAULT NULL,
  `fechacuotainicial` date DEFAULT NULL,
  `cuotasapartirde` date DEFAULT NULL,
  `modalidad` int DEFAULT NULL,
  `comensales_factura` int DEFAULT '0',
  `identificador` varchar(25) DEFAULT NULL,
  `impazucaradas` int DEFAULT '0',
  `impultraprocesados` int DEFAULT '0',
  `descuentoporflete` int DEFAULT '0',
  `otrosdescuentos` int DEFAULT '0',
  `sobrecargoeventosf` double DEFAULT '0',
  `forzar2222` varchar(2) DEFAULT 'no',
  `fechafinfe` date DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `idvendedor` (`idvendedor`),
  KEY `facturas_ibfk_3` (`idcliente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `facturas2021`
--


--
-- Table structure for table `facturas2022`
--

CREATE TABLE `facturas2022` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `observaciondelcleinte` varchar(200) DEFAULT NULL,
  `diasemana` varchar(200) DEFAULT NULL,
  `ordendia` int DEFAULT '0',
  `MESALIBERADA` int DEFAULT '1',
  `aliado` varchar(25) DEFAULT NULL,
  `IDMINUTA` int DEFAULT '0',
  `direccion` varchar(200) DEFAULT NULL,
  `barrio` varchar(50) DEFAULT NULL,
  `celular` varchar(50) DEFAULT NULL,
  `cliente` varchar(100) DEFAULT NULL,
  `horaentregadoaldomiciliario` datetime DEFAULT NULL,
  `horaentregadoalcliente` datetime DEFAULT NULL,
  `fecharesolucion` date DEFAULT NULL,
  `resolucion` varchar(20) DEFAULT NULL,
  `desde` int DEFAULT '1',
  `hasta` int DEFAULT '1',
  `iddomiciliario` int DEFAULT '0',
  `comandaf` varchar(11) DEFAULT NULL,
  `entregado` int DEFAULT '0',
  `despachado` int DEFAULT '0',
  `ese` int DEFAULT '0',
  `tienenc` int DEFAULT '0',
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `horatotal` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `documento` varchar(2) NOT NULL DEFAULT 'V',
  `saldo` double NOT NULL DEFAULT '0',
  `observacion` text,
  `origen` varchar(25) DEFAULT NULL,
  `entrega` varchar(100) NOT NULL DEFAULT ' ',
  `cobra` varchar(100) NOT NULL DEFAULT ' ',
  `fecha` datetime DEFAULT CURRENT_TIMESTAMP,
  `cc` int DEFAULT '2',
  `idmesa` int DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `descuento` double NOT NULL DEFAULT '0',
  `total` int DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `abonado` int NOT NULL DEFAULT '0',
  `idfacturaqueabona` int NOT NULL DEFAULT '0',
  `cerrado` int NOT NULL DEFAULT '0',
  `recibido` double NOT NULL DEFAULT '0',
  `devuelta` double NOT NULL DEFAULT '0',
  `iva` double DEFAULT '0',
  `vigenciadelcredito` int NOT NULL DEFAULT '0',
  `condicion` int NOT NULL DEFAULT '0',
  `fechavencimiento` date DEFAULT NULL,
  `ultimaedicion` datetime DEFAULT CURRENT_TIMESTAMP,
  `pedidonumero` varchar(50) DEFAULT NULL,
  `base` double NOT NULL DEFAULT '0',
  `inquiry` varchar(23) NOT NULL DEFAULT ' ',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1' COMMENT 'este vendedor no hizo toda la venta, solo abriÃ² la mesa',
  `emailenviado` int NOT NULL DEFAULT '0',
  `escortesia` int NOT NULL DEFAULT '0',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `nota` varchar(25) NOT NULL DEFAULT '',
  `fechaabonado` datetime DEFAULT NULL,
  `servicio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `CODFORMAPAGO` varchar(5) DEFAULT '1',
  `codalmacen` varchar(25) DEFAULT '1',
  `TIPODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `ESTADODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `n` varchar(1) NOT NULL DEFAULT 'B',
  `aliasespera` int NOT NULL DEFAULT '0',
  `codvendedor` int NOT NULL DEFAULT '0',
  `impresiones` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `CODTIPOTASA1` varchar(1) NOT NULL DEFAULT '1',
  `esbarra` varchar(1) NOT NULL DEFAULT 'F',
  `CODTARIFA` varchar(1) NOT NULL DEFAULT '1',
  `ivainc` varchar(1) NOT NULL DEFAULT 'T',
  `codzona` int NOT NULL DEFAULT '1',
  `domicilio` double NOT NULL DEFAULT '0',
  `cedula` varchar(15) NOT NULL DEFAULT '999999',
  `codigociudad` varchar(5) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `codigopostal` varchar(6) DEFAULT NULL,
  `codigodepartamento` varchar(5) DEFAULT NULL,
  `departamento` varchar(25) DEFAULT NULL,
  `ciudad` varchar(25) DEFAULT NULL,
  `cufe` varchar(250) DEFAULT NULL,
  `resoluciondesde` date DEFAULT NULL,
  `resolucionhasta` date DEFAULT NULL,
  `consecutivofe` int DEFAULT '0',
  `prefijofe` varchar(5) DEFAULT NULL,
  `id_tipo_persona` int DEFAULT '0',
  `COD_SATELITE` varchar(25) DEFAULT NULL,
  `notacreditofe` int DEFAULT '0',
  `cufenc` varchar(250) DEFAULT NULL,
  `numlineas` int DEFAULT '0',
  `razonsocial` varchar(200) DEFAULT NULL,
  `nombrecomercial` varchar(200) DEFAULT NULL,
  `tipodepersona` int DEFAULT '0',
  `tipo_identificacion` varchar(5) DEFAULT NULL,
  `dv` int DEFAULT NULL,
  `sfiscalresponsibilities` varchar(10) DEFAULT NULL,
  `regimenfiscal` int DEFAULT NULL,
  `contacto` varchar(100) DEFAULT NULL,
  `prefijo` varchar(5) DEFAULT 'FV',
  `conceptoanulado` varchar(150) DEFAULT NULL,
  `garantiahasta` date DEFAULT NULL,
  `cantidadmediosdepago` int DEFAULT '0',
  `snumsop` varchar(25) DEFAULT NULL,
  `inumoper` varchar(25) DEFAULT NULL,
  `despachadoaifood` int DEFAULT '0',
  `valornc` int DEFAULT '0',
  `domicilioexterno` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'extremabelleza',
  `numeroabajo` int DEFAULT '0',
  `alergenos` varchar(50) DEFAULT '0',
  `facturatienemodificadores` int DEFAULT '0',
  `conseuctivorappi` varchar(11) DEFAULT NULL,
  `delivery_method` varchar(25) DEFAULT NULL,
  `payment_method` varchar(25) DEFAULT NULL,
  `COD_CLIENTE_FRONT` int DEFAULT '0',
  `ID_CLIENTE_CONTROL` int DEFAULT '1',
  `ssignature` text,
  `sqr` text,
  `observacionesnovedad` varchar(150) DEFAULT NULL,
  `horapreparado` datetime DEFAULT NULL,
  `resdianfe` varchar(25) DEFAULT NULL,
  `desdefe` int DEFAULT '0',
  `hastafe` int DEFAULT '0',
  `fecharesfe` date DEFAULT NULL,
  `fechafe` date DEFAULT NULL,
  `placa` varchar(6) DEFAULT NULL,
  `mediodoepagointegracion` varchar(25) DEFAULT NULL,
  `CONFIRMED` datetime DEFAULT NULL,
  `READY_TO_PICKUP` datetime DEFAULT NULL,
  `DISPATCHED` datetime DEFAULT NULL,
  `CONCLUDED` datetime DEFAULT NULL,
  `CANCELLED` datetime DEFAULT NULL,
  `CANCELLATION_REQUESTED` datetime DEFAULT NULL,
  `aceptado` bit(1) DEFAULT b'0',
  `horaaceptado` datetime DEFAULT NULL,
  `fecha_registrofactura` datetime DEFAULT NULL,
  `enviadoataxxa` bit(1) DEFAULT b'0',
  `horanovedad` datetime DEFAULT NULL,
  `novedad` bit(1) DEFAULT b'0',
  `costofactura` double DEFAULT '0',
  `aceptado_domiciliario` bit(1) DEFAULT b'0',
  `hora_aceptado_domiciliario` datetime DEFAULT NULL,
  `prooduco_recibido_domiciliario` bit(1) DEFAULT b'0',
  `hora_prooduco_recibido_domiciliario` datetime DEFAULT NULL,
  `impreso` bit(1) DEFAULT b'0',
  `pedidorechazado` bit(1) DEFAULT b'0',
  `horapedidorechazado` datetime DEFAULT NULL,
  `domicilioconciliado` bit(1) DEFAULT b'0',
  `fechancdian` datetime DEFAULT NULL,
  `tipodevolucion` varchar(25) DEFAULT NULL,
  `deberecoger` datetime DEFAULT NULL,
  `nombrecomercialfactura` varchar(50) DEFAULT NULL,
  `clasificacioncliente` varchar(20) DEFAULT 'CLIENTE FINAL',
  `codeudor` varchar(50) DEFAULT NULL,
  `telefonoocodeudor` varchar(30) DEFAULT NULL,
  `parentescocodeudor` varchar(25) DEFAULT NULL,
  `plazo` int DEFAULT NULL,
  `valorcuota` int DEFAULT NULL,
  `valorcuotainicial` int DEFAULT NULL,
  `fechacuotainicial` date DEFAULT NULL,
  `cuotasapartirde` date DEFAULT NULL,
  `modalidad` int DEFAULT NULL,
  `comensales_factura` int DEFAULT '0',
  `identificador` varchar(25) DEFAULT NULL,
  `impazucaradas` int DEFAULT '0',
  `impultraprocesados` int DEFAULT '0',
  `descuentoporflete` int DEFAULT '0',
  `otrosdescuentos` int DEFAULT '0',
  `sobrecargoeventosf` double DEFAULT '0',
  `forzar2222` varchar(2) DEFAULT 'no',
  `fechafinfe` date DEFAULT NULL,
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `idvendedor` (`idvendedor`),
  KEY `facturas_ibfk_3` (`idcliente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `facturas2022`
--


--
-- Table structure for table `facturas3`
--

CREATE TABLE `facturas3` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `observaciondelcleinte` varchar(200) DEFAULT NULL,
  `diasemana` varchar(200) DEFAULT NULL,
  `ordendia` int DEFAULT '0',
  `MESALIBERADA` int DEFAULT '1',
  `IDMOTIVODTO` int DEFAULT '1',
  `IDMINUTA` int DEFAULT '0',
  `direccion` varchar(200) DEFAULT NULL,
  `barrio` varchar(50) DEFAULT NULL,
  `celular` varchar(50) DEFAULT NULL,
  `cliente` varchar(100) DEFAULT NULL,
  `horaentregadoaldomiciliario` datetime DEFAULT NULL,
  `horaentregadoalcliente` datetime DEFAULT NULL,
  `fecharesolucion` date DEFAULT NULL,
  `resolucion` varchar(20) DEFAULT NULL,
  `desde` int DEFAULT '1',
  `hasta` int DEFAULT '1',
  `iddomiciliario` int DEFAULT '0',
  `comandaf` varchar(11) DEFAULT NULL,
  `entregado` int DEFAULT '0',
  `despachado` int DEFAULT '0',
  `ese` int DEFAULT '0',
  `tienenc` int DEFAULT '0',
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `horatotal` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `documento` varchar(2) NOT NULL DEFAULT 'V',
  `saldo` double NOT NULL DEFAULT '0',
  `observacion` text,
  `origen` varchar(25) DEFAULT NULL,
  `entrega` varchar(100) NOT NULL DEFAULT ' ',
  `cobra` varchar(100) NOT NULL DEFAULT ' ',
  `fecha` datetime DEFAULT CURRENT_TIMESTAMP,
  `cc` int DEFAULT '2',
  `idmesa` int DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `descuento` double NOT NULL DEFAULT '0',
  `total` int DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `abonado` int NOT NULL DEFAULT '0',
  `idfacturaqueabona` int NOT NULL DEFAULT '0',
  `cerrado` int NOT NULL DEFAULT '0',
  `recibido` double NOT NULL DEFAULT '0',
  `devuelta` double NOT NULL DEFAULT '0',
  `iva` double DEFAULT '0',
  `vigenciadelcredito` int NOT NULL DEFAULT '0',
  `condicion` int NOT NULL DEFAULT '0',
  `fechavencimiento` datetime DEFAULT CURRENT_TIMESTAMP,
  `ultimaedicion` datetime DEFAULT CURRENT_TIMESTAMP,
  `pedidonumero` varchar(50) DEFAULT NULL,
  `base` double NOT NULL DEFAULT '0',
  `inquiry` varchar(23) NOT NULL DEFAULT ' ',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1' COMMENT 'este vendedor no hizo toda la venta, solo abriÃ² la mesa',
  `emailenviado` int NOT NULL DEFAULT '0',
  `escortesia` int NOT NULL DEFAULT '0',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `nota` varchar(25) NOT NULL DEFAULT '',
  `fechaabonado` datetime DEFAULT NULL,
  `servicio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `CODFORMAPAGO` varchar(5) DEFAULT '1',
  `codalmacen` varchar(25) DEFAULT '1',
  `TIPODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `ESTADODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `n` varchar(1) NOT NULL DEFAULT 'B',
  `aliasespera` int NOT NULL DEFAULT '0',
  `codvendedor` int NOT NULL DEFAULT '0',
  `impresiones` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `CODTIPOTASA1` varchar(1) NOT NULL DEFAULT '1',
  `esbarra` varchar(1) NOT NULL DEFAULT 'F',
  `CODTARIFA` varchar(1) NOT NULL DEFAULT '1',
  `ivainc` varchar(1) NOT NULL DEFAULT 'T',
  `codzona` int NOT NULL DEFAULT '1',
  `domicilio` double NOT NULL DEFAULT '0',
  `cedula` varchar(15) NOT NULL DEFAULT '999999',
  `codigociudad` varchar(5) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `codigopostal` varchar(6) DEFAULT NULL,
  `codigodepartamento` varchar(5) DEFAULT NULL,
  `departamento` varchar(25) DEFAULT NULL,
  `ciudad` varchar(25) DEFAULT NULL,
  `cufe` varchar(250) DEFAULT NULL,
  `resoluciondesde` date DEFAULT NULL,
  `resolucionhasta` date DEFAULT NULL,
  `consecutivofe` int DEFAULT '0',
  `prefijofe` varchar(5) DEFAULT NULL,
  `id_tipo_persona` int DEFAULT '0',
  `COD_SATELITE` varchar(25) DEFAULT NULL,
  `notacreditofe` int DEFAULT '0',
  `cufenc` varchar(250) DEFAULT NULL,
  `numlineas` int DEFAULT '0',
  `razonsocial` varchar(200) DEFAULT NULL,
  `nombrecomercial` varchar(200) DEFAULT NULL,
  `tipodepersona` int DEFAULT '0',
  `tipo_identificacion` varchar(5) DEFAULT NULL,
  `dv` int DEFAULT NULL,
  `sfiscalresponsibilities` varchar(10) DEFAULT NULL,
  `regimenfiscal` int DEFAULT NULL,
  `contacto` varchar(100) DEFAULT NULL,
  `prefijo` varchar(5) DEFAULT 'FV',
  `conceptoanulado` varchar(150) DEFAULT NULL,
  `garantiahasta` date DEFAULT NULL,
  `cantidadmediosdepago` int DEFAULT '0',
  `snumsop` varchar(25) DEFAULT NULL,
  `inumoper` varchar(25) DEFAULT NULL,
  `despachadoaifood` int DEFAULT '0',
  `valornc` int DEFAULT '0',
  `domicilioexterno` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'extremabelleza',
  `numeroabajo` int DEFAULT '0',
  `alergenos` varchar(50) DEFAULT '0',
  `facturatienemodificadores` int DEFAULT '0',
  `conseuctivorappi` varchar(11) DEFAULT NULL,
  `delivery_method` varchar(25) DEFAULT NULL,
  `payment_method` varchar(25) DEFAULT NULL,
  `COD_CLIENTE_FRONT` int DEFAULT '0',
  `ID_CLIENTE_CONTROL` int DEFAULT '1',
  `ssignature` text,
  `sqr` text,
  `observacionesnovedad` varchar(150) DEFAULT NULL,
  `horapreparado` datetime DEFAULT NULL,
  `resdianfe` varchar(25) DEFAULT NULL,
  `desdefe` int DEFAULT '0',
  `hastafe` int DEFAULT '0',
  `fecharesfe` date DEFAULT NULL,
  `fechafe` date DEFAULT NULL,
  `placa` varchar(6) DEFAULT NULL,
  `mediodoepagointegracion` varchar(25) DEFAULT NULL,
  `CONFIRMED` datetime DEFAULT NULL,
  `READY_TO_PICKUP` datetime DEFAULT NULL,
  `DISPATCHED` datetime DEFAULT NULL,
  `CONCLUDED` datetime DEFAULT NULL,
  `CANCELLED` datetime DEFAULT NULL,
  `CANCELLATION_REQUESTED` datetime DEFAULT NULL,
  `aceptado` bit(1) DEFAULT b'0',
  `horaaceptado` datetime DEFAULT NULL,
  `fecha_registrofactura` datetime DEFAULT NULL,
  `enviadoataxxa` bit(1) DEFAULT b'0',
  `horanovedad` datetime DEFAULT NULL,
  `novedad` bit(1) DEFAULT b'0',
  `costofactura` double DEFAULT '0',
  `aceptado_domiciliario` bit(1) DEFAULT b'0',
  `hora_aceptado_domiciliario` datetime DEFAULT NULL,
  `prooduco_recibido_domiciliario` bit(1) DEFAULT b'0',
  `hora_prooduco_recibido_domiciliario` datetime DEFAULT NULL,
  `impreso` bit(1) DEFAULT b'0',
  `pedidorechazado` bit(1) DEFAULT b'0',
  `horapedidorechazado` datetime DEFAULT NULL,
  `domicilioconciliado` bit(1) DEFAULT b'0',
  `fechancdian` datetime DEFAULT NULL,
  `tipodevolucion` varchar(25) DEFAULT NULL,
  `deberecoger` datetime DEFAULT NULL,
  `nombrecomercialfactura` varchar(50) DEFAULT NULL,
  `clasificacioncliente` varchar(20) DEFAULT 'CLIENTE FINAL',
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `idvendedor` (`idvendedor`),
  KEY `facturas_ibfk_3` (`idcliente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `facturas3`
--


--
-- Table structure for table `familiasdemodificadores`
--

CREATE TABLE `familiasdemodificadores` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `familiademodificadores` varchar(100) DEFAULT NULL,
  `minimo` int DEFAULT '0',
  `maximo` int DEFAULT '0',
  `codabajo` int DEFAULT '0',
  `cc` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `alias` varchar(100) DEFAULT NULL,
  `idrappi` varchar(25) DEFAULT NULL,
  `sesubeaifood` int DEFAULT '0',
  `idifood` varchar(100) DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  `sepuedeborrar` int DEFAULT '0',
  `saleenlaventa` int DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `familiasdemodificadores`
--


--
-- Table structure for table `fechasdescuentos`
--

CREATE TABLE `fechasdescuentos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date DEFAULT NULL,
  `cc` bigint unsigned NOT NULL,
  `idusuario` bigint unsigned NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  CONSTRAINT `fechasdescuentos_ibfk_1` FOREIGN KEY (`cc`) REFERENCES `centrosdecostos` (`id`),
  CONSTRAINT `fechasdescuentos_ibfk_2` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `fechasdescuentos`
--


--
-- Table structure for table `festivos`
--

CREATE TABLE `festivos` (
  `fecha` date NOT NULL,
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `festivos`
--

INSERT INTO `festivos` (`fecha`, `id`) VALUES ('2022-07-20',2),('2022-12-08',19),('2022-11-14',18),('2022-11-07',17),('2022-10-17',16),('2022-08-15',14);

--
-- Table structure for table `fichaderegistro`
--

CREATE TABLE `fichaderegistro` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cliente` varchar(100) DEFAULT NULL,
  `cedula` varchar(15) DEFAULT NULL,
  `telefono` varchar(25) DEFAULT NULL,
  `fechaentrada` date DEFAULT NULL,
  `fechasalida` date DEFAULT NULL,
  `nacionalidad` varchar(25) DEFAULT NULL,
  `direccion` varchar(100) DEFAULT NULL,
  `ciudad` varchar(25) DEFAULT NULL,
  `marca` varchar(25) DEFAULT NULL,
  `placa` varchar(6) DEFAULT NULL,
  `idcliente` bigint unsigned DEFAULT NULL,
  `idusuario` bigint unsigned DEFAULT NULL,
  `fechacreacion` datetime DEFAULT NULL,
  `idmayor` bigint unsigned DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idcliente` (`idcliente`),
  KEY `idusuario` (`idusuario`),
  KEY `idmayor` (`idmayor`),
  CONSTRAINT `fichaderegistro_ibfk_1` FOREIGN KEY (`idmayor`) REFERENCES `mayoresfichaderegistro` (`id`),
  CONSTRAINT `idcliente` FOREIGN KEY (`idcliente`) REFERENCES `clientes` (`id`),
  CONSTRAINT `idusuario` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `fichaderegistro`
--


--
-- Table structure for table `fichaderegistroauxiliar`
--

CREATE TABLE `fichaderegistroauxiliar` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `cliente` varchar(100) DEFAULT NULL,
  `cedula` varchar(15) DEFAULT NULL,
  `telefono` varchar(25) DEFAULT NULL,
  `fechaentrada` date DEFAULT NULL,
  `fechasalida` date DEFAULT NULL,
  `nacionalidad` varchar(25) DEFAULT NULL,
  `direccion` varchar(100) DEFAULT NULL,
  `ciudad` varchar(25) DEFAULT NULL,
  `marca` varchar(25) DEFAULT NULL,
  `placa` varchar(6) DEFAULT NULL,
  `idcliente` bigint unsigned DEFAULT NULL,
  `idusuario` bigint unsigned DEFAULT NULL,
  `fechacreacion` datetime DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  `idreserva` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `idcliente` (`idcliente`),
  KEY `idclientefichaderegistroauxiliar` (`idcliente`),
  KEY `idusuariofichaderegistroauxiliar` (`idusuario`),
  CONSTRAINT `idclientefichaderegistroauxiliar` FOREIGN KEY (`idcliente`) REFERENCES `clientes` (`id`),
  CONSTRAINT `idusuariofichaderegistroauxiliar` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `fichaderegistroauxiliar`
--


--
-- Table structure for table `garantiasenespera`
--

CREATE TABLE `garantiasenespera` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `codvendedor` int NOT NULL DEFAULT '0',
  `REFERENCIA` varchar(20) DEFAULT NULL,
  `situacioncocina` varchar(50) DEFAULT NULL,
  `idfactura` bigint unsigned NOT NULL,
  `consecutivo` int NOT NULL,
  `idarticulo` bigint unsigned NOT NULL,
  `descripcion` varchar(120) DEFAULT NULL,
  `nombrearticulo` varchar(100) DEFAULT NULL,
  `cantidad` double NOT NULL DEFAULT '0',
  `observaciones` varchar(200) DEFAULT NULL,
  `valorunitario` double NOT NULL DEFAULT '0',
  `idmesa` int NOT NULL DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `baseunitario` double NOT NULL DEFAULT '0',
  `ivaunitario` double NOT NULL DEFAULT '0',
  `descuento` int NOT NULL DEFAULT '0',
  `valortotal` double NOT NULL DEFAULT '0',
  `documento` varchar(3) NOT NULL DEFAULT 'V',
  `origen` varchar(25) DEFAULT NULL,
  `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idcliente` bigint unsigned NOT NULL DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1',
  `devolucionrevisada` int DEFAULT '0',
  `esmodif` int NOT NULL DEFAULT '0',
  `ABONODE_N` varchar(2) NOT NULL DEFAULT '0',
  `domicilio` int DEFAULT '0',
  `bodega` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idfactura` (`idfactura`),
  KEY `idarticulo` (`idarticulo`),
  KEY `idcliente` (`idcliente`),
  KEY `idusuario` (`idusuario`),
  KEY `idvendedor` (`idvendedor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `garantiasenespera`
--


--
-- Table structure for table `gastos`
--

CREATE TABLE `gastos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `cc` bigint unsigned NOT NULL,
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `consecutivo` int NOT NULL DEFAULT '1',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idproveedor` bigint unsigned NOT NULL DEFAULT '1',
  `concepto` text,
  `valor` double NOT NULL DEFAULT '0',
  `numero` varchar(7) DEFAULT NULL,
  `tipo` varchar(50) DEFAULT 'SELECCIONE',
  `afectacaja` int DEFAULT '1',
  `mediodepago` varchar(25) DEFAULT NULL,
  `placa` varchar(25) DEFAULT NULL,
  `fecha` date DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  `contadocredito` varchar(7) DEFAULT 'CONTADO',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idz` (`idz`),
  KEY `idusuario` (`idusuario`),
  KEY `idproveedor` (`idproveedor`),
  CONSTRAINT `gastos_ibfk_2` FOREIGN KEY (`idproveedor`) REFERENCES `clientes` (`id`),
  CONSTRAINT `gastos_ibfk_3` FOREIGN KEY (`idz`) REFERENCES `z` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `gastos`
--


--
-- Table structure for table `gruposdepersonas`
--

CREATE TABLE `gruposdepersonas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `grupo` varchar(20) DEFAULT NULL,
  `cc` bigint unsigned NOT NULL,
  `porcentaje` int DEFAULT '0',
  `campovalordeventa` varchar(25) DEFAULT NULL,
  `alias` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `gruposdepersonas`
--


--
-- Table structure for table `habitaciones`
--

CREATE TABLE `habitaciones` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `habitacion` varchar(25) DEFAULT NULL,
  `codigo` varchar(20) NOT NULL DEFAULT ' ',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idzona` bigint unsigned NOT NULL DEFAULT '1',
  `orden` int NOT NULL DEFAULT '0',
  `idmeseroactual` bigint unsigned NOT NULL DEFAULT '1',
  `barcode` varchar(25) DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idusuario` (`idusuario`),
  KEY `idzona` (`idzona`),
  KEY `idmeseroactual` (`idmeseroactual`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `habitaciones`
--


--
-- Table structure for table `habitacionesvsenseres`
--

CREATE TABLE `habitacionesvsenseres` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `fechacreacion` datetime DEFAULT CURRENT_TIMESTAMP,
  `idusuario` int DEFAULT '0',
  `idhabitacion` bigint unsigned NOT NULL,
  `idensere` bigint unsigned NOT NULL,
  `cantidad` int DEFAULT '1',
  `valor` double DEFAULT '0',
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `idhabitacion_2` (`idhabitacion`,`idensere`),
  KEY `idhabitacion` (`idhabitacion`),
  KEY `idensere` (`idensere`),
  CONSTRAINT `llavedos` FOREIGN KEY (`idensere`) REFERENCES `enseres` (`id`),
  CONSTRAINT `llaveuno` FOREIGN KEY (`idhabitacion`) REFERENCES `habitaciones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `habitacionesvsenseres`
--


--
-- Table structure for table `historial_traslados`
--

CREATE TABLE `historial_traslados` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fecha_original` date NOT NULL,
  `origen` varchar(50) NOT NULL,
  `destino` varchar(50) NOT NULL,
  `fecha_recepcion` datetime NOT NULL,
  `usuario_recibe` varchar(50) NOT NULL,
  `fecha_creacion` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `costomedio` double DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `historial_traslados`
--


--
-- Table structure for table `imprimirhtml`
--

CREATE TABLE `imprimirhtml` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `texto` text,
  `fechacreacion` datetime DEFAULT NULL,
  `usuario` varchar(50) DEFAULT NULL,
  `situacioncocina` varchar(25) DEFAULT 'SELECCIONE',
  `impresora` varchar(25) DEFAULT 'CAJA',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `imprimirhtml`
--


--
-- Table structure for table `informehorasporperiodo`
--

CREATE TABLE `informehorasporperiodo` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) DEFAULT NULL,
  `cedula` varchar(50) DEFAULT NULL,
  `horas` double DEFAULT NULL,
  `cantidaddedias` double DEFAULT NULL,
  `diferencia` double DEFAULT NULL,
  `diasregistrados` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `informehorasporperiodo`
--


--
-- Table structure for table `ingresoempleados`
--

CREATE TABLE `ingresoempleados` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ingreso` datetime DEFAULT NULL,
  `cc` int DEFAULT '2',
  `salida` datetime DEFAULT NULL,
  `idusuario` bigint unsigned NOT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  `inicioesperado` datetime DEFAULT NULL,
  `salidaesperada` datetime DEFAULT NULL,
  `entradatarde` int DEFAULT '0',
  `salidatemprano` int DEFAULT '0',
  `diferenciaentrada` time DEFAULT NULL,
  `diferenciasalida` time DEFAULT NULL,
  `diasemanaingreso` int DEFAULT NULL,
  `diasemanasalida` int DEFAULT NULL,
  `horasextras` decimal(5,2) DEFAULT '0.00',
  `extrasdominical` decimal(5,2) DEFAULT '0.00',
  `extrasdominicalnocturno` decimal(5,2) DEFAULT '0.00',
  `extrasnocturno` decimal(5,2) DEFAULT '0.00',
  `extrasfestivonocturno` decimal(5,2) DEFAULT '0.00',
  `extrasfestivo` decimal(5,2) DEFAULT '0.00',
  `extrasdiurno` decimal(5,2) DEFAULT '0.00',
  `festivo` int DEFAULT NULL,
  `sumahorasextras` decimal(5,2) DEFAULT NULL,
  `nombreturno` varchar(25) DEFAULT NULL,
  `origendelasalida` varchar(4) DEFAULT 'java',
  `latitud` double DEFAULT '0',
  `longitud` double DEFAULT '0',
  `latitudsalida` double DEFAULT '0',
  `longitudsalida` double DEFAULT '0',
  `observaciones` varchar(200) DEFAULT NULL,
  `salidamenosentrada` decimal(4,2) DEFAULT '0.00',
  `minutosdescanso` int DEFAULT '0',
  `iniciocalculado` datetime DEFAULT NULL,
  `salidacalculada` datetime DEFAULT NULL,
  `usuario` varchar(50) DEFAULT NULL,
  `ip` varchar(20) DEFAULT NULL,
  `iniciodescanso` datetime DEFAULT NULL,
  `findescanso` datetime DEFAULT NULL,
  `obsiniciodescanso` varchar(100) DEFAULT NULL,
  `obsfindescanso` varchar(100) DEFAULT NULL,
  `esparacompensatorio` bit(1) DEFAULT b'0',
  `compensatorioredimido` bit(1) DEFAULT b'0',
  `fecharedimido` date DEFAULT NULL,
  `escompensatorio` bit(1) DEFAULT b'0',
  `ipsalida` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idusuario` (`idusuario`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `ingresoempleados`
--


--
-- Table structure for table `iniciosdesesion`
--

CREATE TABLE `iniciosdesesion` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `fechacreacion` datetime DEFAULT NULL,
  `usuario` varchar(100) DEFAULT NULL,
  `ipinicio` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `iniciosdesesion`
--

INSERT INTO `iniciosdesesion` (`id`, `fechacreacion`, `usuario`, `ipinicio`) VALUES (1,'2025-11-20 14:24:31','5 - Edgar Fernando Alvarez Delgado   ','186.99.211.115'),(2,'2025-11-26 11:21:19','5 - DANIELA  RESTREPO RESTREPO','179.1.210.205'),(3,'2025-11-26 11:25:59','5 - DANIELA  RESTREPO RESTREPO','181.53.244.156'),(4,'2025-11-27 09:38:37','5 - DANIELA  RESTREPO RESTREPO','181.53.244.156'),(5,'2025-11-27 09:38:37','5 - DANIELA  RESTREPO RESTREPO','181.53.244.156');

--
-- Table structure for table `insumos`
--

CREATE TABLE `insumos` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(50) NOT NULL DEFAULT ' ',
  `cantidad` double NOT NULL DEFAULT '0',
  `valordecompra` int NOT NULL DEFAULT '0',
  `cantidadminima` double NOT NULL DEFAULT '0',
  `cc` bigint unsigned NOT NULL,
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `pv` varchar(25) DEFAULT 'distrito',
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  CONSTRAINT `insumos_ibfk_1` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`),
  CONSTRAINT `insumos_ibfk_2` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `insumos`
--


--
-- Table structure for table `inventarioinicial`
--

CREATE TABLE `inventarioinicial` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `idarticulo` bigint unsigned NOT NULL,
  `descripcion` varchar(100) NOT NULL DEFAULT '',
  `cantidad` double NOT NULL,
  `mes` int NOT NULL,
  `ano` int NOT NULL,
  `costomedio` double NOT NULL,
  `idusuario` bigint unsigned NOT NULL,
  `cc` bigint unsigned NOT NULL,
  `fechacracion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fisico` double NOT NULL DEFAULT '0',
  `idmayor` bigint unsigned NOT NULL DEFAULT '0',
  `contado` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idusuario` (`idusuario`),
  KEY `idmayor` (`idusuario`),
  KEY `idarticulo` (`idarticulo`),
  KEY `idmayor_2` (`idmayor`),
  CONSTRAINT `inventarioinicial_ibfk_1` FOREIGN KEY (`idmayor`) REFERENCES `mayoresinventarioinicial` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `inventarioinicial`
--


--
-- Table structure for table `ipbloqueadas`
--

CREATE TABLE `ipbloqueadas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ip` varchar(25) DEFAULT NULL,
  `alias` varchar(50) DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  `fechacreacion` datetime DEFAULT CURRENT_TIMESTAMP,
  `cedula` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `ipbloqueadas`
--


--
-- Table structure for table `ips`
--

CREATE TABLE `ips` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `ip` varchar(25) DEFAULT NULL,
  `alias` varchar(50) DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `ips`
--


--
-- Table structure for table `jsonrecibido2`
--

CREATE TABLE `jsonrecibido2` (
  `idrapi` varchar(25) DEFAULT NULL,
  `descripcion` varchar(100) DEFAULT NULL,
  `valor` int NOT NULL DEFAULT '0',
  `cantidad` int NOT NULL DEFAULT '0',
  `comentarios` varchar(100) DEFAULT NULL,
  `descuento` double DEFAULT NULL,
  `front` varchar(25) DEFAULT NULL,
  `idpadre` varchar(25) DEFAULT NULL,
  `numero` int NOT NULL DEFAULT '0',
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `jsonrecibido2`
--


--
-- Table structure for table `lineas`
--

CREATE TABLE `lineas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `linea` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `cc` bigint unsigned NOT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  `ordenlinea` int DEFAULT NULL,
  `valorpuntos` int DEFAULT '0',
  `urlfotolinea` varchar(200) DEFAULT NULL,
  `saleentv` bit(1) DEFAULT b'1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `lineas`
--


--
-- Table structure for table `lineasborradas`
--

CREATE TABLE `lineasborradas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `idusuario` bigint unsigned NOT NULL,
  `fechacreacion` datetime DEFAULT NULL,
  `idarticulo` bigint unsigned NOT NULL,
  `cantidad` int NOT NULL DEFAULT '0',
  `cc` bigint unsigned NOT NULL,
  `descripcion` varchar(50) DEFAULT NULL,
  `usuario` varchar(150) DEFAULT NULL,
  `valorunitario` int DEFAULT '0',
  `mesa` varchar(250) DEFAULT NULL,
  `impreso` int DEFAULT '0',
  `origen` varchar(25) DEFAULT NULL,
  `idcliente` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idcliente` (`idusuario`),
  KEY `idarticulo` (`idarticulo`),
  KEY `cc` (`cc`),
  CONSTRAINT `lineasborradas_ibfk_2` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `lineasborradas`
--

INSERT INTO `lineasborradas` (`id`, `idusuario`, `fechacreacion`, `idarticulo`, `cantidad`, `cc`, `descripcion`, `usuario`, `valorunitario`, `mesa`, `impreso`, `origen`, `idcliente`, `pv`) VALUES (1,5,'2025-11-26 17:12:21',9,1,2,NULL,'DANIELA  RESTREPO RESTREPO',46000,'7',0,NULL,0,'distrito');

--
-- Table structure for table `lineascambios`
--

CREATE TABLE `lineascambios` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `bruto` double DEFAULT '0',
  `idmayor` bigint unsigned NOT NULL,
  `identificador` varchar(100) DEFAULT NULL,
  `referenciapayu` varchar(200) DEFAULT NULL,
  `referenciafront` varchar(15) DEFAULT NULL,
  `descripcion` varchar(120) DEFAULT NULL,
  `pagarcontraentrega` int DEFAULT '0',
  `idfactura` bigint unsigned NOT NULL,
  `descuento` double NOT NULL DEFAULT '0',
  `codsituacion` int NOT NULL,
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `idarticulo` bigint unsigned NOT NULL,
  `cc` bigint unsigned NOT NULL DEFAULT '2',
  `origen` varchar(8) NOT NULL DEFAULT 'MESAS',
  `comentario` varchar(200) DEFAULT NULL,
  `observaciones` varchar(200) DEFAULT NULL,
  `valorunitario` double NOT NULL DEFAULT '0',
  `cantidad` int DEFAULT '0',
  `valortotal` double NOT NULL DEFAULT '0',
  `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fechaentregado` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `costomedio` double DEFAULT '0',
  `porcentajeiva` double NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `tipo` varchar(25) DEFAULT NULL,
  `observacion` varchar(25) NOT NULL DEFAULT '',
  `despachado` int NOT NULL DEFAULT '0' COMMENT 'Significa que la cocina ya sirviÃ² el producto',
  `entregado` int NOT NULL DEFAULT '0' COMMENT 'Significa que la cocina ya sirviÃ² el producto',
  `enespera` int NOT NULL DEFAULT '0' COMMENT 'para que el mesero ya no pueda eliminar',
  `comision` int NOT NULL DEFAULT '0',
  `porcentajedescuento` double NOT NULL DEFAULT '0',
  `impuesto` double NOT NULL DEFAULT '0',
  `base` double NOT NULL DEFAULT '0',
  `servicio` double NOT NULL DEFAULT '0',
  `CODMODIF` int NOT NULL DEFAULT '0',
  `numlinea` int NOT NULL DEFAULT '0',
  `esmodif` int NOT NULL DEFAULT '0',
  `situacioncocina` varchar(50) DEFAULT NULL,
  `CODARTICULOABAJO` int NOT NULL DEFAULT '0',
  `COD_SATELITE` varchar(25) DEFAULT NULL,
  `unidaddemedida` varchar(25) DEFAULT NULL,
  `impreso` int DEFAULT '0',
  `unidadesdemedida` varchar(25) DEFAULT NULL,
  `domicilio` int DEFAULT '0',
  `enviaraproduccion` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'distrito',
  `afectacaja` int DEFAULT '1',
  `referencia` varchar(25) DEFAULT NULL,
  `consecutivo` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idarticulo` (`idarticulo`),
  KEY `idusuario` (`idusuario`),
  KEY `idcliente` (`idcliente`),
  KEY `idmayor` (`idmayor`),
  KEY `idfactura` (`idfactura`),
  CONSTRAINT `lineascambios_ibfk_1` FOREIGN KEY (`idmayor`) REFERENCES `cambios` (`id`),
  CONSTRAINT `lineascambios_ibfk_2` FOREIGN KEY (`idmayor`) REFERENCES `cambios` (`id`),
  CONSTRAINT `lineascambios_ibfk_3` FOREIGN KEY (`idfactura`) REFERENCES `facturas` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `lineascambios`
--


--
-- Table structure for table `lineasnotascredito`
--

CREATE TABLE `lineasnotascredito` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `codvendedor` int NOT NULL DEFAULT '0',
  `REFERENCIA` varchar(20) DEFAULT NULL,
  `situacioncocina` varchar(50) DEFAULT NULL,
  `idfactura` bigint unsigned NOT NULL,
  `consecutivo` int NOT NULL,
  `codarticulo` int NOT NULL,
  `codsituacion` int NOT NULL,
  `porcentajedescuento` double DEFAULT '0',
  `impuesto` double DEFAULT '0',
  `idarticulo` bigint unsigned NOT NULL,
  `descripcion` varchar(120) DEFAULT NULL,
  `esmodificador` int DEFAULT '0',
  `nombrearticulo` varchar(100) DEFAULT NULL,
  `cantidad` double NOT NULL DEFAULT '0',
  `comentario` varchar(200) DEFAULT NULL,
  `observaciones` varchar(200) DEFAULT NULL,
  `valorunitario` double NOT NULL DEFAULT '0',
  `idmesa` int NOT NULL DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `baseunitario` double NOT NULL DEFAULT '0',
  `ivaunitario` double NOT NULL DEFAULT '0',
  `descuento` int NOT NULL DEFAULT '0',
  `valortotal` double NOT NULL DEFAULT '0',
  `cc` bigint unsigned NOT NULL,
  `documento` varchar(3) NOT NULL DEFAULT 'V',
  `origen` varchar(25) DEFAULT NULL,
  `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `HORAINI` datetime DEFAULT NULL,
  `HORAFIN` datetime DEFAULT NULL,
  `ultimaedicion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idcliente` bigint unsigned NOT NULL DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `abonado` int NOT NULL DEFAULT '0',
  `idfacturaqueabona` int NOT NULL DEFAULT '0',
  `costomedio` double DEFAULT '0',
  `porcentajeiva` double NOT NULL DEFAULT '0',
  `base` double NOT NULL DEFAULT '0',
  `iva` double NOT NULL DEFAULT '0',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1',
  `escortesia` int NOT NULL DEFAULT '0',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `idnc` bigint unsigned NOT NULL DEFAULT '1',
  `nc` int DEFAULT '0',
  `idusuarionc` bigint unsigned NOT NULL DEFAULT '1',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `comision` int NOT NULL DEFAULT '0',
  `devolucionrevisada` int DEFAULT '0',
  `fechaabonado` datetime DEFAULT NULL,
  `fechamc` datetime DEFAULT NULL,
  `tienenc` int NOT NULL DEFAULT '0',
  `marcadoparanc` int NOT NULL DEFAULT '0',
  `servicio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `CODMODIF` varchar(2) NOT NULL DEFAULT '0',
  `esmodif` int NOT NULL DEFAULT '0',
  `CODARTICULOABAJO` varchar(12) NOT NULL DEFAULT '',
  `PRECIOIVA` int NOT NULL DEFAULT '0',
  `NUMMODIF` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `aliasespera` int NOT NULL DEFAULT '1',
  `impresiones` int NOT NULL DEFAULT '1',
  `IDMOTIVODTO` varchar(2) NOT NULL DEFAULT '-1',
  `DETALLEDENUMLINEA` varchar(2) NOT NULL DEFAULT '0',
  `FAMILIAAENA` varchar(2) NOT NULL DEFAULT '0',
  `DETALLEMODIF` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_NUMERO` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_N` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_SERIE` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_FO` varchar(2) NOT NULL DEFAULT '-1',
  `NORDERTIQUET` varchar(1) NOT NULL DEFAULT '0',
  `SORDERTIQUET` varchar(1) NOT NULL DEFAULT '',
  `REQ` int NOT NULL DEFAULT '0',
  `COSTEIVA` int NOT NULL DEFAULT '0',
  `DTO` int NOT NULL DEFAULT '0',
  `TIPO` varchar(2) NOT NULL DEFAULT 'V',
  `CODMACRO` int NOT NULL DEFAULT '0',
  `CODFORMATO` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `codigociudad` varchar(5) DEFAULT NULL,
  `email` varchar(5) DEFAULT NULL,
  `codigopostal` varchar(5) DEFAULT NULL,
  `codigodepartamento` varchar(5) DEFAULT NULL,
  `departamento` varchar(5) DEFAULT NULL,
  `ciudad` varchar(5) DEFAULT NULL,
  `cufe` varchar(5) DEFAULT NULL,
  `unidaddemedida` varchar(25) DEFAULT NULL,
  `esnota` int DEFAULT '0',
  `unidadesdemedida` varchar(25) DEFAULT NULL,
  `impreso` int DEFAULT '0',
  `domicilio` int DEFAULT '0',
  `idmayor` int DEFAULT '0',
  `subiralinventario` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'distrito',
  `afectacaja` int DEFAULT '1',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idfactura` (`idfactura`),
  KEY `idarticulo` (`idarticulo`),
  KEY `idcc` (`cc`),
  KEY `idcliente` (`idcliente`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `idvendedor` (`idvendedor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `lineasnotascredito`
--


--
-- Table structure for table `lineasnotasdebito`
--

CREATE TABLE `lineasnotasdebito` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `consecutivo` int NOT NULL DEFAULT '0',
  `idnotasdebito` bigint unsigned NOT NULL,
  `idmayor` bigint unsigned NOT NULL,
  `idarticulo` bigint unsigned NOT NULL,
  `cantidad` int NOT NULL DEFAULT '0',
  `valorunitario` double NOT NULL DEFAULT '0',
  `valortotal` double NOT NULL DEFAULT '0',
  `fechadecreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `cc` int NOT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  `factor` int DEFAULT '0',
  `descripcionencompra` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `idmayor` (`idmayor`),
  KEY `idarticulo` (`idarticulo`),
  KEY `idnotasdebito` (`idnotasdebito`) USING BTREE,
  CONSTRAINT `lineasnotasdebito_ibfk_1` FOREIGN KEY (`idnotasdebito`) REFERENCES `notasdebito` (`id`),
  CONSTRAINT `lineasnotasdebito_ibfk_2` FOREIGN KEY (`idmayor`) REFERENCES `mayorescompras` (`id`),
  CONSTRAINT `lineasnotasdebito_ibfk_3` FOREIGN KEY (`idarticulo`) REFERENCES `articulos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `lineasnotasdebito`
--


--
-- Table structure for table `lineaspedidosweb`
--

CREATE TABLE `lineaspedidosweb` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `codvendedor` int NOT NULL DEFAULT '0',
  `REFERENCIA` varchar(20) DEFAULT NULL,
  `situacioncocina` varchar(50) DEFAULT NULL,
  `idfactura` bigint unsigned NOT NULL,
  `consecutivo` int NOT NULL,
  `INCREMENTO` int NOT NULL,
  `codarticulo` int NOT NULL,
  `codsituacion` int NOT NULL,
  `porcentajedescuento` double DEFAULT '0',
  `referenciafront` varchar(15) DEFAULT NULL,
  `impuesto` double DEFAULT '0',
  `idarticulo` bigint unsigned NOT NULL,
  `descripcion` varchar(120) DEFAULT NULL,
  `esmodificador` int DEFAULT '0',
  `nombrearticulo` varchar(100) DEFAULT NULL,
  `cantidad` double NOT NULL DEFAULT '0',
  `comentario` varchar(200) DEFAULT NULL,
  `observaciones` varchar(200) DEFAULT NULL,
  `valorunitario` double NOT NULL DEFAULT '0',
  `idmesa` int NOT NULL DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `baseunitario` double NOT NULL DEFAULT '0',
  `ivaunitario` double NOT NULL DEFAULT '0',
  `descuento` int NOT NULL DEFAULT '0',
  `valortotal` double NOT NULL DEFAULT '0',
  `cc` int DEFAULT '2',
  `documento` varchar(3) NOT NULL DEFAULT 'V',
  `origen` varchar(25) DEFAULT NULL,
  `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `HORAINI` datetime DEFAULT NULL,
  `HORAFIN` datetime DEFAULT NULL,
  `ultimaedicion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idcliente` bigint unsigned NOT NULL DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `abonado` int NOT NULL DEFAULT '0',
  `idfacturaqueabona` int NOT NULL DEFAULT '0',
  `costomedio` double DEFAULT '0',
  `porcentajeiva` double NOT NULL DEFAULT '0',
  `base` double NOT NULL DEFAULT '0',
  `iva` double NOT NULL DEFAULT '0',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1',
  `escortesia` int NOT NULL DEFAULT '0',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `idnc` bigint unsigned NOT NULL DEFAULT '1',
  `nc` int DEFAULT '0',
  `idusuarionc` bigint unsigned NOT NULL DEFAULT '1',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `comision` int NOT NULL DEFAULT '0',
  `devolucionrevisada` int DEFAULT '0',
  `fechaabonado` datetime DEFAULT NULL,
  `fechamc` datetime DEFAULT NULL,
  `tienenc` int NOT NULL DEFAULT '0',
  `marcadoparanc` int NOT NULL DEFAULT '0',
  `servicio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `CODMODIF` int DEFAULT '0',
  `esmodif` int NOT NULL DEFAULT '0',
  `CODARTICULOABAJO` varchar(12) NOT NULL DEFAULT '',
  `PRECIOIVA` int NOT NULL DEFAULT '0',
  `NUMMODIF` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `aliasespera` int NOT NULL DEFAULT '1',
  `impresiones` int NOT NULL DEFAULT '1',
  `IDMOTIVODTO` varchar(2) NOT NULL DEFAULT '-1',
  `DETALLEDENUMLINEA` varchar(2) NOT NULL DEFAULT '0',
  `FAMILIAAENA` varchar(2) NOT NULL DEFAULT '0',
  `DETALLEMODIF` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_NUMERO` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_N` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_SERIE` varchar(2) NOT NULL DEFAULT '0',
  `ABONODE_FO` varchar(2) NOT NULL DEFAULT '-1',
  `NORDERTIQUET` varchar(1) NOT NULL DEFAULT '0',
  `SORDERTIQUET` varchar(1) NOT NULL DEFAULT '',
  `REQ` int NOT NULL DEFAULT '0',
  `COSTEIVA` int NOT NULL DEFAULT '0',
  `DTO` int NOT NULL DEFAULT '0',
  `TIPO` varchar(2) NOT NULL DEFAULT 'V',
  `CODMACRO` int NOT NULL DEFAULT '0',
  `CODFORMATO` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `codigociudad` varchar(5) DEFAULT NULL,
  `email` varchar(5) DEFAULT NULL,
  `codigopostal` varchar(5) DEFAULT NULL,
  `codigodepartamento` varchar(5) DEFAULT NULL,
  `departamento` varchar(5) DEFAULT NULL,
  `ciudad` varchar(5) DEFAULT NULL,
  `cufe` varchar(5) DEFAULT NULL,
  `unidaddemedida` varchar(25) DEFAULT NULL,
  `esnota` int DEFAULT '0',
  `unidadesdemedida` varchar(25) DEFAULT NULL,
  `impreso` int DEFAULT '0',
  `domicilio` int DEFAULT '0',
  `domicilioexterno` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'extremabelleza',
  `zonaventas` varchar(25) DEFAULT NULL,
  `seccionventas` varchar(25) DEFAULT NULL,
  `bodega` varchar(25) DEFAULT NULL,
  `integraconfamilia` int DEFAULT '1',
  `codmodifpapa` int DEFAULT '0',
  `TIPOIVA` int DEFAULT '1',
  `sesubearappi` int DEFAULT '0',
  `situacioncocina2` varchar(25) DEFAULT 'SELECCIONE',
  `refventas` varchar(20) DEFAULT NULL,
  `placa` varchar(6) DEFAULT NULL,
  `iddomiciliario` int DEFAULT NULL,
  `horaaceptado` datetime DEFAULT NULL,
  `comandaaceptada` bit(1) DEFAULT b'0',
  `horaacancelada` datetime DEFAULT NULL,
  `comandacancelada` bit(1) DEFAULT b'0',
  `motivocancela` varchar(25) DEFAULT NULL,
  `paqueterecibido` bit(1) DEFAULT b'0',
  `hora_paqueterecibido` bit(1) DEFAULT b'0',
  `porcentajecomision` decimal(5,2) DEFAULT '0.00',
  `articulovence` date DEFAULT NULL,
  `deberecoger` datetime DEFAULT NULL,
  `imei` varchar(50) DEFAULT NULL,
  `factor` int DEFAULT '1',
  `puntosrevisados` bit(1) DEFAULT b'0',
  `idusuarioredime` int DEFAULT NULL,
  `usuarioredime` varchar(50) DEFAULT NULL,
  `fecharedime` datetime DEFAULT NULL,
  `costomenu` decimal(11,2) DEFAULT '0.00',
  `comensales` int DEFAULT '0',
  `unidadesdisponibles` int DEFAULT '0',
  `entregado` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idfactura` (`idfactura`),
  KEY `idarticulo` (`idarticulo`),
  KEY `idcc` (`cc`),
  KEY `idcliente` (`idcliente`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `idvendedor` (`idvendedor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `lineaspedidosweb`
--


--
-- Table structure for table `lineasproduccion`
--

CREATE TABLE `lineasproduccion` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `idmesa` int DEFAULT '1',
  `descuento` double NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL,
  `idarticulo` bigint unsigned NOT NULL,
  `cc` bigint unsigned NOT NULL,
  `origen` varchar(8) NOT NULL DEFAULT 'MESAS',
  `comentario` varchar(200) DEFAULT NULL,
  `valorunitario` double NOT NULL DEFAULT '0',
  `cantidad` double DEFAULT '0',
  `valortotal` double NOT NULL DEFAULT '0',
  `fecha` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `fechaentregado` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `costomedio` double DEFAULT '0',
  `porcentajeiva` double NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1',
  `idmayor` bigint unsigned DEFAULT NULL,
  `nota` varchar(25) NOT NULL DEFAULT '',
  `despachado` int NOT NULL DEFAULT '0' COMMENT 'Significa que la cocina ya sirviÃ² el producto',
  `entregado` int NOT NULL DEFAULT '0' COMMENT 'Significa que la cocina ya sirviÃ² el producto',
  `comision` int NOT NULL DEFAULT '0',
  `porcentajedescuento` double NOT NULL DEFAULT '0',
  `impuesto` double NOT NULL DEFAULT '0',
  `base` double NOT NULL DEFAULT '0',
  `servicio` double NOT NULL DEFAULT '0',
  `descripcion` varchar(50) DEFAULT NULL,
  `pv` varchar(25) DEFAULT NULL,
  `factor` int DEFAULT '0',
  `unidaddemedida` varchar(25) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idarticulo` (`idarticulo`),
  KEY `idcc` (`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idvendedor` (`idvendedor`),
  KEY `idcaja` (`idmayor`),
  KEY `idcliente` (`idcliente`),
  CONSTRAINT `lineasproduccion_ibfk_1` FOREIGN KEY (`idmayor`) REFERENCES `produccion` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `lineasproduccion`
--


--
-- Table structure for table `logsintegraciones`
--

CREATE TABLE `logsintegraciones` (
  `fechacreacion` datetime DEFAULT NULL,
  `mensaje` text,
  `descatalogado` int DEFAULT '0',
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `logsintegraciones`
--


--
-- Table structure for table `marcas`
--

CREATE TABLE `marcas` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `marca` varchar(25) DEFAULT NULL,
  `celular` varchar(12) DEFAULT '',
  `video` varchar(1) DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `color` (`marca`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `marcas`
--


--
-- Table structure for table `mayoresbajas`
--

CREATE TABLE `mayoresbajas` (
  `observaciondelcleinte` varchar(200) DEFAULT NULL,
  `diasemana` varchar(200) DEFAULT NULL,
  `ordendia` int DEFAULT '0',
  `MESALIBERADA` int DEFAULT '1',
  `IDMOTIVODTO` int DEFAULT '1',
  `IDMINUTA` int DEFAULT '0',
  `direccion` varchar(200) DEFAULT NULL,
  `barrio` varchar(50) DEFAULT NULL,
  `celular` varchar(50) DEFAULT NULL,
  `cliente` varchar(100) DEFAULT NULL,
  `horaentregadoaldomiciliario` datetime DEFAULT NULL,
  `horaentregadoalcliente` datetime DEFAULT NULL,
  `fecharesolucion` date DEFAULT NULL,
  `resolucion` varchar(20) DEFAULT NULL,
  `desde` int DEFAULT '1',
  `hasta` int DEFAULT '1',
  `iddomiciliario` int DEFAULT '0',
  `documentid` varchar(200) DEFAULT NULL,
  `entregado` int DEFAULT '0',
  `despachado` int DEFAULT '0',
  `ese` int DEFAULT '0',
  `tienenc` int DEFAULT '0',
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `horatotal` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `documento` varchar(2) NOT NULL DEFAULT 'V',
  `saldo` double NOT NULL DEFAULT '0',
  `observacion` text,
  `origen` varchar(8) NOT NULL DEFAULT 'MESAS',
  `entrega` varchar(100) NOT NULL DEFAULT ' ',
  `cobra` varchar(100) NOT NULL DEFAULT ' ',
  `fecha` datetime DEFAULT CURRENT_TIMESTAMP,
  `cc` bigint unsigned NOT NULL,
  `idmesa` int DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `descuento` double NOT NULL DEFAULT '0',
  `total` double NOT NULL DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `abonado` int NOT NULL DEFAULT '0',
  `idfacturaqueabona` int NOT NULL DEFAULT '0',
  `cerrado` int NOT NULL DEFAULT '0',
  `recibido` double NOT NULL DEFAULT '0',
  `devuelta` double NOT NULL DEFAULT '0',
  `iva` int NOT NULL DEFAULT '0',
  `vigenciadelcredito` int NOT NULL DEFAULT '0',
  `condicion` int NOT NULL DEFAULT '0',
  `fechavencimiento` datetime DEFAULT CURRENT_TIMESTAMP,
  `ultimaedicion` datetime DEFAULT CURRENT_TIMESTAMP,
  `pedidonumero` varchar(10) DEFAULT NULL,
  `base` double NOT NULL DEFAULT '0',
  `inquiry` varchar(23) NOT NULL DEFAULT ' ',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1' COMMENT 'este vendedor no hizo toda la venta, solo abriÃ² la mesa',
  `emailenviado` int NOT NULL DEFAULT '0',
  `escortesia` int NOT NULL DEFAULT '0',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `nota` varchar(25) NOT NULL DEFAULT '',
  `fechaabonado` datetime DEFAULT NULL,
  `servicio` int NOT NULL DEFAULT '0',
  `domicilio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `CODFORMAPAGO` varchar(5) DEFAULT '1',
  `codalmacen` varchar(25) DEFAULT '1',
  `TIPODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `ESTADODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `n` varchar(1) NOT NULL DEFAULT 'B',
  `aliasespera` int NOT NULL DEFAULT '0',
  `codvendedor` int NOT NULL DEFAULT '0',
  `impresiones` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `CODTIPOTASA1` varchar(1) NOT NULL DEFAULT '1',
  `esbarra` varchar(1) NOT NULL DEFAULT 'F',
  `CODTARIFA` varchar(1) NOT NULL DEFAULT '1',
  `ivainc` varchar(1) NOT NULL DEFAULT 'T',
  `codzona` int NOT NULL DEFAULT '1',
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `idvendedor` (`idvendedor`),
  KEY `mayoresbajas_ibfk_3` (`idcliente`),
  CONSTRAINT `mayoresbajas_ibfk_1` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`),
  CONSTRAINT `mayoresbajas_ibfk_2` FOREIGN KEY (`idz`) REFERENCES `z` (`id`),
  CONSTRAINT `mayoresbajas_ibfk_3` FOREIGN KEY (`idcliente`) REFERENCES `clientes` (`id`),
  CONSTRAINT `mayoresbajas_ibfk_4` FOREIGN KEY (`idvendedor`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayoresbajas`
--


--
-- Table structure for table `mayorescompras`
--

CREATE TABLE `mayorescompras` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `numero` varchar(10) DEFAULT NULL,
  `fecha` datetime DEFAULT CURRENT_TIMESTAMP,
  `iva` double NOT NULL DEFAULT '0',
  `descuentocomercial` double NOT NULL DEFAULT '0',
  `base` double NOT NULL DEFAULT '0',
  `idproveedor` bigint unsigned NOT NULL DEFAULT '0',
  `valor` double NOT NULL DEFAULT '0',
  `cc` bigint unsigned NOT NULL DEFAULT '0',
  `documento` varchar(7) DEFAULT 'CONTADO',
  `saldo` int DEFAULT '0',
  `nd` int DEFAULT '0',
  `vence` datetime DEFAULT CURRENT_TIMESTAMP,
  `observacion` text,
  `idz` int NOT NULL DEFAULT '1',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `descuento` double DEFAULT '0',
  `pv` varchar(25) DEFAULT 'distrito',
  `idusuario` int DEFAULT '1',
  `esremision` varchar(25) DEFAULT NULL,
  `consecutivodocequ` int DEFAULT '0',
  `formadepago` int DEFAULT '10',
  `cufe` varchar(250) DEFAULT NULL,
  `consecutivofe` varchar(5) DEFAULT NULL,
  `sqr` text,
  `ssignature` text,
  `mediodepagocompra` varchar(25) DEFAULT NULL,
  `fechavencecredito` date DEFAULT NULL,
  `comandaf` varchar(11) DEFAULT NULL,
  `overvacionescompra` varchar(200) DEFAULT NULL,
  `otrosdescuentos` int DEFAULT '0',
  `p_reteica` decimal(6,3) DEFAULT '0.000',
  `p_reterenta` decimal(6,3) DEFAULT '0.000',
  `v_reteica` decimal(11,2) DEFAULT '0.00',
  `v_reterenta` decimal(11,2) DEFAULT '0.00',
  `ibuatotal` mediumint unsigned DEFAULT '0',
  `advaloremtotal` int DEFAULT '0',
  `flete` int DEFAULT '0',
  `v_reteiva` double DEFAULT '0',
  `p_reteiva` double DEFAULT '0',
  `p_descuentosinfacturar` double DEFAULT '0',
  `cufenotadeajuste` varchar(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idproveedor` (`idproveedor`),
  KEY `cc` (`cc`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayorescompras`
--


--
-- Table structure for table `mayoresconteodiario`
--

CREATE TABLE `mayoresconteodiario` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date DEFAULT NULL,
  `idusuario` bigint unsigned DEFAULT NULL,
  `fechacreacion` datetime DEFAULT CURRENT_TIMESTAMP,
  `estado` varchar(25) DEFAULT 'ABIERTO',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  KEY `idusuario` (`idusuario`),
  KEY `idusuario_2` (`idusuario`),
  CONSTRAINT `mayoresconteodiario_ibfk_1` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayoresconteodiario`
--


--
-- Table structure for table `mayorescotizaciones`
--

CREATE TABLE `mayorescotizaciones` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `bruto` float NOT NULL DEFAULT '0',
  `descuento` float NOT NULL DEFAULT '0',
  `total` float NOT NULL DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `fechavencimiento` datetime DEFAULT CURRENT_TIMESTAMP,
  `cliente` varchar(25) DEFAULT NULL,
  `direccion` varchar(25) DEFAULT NULL,
  `telefono` varchar(25) DEFAULT NULL,
  `base` double DEFAULT '0',
  `impuesto` double DEFAULT '0',
  UNIQUE KEY `id` (`id`),
  KEY `idusuario` (`idusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `mayorescotizaciones`
--


--
-- Table structure for table `mayoresfichaderegistro`
--

CREATE TABLE `mayoresfichaderegistro` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `consecutivo` int DEFAULT NULL,
  `fechacreacion` datetime DEFAULT NULL,
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayoresfichaderegistro`
--


--
-- Table structure for table `mayoresinventarioinicial`
--

CREATE TABLE `mayoresinventarioinicial` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `fecha` date DEFAULT NULL,
  `idusuario` bigint unsigned DEFAULT NULL,
  `fechacreacion` datetime DEFAULT CURRENT_TIMESTAMP,
  `cc` bigint unsigned DEFAULT '1',
  `estado` varchar(25) DEFAULT 'ABIERTO',
  `pv` varchar(25) DEFAULT 'distrito',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `fecha` (`fecha`,`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idusuario_2` (`idusuario`),
  KEY `cc` (`cc`),
  CONSTRAINT `mayoresinventarioinicial_ibfk_1` FOREIGN KEY (`idusuario`) REFERENCES `clientes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayoresinventarioinicial`
--


--
-- Table structure for table `mayoresnotascredito`
--

CREATE TABLE `mayoresnotascredito` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `observaciondelcleinte` varchar(200) DEFAULT NULL,
  `diasemana` varchar(200) DEFAULT NULL,
  `ordendia` int DEFAULT '0',
  `MESALIBERADA` int DEFAULT '1',
  `IDMOTIVODTO` int DEFAULT '1',
  `IDMINUTA` int DEFAULT '0',
  `direccion` varchar(200) DEFAULT NULL,
  `barrio` varchar(50) DEFAULT NULL,
  `celular` varchar(50) DEFAULT NULL,
  `cliente` varchar(100) DEFAULT NULL,
  `horaentregadoaldomiciliario` datetime DEFAULT NULL,
  `horaentregadoalcliente` datetime DEFAULT NULL,
  `fecharesolucion` date DEFAULT NULL,
  `resolucion` varchar(20) DEFAULT NULL,
  `desde` int DEFAULT '1',
  `hasta` int DEFAULT '1',
  `iddomiciliario` int DEFAULT '0',
  `documentid` varchar(200) DEFAULT NULL,
  `entregado` int DEFAULT '0',
  `despachado` int DEFAULT '0',
  `ese` int DEFAULT '0',
  `tienenc` int DEFAULT '0',
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `horatotal` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `documento` varchar(2) NOT NULL DEFAULT 'V',
  `saldo` double NOT NULL DEFAULT '0',
  `observacion` text,
  `origen` varchar(25) DEFAULT NULL,
  `entrega` varchar(100) NOT NULL DEFAULT ' ',
  `cobra` varchar(100) NOT NULL DEFAULT ' ',
  `fecha` datetime DEFAULT CURRENT_TIMESTAMP,
  `cc` int DEFAULT '2',
  `idmesa` int DEFAULT '1',
  `bruto` double NOT NULL DEFAULT '0',
  `descuento` double NOT NULL DEFAULT '0',
  `total` int DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `abonado` int NOT NULL DEFAULT '0',
  `idfacturaqueabona` int NOT NULL DEFAULT '0',
  `cerrado` int NOT NULL DEFAULT '0',
  `recibido` double NOT NULL DEFAULT '0',
  `devuelta` double NOT NULL DEFAULT '0',
  `iva` int NOT NULL DEFAULT '0',
  `vigenciadelcredito` int NOT NULL DEFAULT '0',
  `condicion` int NOT NULL DEFAULT '0',
  `fechavencimiento` datetime DEFAULT CURRENT_TIMESTAMP,
  `ultimaedicion` datetime DEFAULT CURRENT_TIMESTAMP,
  `pedidonumero` varchar(10) DEFAULT NULL,
  `base` double NOT NULL DEFAULT '0',
  `inquiry` varchar(23) NOT NULL DEFAULT ' ',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `idvendedor` bigint unsigned NOT NULL DEFAULT '1' COMMENT 'este vendedor no hizo toda la venta, solo abriÃ² la mesa',
  `emailenviado` int NOT NULL DEFAULT '0',
  `escortesia` int NOT NULL DEFAULT '0',
  `idcaja` bigint unsigned NOT NULL DEFAULT '1',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `nota` varchar(25) NOT NULL DEFAULT '',
  `fechaabonado` datetime DEFAULT NULL,
  `servicio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `CODFORMAPAGO` varchar(5) DEFAULT '1',
  `codalmacen` varchar(25) DEFAULT '1',
  `TIPODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `ESTADODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `n` varchar(1) NOT NULL DEFAULT 'B',
  `aliasespera` int NOT NULL DEFAULT '0',
  `codvendedor` int NOT NULL DEFAULT '0',
  `impresiones` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `CODTIPOTASA1` varchar(1) NOT NULL DEFAULT '1',
  `esbarra` varchar(1) NOT NULL DEFAULT 'F',
  `CODTARIFA` varchar(1) NOT NULL DEFAULT '1',
  `ivainc` varchar(1) NOT NULL DEFAULT 'T',
  `codzona` int NOT NULL DEFAULT '1',
  `domicilio` double NOT NULL DEFAULT '0',
  `cedula` varchar(15) NOT NULL DEFAULT '999999',
  `codigociudad` varchar(5) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `codigopostal` varchar(5) DEFAULT NULL,
  `codigodepartamento` varchar(5) DEFAULT NULL,
  `departamento` varchar(25) DEFAULT NULL,
  `ciudad` varchar(5) DEFAULT NULL,
  `cufe` varchar(250) DEFAULT NULL,
  `resoluciondesde` date DEFAULT NULL,
  `resolucionhasta` date DEFAULT NULL,
  `consecutivofe` int DEFAULT '0',
  `prefijofe` varchar(5) DEFAULT NULL,
  `id_tipo_persona` int DEFAULT '0',
  `fecha_registrofactura` varchar(20) DEFAULT NULL,
  `COD_SATELITE` varchar(25) DEFAULT NULL,
  `notacreditofe` int DEFAULT '0',
  `cufenc` varchar(250) DEFAULT NULL,
  `numlineas` int DEFAULT '0',
  `razonsocial` varchar(200) DEFAULT NULL,
  `nombrecomercial` varchar(200) DEFAULT NULL,
  `tipodepersona` int DEFAULT '0',
  `tipo_identificacion` varchar(5) DEFAULT NULL,
  `dv` int DEFAULT NULL,
  `sfiscalresponsibilities` varchar(10) DEFAULT NULL,
  `regimenfiscal` int DEFAULT NULL,
  `contacto` varchar(100) DEFAULT NULL,
  `prefijo` varchar(5) DEFAULT 'FV',
  `conceptoanulado` varchar(150) DEFAULT NULL,
  `garantiahasta` date DEFAULT NULL,
  `cantidadmediosdepago` int DEFAULT '0',
  `snumsop` varchar(25) DEFAULT NULL,
  `inumoper` varchar(25) DEFAULT NULL,
  `anuladoencontapyme` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'distrito',
  UNIQUE KEY `id` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `idvendedor` (`idvendedor`),
  KEY `facturas_ibfk_3` (`idcliente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayoresnotascredito`
--


--
-- Table structure for table `mayoresordendeservicio`
--

CREATE TABLE `mayoresordendeservicio` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `consecutivo` int DEFAULT NULL,
  `idusuario` int DEFAULT NULL,
  `fechacreacion` datetime DEFAULT NULL,
  `foto1` longtext,
  `foto2` longtext,
  `foto3` longtext,
  `foto4` longtext,
  `foto5` longtext,
  `foto6` longtext,
  `foto7` longtext,
  `foto8` longtext,
  `idmesa` int DEFAULT NULL,
  `estado` varchar(25) NOT NULL DEFAULT 'ABIERTA',
  `idfactura` int DEFAULT '0',
  `kilometraje` int DEFAULT '0',
  `idtecnico1` int DEFAULT NULL,
  `idtecnico2` int DEFAULT NULL,
  `idtecnico3` int DEFAULT NULL,
  `firma` text,
  `horafirmado` datetime DEFAULT NULL,
  `placa` varchar(7) DEFAULT NULL,
  `valor` double DEFAULT '0',
  `numlineas` int DEFAULT '0',
  `estadovehiculo` varchar(50) DEFAULT NULL,
  `idclientes` int DEFAULT '0',
  `idcliente` int DEFAULT '0',
  `descuento` double DEFAULT '0',
  `marca` varchar(50) DEFAULT NULL,
  `modelo` int DEFAULT NULL,
  `matricula` varchar(25) DEFAULT NULL,
  `combustible` int DEFAULT '0',
  `descripcionreparacion` varchar(500) DEFAULT NULL,
  `repuestosaportados` varchar(500) DEFAULT NULL,
  `firmaresguardo` text,
  `horafirmadoresguardo` datetime DEFAULT NULL,
  `autorizadoresguardo` int DEFAULT '0',
  `recogepiezas` int DEFAULT '0',
  `referencia` varchar(25) DEFAULT NULL,
  `numerodebastidor` varchar(25) DEFAULT NULL,
  `fechaprevista` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `idfactura` (`idfactura`,`idmesa`)
) ENGINE=InnoDB AUTO_INCREMENT=397 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayoresordendeservicio`
--

INSERT INTO `mayoresordendeservicio` (`id`, `consecutivo`, `idusuario`, `fechacreacion`, `foto1`, `foto2`, `foto3`, `foto4`, `foto5`, `foto6`, `foto7`, `foto8`, `idmesa`, `estado`, `idfactura`, `kilometraje`, `idtecnico1`, `idtecnico2`, `idtecnico3`, `firma`, `horafirmado`, `placa`, `valor`, `numlineas`, `estadovehiculo`, `idclientes`, `idcliente`, `descuento`, `marca`, `modelo`, `matricula`, `combustible`, `descripcionreparacion`, `repuestosaportados`, `firmaresguardo`, `horafirmadoresguardo`, `autorizadoresguardo`, `recogepiezas`, `referencia`, `numerodebastidor`, `fechaprevista`) VALUES (91,NULL,7,'2023-10-02 14:57:49',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',12,0,NULL,NULL,NULL,NULL,NULL,'TUR001',1852500,1,NULL,0,16,0,'KUBOTA',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(101,NULL,2,'2023-10-02 23:59:59',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,9,'ABIERTA',6,0,NULL,NULL,NULL,NULL,NULL,'NMU22B',314160,1,NULL,0,0,0,'PASSAGIO',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(103,NULL,2,'2023-10-03 06:35:51',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,9,'ABIERTA',7,0,NULL,NULL,NULL,NULL,NULL,'NMU22B',314160,1,NULL,0,0,0,'NMU22B',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(104,NULL,2,'2023-10-03 06:36:26',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,8,'ABIERTA',8,0,NULL,NULL,NULL,NULL,NULL,'NMU22B',1852500,3,NULL,0,0,0,'NMU22B',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(105,NULL,2,'2023-10-03 06:43:07',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,9,'ABIERTA',9,0,NULL,NULL,NULL,NULL,NULL,'NMU22B',0,1,NULL,0,0,0,'NMU22B',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(106,NULL,2,'2023-10-03 06:45:15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,9,'ABIERTA',10,0,NULL,NULL,NULL,NULL,NULL,'NMU22B',0,1,NULL,0,0,0,'NMU22B',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(107,NULL,2,'2023-10-03 06:45:39',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,9,'ABIERTA',11,0,NULL,NULL,NULL,NULL,NULL,'NMU22B',314160,1,NULL,0,0,0,'NMU22B',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(108,NULL,7,'2023-10-04 11:21:31',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,'ABIERTA',13,0,NULL,NULL,NULL,NULL,NULL,'TUR002',950000,1,NULL,0,17,0,'TUR002',0,'',0,'REPARACION DE TURBO HINO J205',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(109,NULL,7,'2023-10-04 12:16:23',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,15,'ABIERTA',14,0,NULL,NULL,NULL,NULL,NULL,'TUR005',1000000,1,NULL,0,19,0,'QD 32',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(110,NULL,7,'2023-10-04 15:09:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',66,0,NULL,NULL,NULL,NULL,NULL,'TUR003',1000000,2,NULL,0,20,0,'NKR 2800',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(111,NULL,7,'2023-10-04 15:26:09',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,9,'ABIERTA',16,0,NULL,NULL,NULL,NULL,NULL,'EPW558',1200000,1,NULL,0,22,0,'NISSAN FRONTIER',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(113,NULL,7,'2023-10-04 15:57:18',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,7,'ABIERTA',15,0,NULL,NULL,NULL,NULL,NULL,'KGI171',650000,1,NULL,0,24,0,'TOYOTA 2.5',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(114,NULL,7,'2023-10-05 12:44:27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',17,0,NULL,NULL,NULL,NULL,NULL,'IKZ271',1200000,1,NULL,0,8,0,'TOYOTA TXL',0,'',0,'REPARACION TUBO , TIENE HECHA DE ANILLOS X 120.000 \nSE COMPRA MANGUERA X 20.000',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(115,NULL,7,'2023-10-05 14:52:51',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,6,'ABIERTA',60,0,NULL,NULL,NULL,NULL,NULL,'TUR004',550000,1,NULL,0,77,0,'MAQUINA PERKIN',0,'',0,'EMPAQUETADURA TURBO PEKINS',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(117,NULL,7,'2023-10-05 17:36:21',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',53,0,NULL,NULL,NULL,NULL,NULL,'TUR006',2500000,1,NULL,0,28,0,'ISL350',0,'',0,'CAMBIO DE EMPAQUETADURA, GEOMETRIA Y EJE',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(119,NULL,7,'2023-10-06 17:44:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,9,'ABIERTA',55,0,NULL,NULL,NULL,NULL,NULL,'OUC795',650000,1,NULL,0,36,0,'D-MAX',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(120,NULL,7,'2023-10-11 10:06:24',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',67,0,NULL,NULL,NULL,NULL,NULL,'WLB858',650000,1,NULL,0,69,0,'NKR',0,'',0,'REPARACION DE TURBO \n\nPERA DEL OTUN S.A INTERNO 150',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(121,NULL,7,'2023-10-11 10:34:46',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,7,'ABIERTA',99,0,NULL,NULL,NULL,NULL,NULL,'PFH849',1100000,1,NULL,0,70,0,'MITSUBISHI',0,'',0,'REPARACION TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(122,NULL,7,'2023-10-11 11:04:30',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,'ABIERTA',59,0,NULL,NULL,NULL,NULL,NULL,'TUR009',750000,1,NULL,0,29,0,'NPR 3.9',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(123,NULL,7,'2023-10-11 11:14:34',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',54,0,NULL,NULL,NULL,NULL,NULL,'DAA834',950000,1,NULL,0,72,0,'HYUNDAI TUCSON 2.0',0,'',0,'CAMBIO DE CATRIX ',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(124,NULL,7,'2023-10-11 11:33:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',56,0,NULL,NULL,NULL,NULL,NULL,'TUR008',1100000,1,NULL,0,73,0,'NKR',0,'',0,'REPARACION DE TURBO (CLIENTE ENVIO EL TURBO)',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(125,NULL,7,'2023-10-11 11:42:02',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',57,0,NULL,NULL,NULL,NULL,NULL,'WDJ972',900000,1,NULL,0,74,0,'QD32',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(126,NULL,7,'2023-10-11 11:54:18',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',58,0,NULL,NULL,NULL,NULL,NULL,'EQQ410',1900000,1,NULL,0,75,0,'AMAROK',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(127,NULL,7,'2023-10-13 10:23:30',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',61,0,NULL,NULL,NULL,NULL,NULL,'TUR009',850000,1,NULL,0,73,0,'T27',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(128,NULL,7,'2023-10-13 10:31:44',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,15,'ABIERTA',62,0,NULL,NULL,NULL,NULL,NULL,'DHV116',1300000,1,NULL,0,79,0,'NISSAN NP300',0,'',0,'SENSOR NISSAN NP300',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(131,NULL,7,'2023-10-13 10:41:41',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13,'ABIERTA',63,0,NULL,NULL,NULL,NULL,NULL,'DRL755',1100000,1,NULL,0,81,0,'NISSAN FRONTIER NP 300',0,'',0,'REPARACION DE TURBO NISSAN FRONTIER NP 300',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(137,NULL,7,'2023-10-13 11:05:22',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,6,'ABIERTA',76,0,NULL,NULL,NULL,NULL,NULL,'DHU195',2700000,1,NULL,0,82,0,'RENAULT KOLEOS',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(139,NULL,7,'2023-10-13 11:07:50',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,5,'ABIERTA',77,0,NULL,NULL,NULL,NULL,NULL,'SJS731',650000,1,NULL,0,83,0,'MT 3000',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(140,NULL,7,'2023-10-13 12:13:07',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,4,'ABIERTA',64,0,NULL,NULL,NULL,NULL,NULL,'UFZ637',1200000,1,NULL,0,84,0,'UFZ637',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(142,NULL,7,'2023-10-14 13:48:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',65,0,NULL,NULL,NULL,NULL,NULL,'USC500',900000,1,NULL,0,90,0,'FTR',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(144,NULL,7,'2023-10-18 18:06:09',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',68,0,NULL,NULL,NULL,NULL,NULL,'SDQ206',700000,1,NULL,0,92,0,'HINO 500',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(145,NULL,7,'2023-10-18 18:12:10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',69,0,NULL,NULL,NULL,NULL,NULL,'SDQ932',1900000,1,NULL,0,93,0,'FOTON',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(146,NULL,7,'2023-10-19 15:31:41',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',70,0,NULL,NULL,NULL,NULL,NULL,'WEF407',900000,1,NULL,0,94,0,'MITSUBISHI',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(147,NULL,7,'2023-10-19 15:48:03',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',71,0,NULL,NULL,NULL,NULL,NULL,'TUR010',980000,1,NULL,0,17,0,'HINO 500',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(148,NULL,7,'2023-10-19 15:58:48',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',72,0,NULL,NULL,NULL,NULL,NULL,'DRW296',1360000,1,NULL,0,96,0,'NISSAN FRONTIER',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(149,NULL,7,'2023-10-19 17:34:08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',73,0,NULL,NULL,NULL,NULL,NULL,'TDY502',550000,1,NULL,0,97,0,'NPR GRETWALL',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(150,NULL,7,'2023-10-20 18:29:17',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',74,0,NULL,NULL,NULL,NULL,NULL,'TDY502',550000,1,NULL,0,97,0,'TDY502',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(151,NULL,7,'2023-10-21 13:29:51',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',75,0,NULL,NULL,NULL,NULL,NULL,'SDN756',800000,1,NULL,0,99,0,'MITSUBISHI',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(153,NULL,7,'2023-10-24 15:03:10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',78,0,NULL,NULL,NULL,NULL,NULL,'SKY131',1050000,1,NULL,0,102,0,'SKY131',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(154,NULL,7,'2023-10-24 15:21:20',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',79,0,NULL,NULL,NULL,NULL,NULL,'WFL744',1000000,1,NULL,0,28,0,'WFL744',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(155,NULL,7,'2023-10-24 16:42:39',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',80,0,NULL,NULL,NULL,NULL,NULL,'OUC049',1000000,1,NULL,0,105,0,'OUC049',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(156,NULL,7,'2023-10-24 16:51:21',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',81,0,NULL,NULL,NULL,NULL,NULL,'STR247',3400000,1,NULL,0,106,0,'STR247',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(157,NULL,7,'2023-10-24 17:03:31',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',82,0,NULL,NULL,NULL,NULL,NULL,'TUR011',1300000,1,NULL,0,44,0,'TUR011',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(158,NULL,7,'2023-10-25 10:05:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',83,0,NULL,NULL,NULL,NULL,NULL,'HLL738',700000,1,NULL,0,108,0,'HLL738',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(159,NULL,7,'2023-10-25 16:18:25',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',84,0,NULL,NULL,NULL,NULL,NULL,'TUR012',1100000,1,NULL,0,111,0,'TUR012',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(160,NULL,7,'2023-10-25 17:11:02',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',85,0,NULL,NULL,NULL,NULL,NULL,'SMR636',1100000,1,NULL,0,113,0,'SMR636',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(161,NULL,7,'2023-10-27 11:30:39',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',86,0,NULL,NULL,NULL,NULL,NULL,'MCM037',1900000,1,NULL,0,118,0,'MCM037',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(162,NULL,7,'2023-10-27 14:56:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',87,0,NULL,NULL,NULL,NULL,NULL,'722739',1800000,1,NULL,0,28,0,'722739',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(163,NULL,7,'2023-10-27 15:04:49',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',88,0,NULL,NULL,NULL,NULL,NULL,'722739',1800000,1,NULL,0,28,0,'722739',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(164,NULL,7,'2023-10-27 16:00:49',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',89,0,NULL,NULL,NULL,NULL,NULL,'HTO541',1200000,1,NULL,0,42,0,'HTO541',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(165,NULL,7,'2023-10-27 16:22:11',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',90,0,NULL,NULL,NULL,NULL,NULL,'HTO541',650000,1,NULL,0,119,0,'HTO541',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(166,NULL,7,'2023-10-27 16:34:55',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',91,0,NULL,NULL,NULL,NULL,NULL,'TUR011',700000,1,NULL,0,122,0,'TUR011',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(167,NULL,7,'2023-10-27 17:37:10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',92,0,NULL,NULL,NULL,NULL,NULL,'TUR012',750000,1,NULL,0,29,0,'TUR012',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(168,NULL,7,'2023-10-28 09:38:56',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',93,0,NULL,NULL,NULL,NULL,NULL,'SPP188',1300000,1,NULL,0,123,0,'SPP188',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(170,NULL,7,'2023-10-28 11:42:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',94,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','TUR013',2371200,1,NULL,0,125,0,'NQR',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(171,NULL,7,'2023-10-28 13:24:47',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',95,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','PEZ744',750000,1,NULL,0,127,0,'TOYOTA',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(172,NULL,7,'2023-10-30 12:37:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',96,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','NAP234',700000,1,NULL,0,128,0,'NISSAN',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(173,NULL,7,'2023-10-31 17:13:22',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',97,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','SNT811',1200000,1,NULL,0,131,0,'VOLSKWAGEN',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(174,NULL,7,'2023-10-31 17:32:38',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',98,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','PEQ149',1200000,1,NULL,0,132,0,'PEQ149',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(176,NULL,7,'2023-11-01 17:53:37',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,15,'ABIERTA',100,0,NULL,NULL,NULL,NULL,NULL,'VEI805',950000,1,NULL,0,134,0,'VEI805',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(177,NULL,7,'2023-11-02 14:37:46',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',101,0,NULL,NULL,NULL,NULL,NULL,'SPY205',1000000,1,NULL,0,135,0,'HINO',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(178,NULL,7,'2023-11-02 15:41:51',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',102,0,NULL,NULL,NULL,NULL,NULL,'TTO286',900000,1,NULL,0,136,0,'RENAULT MASTER',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(179,NULL,7,'2023-11-02 18:04:43',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',103,0,NULL,NULL,NULL,NULL,NULL,'SPE146',1400000,1,NULL,0,137,0,'SPE146',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(180,NULL,7,'2023-11-03 11:36:43',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',104,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','WFL722',800000,1,NULL,0,28,0,'WFL722',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(181,NULL,7,'2023-11-04 12:27:58',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',105,0,NULL,NULL,NULL,NULL,NULL,'MOR815',900000,1,NULL,0,139,0,'MOR815',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(182,NULL,7,'2023-11-04 13:15:46',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',106,0,NULL,NULL,NULL,NULL,NULL,'SXF878',850000,1,NULL,0,140,0,'SXF878',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(183,NULL,7,'2023-11-07 16:20:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',107,0,NULL,NULL,NULL,NULL,NULL,'HBY855',2300000,1,NULL,0,142,0,'HBY855',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(184,NULL,7,'2023-11-07 16:33:51',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',108,0,NULL,NULL,NULL,NULL,NULL,'SNR696',1100000,1,NULL,0,143,0,'SNR696',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(185,NULL,7,'2023-11-08 11:11:03',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',109,0,NULL,NULL,NULL,NULL,NULL,'OCA097',1200000,1,NULL,0,40,0,'OCA097',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(186,NULL,7,'2023-11-08 11:55:41',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',110,0,NULL,NULL,NULL,NULL,NULL,'TJA482',1200000,1,NULL,0,145,0,'FORD CARGO',0,'',0,'REPARACION TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(187,NULL,7,'2023-11-08 12:14:39',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,14,'ABIERTA',111,0,NULL,NULL,NULL,NULL,NULL,'TUR014',400000,1,NULL,0,146,0,'NISSAN',0,'',0,'REPARACION DE TURBO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(188,NULL,7,'2023-11-08 16:19:05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',112,0,NULL,NULL,NULL,NULL,NULL,'TUR015',870000,1,NULL,0,44,0,'TUR015',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(189,NULL,7,'2023-11-08 16:48:05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',113,0,NULL,NULL,NULL,NULL,NULL,'FVR236',280000,1,NULL,0,45,0,'FVR236',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(190,NULL,7,'2023-11-08 17:11:23',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',114,0,NULL,NULL,NULL,NULL,NULL,'AKK302',650000,1,NULL,0,148,0,'AKK302',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(191,NULL,7,'2023-11-08 17:28:58',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',115,0,NULL,NULL,NULL,NULL,NULL,'VCY581',1800000,1,NULL,0,149,0,'CITROEN',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(192,NULL,7,'2023-11-09 12:48:17',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',116,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','QFW634',900000,1,NULL,0,150,0,'QFW634',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(193,NULL,7,'2023-11-09 16:03:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13,'ABIERTA',117,0,NULL,NULL,NULL,NULL,NULL,'OCM820',3000000,1,NULL,0,151,0,'RENAULT TRAFFIC',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(194,NULL,7,'2023-11-14 17:31:03',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',118,0,NULL,NULL,NULL,'data:image/jpeg;base64,[encoded data, 16596 characters]','2023-12-02 15:48:15','WHK247',700000,1,NULL,0,154,0,'WHK247',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(195,NULL,7,'2023-11-14 17:45:46',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',119,0,NULL,NULL,NULL,NULL,NULL,'STQ452',1100000,1,NULL,0,155,0,'STQ452',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(196,NULL,7,'2023-11-14 17:54:04',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',120,0,NULL,NULL,NULL,NULL,NULL,'WFJ447',700000,1,NULL,0,156,0,'WFJ447',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(197,NULL,7,'2023-11-15 16:32:03',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',121,0,NULL,NULL,NULL,NULL,NULL,'TUR015',700000,1,NULL,0,157,0,'TUR015',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(198,NULL,7,'2023-11-15 17:27:43',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13,'ABIERTA',122,0,NULL,NULL,NULL,NULL,NULL,'SXJ480',2000000,1,NULL,0,158,0,'SXJ480',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(199,NULL,7,'2023-11-16 14:37:37',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',123,0,NULL,NULL,NULL,NULL,NULL,'TLO049',450000,1,NULL,0,159,0,'TLO049',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(201,NULL,7,'2023-11-18 11:48:07',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',124,0,NULL,NULL,NULL,NULL,NULL,'STR530',2800000,1,NULL,0,163,0,'STR530',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(202,NULL,7,'2023-11-18 13:12:37',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',125,0,NULL,NULL,NULL,NULL,NULL,'ETL644',2000000,1,NULL,0,164,0,'ETL644',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(204,NULL,7,'2023-11-20 17:45:24',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',126,0,NULL,NULL,NULL,NULL,NULL,'SPY219',2000000,1,NULL,0,165,0,'SPY219',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(205,NULL,7,'2023-11-21 12:20:32',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',127,0,NULL,NULL,NULL,NULL,NULL,'PXJ647',750000,1,NULL,0,166,0,'PXJ647',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(206,NULL,7,'2023-11-21 12:29:10',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',128,0,NULL,NULL,NULL,NULL,NULL,'SJU578',1100000,1,NULL,0,167,0,'SJU578',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(207,NULL,7,'2023-11-21 17:20:39',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',129,0,NULL,NULL,NULL,NULL,NULL,'TUR015',750000,1,NULL,0,168,0,'TUR015',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(208,NULL,7,'2023-11-21 17:41:38',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',131,0,NULL,NULL,NULL,NULL,NULL,'TUR015',1700000,1,NULL,0,17,0,'TUR015',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(209,NULL,7,'2023-11-22 17:51:19',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,13,'ABIERTA',130,0,NULL,NULL,NULL,NULL,NULL,'TTK559',5000000,1,NULL,0,28,0,'TTK559',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(211,NULL,7,'2023-11-24 11:15:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',132,0,NULL,NULL,NULL,NULL,NULL,'WBE549',300000,1,NULL,0,172,0,'WBE549',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(212,NULL,7,'2023-11-27 11:16:41',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',133,0,NULL,NULL,NULL,NULL,NULL,'SNZ442',1100000,1,NULL,0,176,0,'SNZ442',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(213,NULL,7,'2023-11-27 14:22:25',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',134,0,NULL,NULL,NULL,NULL,NULL,'WAA042',1000000,1,NULL,0,177,0,'WAA042',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(214,NULL,7,'2023-11-27 14:44:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',135,0,NULL,NULL,NULL,NULL,NULL,'TUR016',1100000,1,NULL,0,178,0,'TUR016',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(215,NULL,7,'2023-11-27 15:26:54',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',136,0,NULL,NULL,NULL,NULL,NULL,'STQ018',1300000,1,NULL,0,179,0,'STQ018',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(216,NULL,7,'2023-11-27 17:40:08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',137,0,NULL,NULL,NULL,NULL,NULL,'FQK292',500000,1,NULL,0,180,0,'FQK292',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(217,NULL,7,'2023-11-27 17:54:43',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,12,'ABIERTA',138,0,NULL,NULL,NULL,NULL,NULL,'MNW904',2070000,1,NULL,0,182,0,'MNW904',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(232,NULL,1,'2023-12-04 20:07:20',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',10,0,NULL,NULL,NULL,NULL,NULL,'ONC06E',636270,15,NULL,0,36,0,'PULSAR NS200',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(233,NULL,5,'2023-12-05 11:40:16',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',8,0,NULL,NULL,NULL,NULL,NULL,'OZB51F',51000,2,NULL,0,39,0,'HONDA',0,'',0,'CAMBIO DE ACEITE',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(236,NULL,5,'2023-12-05 16:43:29',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,'ABIERTA',9,0,NULL,NULL,NULL,NULL,NULL,'SNX30G',113000,3,NULL,0,45,0,'AKT NKD',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(237,NULL,5,'2023-12-06 09:51:17',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',13,20780,NULL,NULL,NULL,NULL,NULL,'CEI75G',75000,3,NULL,0,46,0,'SUZUKI GN',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(239,NULL,5,'2023-12-06 11:15:36',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',17,1000,NULL,NULL,NULL,NULL,NULL,'QZX60G',83000,3,NULL,0,48,0,'SUZUKI GIXXER',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(240,NULL,5,'2023-12-06 12:41:51',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',18,0,NULL,NULL,NULL,NULL,NULL,'TRF78E',845400,4,NULL,0,38,0,'YAMAHA BWSFI',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(242,NULL,5,'2023-12-06 18:09:05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',20,0,NULL,NULL,NULL,NULL,NULL,'JLP33G',982000,8,NULL,0,49,0,'PULSAR NS200 FI',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(243,NULL,5,'2023-12-07 10:06:43',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',23,0,NULL,NULL,NULL,NULL,NULL,'RJG67F',200000,2,NULL,0,50,0,'BMW',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(248,NULL,5,'2023-12-11 12:44:24',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',32,0,NULL,NULL,NULL,NULL,NULL,'XXXXXX',25000,2,NULL,0,0,0,'XXXXXX',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(276,NULL,5,'2024-01-18 14:36:09',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',204,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',78000,2,NULL,0,48,0,'SUZUKI GIXXER',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(280,NULL,5,'2024-01-22 10:03:44',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',217,0,NULL,NULL,NULL,NULL,NULL,'CEI65G',130000,4,NULL,0,46,0,'SUZUKI GN125F',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(283,NULL,5,'2024-01-24 10:08:52',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',229,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',40000,2,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(289,NULL,5,'2024-02-01 10:32:19',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',259,0,NULL,NULL,NULL,NULL,NULL,'YBK35D',115000,5,NULL,0,65,0,'AUTECO',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(290,NULL,5,'2024-02-02 17:28:56',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',266,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',220000,3,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(294,NULL,5,'2024-02-15 11:43:04',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',293,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',78000,2,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(295,NULL,5,'2024-02-15 17:49:11',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',307,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',209000,7,NULL,0,46,0,'SUZUKI GN',0,'',0,'SE HIZO CAMBIO DE ACEITE 3114 KM, KIXX 20W40 SEMISINTETICO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(298,NULL,5,'2024-02-27 18:02:55',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',335,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',21000,2,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(301,NULL,5,'2024-03-01 14:44:02',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',340,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',83000,3,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(305,NULL,5,'2024-03-05 11:53:20',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',351,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',8000,1,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(307,NULL,5,'2024-03-07 10:08:09',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',357,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',70000,2,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(309,NULL,5,'2024-03-07 19:54:29',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',445,0,NULL,NULL,NULL,NULL,NULL,'YBA09D',60000,4,NULL,0,66,0,'SYM CROX',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(312,NULL,5,'2024-03-13 16:09:31',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',376,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',10000,1,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(313,NULL,5,'2024-03-15 11:49:40',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',391,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',75000,2,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(317,NULL,5,'2024-03-19 16:16:59',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',392,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',8000,2,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(321,NULL,5,'2024-03-22 12:46:25',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',414,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',55000,3,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(329,NULL,5,'2024-04-02 16:54:18',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',417,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',5000,1,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(333,NULL,5,'2024-04-04 18:07:09',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,11,'ABIERTA',424,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',86000,3,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(335,NULL,5,'2024-04-08 11:43:02',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',462,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',115000,3,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(343,NULL,5,'2024-04-25 16:56:39',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',490,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',50000,2,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(345,NULL,5,'2024-04-30 10:56:39',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',503,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',162000,6,NULL,0,46,0,'AQC73G',0,'',0,'cambio 32.713 con filtro\nproximo 34.713\n',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(348,NULL,5,'2024-05-08 16:35:37',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',508,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',116000,4,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(355,NULL,5,'2024-05-16 10:36:49',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',524,20780,NULL,NULL,NULL,NULL,NULL,'CEI75G',167000,6,NULL,0,46,0,'CEI75G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(356,NULL,5,'2024-05-16 10:48:56',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',525,0,NULL,NULL,NULL,NULL,NULL,'AQC73G',98000,4,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(358,NULL,5,'2024-05-16 17:39:24',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',532,0,NULL,NULL,NULL,NULL,NULL,'XXX000',160000,5,NULL,0,52,0,'AYCO',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(359,NULL,5,'2024-05-27 16:17:15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',571,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',73000,2,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(360,NULL,5,'2024-05-30 19:47:50',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',600,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',83000,3,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(370,NULL,5,'2024-06-14 10:10:03',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',605,20780,NULL,NULL,NULL,NULL,NULL,'CEI75G',87000,5,NULL,0,46,0,'CEI75G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(377,NULL,5,'2024-06-29 14:35:44',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',654,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',669000,12,NULL,0,48,0,'UXZ60G',0,'',0,'MANTENIMIENTO PREVENTIVO',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(378,NULL,5,'2024-07-02 10:20:30',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',656,10153,NULL,NULL,NULL,NULL,NULL,'AQC73G',43000,2,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(379,NULL,5,'2024-07-03 15:01:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',732,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',73000,2,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(383,NULL,5,'2024-07-10 18:24:06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',697,34855,NULL,NULL,NULL,NULL,NULL,'CEI75G',61000,3,NULL,0,46,0,'CEI75G',0,'',0,'CAMBIO DE ACEITE Y FILTRO ',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(385,NULL,5,'2024-07-18 10:09:05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',733,10153,NULL,NULL,NULL,NULL,NULL,'AQC73G',68300,2,NULL,0,46,0,'AQC73G',0,'',0,'se le cambio la aguja y la base aguja',NULL,NULL,NULL,0,0,NULL,NULL,NULL),(388,NULL,5,'2024-07-23 15:45:04',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',746,10153,NULL,NULL,NULL,NULL,NULL,'AQC73G',43000,2,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(389,NULL,5,'2024-07-29 15:45:47',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',775,10153,NULL,NULL,NULL,NULL,NULL,'AQC73G',17000,3,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(391,NULL,5,'2024-07-30 10:04:27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,3,'ABIERTA',776,10153,NULL,NULL,NULL,NULL,NULL,'AQC73G',5000,1,NULL,0,46,0,'AQC73G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(392,NULL,5,'2024-08-03 14:56:41',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',797,0,NULL,NULL,NULL,NULL,NULL,'UXZ60G',83000,3,NULL,0,48,0,'UXZ60G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(393,NULL,5,'2024-08-06 11:08:01',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,'ABIERTA',801,36801,NULL,NULL,NULL,NULL,NULL,'CEI75G',60000,3,NULL,0,46,0,'CEI75G',0,'',0,NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL),(396,NULL,5,'2024-08-10 11:43:05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,'ABIERTA',809,12107,NULL,NULL,NULL,NULL,NULL,'AQC73G',60000,3,NULL,0,46,0,'AQC73G',0,'',0,'SE LE HIZO EL CAMBIO DE ACEITE, PROXIMO QUEDO PARA LOS 14107',NULL,NULL,NULL,0,0,NULL,NULL,NULL);

--
-- Table structure for table `mayorespedidosweb`
--

CREATE TABLE `mayorespedidosweb` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `observaciondelcleinte` varchar(200) DEFAULT NULL,
  `diasemana` varchar(200) DEFAULT NULL,
  `ordendia` int DEFAULT '0',
  `MESALIBERADA` int DEFAULT '1',
  `aliado` varchar(25) DEFAULT NULL,
  `empacado` int DEFAULT '0',
  `direccion` varchar(200) DEFAULT NULL,
  `barrio` varchar(50) DEFAULT NULL,
  `celular` varchar(50) DEFAULT NULL,
  `cliente` varchar(100) DEFAULT NULL,
  `horaentregadoaldomiciliario` datetime DEFAULT NULL,
  `horaentregadoalcliente` datetime DEFAULT NULL,
  `fecharesolucion` date DEFAULT NULL,
  `resolucion` varchar(20) DEFAULT NULL,
  `desde` int DEFAULT '1',
  `hasta` int DEFAULT '1',
  `iddomiciliario` int DEFAULT '0',
  `entregado` int DEFAULT '0',
  `despachado` int DEFAULT '0',
  `ese` int DEFAULT '0',
  `tienenc` int DEFAULT '0',
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `horatotal` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `documento` varchar(2) NOT NULL DEFAULT 'V',
  `saldo` double NOT NULL DEFAULT '0',
  `observacion` text,
  `origen` varchar(25) DEFAULT NULL,
  `entrega` varchar(100) NOT NULL DEFAULT ' ',
  `cobra` varchar(100) NOT NULL DEFAULT ' ',
  `fecha` datetime DEFAULT CURRENT_TIMESTAMP,
  `bruto` double NOT NULL DEFAULT '0',
  `descuento` double NOT NULL DEFAULT '0',
  `total` int DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `cerrado` int NOT NULL DEFAULT '0',
  `recibido` double NOT NULL DEFAULT '0',
  `devuelta` double NOT NULL DEFAULT '0',
  `iva` double DEFAULT '0',
  `fechavencimiento` date DEFAULT NULL,
  `ultimaedicion` datetime DEFAULT CURRENT_TIMESTAMP,
  `base` double NOT NULL DEFAULT '0',
  `esbolsillo` int NOT NULL DEFAULT '0',
  `escortesia` int NOT NULL DEFAULT '0',
  `mediodepago` varchar(25) NOT NULL DEFAULT 'EFECTIVO',
  `nota` varchar(25) NOT NULL DEFAULT '',
  `fecha_anulado` datetime DEFAULT NULL,
  `servicio` int NOT NULL DEFAULT '0',
  `subido` int NOT NULL DEFAULT '0',
  `codalmacen` varchar(25) DEFAULT '1',
  `TIPODELIVERY` varchar(1) NOT NULL DEFAULT '1',
  `n` varchar(1) NOT NULL DEFAULT 'B',
  `codvendedor` int NOT NULL DEFAULT '0',
  `impresiones` int NOT NULL DEFAULT '0',
  `numservicio` int NOT NULL DEFAULT '0',
  `NUMLINEA` int NOT NULL DEFAULT '1',
  `CODTIPOTASA1` varchar(1) NOT NULL DEFAULT '1',
  `CODTARIFA` varchar(1) NOT NULL DEFAULT '1',
  `ivainc` varchar(1) NOT NULL DEFAULT 'T',
  `codzona` int NOT NULL DEFAULT '1',
  `domicilio` double NOT NULL DEFAULT '0',
  `cedula` varchar(15) NOT NULL DEFAULT '999999',
  `codigociudad` varchar(5) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `codigopostal` varchar(6) DEFAULT NULL,
  `codigodepartamento` varchar(5) DEFAULT NULL,
  `departamento` varchar(25) DEFAULT NULL,
  `ciudad` varchar(25) DEFAULT NULL,
  `resoluciondesde` date DEFAULT NULL,
  `resolucionhasta` date DEFAULT NULL,
  `prefijofe` varchar(5) DEFAULT NULL,
  `id_tipo_persona` int DEFAULT '0',
  `COD_SATELITE` varchar(25) DEFAULT NULL,
  `notacreditofe` int DEFAULT '0',
  `cufenc` varchar(250) DEFAULT NULL,
  `numlineas` int DEFAULT '0',
  `razonsocial` varchar(200) DEFAULT NULL,
  `nombrecomercial` varchar(200) DEFAULT NULL,
  `tipodepersona` int DEFAULT '0',
  `tipo_identificacion` varchar(5) DEFAULT NULL,
  `dv` int DEFAULT NULL,
  `regimenfiscal` int DEFAULT NULL,
  `contacto` varchar(100) DEFAULT NULL,
  `prefijo` varchar(5) DEFAULT 'FV',
  `garantiahasta` date DEFAULT NULL,
  `cantidadmediosdepago` int DEFAULT '0',
  `snumsop` varchar(25) DEFAULT NULL,
  `inumoper` varchar(25) DEFAULT NULL,
  `despachadoaifood` int DEFAULT '0',
  `valornc` int DEFAULT '0',
  `domicilioexterno` int DEFAULT '0',
  `pv` varchar(25) DEFAULT 'extremabelleza',
  `numeroabajo` int DEFAULT '0',
  `alergenos` varchar(50) DEFAULT '0',
  `facturatienemodificadores` int DEFAULT '0',
  `conseuctivorappi` varchar(11) DEFAULT NULL,
  `delivery_method` varchar(25) DEFAULT NULL,
  `payment_method` varchar(25) DEFAULT NULL,
  `COD_CLIENTE_FRONT` int DEFAULT '0',
  `ID_CLIENTE_CONTROL` int DEFAULT '1',
  `ssignature` text,
  `sqr` text,
  `observacionesnovedad` varchar(150) DEFAULT NULL,
  `horapreparado` datetime DEFAULT NULL,
  `resdianfe` varchar(25) DEFAULT NULL,
  `desdefe` int DEFAULT '0',
  `hastafe` int DEFAULT '0',
  `fecharesfe` date DEFAULT NULL,
  `fechafe` date DEFAULT NULL,
  `placa` varchar(6) DEFAULT NULL,
  `mediodoepagointegracion` varchar(25) DEFAULT NULL,
  `CONFIRMED` datetime DEFAULT NULL,
  `observacionanula` varchar(100) DEFAULT NULL,
  `DISPATCHED` datetime DEFAULT NULL,
  `CONCLUDED` datetime DEFAULT NULL,
  `CANCELLED` datetime DEFAULT NULL,
  `CANCELLATION_REQUESTED` datetime DEFAULT NULL,
  `aceptado` bit(1) DEFAULT b'0',
  `horaaceptado` datetime DEFAULT NULL,
  `anulado` int DEFAULT '0',
  `enviadoataxxa` bit(1) DEFAULT b'0',
  `horanovedad` datetime DEFAULT NULL,
  `novedad` bit(1) DEFAULT b'0',
  `costofactura` double DEFAULT '0',
  `aceptado_domiciliario` bit(1) DEFAULT b'0',
  `hora_aceptado_domiciliario` datetime DEFAULT NULL,
  `prooduco_recibido_domiciliario` bit(1) DEFAULT b'0',
  `hora_prooduco_recibido_domiciliario` datetime DEFAULT NULL,
  `impreso` bit(1) DEFAULT b'0',
  `pedidorechazado` bit(1) DEFAULT b'0',
  `horapedidorechazado` datetime DEFAULT NULL,
  `domicilioconciliado` bit(1) DEFAULT b'0',
  `fechancdian` datetime DEFAULT NULL,
  `tipodevolucion` varchar(25) DEFAULT NULL,
  `deberecoger` datetime DEFAULT NULL,
  `nombrecomercialfactura` varchar(50) DEFAULT NULL,
  `clasificacioncliente` varchar(20) DEFAULT 'CLIENTE FINAL',
  `codeudor` varchar(50) DEFAULT NULL,
  `telefonoocodeudor` varchar(30) DEFAULT NULL,
  `parentescocodeudor` varchar(25) DEFAULT NULL,
  `plazo` int DEFAULT NULL,
  `valorcuota` int DEFAULT NULL,
  `valorcuotainicial` int DEFAULT NULL,
  `fechacuotainicial` date DEFAULT NULL,
  `cuotasapartirde` date DEFAULT NULL,
  `modalidad` int DEFAULT NULL,
  `identificador` varchar(25) DEFAULT NULL,
  `idvendedor` int DEFAULT NULL,
  `periodiciddad` int DEFAULT '0',
  `centrodecostos` varchar(25) DEFAULT NULL,
  `fechaorden` date DEFAULT NULL,
  `idusuarioanula` int DEFAULT '0',
  `idfactura` int DEFAULT '0',
  UNIQUE KEY `id` (`id`),
  KEY `idusuario` (`idusuario`),
  KEY `facturas_ibfk_3` (`idcliente`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayorespedidosweb`
--


--
-- Table structure for table `mayoresseparados`
--

CREATE TABLE `mayoresseparados` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `idfactura` int NOT NULL DEFAULT '0',
  `consecutivo` int NOT NULL DEFAULT '0',
  `idcliente` bigint unsigned NOT NULL DEFAULT '1',
  `fechacreacion` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `saldo` double NOT NULL DEFAULT '0',
  `observacion` text,
  `cc` bigint unsigned NOT NULL,
  `bruto` double NOT NULL DEFAULT '0',
  `descuento` double NOT NULL DEFAULT '0',
  `total` double NOT NULL DEFAULT '0',
  `idusuario` bigint unsigned NOT NULL DEFAULT '1',
  `idz` bigint unsigned NOT NULL DEFAULT '1',
  `cerrado` int NOT NULL DEFAULT '0',
  `abonado` int NOT NULL DEFAULT '0',
  `vigenciadelcredito` int NOT NULL DEFAULT '0',
  `fechavencimiento` datetime DEFAULT CURRENT_TIMESTAMP,
  `idusuarioanula` int DEFAULT '0',
  UNIQUE KEY `id` (`id`),
  UNIQUE KEY `id_2` (`id`),
  KEY `cc` (`cc`),
  KEY `idusuario` (`idusuario`),
  KEY `idz` (`idz`),
  KEY `facturas_ibfk_3` (`idcliente`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `mayoresseparados`
--

INSERT INTO `mayoresseparados` (`id`, `idfactura`, `consecutivo`, `idcliente`, `fechacreacion`, `saldo`, `observacion`, `cc`, `bruto`, `descuento`, `total`, `idusuario`, `idz`, `cerrado`, `abonado`, `vigenciadelcredito`, `fechavencimiento`, `idusuarioanula`) VALUES (1,0,1,2353,'2025-01-18 16:21:12',1060000,NULL,0,1060000,0,1060000,1964,715,0,1,0,'2025-01-18 16:21:12',1964);

--
