DROP TABLE IF EXISTS `sage`.`movConta`; CREATE TABLE `sage`.`movConta` ( `OrdenMovimientos` int(11) NOT NULL AUTO_INCREMENT, `MovPosicion` varchar(64) COLLATE utf8mb3_unicode_ci NOT NULL, `Ejercicio` smallint(6) NOT NULL, `CodigoEmpresa` smallint(6) NOT NULL, `Asiento` int(11) NOT NULL, `CargoAbono` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `CodigoCuenta` varchar(15) CHARACTER SET utf8mb3 NOT NULL, `Contrapartida` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, `FechaAsiento` datetime NOT NULL, `TipoDocumento` varchar(6) COLLATE utf8mb3_unicode_ci NOT NULL, `DocumentoConta` varchar(9) COLLATE utf8mb3_unicode_ci NOT NULL, `Comentario` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `ImporteAsiento` decimal(28,10) NOT NULL, `CodigoDiario` smallint(6) NOT NULL, `CodigoCanal` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `CodigoActividad` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `FechaVencimiento` datetime DEFAULT NULL, `NumeroPeriodo` smallint(6) NOT NULL, `CodigoUsuario` smallint(6) NOT NULL, `FechaGrabacion` datetime NOT NULL, `TipoEntrada` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, `CodigoDepartamento` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `CodigoSeccion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `CodigoDivisa` varchar(3) COLLATE utf8mb3_unicode_ci NOT NULL, `ImporteCambio` decimal(28,10) NOT NULL, `ImporteDivisa` decimal(28,10) NOT NULL, `FactorCambio` decimal(28,10) NOT NULL, `CodigoProyecto` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `LibreN1` int(11) NOT NULL, `LibreN2` int(11) NOT NULL, `LibreA1` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, `LibreA2` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, `IdDelegacion` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `MovCartera` varchar(64) COLLATE utf8mb3_unicode_ci DEFAULT NULL, `IdProcesoIME` varchar(64) COLLATE utf8mb3_unicode_ci NOT NULL, `TipoCarteraIME` smallint(6) NOT NULL, `TipoAnaliticaIME` smallint(6) NOT NULL, `StatusTraspasadoIME` tinyint(4) NOT NULL, `TipoImportacionIME` tinyint(4) NOT NULL, `BaseIva1` decimal(28,10) NOT NULL, `PorBaseCorrectora1` decimal(28,10) NOT NULL, `PorIva1` decimal(28,10) NOT NULL, `CuotaIva1` decimal(28,10) NOT NULL, `PorRecargoEquivalencia1` decimal(28,10) NOT NULL, `RecargoEquivalencia1` decimal(28,10) NOT NULL, `CodigoTransaccion1` tinyint(4) NOT NULL, `BaseIva2` decimal(28,10) NOT NULL, `PorBaseCorrectora2` decimal(28,10) NOT NULL, `PorIva2` decimal(28,10) NOT NULL, `CuotaIva2` decimal(28,10) NOT NULL, `PorRecargoEquivalencia2` decimal(28,10) NOT NULL, `RecargoEquivalencia2` decimal(28,10) NOT NULL, `CodigoTransaccion2` tinyint(4) NOT NULL, `BaseIva3` decimal(28,10) NOT NULL, `PorBaseCorrectora3` decimal(28,10) NOT NULL, `PorIva3` decimal(28,10) NOT NULL, `CuotaIva3` decimal(28,10) NOT NULL, `PorRecargoEquivalencia3` decimal(28,10) NOT NULL, `RecargoEquivalencia3` decimal(28,10) NOT NULL, `CodigoTransaccion3` tinyint(4) NOT NULL, `baseIva4` decimal(28,10) NOT NULL, `PorBaseCorrectora4` decimal(28,10) NOT NULL, `PorIva4` decimal(28,10) NOT NULL, `CuotaIva4` decimal(28,10) NOT NULL, `PorRecargoEquivalencia4` decimal(28,10) NOT NULL, `RecargoEquivalencia4` decimal(28,10) NOT NULL, `CodigoTransaccion4` tinyint(4) NOT NULL, `Año` smallint(6) NOT NULL, `Serie` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `Factura` int(11) NOT NULL, `SuFacturaNo` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `FechaFactura` datetime NOT NULL, `ImporteFactura` decimal(28,10) NOT NULL, `TipoFactura` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `CodigoCuentaFactura` varchar(15) COLLATE utf8mb3_unicode_ci NOT NULL, `CifDni` varchar(13) COLLATE utf8mb3_unicode_ci NOT NULL, `Nombre` varchar(35) COLLATE utf8mb3_unicode_ci NOT NULL, `CodigoRetencion` smallint(6) NOT NULL, `BaseRetencion` decimal(28,10) NOT NULL, `PorRetencion` decimal(28,10) NOT NULL, `ImporteRetencion` decimal(28,10) NOT NULL, `AbonoIva` smallint(6) NOT NULL, `CodigoActividadF` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `Intracomunitaria` smallint(6) NOT NULL, `CodigoTerritorio` smallint(6) NOT NULL, `SiglaNacion` varchar(2) COLLATE utf8mb3_unicode_ci NOT NULL, `RetencionInformativa` smallint(6) NOT NULL, `EjercicioFacturaOriginal` smallint(6) NOT NULL, `SerieFacturaOriginal` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `NumeroFacturaOriginal` int(11) NOT NULL, `EjercicioFactura` smallint(6) NOT NULL, `CobroPagoRetencion` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `FechaOperacion` datetime NOT NULL, `Exclusion347` smallint(6) NOT NULL, `MovIdentificadorIME` varchar(64) COLLATE utf8mb3_unicode_ci NOT NULL, `Previsiones` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `MantenerAsiento` tinyint(4) NOT NULL, `OrdenMovIME` smallint(6) NOT NULL, `Metalico347` smallint(6) NOT NULL, `ClaveOperacionFactura_` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `SerieAgrupacion_` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `NumeroFacturaInicial_` int(11) NOT NULL, `NumeroFacturaFinal_` int(11) NOT NULL, `IdAsientoExterno` text COLLATE utf8mb3_unicode_ci NOT NULL, `IdDiarioExterno` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL, `IdFacturaExterno` text COLLATE utf8mb3_unicode_ci NOT NULL, `IdMovimiento` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `IdCuadre` smallint(6) NOT NULL, `FechaCuadre` datetime NOT NULL, `TipoCuadre` varchar(4) COLLATE utf8mb3_unicode_ci NOT NULL, `AgrupacionCuadre` int(11) NOT NULL, `StatusSaldo` smallint(6) NOT NULL, `StatusConciliacion` smallint(6) NOT NULL, `CodigoConciliacion` int(11) NOT NULL, `FechaConciliacion` datetime NOT NULL, `TipoConciliacion` smallint(6) NOT NULL, `IndicadorContaBanco` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion3` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion4` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion5` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion6` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion7` varchar(40) COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion8` text COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion9` text COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion2` text COLLATE utf8mb3_unicode_ci NOT NULL, `Descripcion1` text COLLATE utf8mb3_unicode_ci NOT NULL, `Punteo1` smallint(6) NOT NULL, `Punteo9` smallint(6) NOT NULL, `Punteo8` smallint(6) NOT NULL, `Punteo7` smallint(6) NOT NULL, `Punteo6` smallint(6) NOT NULL, `Punteo5` smallint(6) NOT NULL, `Punteo4` smallint(6) NOT NULL, `Punteo3` smallint(6) NOT NULL, `Punteo2` smallint(6) NOT NULL, `CodigoIva1` smallint(6) NOT NULL, `CodigoIva2` smallint(6) NOT NULL, `CodigoIva3` smallint(6) NOT NULL, `CodigoIva4` smallint(6) NOT NULL, `CriterioIva` tinyint(4) NOT NULL, `FechaMaxVencimiento` datetime NOT NULL, `TipoCriterioCaja` tinyint(4) NOT NULL, `MovFacturaOrigenIME` text COLLATE utf8mb3_unicode_ci NOT NULL, `IdFacturaExternoFinal` text COLLATE utf8mb3_unicode_ci NOT NULL, `IdFacturaExternoInicial` text COLLATE utf8mb3_unicode_ci NOT NULL, `IdFacturaExternoOriginal` text COLLATE utf8mb3_unicode_ci NOT NULL, `NumFacturasExternoAgrupacion` int(11) NOT NULL, `CodigoMedioCobro` varchar(1) COLLATE utf8mb3_unicode_ci NOT NULL, `MedioCobro` varchar(31) COLLATE utf8mb3_unicode_ci NOT NULL, `IvaDeducible1` smallint(6) NOT NULL DEFAULT 1, `IvaDeducible2` smallint(6) NOT NULL DEFAULT 1, `IvaDeducible3` smallint(6) NOT NULL DEFAULT 1, `IvaDeducible4` smallint(6) NOT NULL DEFAULT 1, `TipoRectificativa` smallint(6) NOT NULL, `FechaFacturaOriginal` datetime NOT NULL, `BaseImponibleOriginal` decimal(28,10) NOT NULL, `CuotaIvaOriginal` decimal(28,10) NOT NULL, `ClaseAbonoRectificativas` smallint(6) NOT NULL, `RecargoEquivalenciaOriginal` decimal(28,10) NOT NULL, `ObjetoFactura` text COLLATE utf8mb3_unicode_ci NOT NULL, `enlazadoSage` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`OrdenMovimientos`,`LibreN1`), KEY `ix_movconta2` (`IdProcesoIME`), KEY `CodigoCuenta` (`CodigoCuenta`), KEY `movConta_Asiento` (`Asiento`), KEY `ix_movconta` (`enlazadoSage`,`IdProcesoIME`), KEY `movConta_IdProcesoIME` (`IdProcesoIME`), KEY `movConta_Asiento2` (`Asiento`,`IdProcesoIME`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;