|
|
|
@ -363,7 +363,7 @@ CREATE TABLE `user` (
|
|
|
|
|
KEY `nickname` (`nickname`),
|
|
|
|
|
KEY `lang` (`lang`),
|
|
|
|
|
CONSTRAINT `user_ibfk_2` FOREIGN KEY (`role`) REFERENCES `role` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=14329 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global users';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=14333 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global users';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -2433,7 +2433,7 @@ CREATE TABLE `Agencias_dits` (
|
|
|
|
|
`value_old` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
|
|
|
`value_new` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
|
|
|
PRIMARY KEY (`idAgencia_dits`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=20946 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=20952 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -2534,7 +2534,7 @@ CREATE TABLE `Articles` (
|
|
|
|
|
CONSTRAINT `Articles_ibfk_5` FOREIGN KEY (`tipo_id`) REFERENCES `Tipos` (`tipo_id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `expenceFk` FOREIGN KEY (`expenceFk`) REFERENCES `Gastos` (`Id_Gasto`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `producer_id` FOREIGN KEY (`producer_id`) REFERENCES `producer` (`producer_id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=315107 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=315232 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -2746,7 +2746,7 @@ CREATE TABLE `Articles_nicho` (
|
|
|
|
|
KEY `Articles_nicho_wh_fk` (`warehouse_id`),
|
|
|
|
|
CONSTRAINT `Articles_nicho_wh_fk` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouse` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Articles_nichos_fk` FOREIGN KEY (`Id_Article`) REFERENCES `Articles` (`Id_Article`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=482951 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=483580 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -2910,7 +2910,7 @@ CREATE TABLE `Cajas` (
|
|
|
|
|
KEY `warehouse_id` (`warehouse_id`),
|
|
|
|
|
KEY `fk_Cajas_Proveedores_account1_idx` (`Proveedores_account_Id`),
|
|
|
|
|
CONSTRAINT `Cajas_ibfk_2` FOREIGN KEY (`Id_Banco`) REFERENCES `Bancos` (`Id_Banco`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=592926 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=593541 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -3057,7 +3057,7 @@ CREATE TABLE `Clientes` (
|
|
|
|
|
CONSTRAINT `Clientes_ibfk_5` FOREIGN KEY (`province_id`) REFERENCES `province` (`province_id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `canal_nuevo_cliente` FOREIGN KEY (`chanel_id`) REFERENCES `chanel` (`chanel_id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `tipos_de_cliente` FOREIGN KEY (`clientes_tipo_id`) REFERENCES `clientes_tipo` (`clientes_tipo_id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=14329 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=14333 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -3340,7 +3340,7 @@ CREATE TABLE `Colas` (
|
|
|
|
|
CONSTRAINT `Colas_ibfk_3` FOREIGN KEY (`Id_Prioridad`) REFERENCES `Prioridades` (`Id_Prioridad`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Colas_ibfk_4` FOREIGN KEY (`Id_Impresora`) REFERENCES `Impresoras` (`Id_Impresora`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Colas_ibfk_5` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=260021 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=262713 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -3422,7 +3422,7 @@ CREATE TABLE `Compres` (
|
|
|
|
|
CONSTRAINT `Compres_ibfk_2` FOREIGN KEY (`Id_Cubo`) REFERENCES `Cubos` (`Id_Cubo`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Compres_ibfk_3` FOREIGN KEY (`container_id`) REFERENCES `container` (`container_id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `buy_id` FOREIGN KEY (`Id_Entrada`) REFERENCES `Entradas` (`Id_Entrada`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=257828791 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=258014349 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -3718,7 +3718,7 @@ CREATE TABLE `Consignatarios` (
|
|
|
|
|
CONSTRAINT `Consignatarios_ibfk_3` FOREIGN KEY (`province_id`) REFERENCES `province` (`province_id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Consignatarios_ibfk_4` FOREIGN KEY (`Id_Agencia`) REFERENCES `Agencias` (`Id_Agencia`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `address_customer_id` FOREIGN KEY (`Id_cliente`) REFERENCES `Clientes` (`id_cliente`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=25283 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=25294 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -3902,7 +3902,7 @@ CREATE TABLE `Contactos` (
|
|
|
|
|
PRIMARY KEY (`Id_Contacto`),
|
|
|
|
|
KEY `Telefono` (`Telefono`),
|
|
|
|
|
KEY `Movil` (`Movil`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2635 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2636 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -4099,7 +4099,7 @@ CREATE TABLE `Entradas` (
|
|
|
|
|
CONSTRAINT `Entradas_ibfk_1` FOREIGN KEY (`Id_Proveedor`) REFERENCES `Proveedores` (`Id_Proveedor`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Entradas_ibfk_6` FOREIGN KEY (`travel_id`) REFERENCES `travel` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Entradas_ibfk_7` FOREIGN KEY (`empresa_id`) REFERENCES `empresa` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=144217 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='InnoDB free: 88064 kB; (`Id_Proveedor`) REFER `vn2008/Provee';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=144396 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='InnoDB free: 88064 kB; (`Id_Proveedor`) REFER `vn2008/Provee';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -4263,7 +4263,7 @@ CREATE TABLE `Entradas_dits` (
|
|
|
|
|
CONSTRAINT `Entradas_dits_ibfk_1` FOREIGN KEY (`Id_Ticket`) REFERENCES `Entradas` (`Id_Entrada`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `fgkey_entradas_1` FOREIGN KEY (`idaccion_dits`) REFERENCES `accion_dits` (`idaccion_dits`) ON DELETE NO ACTION ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `fgkey_entradas_3` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON DELETE NO ACTION ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2849650 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2854428 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -4281,7 +4281,7 @@ CREATE TABLE `Entradas_kop` (
|
|
|
|
|
PRIMARY KEY (`Id_Entradas_kop`),
|
|
|
|
|
KEY `entradas_entradas_kop_idx` (`Id_Entrada`),
|
|
|
|
|
CONSTRAINT `entradas_entradas_kop` FOREIGN KEY (`Id_Entrada`) REFERENCES `Entradas` (`Id_Entrada`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=519 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Relaciona las entradas con los origenes de compra';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=523 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Relaciona las entradas con los origenes de compra';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -4524,7 +4524,7 @@ CREATE TABLE `Facturas` (
|
|
|
|
|
CONSTRAINT `Facturas_ibfk_4` FOREIGN KEY (`cplusTaxBreakFk`) REFERENCES `vn`.`cplusTaxBreak` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `invoice_bank_id` FOREIGN KEY (`Id_Banco`) REFERENCES `Bancos` (`Id_Banco`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `invoice_customer_id` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=457623 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=457664 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -4742,7 +4742,7 @@ CREATE TABLE `Greuges` (
|
|
|
|
|
KEY `Id_Ticket_Greuge_Ticket_idx` (`Id_Ticket`),
|
|
|
|
|
CONSTRAINT `Id_Ticket_Greuge_Ticket` FOREIGN KEY (`Id_Ticket`) REFERENCES `Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `greuges_type_fk` FOREIGN KEY (`Greuges_type_id`) REFERENCES `Greuges_type` (`Greuges_type_id`) ON DELETE SET NULL ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2278670 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=FIXED;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2280883 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=FIXED;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -4943,7 +4943,7 @@ CREATE TABLE `Movimientos` (
|
|
|
|
|
KEY `itemFk_ticketFk` (`Id_Article`,`Id_Ticket`),
|
|
|
|
|
CONSTRAINT `Movimientos_ibfk_1` FOREIGN KEY (`Id_Article`) REFERENCES `Articles` (`Id_Article`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `movement_ticket_id` FOREIGN KEY (`Id_Ticket`) REFERENCES `Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=21186346 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=21197586 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -5092,7 +5092,7 @@ CREATE TABLE `Movimientos_mark` (
|
|
|
|
|
`Id_Movimiento_mark` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
PRIMARY KEY (`Id_Movimiento_mark`),
|
|
|
|
|
KEY `Id_Movimiento` (`Id_Movimiento`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=10984781 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=11001818 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5162,7 +5162,7 @@ CREATE TABLE `Ordenes` (
|
|
|
|
|
KEY `Id_Comprador` (`CodCOMPRADOR`),
|
|
|
|
|
KEY `Id_Movimiento` (`Id_Movimiento`),
|
|
|
|
|
KEY `Id_Vendedor` (`CodVENDEDOR`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=31735 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=31864 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5360,7 +5360,7 @@ CREATE TABLE `Proveedores_account` (
|
|
|
|
|
KEY `fk_Proveedores_account_entity1_idx` (`entity_id`),
|
|
|
|
|
KEY `fk_banco_prov_account_idx` (`Id_Banco`),
|
|
|
|
|
CONSTRAINT `fk_banco_prov_account` FOREIGN KEY (`Id_Banco`) REFERENCES `Bancos` (`Id_Banco`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=650 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=651 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5451,7 +5451,7 @@ CREATE TABLE `Recibos` (
|
|
|
|
|
CONSTRAINT `Recibos_ibfk_1` FOREIGN KEY (`empresa_id`) REFERENCES `empresa` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Recibos_ibfk_2` FOREIGN KEY (`Id_Banco`) REFERENCES `Bancos` (`Id_Banco`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `recibo_customer_id` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=468932 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=469201 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -5542,7 +5542,7 @@ CREATE TABLE `Relaciones` (
|
|
|
|
|
KEY `Id_Contacto` (`Id_Contacto`),
|
|
|
|
|
KEY `Id_Proveedor` (`Id_Proveedor`),
|
|
|
|
|
KEY `Id_Cliente` (`Id_Cliente`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2636 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2637 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5587,7 +5587,7 @@ CREATE TABLE `Reservas` (
|
|
|
|
|
PRIMARY KEY (`Id_Reserva`),
|
|
|
|
|
KEY `Id_1` (`Id_Ticket`),
|
|
|
|
|
KEY `Id_Article` (`Id_Article`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1703 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1721 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5618,7 +5618,7 @@ CREATE TABLE `Rutas` (
|
|
|
|
|
KEY `Fecha` (`Fecha`),
|
|
|
|
|
KEY `gestdoc_id` (`gestdoc_id`),
|
|
|
|
|
CONSTRAINT `Rutas_ibfk_1` FOREIGN KEY (`gestdoc_id`) REFERENCES `gestdoc` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=39660 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=39692 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -5771,7 +5771,7 @@ CREATE TABLE `Saldos_Prevision` (
|
|
|
|
|
KEY `empresa_prevision_idx` (`empresa_id`),
|
|
|
|
|
CONSTRAINT `banco_prevision` FOREIGN KEY (`Id_Banco`) REFERENCES `Bancos` (`Id_Banco`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `empresa_prevision` FOREIGN KEY (`empresa_id`) REFERENCES `empresa` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Aqui ponemos los gastos e ingresos pendientes de introducir ';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Aqui ponemos los gastos e ingresos pendientes de introducir ';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5806,7 +5806,7 @@ CREATE TABLE `Split_lines` (
|
|
|
|
|
KEY `Id_Compra` (`Id_Compra`),
|
|
|
|
|
CONSTRAINT `Id_Compra` FOREIGN KEY (`Id_Compra`) REFERENCES `Compres` (`Id_Compra`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Split_lines_ibfk_1` FOREIGN KEY (`Id_Split`) REFERENCES `Splits` (`Id_Split`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=323722 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=324303 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5824,7 +5824,7 @@ CREATE TABLE `Splits` (
|
|
|
|
|
`Notas` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
|
|
|
PRIMARY KEY (`Id_Split`),
|
|
|
|
|
KEY `Id_Entrada` (`Id_Entrada`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=36263 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=36266 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5852,7 +5852,7 @@ CREATE TABLE `Stockcontrol` (
|
|
|
|
|
CONSTRAINT `Stockcontrol_ibfk_1` FOREIGN KEY (`Id_Article`) REFERENCES `Articles` (`Id_Article`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Stockcontrol_ibfk_2` FOREIGN KEY (`Id_Remitente`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Stockcontrol_ibfk_3` FOREIGN KEY (`Id_Solver`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=23552 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=23564 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -5910,7 +5910,7 @@ CREATE TABLE `Tickets` (
|
|
|
|
|
CONSTRAINT `Tickets_ibfk_9` FOREIGN KEY (`Id_Ruta`) REFERENCES `Rutas` (`Id_Ruta`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `ticket_customer_id` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `tickets_fk10` FOREIGN KEY (`Factura`) REFERENCES `Facturas` (`Id_Factura`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1900377 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1902105 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -6119,7 +6119,7 @@ CREATE TABLE `Tickets_dits` (
|
|
|
|
|
CONSTRAINT `Tickets_dits_ibfk_1` FOREIGN KEY (`Id_Ticket`) REFERENCES `Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `fgkey1` FOREIGN KEY (`idaccion_dits`) REFERENCES `accion_dits` (`idaccion_dits`) ON DELETE NO ACTION ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `fgkey3` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON DELETE NO ACTION ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=59369706 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=59396518 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -6168,7 +6168,7 @@ CREATE TABLE `Tickets_turno` (
|
|
|
|
|
`weekDay` tinyint(1) DEFAULT NULL COMMENT 'funcion de mysql Lunes = 0, Domingo = 6',
|
|
|
|
|
PRIMARY KEY (`Id_Ticket`),
|
|
|
|
|
CONSTRAINT `Id_Ticket_fk` FOREIGN KEY (`Id_Ticket`) REFERENCES `Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1895740 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1900565 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -6475,7 +6475,7 @@ CREATE TABLE `Vehiculos_consumo` (
|
|
|
|
|
PRIMARY KEY (`Vehiculos_consumo_id`,`Id_Vehiculo`),
|
|
|
|
|
KEY `fk_Vehiculos_consumo_Vehiculos_idx` (`Id_Vehiculo`),
|
|
|
|
|
CONSTRAINT `fk_Vehiculos_consumo_Vehiculos` FOREIGN KEY (`Id_Vehiculo`) REFERENCES `Vehiculos` (`Id_Vehiculo`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=8391 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='En esta tabla apuntan el importe de los tickets de la gasolinera solred, con quien tenemos un contrato y nos facturan mensualmente';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=8416 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='En esta tabla apuntan el importe de los tickets de la gasolinera solred, con quien tenemos un contrato y nos facturan mensualmente';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -6589,7 +6589,7 @@ CREATE TABLE `XDiario` (
|
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
|
KEY `empresa_id` (`empresa_id`),
|
|
|
|
|
CONSTRAINT `XDiario_ibfk_1` FOREIGN KEY (`empresa_id`) REFERENCES `empresa` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3360639 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3361556 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -6697,7 +6697,7 @@ CREATE TABLE `account_conciliacion` (
|
|
|
|
|
KEY `fg_accconciliacion_key1_idx` (`Id_Proveedores_account`),
|
|
|
|
|
KEY `index_id_calculated` (`id_calculated`),
|
|
|
|
|
CONSTRAINT `fg_key1_accountconc` FOREIGN KEY (`Id_Proveedores_account`) REFERENCES `Proveedores_account` (`Id_Proveedores_account`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3617 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3700 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -7107,7 +7107,7 @@ CREATE TABLE `awb` (
|
|
|
|
|
CONSTRAINT `awbInvoiceIn` FOREIGN KEY (`invoiceInFk`) REFERENCES `recibida` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `awbTransitoryFk` FOREIGN KEY (`transitario_id`) REFERENCES `Proveedores` (`Id_Proveedor`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `awb_ibfk_1` FOREIGN KEY (`iva_id`) REFERENCES `iva_codigo` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2580 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2584 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -7365,7 +7365,7 @@ CREATE TABLE `awb_gestdoc` (
|
|
|
|
|
KEY `awb_gestdoc_gestdoc_fk` (`gestdoc_id`),
|
|
|
|
|
CONSTRAINT `awb_gestdoc_awb_fk` FOREIGN KEY (`awb_id`) REFERENCES `awb` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `awb_gestdoc_gestdoc_fk` FOREIGN KEY (`gestdoc_id`) REFERENCES `gestdoc` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2243 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2247 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -7483,7 +7483,7 @@ CREATE TABLE `barcodes` (
|
|
|
|
|
UNIQUE KEY `Id_Article_2` (`Id_Article`,`code`),
|
|
|
|
|
KEY `Id_Article` (`Id_Article`),
|
|
|
|
|
CONSTRAINT `barcodes_ibfk_1` FOREIGN KEY (`Id_Article`) REFERENCES `Articles` (`Id_Article`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=36120 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=36144 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -7624,7 +7624,7 @@ CREATE TABLE `buy_edi` (
|
|
|
|
|
KEY `kop` (`kop`),
|
|
|
|
|
KEY `barcode` (`barcode`),
|
|
|
|
|
KEY `fec` (`fec`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=711970 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=712936 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -7878,7 +7878,7 @@ CREATE TABLE `cl_act` (
|
|
|
|
|
CONSTRAINT `cl_act_ibfk_1` FOREIGN KEY (`Id_Movimiento`) REFERENCES `Movimientos` (`Id_Movimiento`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_act_ibfk_3` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_act_ibfk_4` FOREIGN KEY (`cl_main_id`) REFERENCES `cl_main` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=85175 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Acciones en respuesta a las reclamaciones';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=85387 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Acciones en respuesta a las reclamaciones';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -7912,7 +7912,7 @@ CREATE TABLE `cl_cau` (
|
|
|
|
|
CONSTRAINT `cl_cau_ibfk_7` FOREIGN KEY (`cl_mot_id`) REFERENCES `cl_mot` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_cau_ibfk_8` FOREIGN KEY (`cl_con_id`) REFERENCES `cl_con` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_cau_ibfk_9` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=45884 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Causas de las reclamaciones';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=45936 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Causas de las reclamaciones';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -7966,7 +7966,7 @@ CREATE TABLE `cl_det` (
|
|
|
|
|
CONSTRAINT `cl_det_ibfk_6` FOREIGN KEY (`cl_pet_id`) REFERENCES `cl_pet` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_det_ibfk_7` FOREIGN KEY (`Id_Movimiento`) REFERENCES `Movimientos` (`Id_Movimiento`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_det_ibfk_8` FOREIGN KEY (`cl_main_id`) REFERENCES `cl_main` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=117467 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Detalle de las reclamaciones';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=117654 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Detalle de las reclamaciones';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -8023,7 +8023,7 @@ CREATE TABLE `cl_main` (
|
|
|
|
|
CONSTRAINT `cl_main_ibfk_3` FOREIGN KEY (`cl_est_id`) REFERENCES `cl_est` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_main_ibfk_4` FOREIGN KEY (`cl_dep_id`) REFERENCES `cl_dep` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cl_main_ibfk_5` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=50796 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Reclamaciones, tabla principal';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=50897 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Reclamaciones, tabla principal';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -8136,7 +8136,7 @@ CREATE TABLE `client_observation` (
|
|
|
|
|
KEY `Id_Cliente` (`Id_Cliente`),
|
|
|
|
|
CONSTRAINT `client_observation_ibfk_1` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `client_observation_ibfk_2` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=64393 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Todas las observaciones referentes a un ticket';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=64444 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Todas las observaciones referentes a un ticket';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -8302,7 +8302,7 @@ CREATE TABLE `consignatarios_observation` (
|
|
|
|
|
`text` text COLLATE utf8_unicode_ci NOT NULL,
|
|
|
|
|
PRIMARY KEY (`consignatarios_observation_id`),
|
|
|
|
|
UNIQUE KEY `Id_Consigna` (`Id_Consigna`,`observation_type_id`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3225 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Observaciones de los consignatarios';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3228 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Observaciones de los consignatarios';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -8384,7 +8384,7 @@ CREATE TABLE `credit` (
|
|
|
|
|
KEY `credit_ClienteFk` (`Id_Cliente`),
|
|
|
|
|
CONSTRAINT `credit_ClienteFk` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `workers_fk` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=63960 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=63998 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -8898,7 +8898,7 @@ CREATE TABLE `escritos_det` (
|
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
|
KEY `empresa_id` (`empresa_id`),
|
|
|
|
|
CONSTRAINT `escritos_det_ibfk_1` FOREIGN KEY (`empresa_id`) REFERENCES `empresa` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=15597 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=15601 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -8927,7 +8927,7 @@ CREATE TABLE `expeditions` (
|
|
|
|
|
KEY `index4` (`ticket_id`),
|
|
|
|
|
CONSTRAINT `Id_Agencia` FOREIGN KEY (`agency_id`) REFERENCES `Agencias` (`Id_Agencia`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `ticket_id` FOREIGN KEY (`ticket_id`) REFERENCES `Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2456179 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2458392 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -9187,7 +9187,7 @@ CREATE TABLE `gestdoc` (
|
|
|
|
|
UNIQUE KEY `emp_id` (`emp_id`,`orden`,`warehouse_id`),
|
|
|
|
|
KEY `trabajador_id` (`trabajador_id`),
|
|
|
|
|
KEY `warehouse_id` (`warehouse_id`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1013958 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='document managment system';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1016087 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='document managment system';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -9386,7 +9386,7 @@ CREATE TABLE `intrastat_data` (
|
|
|
|
|
KEY `recibida` (`recibida_id`),
|
|
|
|
|
CONSTRAINT `intrastat_data_ibfk_1` FOREIGN KEY (`intrastat_id`) REFERENCES `Intrastat` (`Codintrastat`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `intrastat_data_ibfk_2` FOREIGN KEY (`recibida_id`) REFERENCES `recibida` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=66464 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=66492 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -9724,7 +9724,7 @@ CREATE TABLE `mail` (
|
|
|
|
|
`recipientFk` int(11) DEFAULT NULL,
|
|
|
|
|
`plainTextBody` text COLLATE utf8_unicode_ci,
|
|
|
|
|
PRIMARY KEY (`id`)
|
|
|
|
|
) ENGINE=MyISAM AUTO_INCREMENT=1368082 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=MyISAM AUTO_INCREMENT=1369384 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -9782,7 +9782,7 @@ CREATE TABLE `mandato` (
|
|
|
|
|
CONSTRAINT `mandato_fgkey1` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON DELETE NO ACTION ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `mandato_fgkey2` FOREIGN KEY (`empresa_id`) REFERENCES `empresa` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `mandato_fgkey3` FOREIGN KEY (`idmandato_tipo`) REFERENCES `mandato_tipo` (`idmandato_tipo`) ON DELETE NO ACTION ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=15252 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=15256 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -9991,7 +9991,7 @@ CREATE TABLE `pago` (
|
|
|
|
|
CONSTRAINT `pago_moneda` FOREIGN KEY (`id_moneda`) REFERENCES `Monedas` (`Id_Moneda`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `pago_pay_met` FOREIGN KEY (`pay_met_id`) REFERENCES `pay_met` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `proveedor_pago` FOREIGN KEY (`id_proveedor`) REFERENCES `Proveedores` (`Id_Proveedor`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=41923 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=42154 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -10486,7 +10486,7 @@ CREATE TABLE `price_fixed` (
|
|
|
|
|
KEY `date_end` (`date_end`),
|
|
|
|
|
KEY `warehouse_id` (`warehouse_id`),
|
|
|
|
|
CONSTRAINT `price_fixed_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `Articles` (`Id_Article`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=53951 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=54010 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -10548,7 +10548,7 @@ CREATE TABLE `producer` (
|
|
|
|
|
`visible` tinyint(1) NOT NULL DEFAULT '1',
|
|
|
|
|
PRIMARY KEY (`producer_id`),
|
|
|
|
|
UNIQUE KEY `name_UNIQUE` (`name`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4702 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4712 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -10717,7 +10717,7 @@ CREATE TABLE `recibida` (
|
|
|
|
|
CONSTRAINT `recibida_ibfk_5` FOREIGN KEY (`cplusInvoiceType472Fk`) REFERENCES `vn`.`cplusInvoiceType472` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `recibida_ibfk_6` FOREIGN KEY (`cplusRectificationTypeFk`) REFERENCES `vn`.`cplusRectificationType` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `recibida_ibfk_7` FOREIGN KEY (`cplusTrascendency472Fk`) REFERENCES `vn`.`cplusTrascendency472` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=68983 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=69046 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -11306,7 +11306,7 @@ CREATE TABLE `recibida_iva` (
|
|
|
|
|
CONSTRAINT `recibida_iva_ibfk_2` FOREIGN KEY (`iva_id`) REFERENCES `iva_codigo` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `recibida_iva_ibfk_5` FOREIGN KEY (`recibida_id`) REFERENCES `recibida` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `recibida_iva_ibfk_6` FOREIGN KEY (`gastos_id`) REFERENCES `Gastos` (`Id_Gasto`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=93045 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=93186 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -11329,7 +11329,7 @@ CREATE TABLE `recibida_vencimiento` (
|
|
|
|
|
KEY `banco_id` (`banco_id`),
|
|
|
|
|
CONSTRAINT `recibida_vencimiento_ibfk_6` FOREIGN KEY (`banco_id`) REFERENCES `Bancos` (`Id_Banco`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `recibida_vencimiento_ibfk_7` FOREIGN KEY (`recibida_id`) REFERENCES `recibida` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=90312 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=90445 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -11372,7 +11372,7 @@ CREATE TABLE `recovery` (
|
|
|
|
|
KEY `cliente_idx` (`Id_Cliente`),
|
|
|
|
|
CONSTRAINT `cliente333` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `cliente_cliente` FOREIGN KEY (`Id_Cliente`) REFERENCES `Clientes` (`id_cliente`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=267 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='En esta tabla apuntaremos los acuerdos de recobro semanal a ';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=268 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='En esta tabla apuntaremos los acuerdos de recobro semanal a ';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -11566,7 +11566,7 @@ CREATE TABLE `scan` (
|
|
|
|
|
`name` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
|
|
|
|
|
`odbc_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
|
PRIMARY KEY (`id`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=59633 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Se borra automaticamente 8 dias en el pasado desde vn2008.clean';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=59796 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Se borra automaticamente 8 dias en el pasado desde vn2008.clean';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -11606,7 +11606,7 @@ CREATE TABLE `scan_line` (
|
|
|
|
|
PRIMARY KEY (`scan_line_id`),
|
|
|
|
|
KEY `id_scan_id_idx` (`scan_id`),
|
|
|
|
|
CONSTRAINT `id_scan_id` FOREIGN KEY (`scan_id`) REFERENCES `scan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=756091 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=757659 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -11628,7 +11628,7 @@ CREATE TABLE `sharingcart` (
|
|
|
|
|
KEY `Suplent` (`Id_Suplente`),
|
|
|
|
|
CONSTRAINT `Suplent_key` FOREIGN KEY (`Id_Suplente`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `Trabajador_key` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1808 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1810 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -12083,7 +12083,7 @@ CREATE TABLE `ticket_observation` (
|
|
|
|
|
KEY `observation_type_id` (`observation_type_id`),
|
|
|
|
|
CONSTRAINT `ticket_observation_ibfk_1` FOREIGN KEY (`Id_Ticket`) REFERENCES `Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `ticket_observation_ibfk_2` FOREIGN KEY (`observation_type_id`) REFERENCES `observation_type` (`observation_type_id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1090202 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Todas las observaciones referentes a un ticket';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1091590 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Todas las observaciones referentes a un ticket';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -12206,7 +12206,7 @@ CREATE TABLE `travel` (
|
|
|
|
|
CONSTRAINT `travel_ibfk_2` FOREIGN KEY (`warehouse_id_out`) REFERENCES `warehouse` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `travel_ibfk_3` FOREIGN KEY (`agency_id`) REFERENCES `Agencias` (`Id_Agencia`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `travel_ibfk_4` FOREIGN KEY (`cargoSupplierFk`) REFERENCES `Proveedores` (`Id_Proveedor`) ON DELETE SET NULL ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=107984 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=108306 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -12343,7 +12343,7 @@ CREATE TABLE `travel_dits` (
|
|
|
|
|
KEY `fgkey2_idx` (`Id_Ticket`),
|
|
|
|
|
KEY `fgkey3_idx` (`Id_Trabajador`),
|
|
|
|
|
CONSTRAINT `travel_dits_ibfk_1` FOREIGN KEY (`Id_Trabajador`) REFERENCES `Trabajadores` (`Id_Trabajador`) ON DELETE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=170903 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=171203 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -43097,6 +43097,22 @@ SET character_set_client = utf8;
|
|
|
|
|
1 AS `eypbc`*/;
|
|
|
|
|
SET character_set_client = @saved_cs_client;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Table structure for table `clientContact`
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS `clientContact`;
|
|
|
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
|
|
|
CREATE TABLE `clientContact` (
|
|
|
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
|
|
|
`clientFk` int(11) NOT NULL,
|
|
|
|
|
`name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
|
|
|
`phone` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
|
|
|
PRIMARY KEY (`id`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4093 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Temporary table structure for view `clientCredit`
|
|
|
|
|
--
|
|
|
|
@ -43163,7 +43179,7 @@ CREATE TABLE `clientLog` (
|
|
|
|
|
KEY `userFk` (`userFk`),
|
|
|
|
|
CONSTRAINT `clientLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `vn2008`.`Clientes` (`id_cliente`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `clientLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=165574 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=165681 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -43782,7 +43798,7 @@ CREATE TABLE `dua` (
|
|
|
|
|
CONSTRAINT `dua_fk1` FOREIGN KEY (`gestdocFk`) REFERENCES `vn2008`.`gestdoc` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `dua_fk2` FOREIGN KEY (`awbFk`) REFERENCES `vn2008`.`awb` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `dua_fk4` FOREIGN KEY (`companyFk`) REFERENCES `vn2008`.`empresa` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3198 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=3203 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -43823,7 +43839,7 @@ CREATE TABLE `duaIntrastat` (
|
|
|
|
|
KEY `duaIntrastat_fk2_idx` (`duaFk`),
|
|
|
|
|
CONSTRAINT `duaIntrastat_fk1` FOREIGN KEY (`intrastatFk`) REFERENCES `vn2008`.`Intrastat` (`Codintrastat`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `duaIntrastat_fk2` FOREIGN KEY (`duaFk`) REFERENCES `dua` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4399 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4402 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -43843,7 +43859,7 @@ CREATE TABLE `duaInvoiceIn` (
|
|
|
|
|
KEY `duaInvoiceIn_fk2_idx` (`invoiceInFk`),
|
|
|
|
|
CONSTRAINT `duaInvoiceIn_fk1` FOREIGN KEY (`duaFk`) REFERENCES `dua` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `duaInvoiceIn_fk2` FOREIGN KEY (`invoiceInFk`) REFERENCES `vn2008`.`recibida` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4151 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Facturas asociadas a la declaración aduanera, básicamente la del agente transitario';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4152 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Facturas asociadas a la declaración aduanera, básicamente la del agente transitario';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -43868,7 +43884,7 @@ CREATE TABLE `duaTax` (
|
|
|
|
|
CONSTRAINT `duaTax_fk1` FOREIGN KEY (`duaFk`) REFERENCES `dua` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `duaTax_fk2` FOREIGN KEY (`supplierFk`) REFERENCES `vn2008`.`Proveedores` (`Id_Proveedor`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `duaTax_fk3` FOREIGN KEY (`taxClassFk`) REFERENCES `vn2008`.`iva_group` (`iva_group_id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1063 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1100 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -43964,7 +43980,7 @@ CREATE TABLE `entryLog` (
|
|
|
|
|
KEY `entryLog_ibfk_2` (`userFk`),
|
|
|
|
|
CONSTRAINT `entryLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `vn2008`.`Entradas` (`Id_Entrada`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `entryLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=50457 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=50861 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -44548,7 +44564,7 @@ CREATE TABLE `invoiceOutExpence` (
|
|
|
|
|
KEY `invoiceOutExpence_FK_2_idx` (`expenceFk`),
|
|
|
|
|
CONSTRAINT `invoiceOutExpence_FK_1` FOREIGN KEY (`invoiceOutFk`) REFERENCES `vn2008`.`Facturas` (`factura_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `invoiceOutExpence_FK_2` FOREIGN KEY (`expenceFk`) REFERENCES `vn2008`.`Gastos` (`Id_Gasto`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=66734 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Desglosa la base imponible de una factura en funcion del tipo de gasto/venta';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=66787 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Desglosa la base imponible de una factura en funcion del tipo de gasto/venta';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -44591,7 +44607,7 @@ CREATE TABLE `invoiceOutTax` (
|
|
|
|
|
KEY `pgcFk` (`pgcFk`),
|
|
|
|
|
CONSTRAINT `invoiceOutFk` FOREIGN KEY (`invoiceOutFk`) REFERENCES `vn2008`.`Facturas` (`factura_id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `invoiceOutTax_ibfk_1` FOREIGN KEY (`pgcFk`) REFERENCES `pgc` (`code`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=927853 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=927902 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -44804,7 +44820,7 @@ CREATE TABLE `itemTag` (
|
|
|
|
|
KEY `priorityItem` (`itemFk`,`priority`),
|
|
|
|
|
KEY `tagFk` (`tagFk`,`value`),
|
|
|
|
|
CONSTRAINT `itemFK` FOREIGN KEY (`itemFk`) REFERENCES `vn2008`.`Articles` (`Id_Article`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=326055 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=326484 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -44866,7 +44882,7 @@ CREATE TABLE `itemTaxCountry` (
|
|
|
|
|
CONSTRAINT `countryFK_paises` FOREIGN KEY (`countryFk`) REFERENCES `vn2008`.`Paises` (`Id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `itemFK_Article` FOREIGN KEY (`itemFk`) REFERENCES `vn2008`.`Articles` (`Id_Article`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `taxClassFK_Iva_Group` FOREIGN KEY (`taxClassFk`) REFERENCES `vn2008`.`iva_group` (`iva_group_id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=497780 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Define la clase de iva por artículo y pais';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=498593 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Define la clase de iva por artículo y pais';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -44956,7 +44972,7 @@ CREATE TABLE `itemTypeTag` (
|
|
|
|
|
KEY `itemTypeTagTag_idx` (`tagFk`),
|
|
|
|
|
CONSTRAINT `itemTypeTagTag` FOREIGN KEY (`tagFk`) REFERENCES `tag` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
|
|
|
|
CONSTRAINT `itemTypeTagTipos` FOREIGN KEY (`itemTypeFk`) REFERENCES `vn2008`.`Tipos` (`tipo_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -45097,7 +45113,7 @@ CREATE TABLE `message` (
|
|
|
|
|
KEY `sender` (`sender`),
|
|
|
|
|
KEY `recipient` (`recipient`),
|
|
|
|
|
KEY `uuid` (`uuid`(8))
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1506576 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1508769 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -45119,7 +45135,7 @@ CREATE TABLE `messageInbox` (
|
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
|
KEY `uuid` (`uuid`(8)),
|
|
|
|
|
KEY `finalRecipient` (`finalRecipient`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1653271 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1655488 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -46020,7 +46036,7 @@ CREATE TABLE `routeLog` (
|
|
|
|
|
`creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
|
`description` text COLLATE utf8_unicode_ci NOT NULL,
|
|
|
|
|
PRIMARY KEY (`id`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=501235 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=502510 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -46125,7 +46141,7 @@ CREATE TABLE `sms` (
|
|
|
|
|
`status` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
|
|
|
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
|
PRIMARY KEY (`id`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=97640 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=97759 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -46289,7 +46305,7 @@ CREATE TABLE `stockBuyed` (
|
|
|
|
|
UNIQUE KEY `date_UNIQUE` (`date`,`user`),
|
|
|
|
|
KEY `stockBuyed_user_idx` (`user`),
|
|
|
|
|
CONSTRAINT `stockBuyedUserFk` FOREIGN KEY (`user`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=332460 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=333343 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -46512,7 +46528,7 @@ CREATE TABLE `ticketLog` (
|
|
|
|
|
KEY `logTicketuserFk` (`userFk`),
|
|
|
|
|
CONSTRAINT `ticketLog_ibfk_1` FOREIGN KEY (`originFk`) REFERENCES `vn2008`.`Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `ticketLog_ibfk_2` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=962560 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=968280 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -46612,7 +46628,7 @@ CREATE TABLE `ticketPackaging` (
|
|
|
|
|
KEY `ticketPackaging_fk2_idx` (`packagingFk`),
|
|
|
|
|
CONSTRAINT `ticketPackaging_fk1` FOREIGN KEY (`ticketFk`) REFERENCES `vn2008`.`Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `ticketPackaging_fk2` FOREIGN KEY (`packagingFk`) REFERENCES `vn2008`.`Cubos` (`Id_Cubo`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=30614 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=30823 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -46822,7 +46838,7 @@ CREATE TABLE `trainingCourse` (
|
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
|
KEY `frgnWorker_idx` (`workerFk`),
|
|
|
|
|
CONSTRAINT `frgnWorker` FOREIGN KEY (`workerFk`) REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de trabajadores que han realizado una formación';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Lista de trabajadores que han realizado una formación';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -47092,7 +47108,7 @@ CREATE TABLE `workerDocument` (
|
|
|
|
|
KEY `workerDocument_ibfk_2` (`document`),
|
|
|
|
|
CONSTRAINT `workerDocument_ibfk_1` FOREIGN KEY (`worker`) REFERENCES `vn2008`.`Trabajadores` (`user_id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `workerDocument_ibfk_2` FOREIGN KEY (`document`) REFERENCES `vn2008`.`gestdoc` (`id`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=5700 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=6055 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -47162,7 +47178,7 @@ CREATE TABLE `workerLog` (
|
|
|
|
|
KEY `userFk_idx` (`userFk`),
|
|
|
|
|
CONSTRAINT `userFk` FOREIGN KEY (`userFk`) REFERENCES `account`.`user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
|
|
|
|
CONSTRAINT `workerFk` FOREIGN KEY (`originFk`) REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4381 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=4382 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -53126,6 +53142,73 @@ BEGIN
|
|
|
|
|
SELECT newItemFk;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
END ;;
|
|
|
|
|
DELIMITER ;
|
|
|
|
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
|
|
|
|
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
|
|
|
|
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
|
|
|
|
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
|
|
|
|
/*!50003 DROP PROCEDURE IF EXISTS `manaSpellersRequery` */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
|
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
|
|
|
|
/*!50003 SET character_set_client = utf8 */ ;
|
|
|
|
|
/*!50003 SET character_set_results = utf8 */ ;
|
|
|
|
|
/*!50003 SET collation_connection = utf8_general_ci */ ;
|
|
|
|
|
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
|
|
|
|
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
|
|
|
|
|
DELIMITER ;;
|
|
|
|
|
CREATE DEFINER=`root`@`%` PROCEDURE `manaSpellersRequery`(worker INTEGER)
|
|
|
|
|
BEGIN
|
|
|
|
|
|
|
|
|
|
DECLARE vWorkerIsExcluded BOOLEAN;
|
|
|
|
|
DECLARE vFromDated DATE;
|
|
|
|
|
|
|
|
|
|
SELECT COUNT(*) INTO vWorkerIsExcluded
|
|
|
|
|
FROM bs.manaSpellersExcluded
|
|
|
|
|
WHERE workerFk = worker;
|
|
|
|
|
|
|
|
|
|
IF NOT vWorkerIsExcluded THEN
|
|
|
|
|
|
|
|
|
|
SELECT max(dated) INTO vFromDated
|
|
|
|
|
FROM clientManaCache;
|
|
|
|
|
|
|
|
|
|
REPLACE bs.workerMana (workerFk, amount)
|
|
|
|
|
SELECT worker, sum(mana) FROM
|
|
|
|
|
(
|
|
|
|
|
SELECT s.quantity * sc.value as mana
|
|
|
|
|
FROM ticket t
|
|
|
|
|
JOIN address a ON a.id = t.addressFk
|
|
|
|
|
JOIN client c ON c.id = a.clientFk
|
|
|
|
|
JOIN sale s ON s.ticketFk = t.id
|
|
|
|
|
JOIN saleComponent sc ON sc.saleFk = s.id
|
|
|
|
|
WHERE c.salesPersonFk = worker AND componentFk IN (39, 37) -- maná auto y maná
|
|
|
|
|
AND t.shipped > vFromDated and t.shipped <= CURDATE()
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
|
|
|
|
|
|
SELECT - r.amountPaid
|
|
|
|
|
FROM receipt r
|
|
|
|
|
JOIN client c ON c.id = r.clientFk
|
|
|
|
|
WHERE c.salesPersonFk = worker AND bankFk = 66
|
|
|
|
|
AND payed > vFromDated
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
|
|
|
|
|
|
SELECT g.amount
|
|
|
|
|
FROM greuge g
|
|
|
|
|
JOIN client c ON c.id = g.clientFk
|
|
|
|
|
WHERE c.salesPersonFk = worker AND g.greugeTypeFk = 3 -- Maná
|
|
|
|
|
AND g.shipped > vFromDated and g.shipped < CURDATE()
|
|
|
|
|
|
|
|
|
|
UNION ALL
|
|
|
|
|
|
|
|
|
|
SELECT mana
|
|
|
|
|
FROM clientManaCache cc
|
|
|
|
|
JOIN client c ON c.id = cc.clientFk
|
|
|
|
|
WHERE c.salesPersonFk = worker AND cc.dated = vFromDated
|
|
|
|
|
) sub;
|
|
|
|
|
END IF;
|
|
|
|
|
END ;;
|
|
|
|
|
DELIMITER ;
|
|
|
|
|
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
|
|
|
@ -57248,7 +57331,7 @@ CREATE TABLE `batch` (
|
|
|
|
|
KEY `buy_edi_id` (`buy_edi_id`),
|
|
|
|
|
CONSTRAINT `batch_ibfk_1` FOREIGN KEY (`message_id`) REFERENCES `message` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `batch_ibfk_2` FOREIGN KEY (`buy_edi_id`) REFERENCES `vn2008`.`buy_edi` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=333542 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=334228 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -57633,7 +57716,7 @@ CREATE TABLE `message` (
|
|
|
|
|
UNIQUE KEY `mail_id` (`mail_id`),
|
|
|
|
|
KEY `sender_id` (`sender_id`),
|
|
|
|
|
CONSTRAINT `message_ibfk_2` FOREIGN KEY (`sender_id`) REFERENCES `mail` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=355012 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=355741 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -58475,6 +58558,18 @@ CREATE TABLE `manaCustomer` (
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Temporary table structure for view `manaSpellersExcluded`
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS `manaSpellersExcluded`;
|
|
|
|
|
/*!50001 DROP VIEW IF EXISTS `manaSpellersExcluded`*/;
|
|
|
|
|
SET @saved_cs_client = @@character_set_client;
|
|
|
|
|
SET character_set_client = utf8;
|
|
|
|
|
/*!50001 CREATE VIEW `manaSpellersExcluded` AS SELECT
|
|
|
|
|
1 AS `workerFk`*/;
|
|
|
|
|
SET character_set_client = @saved_cs_client;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Table structure for table `mana_spellers`
|
|
|
|
|
--
|
|
|
|
@ -63704,7 +63799,7 @@ CREATE TABLE `cdr` (
|
|
|
|
|
KEY `dstchannel` (`dst_channel`),
|
|
|
|
|
KEY `disposition` (`disposition`),
|
|
|
|
|
KEY `src` (`src`)
|
|
|
|
|
) ENGINE=MyISAM AUTO_INCREMENT=202652 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=MyISAM AUTO_INCREMENT=203099 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -64487,7 +64582,7 @@ CREATE TABLE `cache_calc` (
|
|
|
|
|
KEY `cache_id` (`cache_id`),
|
|
|
|
|
KEY `cacheName` (`cacheName`),
|
|
|
|
|
KEY `expires` (`expires`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=135282 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=135736 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -66256,7 +66351,7 @@ CREATE TABLE `inter` (
|
|
|
|
|
CONSTRAINT `inter_ibfk_1` FOREIGN KEY (`Id_Ticket`) REFERENCES `vn2008`.`Tickets` (`Id_Ticket`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `inter_state` FOREIGN KEY (`state_id`) REFERENCES `vn2008`.`state` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `responsable` FOREIGN KEY (`Id_Supervisor`) REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=11194358 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=11219170 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -66992,7 +67087,7 @@ CREATE TABLE `news` (
|
|
|
|
|
KEY `tag` (`tag`),
|
|
|
|
|
CONSTRAINT `news_ibfk_1` FOREIGN KEY (`userFk`) REFERENCES `account`.`account` (`id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `news_ibfk_2` FOREIGN KEY (`tag`) REFERENCES `newsTag` (`name`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=13011 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=13012 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -67043,7 +67138,7 @@ CREATE TABLE `order` (
|
|
|
|
|
CONSTRAINT `order_ibfk_5` FOREIGN KEY (`address_id`) REFERENCES `vn2008`.`Consignatarios` (`id_consigna`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `order_ibfk_8` FOREIGN KEY (`delivery_method_id`) REFERENCES `vn2008`.`Vistas` (`vista_id`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `order_ibfk_9` FOREIGN KEY (`agency_id`) REFERENCES `vn2008`.`Agencias` (`Id_Agencia`) ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1436950 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1439076 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -67142,7 +67237,7 @@ CREATE TABLE `orderRow` (
|
|
|
|
|
KEY `warehouse_shipment` (`warehouseFk`,`shipment`),
|
|
|
|
|
CONSTRAINT `orderRow_ibfk_2` FOREIGN KEY (`itemFk`) REFERENCES `vn2008`.`Articles` (`Id_Article`) ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `orderRow_ibfk_3` FOREIGN KEY (`orderFk`) REFERENCES `order` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=8835395 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=8845777 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
|
|
|
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
|
|
@ -67489,7 +67584,7 @@ CREATE TABLE `tpvTransaction` (
|
|
|
|
|
CONSTRAINT `receipt_id` FOREIGN KEY (`receiptFk`) REFERENCES `vn2008`.`Recibos` (`Id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `tpvTransaction_ibfk_1` FOREIGN KEY (`clientFk`) REFERENCES `vn2008`.`Clientes` (`id_cliente`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `tpvTransaction_ibfk_2` FOREIGN KEY (`merchantFk`) REFERENCES `tpvMerchant` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=224549 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Transactions realized through the virtual TPV';
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=224927 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Transactions realized through the virtual TPV';
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -67524,7 +67619,7 @@ CREATE TABLE `visit` (
|
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
|
KEY `firstAgent` (`firstAgent`),
|
|
|
|
|
CONSTRAINT `visit_ibfk_1` FOREIGN KEY (`firstAgent`) REFERENCES `visitAgent` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1292471 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1293627 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -67544,7 +67639,7 @@ CREATE TABLE `visitAccess` (
|
|
|
|
|
KEY `visit_access_idx_agent` (`agent`),
|
|
|
|
|
KEY `stamp` (`stamp`),
|
|
|
|
|
CONSTRAINT `visitAccess_ibfk_1` FOREIGN KEY (`agent`) REFERENCES `visitAgent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2823563 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2826933 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -67569,7 +67664,7 @@ CREATE TABLE `visitAgent` (
|
|
|
|
|
KEY `firstAccess` (`firstAccess`),
|
|
|
|
|
CONSTRAINT `visitAgent_ibfk_1` FOREIGN KEY (`visit`) REFERENCES `visit` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
|
|
|
CONSTRAINT `visitAgent_ibfk_2` FOREIGN KEY (`firstAccess`) REFERENCES `visitAccess` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1836222 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1837560 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -67589,7 +67684,7 @@ CREATE TABLE `visitUser` (
|
|
|
|
|
KEY `date_time` (`stamp`),
|
|
|
|
|
KEY `user_id` (`user`),
|
|
|
|
|
CONSTRAINT `visitUser_ibfk_1` FOREIGN KEY (`access`) REFERENCES `visitAccess` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2689996 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=2692938 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
|
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
@ -75051,6 +75146,24 @@ USE `bs`;
|
|
|
|
|
/*!50001 SET character_set_results = @saved_cs_results */;
|
|
|
|
|
/*!50001 SET collation_connection = @saved_col_connection */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Final view structure for view `manaSpellersExcluded`
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
/*!50001 DROP VIEW IF EXISTS `manaSpellersExcluded`*/;
|
|
|
|
|
/*!50001 SET @saved_cs_client = @@character_set_client */;
|
|
|
|
|
/*!50001 SET @saved_cs_results = @@character_set_results */;
|
|
|
|
|
/*!50001 SET @saved_col_connection = @@collation_connection */;
|
|
|
|
|
/*!50001 SET character_set_client = utf8 */;
|
|
|
|
|
/*!50001 SET character_set_results = utf8 */;
|
|
|
|
|
/*!50001 SET collation_connection = utf8_general_ci */;
|
|
|
|
|
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
|
|
|
|
/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */
|
|
|
|
|
/*!50001 VIEW `manaSpellersExcluded` AS select `m`.`Id_Trabajador` AS `workerFk` from `mana_spellers_excluded` `m` */;
|
|
|
|
|
/*!50001 SET character_set_client = @saved_cs_client */;
|
|
|
|
|
/*!50001 SET character_set_results = @saved_cs_results */;
|
|
|
|
|
/*!50001 SET collation_connection = @saved_col_connection */;
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Final view structure for view `v_ventas`
|
|
|
|
|
--
|
|
|
|
@ -75647,4 +75760,4 @@ USE `stock`;
|
|
|
|
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
|
|
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
|
|
|
|
|
|
-- Dump completed on 2018-06-21 11:07:46
|
|
|
|
|
-- Dump completed on 2018-06-22 14:30:58
|
|
|
|
|