From 78f25e0b46db3beae3916f721c8a54c2c6a6185d Mon Sep 17 00:00:00 2001 From: bernat Date: Wed, 25 Nov 2020 12:37:44 +0100 Subject: [PATCH] export production --- db/dump/dumpedFixtures.sql | 64 +- db/dump/fixtures.sql | 14 +- db/dump/structure.sql | 4467 ++++++++++------- db/export-data.sh | 2 + .../specs/activeWorkersWithRole.spec.js | 4 +- .../back/methods/client/specs/getCard.spec.js | 2 +- .../back/methods/client/specs/getDebt.spec.js | 2 +- .../methods/client/specs/listWorkers.spec.js | 2 +- .../back/methods/client/specs/summary.spec.js | 2 +- .../methods/ticket/specs/getTotal.spec.js | 2 +- 10 files changed, 2595 insertions(+), 1966 deletions(-) diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql index 879b1eb42..da9776316 100644 --- a/db/dump/dumpedFixtures.sql +++ b/db/dump/dumpedFixtures.sql @@ -23,7 +23,7 @@ USE `util`; LOCK TABLES `config` WRITE; /*!40000 ALTER TABLE `config` DISABLE KEYS */; -INSERT INTO `config` VALUES (1,'10230',0,'production',NULL); +INSERT INTO `config` VALUES (1,'10240',0,'production',NULL); /*!40000 ALTER TABLE `config` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -36,7 +36,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:31 +-- Dump completed on 2020-11-25 12:03:51 USE `account`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -61,7 +61,7 @@ USE `account`; LOCK TABLES `role` WRITE; /*!40000 ALTER TABLE `role` DISABLE KEYS */; -INSERT INTO `role` VALUES (0,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2018-04-23 14:33:59'),(1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'),(13,'teamBoss','Jefe de departamento',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'),(20,'manager','Departamento de gerencia',1,'2017-06-01 14:57:02','2017-06-01 14:57:51'),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08'),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'),(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'),(49,'production','Empleado de producción',0,'2018-02-26 15:28:23','2019-01-21 12:57:21'),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57'),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01'),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07'),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05'),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08'),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26'),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56'),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23'),(69,'coolerAssist','Empleado cámara con permiso compras',1,'2020-02-05 12:36:09','2020-02-05 12:36:09'),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25'),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07'),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46'); +INSERT INTO `role` VALUES (1,'employee','Empleado básico',1,'2017-05-19 07:04:58','2017-11-29 10:06:31'),(2,'customer','Privilegios básicos de un cliente',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(3,'agency','Consultar tablas de predicciones de bultos',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(5,'administrative','Tareas relacionadas con la contabilidad',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(6,'guest','Privilegios para usuarios sin cuenta',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(9,'developer','Desarrolladores del sistema',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(11,'account','Privilegios relacionados con el login',0,'2017-05-19 07:04:58','2017-09-20 17:06:35'),(13,'teamBoss','Jefe de departamento',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(15,'logistic','Departamento de compras, responsables de la logistica',1,'2017-05-19 07:04:58','2018-02-12 10:50:10'),(16,'logisticBoss','Jefe del departamento de logística',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(17,'adminBoss','Jefe del departamento de administración',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(18,'salesPerson','Departamento de ventas',1,'2017-05-19 07:04:58','2017-05-19 07:04:58'),(19,'salesBoss','Jefe del departamento de ventas',1,'2017-05-19 07:04:58','2017-08-16 12:38:27'),(20,'manager','Departamento de gerencia',1,'2017-06-01 14:57:02','2017-06-01 14:57:51'),(21,'salesAssistant','Jefe auxiliar de ventas',1,'2017-08-16 12:40:52','2017-08-16 12:40:52'),(22,'teamManager','Jefe de departamento con privilegios de auxiliar de venta.',1,'2017-09-07 09:08:12','2017-09-07 09:08:12'),(30,'financialBoss','Director finaciero',1,'2017-09-21 11:05:36','2017-09-21 11:05:36'),(31,'freelancer','Trabajadores por cuenta ajena',1,'2017-10-10 12:57:26','2017-10-10 12:59:27'),(32,'ett','Trabajadores de empresa temporal',1,'2017-10-10 12:58:58','2017-10-10 12:59:20'),(33,'invoicing','Personal con acceso a facturación',0,'2018-01-29 16:43:34','2018-01-29 16:43:34'),(34,'agencyBoss','Jefe/a del departamento de agencias',1,'2018-01-29 16:44:39','2018-02-23 07:58:53'),(35,'buyer','Departamento de compras',1,'2018-02-12 10:35:42','2018-02-12 10:35:42'),(36,'replenisher','Trabajadores de camara',1,'2018-02-16 14:07:10','2019-04-12 05:38:08'),(37,'hr','Gestor/a de recursos humanos',1,'2018-02-22 17:34:53','2018-02-22 17:34:53'),(38,'hrBoss','Jefe/a de recursos humanos',1,'2018-02-22 17:35:09','2018-02-22 17:35:09'),(39,'adminAssistant','Jefe auxiliar administrativo',1,'2018-02-23 10:37:36','2018-02-23 10:38:41'),(40,'handmade','Departamento de confección',1,'2018-02-23 11:14:53','2018-02-23 11:39:12'),(41,'handmadeBoss','Jefe de departamento de confección',1,'2018-02-23 11:15:09','2018-02-23 11:39:26'),(42,'artificial','Departamento de artificial',1,'2018-02-23 11:39:59','2018-02-23 11:39:59'),(43,'artificialBoss','Jefe del departamento de artificial',1,'2018-02-23 11:40:16','2018-02-23 11:40:16'),(44,'accessory','Departamento de complementos',1,'2018-02-23 11:41:12','2018-02-23 11:41:12'),(45,'accessoryBoss','Jefe del departamento de complementos',1,'2018-02-23 11:41:23','2018-02-23 11:41:23'),(47,'cooler','Empleados de cámara',1,'2018-02-23 13:08:18','2018-02-23 13:08:18'),(48,'coolerBoss','Jefe del departamento de cámara',1,'2018-02-23 13:12:01','2018-02-23 13:12:01'),(49,'production','Empleado de producción',0,'2018-02-26 15:28:23','2019-01-21 12:57:21'),(50,'productionBoss','Jefe de producción',1,'2018-02-26 15:34:12','2018-02-26 15:34:12'),(51,'marketing','Departamento de marketing',1,'2018-03-01 07:28:39','2018-03-01 07:28:39'),(52,'marketingBoss','Jefe del departamento de marketing',1,'2018-03-01 07:28:57','2018-03-01 07:28:57'),(53,'insurance','Gestor de seguros de cambio',0,'2018-03-05 07:44:35','2019-02-01 13:47:57'),(54,'itemPicker','Sacador en cámara',1,'2018-03-05 12:08:17','2018-03-05 12:08:17'),(55,'itemPickerBoss','Jefe de sacadores',1,'2018-03-05 12:08:31','2018-03-05 12:08:31'),(56,'delivery','Personal de reparto',1,'2018-05-30 06:07:02','2018-05-30 06:07:02'),(57,'deliveryBoss','Jefe de personal de reparto',1,'2018-05-30 06:07:19','2018-05-30 06:07:19'),(58,'packager','Departamento encajadores',1,'2019-01-21 12:43:45','2019-01-21 12:43:45'),(59,'packagerBoss','Jefe departamento encajadores',1,'2019-01-21 12:44:10','2019-01-21 12:44:10'),(60,'productionAssi','Tareas relacionadas con producción y administración',1,'2019-01-29 13:29:01','2019-01-29 13:29:01'),(61,'replenisherBos','Jefe de Complementos/Camara',1,'2019-07-01 06:44:07','2019-07-01 06:44:07'),(62,'noLogin','Role without login access to MySQL',0,'2019-07-01 06:50:19','2019-07-02 13:42:05'),(64,'balanceSheet','Consulta de Balance',0,'2019-07-16 12:12:08','2019-07-16 12:12:08'),(65,'officeBoss','Jefe de filial',1,'2019-08-02 06:54:26','2019-08-02 06:54:26'),(66,'sysadmin','Administrador de sistema',1,'2019-08-08 06:58:56','2019-08-08 06:58:56'),(67,'adminOfficer','categoria profesional oficial de administración',1,'2020-01-03 08:09:23','2020-01-03 08:09:23'),(69,'coolerAssist','Empleado cámara con permiso compras',1,'2020-02-05 12:36:09','2020-02-05 12:36:09'),(70,'trainee','Alumno de prácticas',1,'2020-03-04 11:00:25','2020-03-04 11:00:25'),(71,'checker','Rol de revisor con privilegios de itemPicker',1,'2020-10-02 10:50:07','2020-10-02 10:50:07'),(72,'claimManager','Personal de reclamaciones',1,'2020-10-13 10:01:32','2020-10-26 07:29:46'),(73,'financial','Departamento de finanzas',1,'2020-11-16 09:30:27','2020-11-16 09:30:27'),(100,'root','Rol con todos los privilegios',0,'2018-04-23 14:33:36','2020-11-12 06:50:07'); /*!40000 ALTER TABLE `role` ENABLE KEYS */; UNLOCK TABLES; @@ -71,7 +71,7 @@ UNLOCK TABLES; LOCK TABLES `roleInherit` WRITE; /*!40000 ALTER TABLE `roleInherit` DISABLE KEYS */; -INSERT INTO `roleInherit` VALUES (1,1,2),(2,1,3),(3,1,70),(4,2,11),(5,3,11),(6,5,1),(7,5,21),(8,5,33),(9,9,0),(10,11,6),(11,13,1),(12,15,35),(13,15,57),(14,16,13),(15,16,15),(16,17,20),(17,17,37),(18,17,39),(19,17,64),(20,18,1),(21,19,21),(22,20,13),(23,20,16),(24,20,65),(25,21,13),(26,21,18),(27,21,53),(28,22,13),(29,22,21),(30,30,5),(31,30,20),(32,30,22),(33,30,53),(34,30,64),(35,31,1),(36,32,1),(37,34,1),(38,34,13),(39,34,33),(40,35,1),(41,36,44),(42,36,47),(43,37,1),(44,38,37),(45,38,64),(46,39,5),(47,39,21),(48,39,57),(49,40,1),(50,40,49),(51,41,13),(52,41,35),(53,41,40),(54,42,35),(55,42,49),(56,43,13),(57,43,42),(58,44,1),(59,45,13),(60,45,44),(61,47,1),(62,48,13),(63,48,47),(64,49,36),(65,49,58),(66,50,13),(67,50,21),(68,50,35),(69,50,49),(70,50,57),(71,50,59),(72,51,1),(73,52,13),(74,52,19),(75,52,35),(76,52,51),(77,53,1),(78,54,1),(79,55,13),(80,55,54),(81,56,1),(82,57,13),(83,57,56),(84,58,1),(85,59,13),(86,59,49),(87,60,5),(88,60,37),(89,60,50),(90,60,57),(91,61,13),(92,61,36),(93,65,19),(94,65,35),(95,65,50),(96,66,0),(97,67,5),(98,67,37),(99,69,35),(100,69,47),(101,70,11),(102,71,1),(103,71,58),(104,72,13),(105,72,18); +INSERT INTO `roleInherit` VALUES (1,1,2),(2,1,3),(3,1,70),(4,2,11),(5,3,11),(6,5,1),(7,5,21),(8,5,33),(9,9,100),(10,11,6),(11,13,1),(12,15,35),(13,15,57),(14,16,13),(15,16,15),(16,17,20),(17,17,37),(18,17,39),(19,17,64),(20,18,1),(21,19,21),(22,20,13),(23,20,16),(24,20,65),(25,21,13),(26,21,18),(27,21,53),(28,22,13),(29,22,21),(30,30,5),(31,30,20),(32,30,22),(33,30,53),(34,30,64),(35,31,1),(36,32,1),(37,34,1),(38,34,13),(39,34,33),(40,35,1),(41,36,44),(42,36,47),(43,37,1),(44,38,37),(45,38,64),(46,39,5),(47,39,21),(48,39,57),(49,40,1),(50,40,49),(51,41,13),(52,41,35),(53,41,40),(54,42,35),(55,42,49),(56,43,13),(57,43,42),(58,44,1),(59,45,13),(60,45,44),(61,47,1),(62,48,13),(63,48,47),(64,49,36),(65,49,58),(66,50,13),(67,50,21),(68,50,35),(69,50,49),(70,50,57),(71,50,59),(72,51,1),(73,52,13),(74,52,19),(75,52,35),(76,52,51),(77,53,1),(78,54,1),(79,55,13),(80,55,54),(81,56,1),(82,57,13),(83,57,56),(84,58,1),(85,59,13),(109,59,50),(87,60,5),(88,60,37),(89,60,50),(90,60,57),(91,61,13),(92,61,36),(93,65,19),(94,65,35),(95,65,50),(96,66,100),(97,67,5),(98,67,37),(99,69,35),(100,69,47),(101,70,11),(102,71,1),(103,71,58),(104,72,13),(105,72,18),(106,73,5),(108,73,19),(107,73,64); /*!40000 ALTER TABLE `roleInherit` ENABLE KEYS */; UNLOCK TABLES; @@ -81,7 +81,7 @@ UNLOCK TABLES; LOCK TABLES `roleRole` WRITE; /*!40000 ALTER TABLE `roleRole` DISABLE KEYS */; -INSERT INTO `roleRole` VALUES (0,0),(0,1),(0,2),(0,3),(0,5),(0,6),(0,9),(0,11),(0,13),(0,15),(0,16),(0,17),(0,18),(0,19),(0,20),(0,21),(0,22),(0,30),(0,31),(0,32),(0,33),(0,34),(0,35),(0,36),(0,37),(0,38),(0,39),(0,40),(0,41),(0,42),(0,43),(0,44),(0,45),(0,47),(0,48),(0,49),(0,50),(0,51),(0,52),(0,53),(0,54),(0,55),(0,56),(0,57),(0,58),(0,59),(0,60),(0,61),(0,62),(0,64),(0,65),(0,66),(0,67),(0,69),(0,70),(0,71),(0,72),(1,1),(1,2),(1,3),(1,6),(1,11),(1,70),(2,2),(2,6),(2,11),(3,3),(3,6),(3,11),(5,1),(5,2),(5,3),(5,5),(5,6),(5,11),(5,13),(5,18),(5,21),(5,33),(5,53),(5,70),(6,6),(9,0),(9,1),(9,2),(9,3),(9,5),(9,6),(9,9),(9,11),(9,13),(9,15),(9,16),(9,17),(9,18),(9,19),(9,20),(9,21),(9,22),(9,30),(9,31),(9,32),(9,33),(9,34),(9,35),(9,36),(9,37),(9,38),(9,39),(9,40),(9,41),(9,42),(9,43),(9,44),(9,45),(9,47),(9,48),(9,49),(9,50),(9,51),(9,52),(9,53),(9,54),(9,55),(9,56),(9,57),(9,58),(9,59),(9,60),(9,61),(9,62),(9,64),(9,65),(9,66),(9,67),(9,69),(9,70),(9,71),(9,72),(11,6),(11,11),(13,1),(13,2),(13,3),(13,6),(13,11),(13,13),(13,70),(15,1),(15,2),(15,3),(15,6),(15,11),(15,13),(15,15),(15,35),(15,56),(15,57),(15,70),(16,1),(16,2),(16,3),(16,6),(16,11),(16,13),(16,15),(16,16),(16,35),(16,56),(16,57),(16,70),(17,1),(17,2),(17,3),(17,5),(17,6),(17,11),(17,13),(17,15),(17,16),(17,17),(17,18),(17,19),(17,20),(17,21),(17,33),(17,35),(17,36),(17,37),(17,39),(17,44),(17,47),(17,49),(17,50),(17,53),(17,56),(17,57),(17,58),(17,59),(17,64),(17,65),(17,70),(18,1),(18,2),(18,3),(18,6),(18,11),(18,18),(18,70),(19,1),(19,2),(19,3),(19,6),(19,11),(19,13),(19,18),(19,19),(19,21),(19,53),(19,70),(20,1),(20,2),(20,3),(20,6),(20,11),(20,13),(20,15),(20,16),(20,18),(20,19),(20,20),(20,21),(20,35),(20,36),(20,44),(20,47),(20,49),(20,50),(20,53),(20,56),(20,57),(20,58),(20,59),(20,65),(20,70),(21,1),(21,2),(21,3),(21,6),(21,11),(21,13),(21,18),(21,21),(21,53),(21,70),(22,1),(22,2),(22,3),(22,6),(22,11),(22,13),(22,18),(22,21),(22,22),(22,53),(22,70),(30,1),(30,2),(30,3),(30,5),(30,6),(30,11),(30,13),(30,15),(30,16),(30,18),(30,19),(30,20),(30,21),(30,22),(30,30),(30,33),(30,35),(30,36),(30,44),(30,47),(30,49),(30,50),(30,53),(30,56),(30,57),(30,58),(30,59),(30,64),(30,65),(30,70),(31,1),(31,2),(31,3),(31,6),(31,11),(31,31),(31,70),(32,1),(32,2),(32,3),(32,6),(32,11),(32,32),(32,70),(33,33),(34,1),(34,2),(34,3),(34,6),(34,11),(34,13),(34,33),(34,34),(34,70),(35,1),(35,2),(35,3),(35,6),(35,11),(35,35),(35,70),(36,1),(36,2),(36,3),(36,6),(36,11),(36,36),(36,44),(36,47),(36,70),(37,1),(37,2),(37,3),(37,6),(37,11),(37,37),(37,70),(38,1),(38,2),(38,3),(38,6),(38,11),(38,37),(38,38),(38,64),(38,70),(39,1),(39,2),(39,3),(39,5),(39,6),(39,11),(39,13),(39,18),(39,21),(39,33),(39,39),(39,53),(39,56),(39,57),(39,70),(40,1),(40,2),(40,3),(40,6),(40,11),(40,36),(40,40),(40,44),(40,47),(40,49),(40,58),(40,70),(41,1),(41,2),(41,3),(41,6),(41,11),(41,13),(41,35),(41,36),(41,40),(41,41),(41,44),(41,47),(41,49),(41,58),(41,70),(42,1),(42,2),(42,3),(42,6),(42,11),(42,35),(42,36),(42,42),(42,44),(42,47),(42,49),(42,58),(42,70),(43,1),(43,2),(43,3),(43,6),(43,11),(43,13),(43,35),(43,36),(43,42),(43,43),(43,44),(43,47),(43,49),(43,58),(43,70),(44,1),(44,2),(44,3),(44,6),(44,11),(44,44),(44,70),(45,1),(45,2),(45,3),(45,6),(45,11),(45,13),(45,44),(45,45),(45,70),(47,1),(47,2),(47,3),(47,6),(47,11),(47,47),(47,70),(48,1),(48,2),(48,3),(48,6),(48,11),(48,13),(48,47),(48,48),(48,70),(49,1),(49,2),(49,3),(49,6),(49,11),(49,36),(49,44),(49,47),(49,49),(49,58),(49,70),(50,1),(50,2),(50,3),(50,6),(50,11),(50,13),(50,18),(50,21),(50,35),(50,36),(50,44),(50,47),(50,49),(50,50),(50,53),(50,56),(50,57),(50,58),(50,59),(50,70),(51,1),(51,2),(51,3),(51,6),(51,11),(51,51),(51,70),(52,1),(52,2),(52,3),(52,6),(52,11),(52,13),(52,18),(52,19),(52,21),(52,35),(52,51),(52,52),(52,53),(52,70),(53,1),(53,2),(53,3),(53,6),(53,11),(53,53),(53,70),(54,1),(54,2),(54,3),(54,6),(54,11),(54,54),(54,70),(55,1),(55,2),(55,3),(55,6),(55,11),(55,13),(55,54),(55,55),(55,70),(56,1),(56,2),(56,3),(56,6),(56,11),(56,56),(56,70),(57,1),(57,2),(57,3),(57,6),(57,11),(57,13),(57,56),(57,57),(57,70),(58,1),(58,2),(58,3),(58,6),(58,11),(58,58),(58,70),(59,1),(59,2),(59,3),(59,6),(59,11),(59,13),(59,36),(59,44),(59,47),(59,49),(59,58),(59,59),(59,70),(60,1),(60,2),(60,3),(60,5),(60,6),(60,11),(60,13),(60,18),(60,21),(60,33),(60,35),(60,36),(60,37),(60,44),(60,47),(60,49),(60,50),(60,53),(60,56),(60,57),(60,58),(60,59),(60,60),(60,70),(61,1),(61,2),(61,3),(61,6),(61,11),(61,13),(61,36),(61,44),(61,47),(61,61),(61,70),(62,62),(64,64),(65,1),(65,2),(65,3),(65,6),(65,11),(65,13),(65,18),(65,19),(65,21),(65,35),(65,36),(65,44),(65,47),(65,49),(65,50),(65,53),(65,56),(65,57),(65,58),(65,59),(65,65),(65,70),(66,0),(66,1),(66,2),(66,3),(66,5),(66,6),(66,9),(66,11),(66,13),(66,15),(66,16),(66,17),(66,18),(66,19),(66,20),(66,21),(66,22),(66,30),(66,31),(66,32),(66,33),(66,34),(66,35),(66,36),(66,37),(66,38),(66,39),(66,40),(66,41),(66,42),(66,43),(66,44),(66,45),(66,47),(66,48),(66,49),(66,50),(66,51),(66,52),(66,53),(66,54),(66,55),(66,56),(66,57),(66,58),(66,59),(66,60),(66,61),(66,62),(66,64),(66,65),(66,66),(66,67),(66,69),(66,70),(66,71),(66,72),(67,1),(67,2),(67,3),(67,5),(67,6),(67,11),(67,13),(67,18),(67,21),(67,33),(67,37),(67,53),(67,67),(67,70),(69,1),(69,2),(69,3),(69,6),(69,11),(69,35),(69,47),(69,69),(69,70),(70,6),(70,11),(70,70),(71,1),(71,2),(71,3),(71,6),(71,11),(71,58),(71,70),(71,71),(72,1),(72,2),(72,3),(72,6),(72,11),(72,13),(72,18),(72,70),(72,72); +INSERT INTO `roleRole` VALUES (6839,1,1),(6840,1,2),(6841,1,3),(6844,1,6),(6843,1,11),(6842,1,70),(6762,2,2),(6764,2,6),(6763,2,11),(6672,3,3),(6674,3,6),(6673,3,11),(6647,5,1),(6652,5,2),(6651,5,3),(6646,5,5),(6657,5,6),(6656,5,11),(6653,5,13),(6654,5,18),(6648,5,21),(6649,5,33),(6655,5,53),(6650,5,70),(6904,6,6),(6804,9,1),(6801,9,2),(6790,9,3),(6788,9,5),(6809,9,6),(6781,9,9),(6785,9,11),(6836,9,13),(6818,9,15),(6819,9,16),(6787,9,17),(6834,9,18),(6833,9,19),(6820,9,20),(6832,9,21),(6837,9,22),(6807,9,30),(6808,9,31),(6805,9,32),(6815,9,33),(6791,9,34),(6795,9,35),(6830,9,36),(6812,9,37),(6813,9,38),(6786,9,39),(6810,9,40),(6811,9,41),(6792,9,42),(6793,9,43),(6783,9,44),(6784,9,45),(6798,9,47),(6800,9,48),(6827,9,49),(6829,9,50),(6821,9,51),(6822,9,52),(6814,9,53),(6816,9,54),(6817,9,55),(6802,9,56),(6803,9,57),(6825,9,58),(6826,9,59),(6828,9,60),(6831,9,61),(6823,9,62),(6794,9,64),(6824,9,65),(6835,9,66),(6789,9,67),(6799,9,69),(6838,9,70),(6796,9,71),(6797,9,72),(6806,9,73),(6782,9,100),(6599,11,6),(6598,11,11),(7311,13,1),(7312,13,2),(7313,13,3),(7316,13,6),(7315,13,11),(7310,13,13),(7314,13,70),(6976,15,1),(6980,15,2),(6979,15,3),(6982,15,6),(6981,15,11),(6975,15,13),(6972,15,15),(6973,15,35),(6977,15,56),(6974,15,57),(6978,15,70),(6987,16,1),(6991,16,2),(6990,16,3),(6994,16,6),(6993,16,11),(6984,16,13),(6985,16,15),(6983,16,16),(6986,16,35),(6992,16,56),(6988,16,57),(6989,16,70),(6620,17,1),(6629,17,2),(6628,17,3),(6624,17,5),(6641,17,6),(6638,17,11),(6623,17,13),(6633,17,15),(6622,17,16),(6615,17,17),(6635,17,18),(6632,17,19),(6616,17,20),(6625,17,21),(6634,17,33),(6631,17,35),(6643,17,36),(6617,17,37),(6618,17,39),(6645,17,44),(6644,17,47),(6640,17,49),(6630,17,50),(6636,17,53),(6637,17,56),(6626,17,57),(6642,17,58),(6639,17,59),(6619,17,64),(6621,17,65),(6627,17,70),(7246,18,1),(7247,18,2),(7248,18,3),(7251,18,6),(7250,18,11),(7245,18,18),(7249,18,70),(7239,19,1),(7242,19,2),(7241,19,3),(7244,19,6),(7243,19,11),(7236,19,13),(7237,19,18),(7234,19,19),(7235,19,21),(7238,19,53),(7240,19,70),(7001,20,1),(7008,20,2),(7007,20,3),(7019,20,6),(7016,20,11),(6996,20,13),(7000,20,15),(6997,20,16),(7014,20,18),(6999,20,19),(6995,20,20),(7004,20,21),(7002,20,35),(7012,20,36),(7018,20,44),(7017,20,47),(7009,20,49),(7003,20,50),(7013,20,53),(7015,20,56),(7005,20,57),(7011,20,58),(7010,20,59),(6998,20,65),(7006,20,70),(7228,21,1),(7231,21,2),(7230,21,3),(7233,21,6),(7232,21,11),(7225,21,13),(7226,21,18),(7224,21,21),(7227,21,53),(7229,21,70),(7321,22,1),(7325,22,2),(7324,22,3),(7327,22,6),(7326,22,11),(7318,22,13),(7320,22,18),(7319,22,21),(7317,22,22),(7322,22,53),(7323,22,70),(6877,30,1),(6884,30,2),(6883,30,3),(6868,30,5),(6894,30,6),(6890,30,11),(6874,30,13),(6880,30,15),(6873,30,16),(6881,30,18),(6879,30,19),(6869,30,20),(6876,30,21),(6870,30,22),(6867,30,30),(6875,30,33),(6885,30,35),(6892,30,36),(6896,30,44),(6895,30,47),(6888,30,49),(6886,30,50),(6871,30,53),(6893,30,56),(6889,30,57),(6891,30,58),(6887,30,59),(6872,30,64),(6878,30,65),(6882,30,70),(6898,31,1),(6899,31,2),(6900,31,3),(6903,31,6),(6902,31,11),(6897,31,31),(6901,31,70),(6846,32,1),(6847,32,2),(6848,32,3),(6851,32,6),(6850,32,11),(6845,32,32),(6849,32,70),(6955,33,33),(6676,34,1),(6681,34,2),(6680,34,3),(6683,34,6),(6682,34,11),(6677,34,13),(6678,34,33),(6675,34,34),(6679,34,70),(6714,35,1),(6715,35,2),(6716,35,3),(6719,35,6),(6718,35,11),(6713,35,35),(6717,35,70),(7149,36,1),(7151,36,2),(7150,36,3),(7154,36,6),(7153,36,11),(7146,36,36),(7147,36,44),(7148,36,47),(7152,36,70),(6933,37,1),(6934,37,2),(6935,37,3),(6938,37,6),(6937,37,11),(6932,37,37),(6936,37,70),(6942,38,1),(6944,38,2),(6943,38,3),(6947,38,6),(6946,38,11),(6940,38,37),(6939,38,38),(6941,38,64),(6945,38,70),(6606,39,1),(6612,39,2),(6611,39,3),(6601,39,5),(6614,39,6),(6613,39,11),(6604,39,13),(6607,39,18),(6602,39,21),(6605,39,33),(6600,39,39),(6608,39,53),(6609,39,56),(6603,39,57),(6610,39,70),(6906,40,1),(6909,40,2),(6908,40,3),(6916,40,6),(6915,40,11),(6911,40,36),(6905,40,40),(6914,40,44),(6913,40,47),(6907,40,49),(6912,40,58),(6910,40,70),(6922,41,1),(6925,41,2),(6924,41,3),(6931,41,6),(6930,41,11),(6918,41,13),(6919,41,35),(6926,41,36),(6920,41,40),(6917,41,41),(6929,41,44),(6928,41,47),(6921,41,49),(6927,41,58),(6923,41,70),(6688,42,1),(6692,42,2),(6691,42,3),(6696,42,6),(6695,42,11),(6685,42,35),(6687,42,36),(6684,42,42),(6693,42,44),(6694,42,47),(6686,42,49),(6689,42,58),(6690,42,70),(6701,43,1),(6705,43,2),(6704,43,3),(6711,43,6),(6710,43,11),(6698,43,13),(6700,43,35),(6706,43,36),(6699,43,42),(6697,43,43),(6709,43,44),(6708,43,47),(6702,43,49),(6707,43,58),(6703,43,70),(6583,44,1),(6584,44,2),(6585,44,3),(6588,44,6),(6587,44,11),(6582,44,44),(6586,44,70),(6592,45,1),(6594,45,2),(6593,45,3),(6597,45,6),(6596,45,11),(6590,45,13),(6591,45,44),(6589,45,45),(6595,45,70),(6738,47,1),(6739,47,2),(6740,47,3),(6743,47,6),(6742,47,11),(6737,47,47),(6741,47,70),(6756,48,1),(6758,48,2),(6757,48,3),(6761,48,6),(6760,48,11),(6754,48,13),(6755,48,47),(6753,48,48),(6759,48,70),(7096,49,1),(7099,49,2),(7098,49,3),(7101,49,6),(7100,49,11),(7092,49,36),(7095,49,44),(7094,49,47),(7091,49,49),(7093,49,58),(7097,49,70),(7138,50,1),(7143,50,2),(7142,50,3),(7145,50,6),(7144,50,11),(7127,50,13),(7137,50,18),(7128,50,21),(7129,50,35),(7135,50,36),(7140,50,44),(7139,50,47),(7130,50,49),(7126,50,50),(7136,50,53),(7133,50,56),(7131,50,57),(7134,50,58),(7132,50,59),(7141,50,70),(7021,51,1),(7022,51,2),(7023,51,3),(7026,51,6),(7025,51,11),(7020,51,51),(7024,51,70),(7033,52,1),(7037,52,2),(7036,52,3),(7040,52,6),(7039,52,11),(7028,52,13),(7034,52,18),(7029,52,19),(7032,52,21),(7030,52,35),(7031,52,51),(7027,52,52),(7038,52,53),(7035,52,70),(6949,53,1),(6950,53,2),(6951,53,3),(6954,53,6),(6953,53,11),(6948,53,53),(6952,53,70),(6957,54,1),(6958,54,2),(6959,54,3),(6962,54,6),(6961,54,11),(6956,54,54),(6960,54,70),(6966,55,1),(6968,55,2),(6967,55,3),(6971,55,6),(6970,55,11),(6964,55,13),(6965,55,54),(6963,55,55),(6969,55,70),(6766,56,1),(6767,56,2),(6768,56,3),(6771,56,6),(6770,56,11),(6765,56,56),(6769,56,70),(6775,57,1),(6777,57,2),(6776,57,3),(6780,57,6),(6779,57,11),(6773,57,13),(6774,57,56),(6772,57,57),(6778,57,70),(7065,58,1),(7066,58,2),(7067,58,3),(7070,58,6),(7069,58,11),(7064,58,58),(7068,58,70),(7075,59,1),(7083,59,2),(7082,59,3),(7090,59,6),(7089,59,11),(7072,59,13),(7080,59,18),(7074,59,21),(7076,59,35),(7084,59,36),(7088,59,44),(7087,59,47),(7077,59,49),(7073,59,50),(7079,59,53),(7086,59,56),(7078,59,57),(7085,59,58),(7071,59,59),(7081,59,70),(7110,60,1),(7121,60,2),(7120,60,3),(7103,60,5),(7125,60,6),(7124,60,11),(7107,60,13),(7118,60,18),(7109,60,21),(7108,60,33),(7111,60,35),(7116,60,36),(7104,60,37),(7123,60,44),(7122,60,47),(7112,60,49),(7105,60,50),(7117,60,53),(7114,60,56),(7106,60,57),(7115,60,58),(7113,60,59),(7102,60,60),(7119,60,70),(7159,61,1),(7163,61,2),(7162,61,3),(7165,61,6),(7164,61,11),(7156,61,13),(7157,61,36),(7158,61,44),(7160,61,47),(7155,61,61),(7161,61,70),(7041,62,62),(6712,64,64),(7047,65,1),(7055,65,2),(7054,65,3),(7063,65,6),(7062,65,11),(7046,65,13),(7057,65,18),(7043,65,19),(7048,65,21),(7044,65,35),(7052,65,36),(7061,65,44),(7060,65,47),(7049,65,49),(7045,65,50),(7056,65,53),(7059,65,56),(7050,65,57),(7058,65,58),(7051,65,59),(7042,65,65),(7053,65,70),(7276,66,1),(7272,66,2),(7261,66,3),(7259,66,5),(7281,66,6),(7275,66,9),(7256,66,11),(7307,66,13),(7290,66,15),(7291,66,16),(7258,66,17),(7306,66,18),(7305,66,19),(7292,66,20),(7304,66,21),(7308,66,22),(7279,66,30),(7280,66,31),(7277,66,32),(7287,66,33),(7262,66,34),(7266,66,35),(7302,66,36),(7284,66,37),(7285,66,38),(7257,66,39),(7282,66,40),(7283,66,41),(7263,66,42),(7264,66,43),(7254,66,44),(7255,66,45),(7269,66,47),(7271,66,48),(7299,66,49),(7301,66,50),(7293,66,51),(7294,66,52),(7286,66,53),(7288,66,54),(7289,66,55),(7273,66,56),(7274,66,57),(7297,66,58),(7298,66,59),(7300,66,60),(7303,66,61),(7295,66,62),(7265,66,64),(7296,66,65),(7252,66,66),(7260,66,67),(7270,66,69),(7309,66,70),(7267,66,71),(7268,66,72),(7278,66,73),(7253,66,100),(6662,67,1),(6666,67,2),(6665,67,3),(6659,67,5),(6671,67,6),(6670,67,11),(6667,67,13),(6668,67,18),(6661,67,21),(6663,67,33),(6660,67,37),(6669,67,53),(6658,67,67),(6664,67,70),(6747,69,1),(6749,69,2),(6748,69,3),(6752,69,6),(6751,69,11),(6745,69,35),(6746,69,47),(6744,69,69),(6750,69,70),(7330,70,6),(7329,70,11),(7328,70,70),(6721,71,1),(6724,71,2),(6723,71,3),(6727,71,6),(6726,71,11),(6722,71,58),(6725,71,70),(6720,71,71),(6731,72,1),(6733,72,2),(6732,72,3),(6736,72,6),(6735,72,11),(6729,72,13),(6730,72,18),(6734,72,70),(6728,72,72),(6858,73,1),(6861,73,2),(6860,73,3),(6853,73,5),(6866,73,6),(6865,73,11),(6862,73,13),(6863,73,18),(6854,73,19),(6857,73,21),(6856,73,33),(6864,73,53),(6855,73,64),(6859,73,70),(6852,73,73),(7189,100,1),(7185,100,2),(7174,100,3),(7172,100,5),(7194,100,6),(7188,100,9),(7169,100,11),(7221,100,13),(7203,100,15),(7204,100,16),(7171,100,17),(7219,100,18),(7218,100,19),(7205,100,20),(7217,100,21),(7222,100,22),(7192,100,30),(7193,100,31),(7190,100,32),(7200,100,33),(7175,100,34),(7179,100,35),(7215,100,36),(7197,100,37),(7198,100,38),(7170,100,39),(7195,100,40),(7196,100,41),(7176,100,42),(7177,100,43),(7167,100,44),(7168,100,45),(7182,100,47),(7184,100,48),(7212,100,49),(7214,100,50),(7206,100,51),(7207,100,52),(7199,100,53),(7201,100,54),(7202,100,55),(7186,100,56),(7187,100,57),(7210,100,58),(7211,100,59),(7213,100,60),(7216,100,61),(7208,100,62),(7178,100,64),(7209,100,65),(7220,100,66),(7173,100,67),(7183,100,69),(7223,100,70),(7180,100,71),(7181,100,72),(7191,100,73),(7166,100,100); /*!40000 ALTER TABLE `roleRole` ENABLE KEYS */; UNLOCK TABLES; @@ -124,7 +124,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:34 +-- Dump completed on 2020-11-25 12:03:53 USE `salix`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -149,7 +149,7 @@ USE `salix`; LOCK TABLES `ACL` WRITE; /*!40000 ALTER TABLE `ACL` DISABLE KEYS */; -INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','salesAssistant'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','salesAssistant'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','salesAssistant'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(164,'InvoiceOut','regenerate','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','READ','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(188,'TicketDms','removeFile','WRITE','ALLOW','ROLE','employee'),(189,'TicketDms','*','READ','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','employee'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','salesAssistant'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(219,'Account','acl','READ','ALLOW','ROLE','account'),(220,'Account','getCurrentUserData','READ','ALLOW','ROLE','account'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'); +INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','claimManager'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','claimManager'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','claimManager'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(164,'InvoiceOut','regenerate','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','READ','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(188,'TicketDms','removeFile','WRITE','ALLOW','ROLE','employee'),(189,'TicketDms','*','READ','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','deliveryBoss'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','claimManager'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(219,'Account','acl','READ','ALLOW','ROLE','account'),(220,'Account','getCurrentUserData','READ','ALLOW','ROLE','account'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','salesAssistant'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'),(238,'Town','*','WRITE','ALLOW','ROLE','deliveryBoss'),(239,'Province','*','WRITE','ALLOW','ROLE','deliveryBoss'),(240,'supplier','*','WRITE','ALLOW','ROLE','administrative'),(241,'SupplierContact','*','WRITE','ALLOW','ROLE','administrative'); /*!40000 ALTER TABLE `ACL` ENABLE KEYS */; UNLOCK TABLES; @@ -172,7 +172,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:35 +-- Dump completed on 2020-11-25 12:03:55 USE `vn`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -257,7 +257,7 @@ UNLOCK TABLES; LOCK TABLES `tag` WRITE; /*!40000 ALTER TABLE `tag` DISABLE KEYS */; -INSERT INTO `tag` VALUES (1,'color','Color',0,0,'ink',NULL,NULL,'inkFk'),(2,NULL,'Forma',1,0,NULL,NULL,NULL,NULL),(3,NULL,'Material',1,0,NULL,NULL,NULL,NULL),(4,NULL,'Longitud',1,1,NULL,'mm',NULL,'size'),(5,NULL,'Diámetro',1,1,NULL,'mm',NULL,'diameter'),(6,NULL,'Perímetro',1,1,NULL,'mm',NULL,NULL),(7,NULL,'Ancho de la base',1,1,NULL,'mm',NULL,NULL),(8,NULL,'Altura',1,1,NULL,'mm',NULL,'size'),(9,NULL,'Volumen',1,1,NULL,'ml',NULL,NULL),(10,NULL,'Densidad',1,1,NULL,NULL,NULL,NULL),(11,NULL,'Calidad',1,0,NULL,NULL,NULL,NULL),(12,NULL,'Textura',1,0,NULL,NULL,NULL,NULL),(13,NULL,'Material del mango',1,0,NULL,NULL,NULL,NULL),(14,NULL,'Compra mínima',1,0,NULL,NULL,NULL,NULL),(15,NULL,'Nº pétalos',1,1,NULL,NULL,NULL,NULL),(16,NULL,'Ancho',1,1,NULL,'mm',NULL,NULL),(18,NULL,'Profundidad',1,1,NULL,'mm',NULL,NULL),(19,NULL,'Largo',1,1,NULL,'mm',NULL,'size'),(20,NULL,'Ancho superior',1,1,NULL,'mm',NULL,NULL),(21,NULL,'Ancho inferior',1,1,NULL,'mm',NULL,NULL),(22,NULL,'Gramaje',1,1,NULL,'g',NULL,NULL),(23,'stems','Tallos',1,1,NULL,NULL,NULL,'stems'),(24,NULL,'Estado',1,0,NULL,NULL,NULL,NULL),(25,NULL,'Color principal',0,0,'ink',NULL,NULL,NULL),(26,NULL,'Color secundario',0,0,'ink',NULL,NULL,NULL),(27,NULL,'Longitud(cm)',1,1,NULL,'cm',NULL,NULL),(28,NULL,'Diámetro base',1,1,'','mm',NULL,'diameter'),(29,NULL,'Colección',1,0,NULL,NULL,NULL,NULL),(30,NULL,'Uds / caja',1,1,NULL,NULL,NULL,NULL),(31,NULL,'Contenido',1,0,NULL,NULL,NULL,NULL),(32,NULL,'Peso',1,1,NULL,'g',NULL,NULL),(33,NULL,'Grosor',1,1,NULL,'mm',NULL,NULL),(34,NULL,'Marca',1,0,NULL,NULL,NULL,NULL),(35,'origin','Origen',0,0,'origin',NULL,NULL,'originFk'),(36,NULL,'Proveedor',1,0,NULL,NULL,NULL,NULL),(37,'producer','Productor',0,0,'producer',NULL,NULL,'producerFk'),(38,NULL,'Duración',1,1,NULL,'s',NULL,NULL),(39,NULL,'Flor',1,0,NULL,NULL,NULL,NULL),(40,NULL,'Soporte',1,0,NULL,NULL,NULL,NULL),(41,NULL,'Tamaño flor',1,0,NULL,NULL,NULL,NULL),(42,NULL,'Apertura',1,0,NULL,NULL,NULL,NULL),(43,NULL,'Tallo',1,0,NULL,NULL,NULL,NULL),(44,NULL,'Nº hojas',1,1,NULL,NULL,NULL,NULL),(45,NULL,'Dimensiones',1,0,NULL,NULL,NULL,NULL),(46,NULL,'Diámetro boca',1,1,NULL,'mm',NULL,NULL),(47,NULL,'Nº flores',1,1,NULL,NULL,NULL,NULL),(48,NULL,'Uds / paquete',1,1,NULL,NULL,NULL,NULL),(49,NULL,'Maceta',1,1,NULL,'cm',NULL,'diameter'),(50,NULL,'Textura flor',1,0,NULL,NULL,NULL,NULL),(51,NULL,'Textura hoja',1,0,NULL,NULL,NULL,NULL),(52,NULL,'Tipo de IVA',1,0,NULL,NULL,NULL,NULL),(53,NULL,'Tronco',1,0,NULL,NULL,NULL,NULL),(54,NULL,'Hoja',1,0,NULL,NULL,NULL,NULL),(55,NULL,'Formato',1,0,NULL,NULL,NULL,NULL),(56,NULL,'Genero',1,0,NULL,NULL,NULL,NULL),(57,NULL,'Especie',1,0,NULL,NULL,NULL,NULL),(58,NULL,'Variedad',1,0,NULL,NULL,NULL,NULL),(59,NULL,'Medida grande',1,0,NULL,NULL,NULL,NULL),(60,NULL,'Medida mediano',1,0,NULL,NULL,NULL,NULL),(61,NULL,'Medida pequeño',1,0,NULL,NULL,NULL,NULL),(63,NULL,'Recipiente interior',1,0,NULL,NULL,NULL,NULL),(64,NULL,'Material secundario',1,0,NULL,NULL,NULL,NULL),(65,NULL,'Colores',1,0,NULL,NULL,NULL,NULL),(66,NULL,'Referencia',1,0,NULL,NULL,NULL,NULL),(67,'category','Categoria',1,0,NULL,NULL,NULL,NULL),(68,NULL,'Amb',1,0,NULL,NULL,NULL,NULL),(69,NULL,'Anchura',1,1,NULL,'cm',NULL,NULL),(70,NULL,'Hueco interior',1,0,NULL,NULL,NULL,NULL),(71,NULL,'Tamaño',1,0,NULL,NULL,NULL,NULL),(72,NULL,'Color botón',1,0,NULL,NULL,NULL,NULL),(73,NULL,'Tamaño minimo del botón',1,0,NULL,NULL,NULL,NULL),(74,NULL,'Obtentor',1,0,NULL,NULL,NULL,NULL),(75,NULL,'Longitud del brote',1,0,NULL,NULL,NULL,NULL),(76,NULL,'Tallos / u.v.',1,0,NULL,NULL,NULL,NULL),(77,NULL,'Madera de',1,0,NULL,NULL,NULL,NULL),(78,NULL,'Unidad de venta',1,0,NULL,NULL,NULL,NULL),(79,NULL,'Temporal',1,0,NULL,NULL,NULL,NULL),(80,NULL,'Gramaje/tallo',1,1,NULL,'g',NULL,NULL),(81,NULL,'Peso/paquete',1,1,NULL,'g',NULL,NULL),(82,NULL,'Flexibilidad del tallo',1,0,NULL,NULL,NULL,NULL),(83,NULL,'Nº planchas',1,1,NULL,NULL,NULL,NULL),(84,NULL,'Nº páginas',1,1,NULL,NULL,NULL,NULL),(85,NULL,'Editorial',1,0,NULL,NULL,NULL,NULL),(86,NULL,'Idioma',1,0,NULL,NULL,NULL,NULL),(87,NULL,'Fecha publicación',1,0,NULL,NULL,NULL,NULL),(88,NULL,'Cubierta',1,0,NULL,NULL,NULL,NULL),(89,NULL,'Encuadernación',1,0,NULL,NULL,NULL,NULL),(90,NULL,'Autor',1,0,NULL,NULL,NULL,NULL),(91,NULL,'Envoltorio',1,0,NULL,NULL,NULL,NULL),(92,NULL,'Nombre temporal',1,0,NULL,NULL,NULL,NULL),(93,NULL,'Modelo',1,0,NULL,NULL,NULL,NULL),(94,NULL,'Producto',1,0,NULL,NULL,NULL,NULL),(95,NULL,'Título',1,0,NULL,NULL,NULL,NULL),(96,NULL,'Tomo',1,0,NULL,NULL,NULL,NULL),(97,NULL,'Articulo',1,0,NULL,NULL,NULL,NULL),(98,NULL,'Metodo de cultivo',1,0,NULL,NULL,NULL,NULL),(99,NULL,'Edad',1,0,NULL,NULL,NULL,NULL),(100,NULL,'Agotado',1,0,NULL,NULL,NULL,NULL),(101,NULL,'Altura con asa',1,1,NULL,'cm',NULL,NULL),(102,NULL,'Nº tallos',1,1,NULL,NULL,NULL,NULL),(103,NULL,'Cultivo',1,0,NULL,NULL,NULL,NULL),(104,NULL,'Sabor',1,0,NULL,NULL,NULL,NULL),(105,NULL,'Talla',1,0,NULL,NULL,NULL,NULL),(106,NULL,'Calibre',1,1,NULL,NULL,NULL,NULL),(107,NULL,'Dulzura',1,1,NULL,'bx',NULL,NULL),(108,NULL,'Piezas',1,0,NULL,NULL,NULL,NULL),(109,NULL,'Altura con patas',1,0,NULL,NULL,NULL,NULL),(110,NULL,'Envase',1,0,NULL,NULL,NULL,NULL),(111,NULL,'Nº piezas',1,0,NULL,NULL,NULL,NULL),(112,NULL,'Uso',1,0,NULL,'cm',NULL,NULL),(113,NULL,'Color luz',1,0,NULL,NULL,NULL,NULL),(114,NULL,'Capacidad',1,0,NULL,NULL,NULL,NULL),(184,NULL,'Tallos por paquete',1,0,NULL,NULL,NULL,NULL),(205,NULL,'Apertura',1,0,NULL,NULL,'S05',NULL),(219,NULL,'Altura',1,0,NULL,NULL,'S20','size'),(552,NULL,'fout kenmerk',1,0,NULL,NULL,'081',NULL),(553,NULL,'Potinhoud',1,0,NULL,NULL,'A01',NULL),(554,NULL,'Marketingconcept',1,0,NULL,NULL,'A02',NULL),(555,NULL,'Leeftijd',1,0,NULL,NULL,'A03',NULL),(556,NULL,'Base',1,0,NULL,NULL,'A04',NULL),(557,NULL,'Kleurbehandeld',1,0,NULL,NULL,'A05','inkFk'),(558,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,'A06',NULL),(559,NULL,'Verzorging: Water',1,0,NULL,NULL,'A07',NULL),(560,NULL,'Verzorging: Voeding',1,0,NULL,NULL,'A08',NULL),(561,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,'A09',NULL),(562,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,'A10',NULL),(563,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,'A11',NULL),(564,NULL,'Nabehandeling',1,0,NULL,NULL,'A13',NULL),(565,NULL,'Artikel beeld',1,0,NULL,NULL,'A23',NULL),(566,NULL,'Hoofdkleur 1',1,0,NULL,NULL,'B01',NULL),(567,NULL,'Hoofdkleur 2',1,0,NULL,NULL,'B02',NULL),(568,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,'B03',NULL),(569,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,'B04',NULL),(570,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,'B05',NULL),(571,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,'B06',NULL),(572,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,'B07',NULL),(573,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,'B08',NULL),(574,NULL,'Botanisch beeld',1,0,NULL,NULL,'B09',NULL),(575,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,'B10',NULL),(576,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,'B11',NULL),(577,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,'B12',NULL),(578,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,'B13',NULL),(579,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,'B14',NULL),(580,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,'B15',NULL),(581,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,'B16',NULL),(582,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,'K01',NULL),(583,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,'K02',NULL),(584,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,'K03',NULL),(585,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K04',NULL),(586,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,'K05',NULL),(587,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,'K07',NULL),(588,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,'K08',NULL),(589,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,'K11',NULL),(590,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,'K12',NULL),(591,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,'K13',NULL),(592,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,'K14',NULL),(593,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,'K15',NULL),(594,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,'K16',NULL),(595,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,'K17',NULL),(596,NULL,'Certificaten biologisch',1,0,NULL,NULL,'K18',NULL),(597,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,'K19',NULL),(598,NULL,'Certificaten Florimark',1,0,NULL,NULL,'K20',NULL),(599,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,'K21',NULL),(600,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,'K22',NULL),(601,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,'K23',NULL),(602,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,'K24',NULL),(603,NULL,'Certificaten ISO',1,0,NULL,NULL,'K25',NULL),(604,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K26',NULL),(605,NULL,'Certificaten Florverde',1,0,NULL,NULL,'K27',NULL),(606,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,'K28',NULL),(607,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,'K29',NULL),(608,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,'K30',NULL),(609,NULL,'Certificaten SAN',1,0,NULL,NULL,'K31',NULL),(610,NULL,'Certificaten GRASP',1,0,NULL,NULL,'K32',NULL),(611,NULL,'Label Fair Flora',1,0,NULL,NULL,'K33',NULL),(612,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,'K34',NULL),(613,NULL,'Fust',1,0,NULL,NULL,'L01',NULL),(614,NULL,'Stapelwagen',1,0,NULL,NULL,'L02',NULL),(615,NULL,'Aantal legborden veilings',1,0,NULL,NULL,'L03',NULL),(616,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,'L04',NULL),(617,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,'L05',NULL),(618,NULL,'Fustsoort',1,0,NULL,NULL,'L06',NULL),(619,NULL,'Envase',1,0,NULL,NULL,'L07',NULL),(620,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,'L08',NULL),(621,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,'L09',NULL),(622,NULL,'Tallos/bolsa',1,0,NULL,NULL,'L11',''),(623,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,'L12',NULL),(624,NULL,'Aantal stuks per fust',1,0,NULL,NULL,'L13',NULL),(625,NULL,'Aantal bossen per fust',1,0,NULL,NULL,'L14',NULL),(626,NULL,'Aantal bundels per fust',1,0,NULL,NULL,'L15',NULL),(627,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,'L16',NULL),(628,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,'L17',NULL),(629,NULL,'Fustlabel',1,0,NULL,NULL,'L18',NULL),(630,NULL,'Karlabel',1,0,NULL,NULL,'L19',NULL),(631,NULL,'Service productlabel',1,0,NULL,NULL,'L20',NULL),(632,NULL,'Service fustlabel',1,0,NULL,NULL,'L21',NULL),(633,NULL,'Service karlabel',1,0,NULL,NULL,'L22',NULL),(634,NULL,'Aantal fusten per laag',1,0,NULL,NULL,'L23',NULL),(635,NULL,'Presentatie per schapm2',1,0,NULL,NULL,'L24',NULL),(636,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,'P01',NULL),(637,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,'P02',NULL),(638,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,'P03',NULL),(639,NULL,'Maceta',1,1,NULL,'cm','S01','diameter'),(640,NULL,'Altura',1,0,NULL,NULL,'S02','size'),(641,NULL,'nº plantas',1,0,NULL,NULL,'S03',NULL),(642,NULL,'Diámetro',1,0,NULL,NULL,'S04',NULL),(644,NULL,'Combinatiehoogte',1,0,NULL,NULL,'S06',NULL),(645,NULL,'Plantas/Maceta',1,0,NULL,NULL,'S07',NULL),(646,NULL,'Dikte',1,0,NULL,NULL,'S08',NULL),(647,NULL,'nº flores',1,0,NULL,NULL,'S09',NULL),(648,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,'S10',NULL),(649,NULL,'nº ramales',1,0,NULL,NULL,'S11',NULL),(650,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,'S12',NULL),(651,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,'S13',NULL),(652,NULL,'Minimum stamhoogte',1,0,NULL,NULL,'S14',NULL),(653,NULL,'Altura caja',1,0,NULL,NULL,'S15',NULL),(654,NULL,'Lengte scheuten',1,0,NULL,NULL,'S16',NULL),(655,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,'S17',NULL),(656,NULL,'Altura del capullo',1,0,NULL,NULL,'S19',NULL),(658,NULL,'Peso tallo',1,0,NULL,NULL,'S21',NULL),(659,NULL,'nº flores',1,0,NULL,NULL,'S22',NULL),(660,NULL,'Diámetro de la flor',1,0,NULL,NULL,'S23',NULL),(661,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,'S24',NULL),(662,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,'S25',NULL),(663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S26',NULL),(664,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S27',NULL),(665,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S28',NULL),(666,NULL,'Longitud inflorescencia',1,0,NULL,NULL,'S29',NULL),(667,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,'S30',NULL),(668,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,'S31',NULL),(669,NULL,'Longitud',1,0,NULL,NULL,'S32',NULL),(670,NULL,'Jaartal sortering hout',1,0,NULL,NULL,'S33',NULL),(671,NULL,'Diámetro de la hoja',1,0,NULL,NULL,'S34',NULL),(672,NULL,'Peso paquete',1,0,NULL,NULL,'S35',NULL),(673,NULL,'Maximum planthoogte',1,0,NULL,NULL,'S36',NULL),(674,NULL,'Maximum plantdiameter',1,0,NULL,NULL,'S37',NULL),(675,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,'S38',NULL),(676,NULL,'Maximum aantal takken per',1,0,NULL,NULL,'S39',NULL),(677,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,'S40',NULL),(678,NULL,'Maximum stamhoogte',1,0,NULL,NULL,'S41',NULL),(679,NULL,'Longitud mínima',1,0,NULL,NULL,'S42','size'),(680,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,'S43',NULL),(681,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,'S44',NULL),(682,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,'S45',NULL),(683,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,'S46',NULL),(684,NULL,'Verpakkingswijze',1,0,NULL,NULL,'S47',NULL),(685,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,'S48',NULL),(686,NULL,'Bolomvang',1,0,NULL,NULL,'S49',NULL),(687,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,'S50',NULL),(688,NULL,'Potvorm',1,0,NULL,NULL,'S51',NULL),(689,NULL,'Potkleur',1,0,NULL,NULL,'S52',NULL),(690,NULL,'Material maceta',1,0,NULL,NULL,'S53',NULL),(691,NULL,'Plantvorm',1,0,NULL,NULL,'S54',NULL),(692,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S55',NULL),(693,NULL,'Teeltwijze',1,0,NULL,NULL,'S56',NULL),(694,NULL,'Teeltmedium',1,0,NULL,NULL,'S57',NULL),(695,NULL,'Cubierta',1,0,NULL,NULL,'S58',NULL),(696,NULL,'Hoesvorm',1,0,NULL,NULL,'S59',NULL),(697,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,'S60',NULL),(698,NULL,'Extra toevoegingen',1,0,NULL,NULL,'S61',NULL),(699,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,'S62',NULL),(700,NULL,'Verpakte orchidee',1,0,NULL,NULL,'S63',NULL),(701,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,'S64',NULL),(702,NULL,'Voorbehandeling',1,0,NULL,NULL,'S65',NULL),(703,NULL,'Overige niet in pot',1,0,NULL,NULL,'S66',NULL),(704,NULL,'Forma de la flor',1,0,NULL,NULL,'S67',NULL),(705,NULL,'Flexibilidad',1,0,NULL,NULL,'S68',NULL),(706,NULL,'Hoeskleur',1,0,NULL,NULL,'S69',NULL),(707,NULL,'Extra deco',1,0,NULL,NULL,'S70',NULL),(708,NULL,'Color',1,0,NULL,NULL,'S71','inkFk'),(709,NULL,'Producto',1,0,NULL,NULL,'S72',NULL),(710,NULL,'Altura',1,0,NULL,NULL,'S73',NULL),(711,NULL,'Diametro',1,0,NULL,NULL,'S74',NULL),(712,NULL,'Barcode',1,0,NULL,NULL,'S75',NULL),(713,NULL,'Productlabel',1,0,NULL,NULL,'S76',NULL),(714,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,'S77',NULL),(715,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,'S78',NULL),(716,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S79',NULL),(717,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,'S80',NULL),(718,NULL,'Maximum lengte verschil',1,0,NULL,NULL,'S81',NULL),(719,NULL,'Bladkleur',1,0,NULL,NULL,'S82',NULL),(720,NULL,'Plantgewicht',1,0,NULL,NULL,'S83',NULL),(721,NULL,'Diámetro',1,0,NULL,NULL,'S84',NULL),(722,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,'S85',NULL),(723,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,'S86',NULL),(724,NULL,'Kleurbehandeld',1,0,NULL,NULL,'S87','inkFk'),(725,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,'S88',NULL),(726,NULL,'Diámetro del capullo',1,0,NULL,NULL,'S89',NULL),(727,NULL,'Volume inhoud',1,0,NULL,NULL,'S90',NULL),(728,NULL,'Vruchtbenaming',1,0,NULL,NULL,'S91',NULL),(729,NULL,'Vaaslevenindex',1,0,NULL,NULL,'S92',NULL),(730,NULL,'Overige informatie plante',1,0,NULL,NULL,'S93',NULL),(731,NULL,'Overige informatie snijbl',1,0,NULL,NULL,'S94',NULL),(732,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,'S95',NULL),(733,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,'S96',NULL),(734,NULL,'MPS certificering',1,0,NULL,NULL,'S97',NULL),(735,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,'S98',NULL),(736,NULL,'Artikelomschrijving',1,0,NULL,NULL,'S99',NULL),(737,NULL,'BTW-tarief',1,0,NULL,NULL,'T01',NULL),(738,NULL,'Prijseenheid',1,0,NULL,NULL,'T02',NULL),(739,NULL,'Transactievorm',1,0,NULL,NULL,'T03',NULL),(740,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,'T10',NULL),(741,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,'T11',NULL),(742,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,'T12',NULL),(743,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,'T13',NULL),(744,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,'T14',NULL),(745,NULL,'Algemene voorwaarden',1,0,NULL,NULL,'T15',NULL),(746,NULL,'Marktvorm',1,0,NULL,NULL,'T16',NULL),(747,NULL,'Themadagen',1,0,NULL,NULL,'T17',NULL),(748,NULL,'Handelscategorie',1,0,NULL,NULL,'T18',NULL),(749,NULL,'Producentengroepen',1,0,NULL,NULL,'T19',NULL),(750,NULL,'Favorieten Id',1,0,NULL,NULL,'T20',NULL),(751,NULL,'Verkoopeenheid',1,0,NULL,NULL,'T21',NULL),(752,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,'V01',NULL),(753,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V02',NULL),(754,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,'V03',NULL),(755,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,'V04',NULL),(756,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,'V05',NULL),(757,NULL,'FloraHolland Financial',1,0,NULL,NULL,'V06',NULL),(758,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V07',NULL),(759,NULL,'Benefiet veiling',1,0,NULL,NULL,'V08',NULL),(760,NULL,'Kloksoort',1,0,NULL,NULL,'V09',NULL),(761,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,'V10',NULL),(762,NULL,'Rest aantallen',1,0,NULL,NULL,'V11',NULL),(763,NULL,'Veilsoort',1,0,NULL,NULL,'V12',NULL),(764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V13',NULL),(765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V14',NULL),(766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V15',NULL),(767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V16',NULL),(768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V17',NULL),(769,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V18',NULL),(770,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V19',NULL),(771,NULL,'Gereserveerd',1,0,NULL,NULL,'V20',NULL),(772,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,'V21',NULL),(773,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,'V22',NULL),(774,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,'V23',NULL),(775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V24',NULL),(776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V25',NULL),(777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V26',NULL),(778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V27',NULL),(779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V28',NULL),(780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V29',NULL),(781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V30',NULL),(782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V31',NULL),(783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V32',NULL),(784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V33',NULL),(785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V34',NULL),(786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V35',NULL),(787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V36',NULL),(788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V37',NULL),(789,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V38',NULL),(790,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V39',NULL),(791,NULL,'Gereserveerd',1,0,NULL,NULL,'V40',NULL),(792,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,'V41',NULL),(793,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,'V42',NULL),(794,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,'V43',NULL),(795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V44',NULL),(796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V45',NULL),(797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V46',NULL),(798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V47',NULL),(799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V48',NULL),(800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V49',NULL),(801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V50',NULL),(802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V51',NULL),(803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V52',NULL),(804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V53',NULL),(805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V54',NULL),(806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V55',NULL),(807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V56',NULL),(808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V57',NULL),(809,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V58',NULL),(810,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V59',NULL),(811,NULL,'Gereserveerd',1,0,NULL,NULL,'V60',NULL),(812,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,'V61',NULL),(813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V62',NULL),(814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V63',NULL),(815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V64',NULL),(816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V65',NULL),(817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V66',NULL),(818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V67',NULL),(819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V68',NULL),(820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V69',NULL),(821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V70',NULL),(822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V71',NULL),(823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V72',NULL),(824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V73',NULL),(825,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V74',NULL),(826,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V75',NULL),(827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V76',NULL),(828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V77',NULL),(829,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V78',NULL),(830,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V79',NULL),(831,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,'V80',NULL),(832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V81',NULL),(833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V82',NULL),(834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V83',NULL),(835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V84',NULL),(836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V85',NULL),(837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V86',NULL),(838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V87',NULL),(839,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V88',NULL),(840,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V89',NULL),(841,NULL,'Veiling',1,0,NULL,NULL,'V99',NULL),(842,NULL,'kopersaantallen',1,0,NULL,NULL,'Z01',NULL),(843,NULL,'Caducidad',1,0,NULL,NULL,NULL,NULL),(844,NULL,'Lote',1,0,NULL,NULL,NULL,NULL),(845,NULL,'Uds palet',1,0,NULL,NULL,NULL,NULL); +INSERT INTO `tag` VALUES (1,'color','Color',0,0,'ink',NULL,NULL,'inkFk'),(2,NULL,'Forma',1,0,NULL,NULL,NULL,NULL),(3,NULL,'Material',1,0,NULL,NULL,NULL,NULL),(4,NULL,'Longitud',1,1,NULL,'mm',NULL,'size'),(5,NULL,'Diámetro',1,1,NULL,'mm',NULL,'diameter'),(6,NULL,'Perímetro',1,1,NULL,'mm',NULL,NULL),(7,NULL,'Ancho de la base',1,1,NULL,'mm',NULL,NULL),(8,NULL,'Altura',1,1,NULL,'mm',NULL,'size'),(9,NULL,'Volumen',1,1,NULL,'ml',NULL,NULL),(10,NULL,'Densidad',1,1,NULL,NULL,NULL,NULL),(11,NULL,'Calidad',1,0,NULL,NULL,NULL,NULL),(12,NULL,'Textura',1,0,NULL,NULL,NULL,NULL),(13,NULL,'Material del mango',1,0,NULL,NULL,NULL,NULL),(14,NULL,'Compra mínima',1,0,NULL,NULL,NULL,NULL),(15,NULL,'Nº pétalos',1,1,NULL,NULL,NULL,NULL),(16,NULL,'Ancho',1,1,NULL,'mm',NULL,NULL),(18,NULL,'Profundidad',1,1,NULL,'mm',NULL,NULL),(19,NULL,'Largo',1,1,NULL,'mm',NULL,'size'),(20,NULL,'Ancho superior',1,1,NULL,'mm',NULL,NULL),(21,NULL,'Ancho inferior',1,1,NULL,'mm',NULL,NULL),(22,NULL,'Gramaje',1,1,NULL,'g',NULL,NULL),(23,'stems','Tallos',1,1,NULL,NULL,NULL,'stems'),(24,NULL,'Estado',1,0,NULL,NULL,NULL,NULL),(25,NULL,'Color principal',0,0,'ink',NULL,NULL,NULL),(26,NULL,'Color secundario',0,0,'ink',NULL,NULL,NULL),(27,NULL,'Longitud(cm)',1,1,NULL,'cm',NULL,NULL),(28,NULL,'Diámetro base',1,1,NULL,'mm',NULL,'diameter'),(29,NULL,'Colección',1,0,NULL,NULL,NULL,NULL),(30,NULL,'Uds / caja',1,1,NULL,NULL,NULL,NULL),(31,NULL,'Contenido',1,0,NULL,NULL,NULL,NULL),(32,NULL,'Peso',1,1,NULL,'g',NULL,NULL),(33,NULL,'Grosor',1,1,NULL,'mm',NULL,NULL),(34,NULL,'Marca',1,0,NULL,NULL,NULL,NULL),(35,'origin','Origen',0,0,'origin',NULL,NULL,'originFk'),(36,NULL,'Proveedor',1,0,NULL,NULL,NULL,NULL),(37,'producer','Productor',0,0,'producer',NULL,NULL,'producerFk'),(38,NULL,'Duración',1,1,NULL,'s',NULL,NULL),(39,NULL,'Flor',1,0,NULL,NULL,NULL,NULL),(40,NULL,'Soporte',1,0,NULL,NULL,NULL,NULL),(41,NULL,'Tamaño flor',1,0,NULL,NULL,NULL,NULL),(42,NULL,'Apertura',1,0,NULL,NULL,NULL,NULL),(43,NULL,'Tallo',1,0,NULL,NULL,NULL,NULL),(44,NULL,'Nº hojas',1,1,NULL,NULL,NULL,NULL),(45,NULL,'Dimensiones',1,0,NULL,NULL,NULL,NULL),(46,NULL,'Diámetro boca',1,1,NULL,'mm',NULL,NULL),(47,NULL,'Nº flores',1,1,NULL,NULL,NULL,NULL),(48,NULL,'Uds / paquete',1,1,NULL,NULL,NULL,NULL),(49,NULL,'Maceta',1,1,NULL,'cm',NULL,'diameter'),(50,NULL,'Textura flor',1,0,NULL,NULL,NULL,NULL),(51,NULL,'Textura hoja',1,0,NULL,NULL,NULL,NULL),(52,NULL,'Tipo de IVA',1,0,NULL,NULL,NULL,NULL),(53,NULL,'Tronco',1,0,NULL,NULL,NULL,NULL),(54,NULL,'Hoja',1,0,NULL,NULL,NULL,NULL),(55,NULL,'Formato',1,0,NULL,NULL,NULL,NULL),(56,NULL,'Genero',1,0,NULL,NULL,NULL,NULL),(57,NULL,'Especie',1,0,NULL,NULL,NULL,NULL),(58,NULL,'Variedad',1,0,NULL,NULL,NULL,NULL),(59,NULL,'Medida grande',1,0,NULL,NULL,NULL,NULL),(60,NULL,'Medida mediano',1,0,NULL,NULL,NULL,NULL),(61,NULL,'Medida pequeño',1,0,NULL,NULL,NULL,NULL),(63,NULL,'Recipiente interior',1,0,NULL,NULL,NULL,NULL),(64,NULL,'Material secundario',1,0,NULL,NULL,NULL,NULL),(65,NULL,'Colores',1,0,NULL,NULL,NULL,NULL),(66,NULL,'Referencia',1,0,NULL,NULL,NULL,NULL),(67,'category','Categoria',1,0,NULL,NULL,NULL,NULL),(68,NULL,'Amb',1,0,NULL,NULL,NULL,NULL),(69,NULL,'Anchura',1,1,NULL,'cm',NULL,NULL),(70,NULL,'Hueco interior',1,0,NULL,NULL,NULL,NULL),(71,NULL,'Tamaño',1,0,NULL,NULL,NULL,NULL),(72,NULL,'Color botón',1,0,NULL,NULL,NULL,NULL),(73,NULL,'Tamaño minimo del botón',1,0,NULL,NULL,NULL,NULL),(74,NULL,'Obtentor',1,0,NULL,NULL,NULL,NULL),(75,NULL,'Longitud del brote',1,0,NULL,NULL,NULL,NULL),(76,NULL,'Tallos / u.v.',1,0,NULL,NULL,NULL,NULL),(77,NULL,'Madera de',1,0,NULL,NULL,NULL,NULL),(78,NULL,'Unidad de venta',1,0,NULL,NULL,NULL,NULL),(79,NULL,'Temporal',1,0,NULL,NULL,NULL,NULL),(80,NULL,'Gramaje/tallo',1,1,NULL,'g',NULL,NULL),(81,NULL,'Peso/paquete',1,1,NULL,'g',NULL,NULL),(82,NULL,'Flexibilidad del tallo',1,0,NULL,NULL,NULL,NULL),(83,NULL,'Nº planchas',1,1,NULL,NULL,NULL,NULL),(84,NULL,'Nº páginas',1,1,NULL,NULL,NULL,NULL),(85,NULL,'Editorial',1,0,NULL,NULL,NULL,NULL),(86,NULL,'Idioma',1,0,NULL,NULL,NULL,NULL),(87,NULL,'Fecha publicación',1,0,NULL,NULL,NULL,NULL),(88,NULL,'Cubierta',1,0,NULL,NULL,NULL,NULL),(89,NULL,'Encuadernación',1,0,NULL,NULL,NULL,NULL),(90,NULL,'Autor',1,0,NULL,NULL,NULL,NULL),(91,NULL,'Envoltorio',1,0,NULL,NULL,NULL,NULL),(92,NULL,'Nombre temporal',1,0,NULL,NULL,NULL,NULL),(93,NULL,'Modelo',1,0,NULL,NULL,NULL,NULL),(94,NULL,'Producto',1,0,NULL,NULL,NULL,NULL),(95,NULL,'Título',1,0,NULL,NULL,NULL,NULL),(96,NULL,'Tomo',1,0,NULL,NULL,NULL,NULL),(97,NULL,'Articulo',1,0,NULL,NULL,NULL,NULL),(98,NULL,'Metodo de cultivo',1,0,NULL,NULL,NULL,NULL),(99,NULL,'Edad',1,0,NULL,NULL,NULL,NULL),(100,NULL,'Agotado',1,0,NULL,NULL,NULL,NULL),(101,NULL,'Altura con asa',1,1,NULL,'cm',NULL,'size'),(102,NULL,'Nº tallos',1,1,NULL,NULL,NULL,NULL),(103,NULL,'Cultivo',1,0,NULL,NULL,NULL,NULL),(104,NULL,'Sabor',1,0,NULL,NULL,NULL,NULL),(105,NULL,'Talla',1,0,NULL,NULL,NULL,NULL),(106,NULL,'Calibre',1,1,NULL,NULL,NULL,NULL),(107,NULL,'Dulzura',1,1,NULL,'bx',NULL,NULL),(108,NULL,'Piezas',1,0,NULL,NULL,NULL,NULL),(109,NULL,'Altura con patas',1,0,NULL,'cm',NULL,'size'),(110,NULL,'Envase',1,0,NULL,NULL,NULL,NULL),(111,NULL,'Nº piezas',1,0,NULL,NULL,NULL,NULL),(112,NULL,'Uso',1,0,NULL,'cm',NULL,NULL),(113,NULL,'Color luz',1,0,NULL,NULL,NULL,NULL),(114,NULL,'Capacidad',1,0,NULL,NULL,NULL,NULL),(184,NULL,'Tallos por paquete',1,0,NULL,NULL,NULL,NULL),(205,NULL,'Apertura',1,0,NULL,NULL,NULL,NULL),(219,NULL,'Altura',1,0,NULL,'cm',NULL,'size'),(552,NULL,'fout kenmerk',1,0,NULL,NULL,NULL,NULL),(553,NULL,'Potinhoud',1,0,NULL,NULL,NULL,NULL),(554,NULL,'Marketingconcept',1,0,NULL,NULL,NULL,NULL),(555,NULL,'Leeftijd',1,0,NULL,NULL,NULL,NULL),(556,NULL,'Base',1,0,NULL,NULL,NULL,NULL),(557,NULL,'Kleurbehandeld',1,0,NULL,NULL,NULL,'inkFk'),(558,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,NULL,NULL),(559,NULL,'Verzorging: Water',1,0,NULL,NULL,NULL,NULL),(560,NULL,'Verzorging: Voeding',1,0,NULL,NULL,NULL,NULL),(561,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,NULL,NULL),(562,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,NULL,NULL),(563,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,NULL,NULL),(564,NULL,'Nabehandeling',1,0,NULL,NULL,NULL,NULL),(565,NULL,'Artikel beeld',1,0,NULL,NULL,NULL,NULL),(566,NULL,'Hoofdkleur 1',1,0,NULL,NULL,NULL,NULL),(567,NULL,'Hoofdkleur 2',1,0,NULL,NULL,NULL,NULL),(568,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,NULL,NULL),(569,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,NULL,NULL),(570,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,NULL,NULL),(571,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,NULL,NULL),(572,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,NULL,NULL),(573,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,NULL,NULL),(574,NULL,'Botanisch beeld',1,0,NULL,NULL,NULL,NULL),(575,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,NULL,NULL),(576,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,NULL,NULL),(577,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,NULL,NULL),(578,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,NULL,NULL),(579,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,NULL,NULL),(580,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,NULL,NULL),(581,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,NULL,NULL),(582,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,NULL,NULL),(583,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,NULL,NULL),(584,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,NULL,NULL),(585,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,NULL,NULL),(586,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,NULL,NULL),(587,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,NULL,NULL),(588,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,NULL,NULL),(589,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,NULL,NULL),(590,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,NULL,NULL),(591,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,NULL,NULL),(592,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,NULL,NULL),(593,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,NULL,NULL),(594,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,NULL,NULL),(595,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,NULL,NULL),(596,NULL,'Certificaten biologisch',1,0,NULL,NULL,NULL,NULL),(597,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,NULL,NULL),(598,NULL,'Certificaten Florimark',1,0,NULL,NULL,NULL,NULL),(599,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,NULL,NULL),(600,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,NULL,NULL),(601,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,NULL,NULL),(602,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,NULL,NULL),(603,NULL,'Certificaten ISO',1,0,NULL,NULL,NULL,NULL),(604,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,NULL,NULL),(605,NULL,'Certificaten Florverde',1,0,NULL,NULL,NULL,NULL),(606,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,NULL,NULL),(607,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,NULL,NULL),(608,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,NULL,NULL),(609,NULL,'Certificaten SAN',1,0,NULL,NULL,NULL,NULL),(610,NULL,'Certificaten GRASP',1,0,NULL,NULL,NULL,NULL),(611,NULL,'Label Fair Flora',1,0,NULL,NULL,NULL,NULL),(612,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,NULL,NULL),(613,NULL,'Fust',1,0,NULL,NULL,NULL,NULL),(614,NULL,'Stapelwagen',1,0,NULL,NULL,NULL,NULL),(615,NULL,'Aantal legborden veilings',1,0,NULL,NULL,NULL,NULL),(616,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,NULL,NULL),(617,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,NULL,NULL),(618,NULL,'Fustsoort',1,0,NULL,NULL,NULL,NULL),(619,NULL,'Envase',1,0,NULL,NULL,NULL,NULL),(620,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,NULL,NULL),(621,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,NULL,NULL),(622,NULL,'Tallos/bolsa',1,0,NULL,NULL,NULL,''),(623,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,NULL,NULL),(624,NULL,'Aantal stuks per fust',1,0,NULL,NULL,NULL,NULL),(625,NULL,'Aantal bossen per fust',1,0,NULL,NULL,NULL,NULL),(626,NULL,'Aantal bundels per fust',1,0,NULL,NULL,NULL,NULL),(627,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,NULL,NULL),(628,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,NULL,NULL),(629,NULL,'Fustlabel',1,0,NULL,NULL,NULL,NULL),(630,NULL,'Karlabel',1,0,NULL,NULL,NULL,NULL),(631,NULL,'Service productlabel',1,0,NULL,NULL,NULL,NULL),(632,NULL,'Service fustlabel',1,0,NULL,NULL,NULL,NULL),(633,NULL,'Service karlabel',1,0,NULL,NULL,NULL,NULL),(634,NULL,'Aantal fusten per laag',1,0,NULL,NULL,NULL,NULL),(635,NULL,'Presentatie per schapm2',1,0,NULL,NULL,NULL,NULL),(636,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,NULL,NULL),(637,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,NULL,NULL),(638,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,NULL,NULL),(639,NULL,'Maceta',1,1,NULL,'cm',NULL,'diameter'),(640,NULL,'Altura',1,0,NULL,'cm',NULL,'size'),(641,NULL,'nº plantas',1,0,NULL,NULL,NULL,NULL),(642,NULL,'Diámetro',1,0,NULL,NULL,NULL,NULL),(644,NULL,'Altura',1,1,NULL,'cm',NULL,'size'),(645,NULL,'Plantas/Maceta',1,0,NULL,NULL,NULL,NULL),(646,NULL,'Dikte',1,0,NULL,NULL,NULL,NULL),(647,NULL,'nº flores',1,0,NULL,NULL,NULL,NULL),(648,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,NULL,NULL),(649,NULL,'nº ramales',1,0,NULL,NULL,NULL,NULL),(650,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,NULL,NULL),(651,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,NULL,NULL),(652,NULL,'Altura tronco',1,1,NULL,'cm',NULL,'size'),(653,NULL,'Altura caja',1,0,NULL,'cm',NULL,'size'),(654,NULL,'Lengte scheuten',1,0,NULL,NULL,NULL,NULL),(655,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,NULL,NULL),(656,NULL,'Altura del capullo',1,0,NULL,NULL,NULL,NULL),(658,NULL,'Peso tallo',1,0,NULL,NULL,NULL,NULL),(659,NULL,'nº flores',1,0,NULL,NULL,NULL,NULL),(660,NULL,'Diámetro de la flor',1,0,NULL,NULL,NULL,NULL),(661,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,NULL,NULL),(662,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,NULL,NULL),(663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL,NULL),(664,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL,NULL),(665,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL,NULL),(666,NULL,'Longitud inflorescencia',1,0,NULL,NULL,NULL,NULL),(667,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,NULL,NULL),(668,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,NULL,NULL),(669,NULL,'Longitud',1,0,NULL,NULL,NULL,'size'),(670,NULL,'Jaartal sortering hout',1,0,NULL,NULL,NULL,NULL),(671,NULL,'Diámetro de la hoja',1,0,NULL,NULL,NULL,NULL),(672,NULL,'Peso paquete',1,0,NULL,NULL,NULL,NULL),(673,NULL,'Maximum planthoogte',1,0,NULL,NULL,NULL,NULL),(674,NULL,'Maximum plantdiameter',1,0,NULL,NULL,NULL,NULL),(675,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,NULL,NULL),(676,NULL,'Maximum aantal takken per',1,0,NULL,NULL,NULL,NULL),(677,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,NULL,NULL),(678,NULL,'Maximum stamhoogte',1,0,NULL,NULL,NULL,NULL),(679,NULL,'Longitud mínima',1,0,NULL,NULL,NULL,'size'),(680,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,NULL,NULL),(681,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,NULL,NULL),(682,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,NULL,NULL),(683,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,NULL,NULL),(684,NULL,'Verpakkingswijze',1,0,NULL,NULL,NULL,NULL),(685,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,NULL,NULL),(686,NULL,'Medida',1,1,NULL,'cm',NULL,'size'),(687,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,NULL,NULL),(688,NULL,'Potvorm',1,0,NULL,NULL,NULL,NULL),(689,NULL,'Potkleur',1,0,NULL,NULL,NULL,NULL),(690,NULL,'Material maceta',1,0,NULL,NULL,NULL,NULL),(691,NULL,'Plantvorm',1,0,NULL,NULL,NULL,NULL),(692,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,NULL,NULL),(693,NULL,'Teeltwijze',1,0,NULL,NULL,NULL,NULL),(694,NULL,'Teeltmedium',1,0,NULL,NULL,NULL,NULL),(695,NULL,'Cubierta',1,0,NULL,NULL,NULL,NULL),(696,NULL,'Hoesvorm',1,0,NULL,NULL,NULL,NULL),(697,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,NULL,NULL),(698,NULL,'Extra toevoegingen',1,0,NULL,NULL,NULL,NULL),(699,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,NULL,NULL),(700,NULL,'Verpakte orchidee',1,0,NULL,NULL,NULL,NULL),(701,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,NULL,NULL),(702,NULL,'Voorbehandeling',1,0,NULL,NULL,NULL,NULL),(703,NULL,'Overige niet in pot',1,0,NULL,NULL,NULL,NULL),(704,NULL,'Forma de la flor',1,0,NULL,NULL,NULL,NULL),(705,NULL,'Flexibilidad',1,0,NULL,NULL,NULL,NULL),(706,NULL,'Hoeskleur',1,0,NULL,NULL,NULL,NULL),(707,NULL,'Extra deco',1,0,NULL,NULL,NULL,NULL),(708,NULL,'Color',1,0,NULL,NULL,NULL,'inkFk'),(709,NULL,'Producto',1,0,NULL,NULL,NULL,NULL),(710,NULL,'Altura',1,0,NULL,'cm',NULL,'size'),(711,NULL,'Diametro',1,0,NULL,NULL,NULL,NULL),(712,NULL,'Barcode',1,0,NULL,NULL,NULL,NULL),(713,NULL,'Productlabel',1,0,NULL,NULL,NULL,NULL),(714,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,NULL,NULL),(715,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,NULL,NULL),(716,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,NULL,NULL),(717,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,NULL,NULL),(718,NULL,'Maximum lengte verschil',1,0,NULL,NULL,NULL,NULL),(719,NULL,'Bladkleur',1,0,NULL,NULL,NULL,NULL),(720,NULL,'Plantgewicht',1,0,NULL,NULL,NULL,NULL),(721,NULL,'Diámetro',1,0,NULL,NULL,NULL,NULL),(722,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,NULL,NULL),(723,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,NULL,NULL),(724,NULL,'Kleurbehandeld',1,0,NULL,NULL,NULL,'inkFk'),(725,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,NULL,NULL),(726,NULL,'Diámetro del capullo',1,0,NULL,NULL,NULL,NULL),(727,NULL,'Volume inhoud',1,0,NULL,NULL,NULL,NULL),(728,NULL,'Vruchtbenaming',1,0,NULL,NULL,NULL,NULL),(729,NULL,'Vaaslevenindex',1,0,NULL,NULL,NULL,NULL),(730,NULL,'Overige informatie plante',1,0,NULL,NULL,NULL,NULL),(731,NULL,'Overige informatie snijbl',1,0,NULL,NULL,NULL,NULL),(732,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,NULL,NULL),(733,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,NULL,NULL),(734,NULL,'MPS certificering',1,0,NULL,NULL,NULL,NULL),(735,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,NULL,NULL),(736,NULL,'Artikelomschrijving',1,0,NULL,NULL,NULL,NULL),(737,NULL,'BTW-tarief',1,0,NULL,NULL,NULL,NULL),(738,NULL,'Prijseenheid',1,0,NULL,NULL,NULL,NULL),(739,NULL,'Transactievorm',1,0,NULL,NULL,NULL,NULL),(740,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,NULL,NULL),(741,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,NULL,NULL),(742,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,NULL,NULL),(743,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,NULL,NULL),(744,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,NULL,NULL),(745,NULL,'Algemene voorwaarden',1,0,NULL,NULL,NULL,NULL),(746,NULL,'Marktvorm',1,0,NULL,NULL,NULL,NULL),(747,NULL,'Themadagen',1,0,NULL,NULL,NULL,NULL),(748,NULL,'Handelscategorie',1,0,NULL,NULL,NULL,NULL),(749,NULL,'Producentengroepen',1,0,NULL,NULL,NULL,NULL),(750,NULL,'Favorieten Id',1,0,NULL,NULL,NULL,NULL),(751,NULL,'Verkoopeenheid',1,0,NULL,NULL,NULL,NULL),(752,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,NULL,NULL),(753,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(754,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,NULL,NULL),(755,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,NULL,NULL),(756,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,NULL,NULL),(757,NULL,'FloraHolland Financial',1,0,NULL,NULL,NULL,NULL),(758,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(759,NULL,'Benefiet veiling',1,0,NULL,NULL,NULL,NULL),(760,NULL,'Kloksoort',1,0,NULL,NULL,NULL,NULL),(761,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,NULL,NULL),(762,NULL,'Rest aantallen',1,0,NULL,NULL,NULL,NULL),(763,NULL,'Veilsoort',1,0,NULL,NULL,NULL,NULL),(764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(769,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(770,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(771,NULL,'Gereserveerd',1,0,NULL,NULL,NULL,NULL),(772,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,NULL,NULL),(773,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,NULL,NULL),(774,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,NULL,NULL),(775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(789,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(790,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(791,NULL,'Gereserveerd',1,0,NULL,NULL,NULL,NULL),(792,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,NULL,NULL),(793,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,NULL,NULL),(794,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,NULL,NULL),(795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(809,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(810,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(811,NULL,'Gereserveerd',1,0,NULL,NULL,NULL,NULL),(812,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,NULL,NULL),(813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(825,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(826,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(829,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(830,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(831,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,NULL,NULL),(832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(839,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(840,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(841,NULL,'Veiling',1,0,NULL,NULL,NULL,NULL),(842,NULL,'kopersaantallen',1,0,NULL,NULL,NULL,NULL),(843,NULL,'Caducidad',1,0,NULL,NULL,NULL,NULL),(844,NULL,'Lote',1,0,NULL,NULL,NULL,NULL),(845,NULL,'Uds palet',1,0,NULL,NULL,NULL,NULL),(4548,NULL,'fout kenmerk',1,0,NULL,NULL,'081',NULL),(4549,NULL,'Potinhoud',1,0,NULL,NULL,'A01',NULL),(4550,NULL,'Marketingconcept',1,0,NULL,NULL,'A02',NULL),(4551,NULL,'Leeftijd',1,0,NULL,NULL,'A03',NULL),(4552,NULL,'Uitgangsmateriaal',1,0,NULL,NULL,'A04',NULL),(4553,NULL,'Kleurbehandeld',1,0,NULL,NULL,'A05',NULL),(4554,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,'A06',NULL),(4555,NULL,'Verzorging: Water',1,0,NULL,NULL,'A07',NULL),(4556,NULL,'Verzorging: Voeding',1,0,NULL,NULL,'A08',NULL),(4557,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,'A09',NULL),(4558,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,'A10',NULL),(4559,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,'A11',NULL),(4560,NULL,'Nabehandeling',1,0,NULL,NULL,'A13',NULL),(4561,NULL,'Artikel beeld',1,0,NULL,NULL,'A23',NULL),(4562,NULL,'Hoofdkleur 1',1,0,NULL,NULL,'B01',NULL),(4563,NULL,'Hoofdkleur 2',1,0,NULL,NULL,'B02',NULL),(4564,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,'B03',NULL),(4565,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,'B04',NULL),(4566,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,'B05',NULL),(4567,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,'B06',NULL),(4568,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,'B07',NULL),(4569,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,'B08',NULL),(4570,NULL,'Botanisch beeld',1,0,NULL,NULL,'B09',NULL),(4571,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,'B10',NULL),(4572,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,'B11',NULL),(4573,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,'B12',NULL),(4574,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,'B13',NULL),(4575,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,'B14',NULL),(4576,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,'B15',NULL),(4577,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,'B16',NULL),(4578,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,'K01',NULL),(4579,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,'K02',NULL),(4580,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,'K03',NULL),(4581,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K04',NULL),(4582,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,'K05',NULL),(4583,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,'K07',NULL),(4584,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,'K08',NULL),(4585,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,'K11',NULL),(4586,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,'K12',NULL),(4587,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,'K13',NULL),(4588,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,'K14',NULL),(4589,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,'K15',NULL),(4590,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,'K16',NULL),(4591,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,'K17',NULL),(4592,NULL,'Certificaten biologisch',1,0,NULL,NULL,'K18',NULL),(4593,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,'K19',NULL),(4594,NULL,'Certificaten Florimark',1,0,NULL,NULL,'K20',NULL),(4595,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,'K21',NULL),(4596,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,'K22',NULL),(4597,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,'K23',NULL),(4598,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,'K24',NULL),(4599,NULL,'Certificaten ISO',1,0,NULL,NULL,'K25',NULL),(4600,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K26',NULL),(4601,NULL,'Certificaten Florverde',1,0,NULL,NULL,'K27',NULL),(4602,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,'K28',NULL),(4603,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,'K29',NULL),(4604,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,'K30',NULL),(4605,NULL,'Certificaten SAN',1,0,NULL,NULL,'K31',NULL),(4606,NULL,'Certificaten GRASP',1,0,NULL,NULL,'K32',NULL),(4607,NULL,'Label Fair Flora',1,0,NULL,NULL,'K33',NULL),(4608,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,'K34',NULL),(4609,NULL,'Certificaten Vegaplan',1,0,NULL,NULL,'K35',NULL),(4610,NULL,'Floriculture Sustainabili',1,0,NULL,NULL,'K99',NULL),(4611,NULL,'Fust',1,0,NULL,NULL,'L01',NULL),(4612,NULL,'Stapelwagen',1,0,NULL,NULL,'L02',NULL),(4613,NULL,'Aantal legborden veilings',1,0,NULL,NULL,'L03',NULL),(4614,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,'L04',NULL),(4615,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,'L05',NULL),(4616,NULL,'Fustsoort',1,0,NULL,NULL,'L06',NULL),(4617,NULL,'Fustmateriaal',1,0,NULL,NULL,'L07',NULL),(4618,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,'L08',NULL),(4619,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,'L09',NULL),(4620,NULL,'Aantal stelen per bos',1,0,NULL,NULL,'L11',NULL),(4621,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,'L12',NULL),(4622,NULL,'Aantal stuks per fust',1,0,NULL,NULL,'L13',NULL),(4623,NULL,'Aantal bossen per fust',1,0,NULL,NULL,'L14',NULL),(4624,NULL,'Aantal bundels per fust',1,0,NULL,NULL,'L15',NULL),(4625,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,'L16',NULL),(4626,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,'L17',NULL),(4627,NULL,'Fustlabel',1,0,NULL,NULL,'L18',NULL),(4628,NULL,'Karlabel',1,0,NULL,NULL,'L19',NULL),(4629,NULL,'Service productlabel',1,0,NULL,NULL,'L20',NULL),(4630,NULL,'Service fustlabel',1,0,NULL,NULL,'L21',NULL),(4631,NULL,'Service karlabel',1,0,NULL,NULL,'L22',NULL),(4632,NULL,'Aantal fusten per laag',1,0,NULL,NULL,'L23',NULL),(4633,NULL,'Presentatie per schapm2',1,0,NULL,NULL,'L24',NULL),(4634,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,'P01',NULL),(4635,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,'P02',NULL),(4636,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,'P03',NULL),(4637,NULL,'Maceta',1,0,NULL,NULL,'S01',NULL),(4638,NULL,'Altura mínima',1,1,NULL,'cm','S02','size'),(4639,NULL,'nº plantas',1,0,NULL,NULL,'S03',NULL),(4640,NULL,'Minimum plantdiameter',1,0,NULL,NULL,'S04',NULL),(4641,NULL,'Madurez',1,0,NULL,NULL,'S05',NULL),(4642,NULL,'Combinatiehoogte',1,0,NULL,NULL,'S06',NULL),(4643,NULL,'Min aantal koppen hoogste',1,0,NULL,NULL,'S07',NULL),(4644,NULL,'Dikte',1,0,NULL,NULL,'S08',NULL),(4645,NULL,'Min aantal bloemen/bloeiw',1,0,NULL,NULL,'S09',NULL),(4646,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,'S10',NULL),(4647,NULL,'Minimum aantal takken per',1,0,NULL,NULL,'S11',NULL),(4648,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,'S12',NULL),(4649,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,'S13',NULL),(4650,NULL,'Altura tronco',1,1,NULL,'cm','S14','size'),(4651,NULL,'Altura transporte',1,0,NULL,'cm','S15','size'),(4652,NULL,'Lengte scheuten',1,0,NULL,NULL,'S16',NULL),(4653,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,'S17',NULL),(4654,NULL,'Minimum bloemknophoogte',1,0,NULL,NULL,'S19',NULL),(4655,NULL,'Altura',1,1,NULL,'cm','S20','size'),(4656,NULL,'Gewicht (gemiddeld)',1,0,NULL,NULL,'S21',NULL),(4657,NULL,'Aantal bloemknoppen snijb',1,0,NULL,NULL,'S22',NULL),(4658,NULL,'Minimum bloemdiameter',1,0,NULL,NULL,'S23',NULL),(4659,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,'S24',NULL),(4660,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,'S25',NULL),(4661,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S26',NULL),(4662,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S27',NULL),(4663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S28',NULL),(4664,NULL,'Minimum bloeiwijzelengte',1,0,NULL,NULL,'S29',NULL),(4665,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,'S30',NULL),(4666,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,'S31',NULL),(4667,NULL,'Medida',1,0,NULL,'cm','S32','size'),(4668,NULL,'Jaartal sortering hout',1,0,NULL,NULL,'S33',NULL),(4669,NULL,'Minimum bladdiameter',1,0,NULL,NULL,'S34',NULL),(4670,NULL,'Minimum bundelgewicht',1,0,NULL,NULL,'S35',NULL),(4671,NULL,'Altura máxima',1,0,NULL,NULL,'S36',NULL),(4672,NULL,'Maximum plantdiameter',1,0,NULL,NULL,'S37',NULL),(4673,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,'S38',NULL),(4674,NULL,'Maximum aantal takken per',1,0,NULL,NULL,'S39',NULL),(4675,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,'S40',NULL),(4676,NULL,'Altura máxima',1,0,NULL,NULL,'S41',NULL),(4677,NULL,'Maximum steellengte',1,0,NULL,NULL,'S42',NULL),(4678,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,'S43',NULL),(4679,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,'S44',NULL),(4680,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,'S45',NULL),(4681,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,'S46',NULL),(4682,NULL,'Verpakkingswijze',1,0,NULL,NULL,'S47',NULL),(4683,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,'S48',NULL),(4684,NULL,'Medida',1,1,NULL,'cm','S49','size'),(4685,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,'S50',NULL),(4686,NULL,'Potvorm',1,0,NULL,NULL,'S51',NULL),(4687,NULL,'Potkleur',1,0,NULL,NULL,'S52',NULL),(4688,NULL,'Potmateriaal',1,0,NULL,NULL,'S53',NULL),(4689,NULL,'Plantvorm',1,0,NULL,NULL,'S54',NULL),(4690,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S55',NULL),(4691,NULL,'Teeltwijze',1,0,NULL,NULL,'S56',NULL),(4692,NULL,'Teeltmedium',1,0,NULL,NULL,'S57',NULL),(4693,NULL,'Hoesmateriaal',1,0,NULL,NULL,'S58',NULL),(4694,NULL,'Hoesvorm',1,0,NULL,NULL,'S59',NULL),(4695,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,'S60',NULL),(4696,NULL,'Extra toevoegingen',1,0,NULL,NULL,'S61',NULL),(4697,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,'S62',NULL),(4698,NULL,'Verpakte orchidee',1,0,NULL,NULL,'S63',NULL),(4699,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,'S64',NULL),(4700,NULL,'Voorbehandeling',1,0,NULL,NULL,'S65',NULL),(4701,NULL,'Overige niet in pot',1,0,NULL,NULL,'S66',NULL),(4702,NULL,'Vorm snijbloemen',1,0,NULL,NULL,'S67',NULL),(4703,NULL,'Buigzaamheid bloemsteel',1,0,NULL,NULL,'S68',NULL),(4704,NULL,'Hoeskleur',1,0,NULL,NULL,'S69',NULL),(4705,NULL,'Extra deco materiaal',1,0,NULL,NULL,'S70',NULL),(4706,NULL,'Productkleur',1,0,NULL,NULL,'S71',NULL),(4707,NULL,'Productmateriaal',1,0,NULL,NULL,'S72',NULL),(4708,NULL,'Altura',1,1,NULL,'cm','S73','size'),(4709,NULL,'Materiaaldiameter',1,0,NULL,NULL,'S74',NULL),(4710,NULL,'Barcode',1,0,NULL,NULL,'S75',NULL),(4711,NULL,'Productlabel',1,0,NULL,NULL,'S76',NULL),(4712,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,'S77',NULL),(4713,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,'S78',NULL),(4714,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S79',NULL),(4715,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,'S80',NULL),(4716,NULL,'Maximum lengte verschil',1,0,NULL,NULL,'S81',NULL),(4717,NULL,'Bladkleur',1,0,NULL,NULL,'S82',NULL),(4718,NULL,'Plantgewicht',1,0,NULL,NULL,'S83',NULL),(4719,NULL,'Gemiddelde bloemdiameter',1,0,NULL,NULL,'S84',NULL),(4720,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,'S85',NULL),(4721,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,'S86',NULL),(4722,NULL,'Kleurbehandeld',1,0,NULL,NULL,'S87',NULL),(4723,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,'S88',NULL),(4724,NULL,'Minimum bloemknopdiameter',1,0,NULL,NULL,'S89',NULL),(4725,NULL,'Volume inhoud',1,0,NULL,NULL,'S90',NULL),(4726,NULL,'Vruchtbenaming',1,0,NULL,NULL,'S91',NULL),(4727,NULL,'Vaaslevenindex',1,0,NULL,NULL,'S92',NULL),(4728,NULL,'Overige informatie plante',1,0,NULL,NULL,'S93',NULL),(4729,NULL,'Overige informatie snijbl',1,0,NULL,NULL,'S94',NULL),(4730,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,'S95',NULL),(4731,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,'S96',NULL),(4732,NULL,'MPS certificering',1,0,NULL,NULL,'S97',NULL),(4733,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,'S98',NULL),(4734,NULL,'Artikelomschrijving',1,0,NULL,NULL,'S99',NULL),(4735,NULL,'BTW-tarief',1,0,NULL,NULL,'T01',NULL),(4736,NULL,'Prijseenheid',1,0,NULL,NULL,'T02',NULL),(4737,NULL,'Transactievorm',1,0,NULL,NULL,'T03',NULL),(4738,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,'T10',NULL),(4739,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,'T11',NULL),(4740,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,'T12',NULL),(4741,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,'T13',NULL),(4742,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,'T14',NULL),(4743,NULL,'Algemene voorwaarden',1,0,NULL,NULL,'T15',NULL),(4744,NULL,'Marktvorm',1,0,NULL,NULL,'T16',NULL),(4745,NULL,'Themadagen',1,0,NULL,NULL,'T17',NULL),(4746,NULL,'Handelscategorie',1,0,NULL,NULL,'T18',NULL),(4747,NULL,'Producentengroepen',1,0,NULL,NULL,'T19',NULL),(4748,NULL,'Favorieten Id',1,0,NULL,NULL,'T20',NULL),(4749,NULL,'Verkoopeenheid',1,0,NULL,NULL,'T21',NULL),(4750,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,'V01',NULL),(4751,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V02',NULL),(4752,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,'V03',NULL),(4753,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,'V04',NULL),(4754,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,'V05',NULL),(4755,NULL,'FloraHolland Financial',1,0,NULL,NULL,'V06',NULL),(4756,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V07',NULL),(4757,NULL,'Benefiet veiling',1,0,NULL,NULL,'V08',NULL),(4758,NULL,'Kloksoort',1,0,NULL,NULL,'V09',NULL),(4759,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,'V10',NULL),(4760,NULL,'Rest aantallen',1,0,NULL,NULL,'V11',NULL),(4761,NULL,'Veilsoort',1,0,NULL,NULL,'V12',NULL),(4762,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V13',NULL),(4763,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V14',NULL),(4764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V15',NULL),(4765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V16',NULL),(4766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V17',NULL),(4767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V18',NULL),(4768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V19',NULL),(4769,NULL,'Gereserveerd',1,0,NULL,NULL,'V20',NULL),(4770,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,'V21',NULL),(4771,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,'V22',NULL),(4772,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,'V23',NULL),(4773,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V24',NULL),(4774,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V25',NULL),(4775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V26',NULL),(4776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V27',NULL),(4777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V28',NULL),(4778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V29',NULL),(4779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V30',NULL),(4780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V31',NULL),(4781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V32',NULL),(4782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V33',NULL),(4783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V34',NULL),(4784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V35',NULL),(4785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V36',NULL),(4786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V37',NULL),(4787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V38',NULL),(4788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V39',NULL),(4789,NULL,'Gereserveerd',1,0,NULL,NULL,'V40',NULL),(4790,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,'V41',NULL),(4791,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,'V42',NULL),(4792,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,'V43',NULL),(4793,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V44',NULL),(4794,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V45',NULL),(4795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V46',NULL),(4796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V47',NULL),(4797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V48',NULL),(4798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V49',NULL),(4799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V50',NULL),(4800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V51',NULL),(4801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V52',NULL),(4802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V53',NULL),(4803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V54',NULL),(4804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V55',NULL),(4805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V56',NULL),(4806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V57',NULL),(4807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V58',NULL),(4808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V59',NULL),(4809,NULL,'Gereserveerd',1,0,NULL,NULL,'V60',NULL),(4810,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,'V61',NULL),(4811,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V62',NULL),(4812,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V63',NULL),(4813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V64',NULL),(4814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V65',NULL),(4815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V66',NULL),(4816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V67',NULL),(4817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V68',NULL),(4818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V69',NULL),(4819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V70',NULL),(4820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V71',NULL),(4821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V72',NULL),(4822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V73',NULL),(4823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V74',NULL),(4824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V75',NULL),(4825,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V76',NULL),(4826,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V77',NULL),(4827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V78',NULL),(4828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V79',NULL),(4829,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,'V80',NULL),(4830,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V81',NULL),(4831,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V82',NULL),(4832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V83',NULL),(4833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V84',NULL),(4834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V85',NULL),(4835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V86',NULL),(4836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V87',NULL),(4837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V88',NULL),(4838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V89',NULL),(4839,NULL,'Veiling',1,0,NULL,NULL,'V99',NULL),(4840,NULL,'kopersaantallen',1,0,NULL,NULL,'Z01',NULL); /*!40000 ALTER TABLE `tag` ENABLE KEYS */; UNLOCK TABLES; @@ -347,7 +347,7 @@ UNLOCK TABLES; LOCK TABLES `department` WRITE; /*!40000 ALTER TABLE `department` DISABLE KEYS */; -INSERT INTO `department` VALUES (1,'VERDNATURA',1,2,763,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0,NULL),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/',NULL,1,NULL),(23,'CAMARA',14,19,NULL,72,604,2,6,1,0,1,2,37,'/37/',NULL,0,NULL),(31,'INFORMATICA',5,6,NULL,72,127,3,9,0,0,0,0,NULL,'/',NULL,1,NULL),(34,'CONTABILIDAD',7,8,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1,NULL),(35,'FINANZAS',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1,NULL),(36,'LABORAL',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1,NULL),(37,'PRODUCCION',13,52,NULL,72,230,3,11,1,0,0,17,NULL,'/',NULL,0,NULL),(38,'SACADO',20,21,NULL,72,230,4,14,1,0,1,0,37,'/37/',NULL,0,NULL),(39,'ENCAJADO',22,23,NULL,72,230,4,12,1,0,1,0,37,'/37/',NULL,0,NULL),(41,'ADMINISTRACION',53,54,NULL,72,599,3,8,0,0,0,0,NULL,'/',NULL,1,NULL),(43,'VENTAS',55,76,NULL,0,NULL,NULL,NULL,0,0,0,10,NULL,'/',NULL,1,'direccioncomercial@verdnatura.es'),(44,'GERENCIA',77,78,NULL,72,300,2,7,0,0,0,0,NULL,'/',NULL,0,NULL),(45,'LOGISTICA',79,80,NULL,72,596,3,19,0,0,0,0,NULL,'/',NULL,1,NULL),(46,'REPARTO',81,84,NULL,72,659,3,10,0,0,0,1,NULL,'/',NULL,0,NULL),(48,'ALMACENAJE',85,86,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0,NULL),(49,'PROPIEDAD',87,88,NULL,72,1008,1,1,0,0,0,0,NULL,'/',NULL,0,NULL),(52,'CARGA AEREA',89,90,NULL,72,163,4,28,0,0,0,0,NULL,'/',NULL,0,NULL),(53,'MARKETING Y COMUNICACIÓN',91,92,NULL,72,1238,0,0,0,0,0,0,NULL,'/',NULL,1,NULL),(54,'ORNAMENTALES',93,94,NULL,72,433,3,21,0,0,0,0,NULL,'/',NULL,0,NULL),(55,'TALLER NATURAL',95,96,NULL,72,695,2,23,0,0,0,0,NULL,'/',NULL,0,NULL),(56,'TALLER ARTIFICIAL',97,98,NULL,72,1780,2,24,0,0,0,0,NULL,'/',NULL,0,NULL),(58,'CAMPOS',99,100,NULL,72,225,2,2,0,0,0,0,NULL,'/',NULL,0,NULL),(59,'MANTENIMIENTO',101,102,NULL,72,1907,4,16,0,0,0,0,NULL,'/',NULL,0,NULL),(60,'RECLAMACIONES',103,104,NULL,72,563,3,20,0,0,0,0,NULL,'/',NULL,1,NULL),(61,'VNH',105,106,NULL,73,1297,3,17,0,0,0,0,NULL,'/',NULL,0,NULL),(63,'VENTAS FRANCIA',56,57,NULL,72,277,2,27,0,0,1,0,43,'/43/',NULL,0,NULL),(66,'VERDNAMADRID',107,108,NULL,72,163,3,18,0,0,0,0,NULL,'/',NULL,0,NULL),(68,'COMPLEMENTOS',24,25,NULL,72,617,3,26,1,0,1,0,37,'/37/',NULL,0,NULL),(69,'VERDNABARNA',109,110,NULL,74,432,3,22,0,0,0,0,NULL,'/',NULL,0,NULL),(77,'PALETIZADO',82,83,NULL,72,230,4,15,1,0,1,0,46,'/46/',NULL,0,NULL),(80,'EQUIPO J VALLES',58,59,NULL,72,693,3,4,0,0,1,0,43,'/43/','jvp_equipo',1,NULL),(86,'LIMPIEZA',111,112,NULL,72,599,0,0,0,0,0,0,NULL,'/',NULL,0,NULL),(89,'COORDINACION',113,114,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0,NULL),(90,'TRAILER',115,116,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0,NULL),(91,'ARTIFICIAL',26,27,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(92,'EQUIPO SILVERIO',60,61,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','sdc_equipo',1,NULL),(93,'CONFECCION',117,118,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0,NULL),(94,'EQUIPO J BROCAL',62,63,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jes_equipo',1,NULL),(95,'EQUIPO C ZAMBRANO',64,65,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','czg_equipo',1,NULL),(96,'EQUIPO C LOPEZ',66,67,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','cla_equipo',1,NULL),(98,'EQUIPO RODRIGO',68,69,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','rhr_equipo',1,NULL),(101,'EQUIPO J IBAÑEZ',70,71,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jmi_equipo',1,NULL),(102,'EQ ROJO FV RUBEN C',28,29,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(103,'EQ AZUL FV A FOLQUES',30,31,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(104,'EQ AMARILLO FV NORMAN G',32,33,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(105,'EQ MORADO FV MATOU',34,35,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(106,'EQ VERDE PCA KEVIN GIMENEZ',36,37,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(107,'EQ NARANJA PCA RUBEN ZANON',38,39,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(110,'EQ ROSA PCA J BONDIA',40,41,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(111,'EQ REPONEDOR CAJAS',42,43,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(112,'CAMARA EQ EDGAR LLEO',15,16,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0,NULL),(113,'CAMARA EQ MARC ROCA',17,18,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0,NULL),(114,'EQ MARRON PCA JL NUEVO',44,45,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(115,'EQUIPO CLAUDI',72,73,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','csr_equipo',1,NULL),(120,'PCA PRODUCCION',46,47,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(121,'FV PRODUCCION',48,49,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(122,'PCA ALMACEN',50,51,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(123,'EQUIPO ELENA BASCUÑANA',74,75,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','ebt_equipo',0,NULL),(124,'CONTROL INTERNO',119,120,NULL,72,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0,NULL); +INSERT INTO `department` VALUES (1,'VERDNATURA',1,2,763,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0,NULL),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/',NULL,1,NULL),(23,'CAMARA',14,19,NULL,72,604,2,6,1,0,1,2,37,'/37/',NULL,0,NULL),(31,'INFORMATICA',5,6,NULL,72,127,3,9,0,0,0,0,NULL,'/',NULL,1,NULL),(34,'CONTABILIDAD',7,8,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1,NULL),(35,'FINANZAS',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1,NULL),(36,'LABORAL',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1,NULL),(37,'PRODUCCION',13,52,NULL,72,230,3,11,1,0,0,17,NULL,'/',NULL,0,NULL),(38,'SACADO',20,21,NULL,72,230,4,14,1,0,1,0,37,'/37/',NULL,0,NULL),(39,'ENCAJADO',22,23,NULL,72,230,4,12,1,0,1,0,37,'/37/',NULL,0,NULL),(41,'ADMINISTRACION',53,54,NULL,72,599,3,8,0,0,0,0,NULL,'/',NULL,1,NULL),(43,'VENTAS',55,76,NULL,0,NULL,NULL,NULL,0,0,0,10,NULL,'/',NULL,1,'direccioncomercial@verdnatura.es'),(44,'GERENCIA',77,78,NULL,72,300,2,7,0,0,0,0,NULL,'/',NULL,0,NULL),(45,'LOGISTICA',79,80,NULL,72,596,3,19,0,0,0,0,NULL,'/',NULL,1,NULL),(46,'REPARTO',81,84,NULL,72,659,3,10,0,0,0,1,NULL,'/',NULL,0,NULL),(48,'ALMACENAJE',85,86,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0,NULL),(49,'PROPIEDAD',87,88,NULL,72,1008,1,1,0,0,0,0,NULL,'/',NULL,0,NULL),(52,'CARGA AEREA',89,90,NULL,72,163,4,28,0,0,0,0,NULL,'/',NULL,0,NULL),(53,'MARKETING Y COMUNICACIÓN',91,92,NULL,72,1238,0,0,0,0,0,0,NULL,'/',NULL,1,NULL),(54,'ORNAMENTALES',93,94,NULL,72,433,3,21,0,0,0,0,NULL,'/',NULL,0,NULL),(55,'TALLER NATURAL',95,96,NULL,72,695,2,23,0,0,0,0,NULL,'/',NULL,0,NULL),(56,'TALLER ARTIFICIAL',97,98,NULL,72,1780,2,24,0,0,0,0,NULL,'/',NULL,0,NULL),(58,'CAMPOS',99,100,NULL,72,225,2,2,0,0,0,0,NULL,'/',NULL,0,NULL),(59,'MANTENIMIENTO',101,102,NULL,72,1907,4,16,0,0,0,0,NULL,'/',NULL,0,NULL),(60,'RECLAMACIONES',103,104,NULL,72,563,3,20,0,0,0,0,NULL,'/',NULL,1,NULL),(61,'VNH',105,106,NULL,73,1297,3,17,0,0,0,0,NULL,'/',NULL,0,NULL),(63,'VENTAS FRANCIA',56,57,NULL,72,277,2,27,0,0,1,0,43,'/43/',NULL,0,NULL),(66,'VERDNAMADRID',107,108,NULL,72,163,3,18,0,0,0,0,NULL,'/',NULL,0,NULL),(68,'COMPLEMENTOS',24,25,NULL,72,617,3,26,1,0,1,0,37,'/37/',NULL,0,NULL),(69,'VERDNABARNA',109,110,NULL,74,432,3,22,0,0,0,0,NULL,'/',NULL,0,NULL),(77,'PALETIZADO',82,83,NULL,72,230,4,15,1,0,1,0,46,'/46/',NULL,0,NULL),(80,'EQUIPO J VALLES',58,59,NULL,72,693,3,4,0,0,1,0,43,'/43/','jvp_equipo',1,NULL),(86,'LIMPIEZA',111,112,NULL,72,599,0,0,0,0,0,0,NULL,'/',NULL,0,NULL),(89,'COORDINACION',113,114,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0,NULL),(90,'TRAILER',115,116,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0,NULL),(91,'ARTIFICIAL',26,27,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(92,'EQUIPO SILVERIO',60,61,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','sdc_equipo',1,NULL),(93,'CONFECCION',117,118,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0,NULL),(94,'EQUIPO J BROCAL',62,63,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jes_equipo',1,NULL),(95,'EQUIPO C ZAMBRANO',64,65,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','czg_equipo',1,NULL),(96,'EQUIPO C LOPEZ',66,67,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','cla_equipo',1,NULL),(98,'EQUIPO RODRIGO',68,69,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','rhr_equipo',1,NULL),(101,'EQUIPO J IBAÑEZ',70,71,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jmi_equipo',1,NULL),(102,'EQ ROJO FV RUBEN C',28,29,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(103,'EQ AZUL FV A FOLQUES',30,31,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(104,'EQ AMARILLO FV NORMAN G',32,33,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(105,'EQ MORADO FV MATOU',34,35,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(106,'EQ VERDE PCA KEVIN GIMENEZ',36,37,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(107,'EQ NARANJA PCA RUBEN ZANON',38,39,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(110,'EQ ROSA PCA J BONDIA',40,41,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(111,'EQ REPONEDOR CAJAS',42,43,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(112,'CAMARA EQ EDGAR LLEO',15,16,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0,NULL),(113,'CAMARA EQ MARC ROCA',17,18,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0,NULL),(114,'EQ MARRON PCA JL NUEVO',44,45,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(115,'EQUIPO CLAUDI',72,73,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','csr_equipo',1,NULL),(120,'PCA PRODUCCION',46,47,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(121,'FV PRODUCCION',48,49,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(122,'PCA ALMACEN',50,51,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0,NULL),(123,'EQUIPO ELENA BASCUÑANA',74,75,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','ebt_equipo',1,NULL),(124,'CONTROL INTERNO',119,120,NULL,72,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1,NULL); /*!40000 ALTER TABLE `department` ENABLE KEYS */; UNLOCK TABLES; @@ -357,7 +357,7 @@ UNLOCK TABLES; LOCK TABLES `component` WRITE; /*!40000 ALTER TABLE `component` DISABLE KEYS */; -INSERT INTO `component` VALUES (10,'Precios Especiales',4,NULL,NULL,1,'specialPrices'),(14,'porte extra por dia semana',6,NULL,NULL,1,'extraCostPerWeekDay'),(15,'reparto',6,NULL,NULL,1,'delivery'),(17,'recobro',5,NULL,NULL,1,'debtCollection'),(21,'ajuste',11,NULL,NULL,1,'adjustment'),(22,'venta por paquete',9,1,NULL,0,'salePerPackage'),(23,'venta por caja',9,2,NULL,0,'salePerBox'),(28,'valor de compra',1,NULL,NULL,1,'purchaseValue'),(29,'margen',4,NULL,NULL,1,'margin'),(32,'descuento ultimas unidades',9,3,-0.05,0,'lastUnitsDiscount'),(33,'venta por caja',9,1,NULL,0,'salePerBox'),(34,'descuento comprador',4,NULL,NULL,1,'buyerDiscount'),(35,'cartera comprador',10,NULL,NULL,1,NULL),(36,'descuadre',12,NULL,NULL,1,'imbalance'),(37,'maná',7,4,NULL,0,'mana'),(38,'embolsado',9,NULL,NULL,1,'bagged'),(39,'maná auto',7,NULL,NULL,1,'autoMana'),(40,'cambios Santos 2016',4,NULL,NULL,1,NULL),(41,'bonificacion porte',4,NULL,NULL,1,'freightCharge'); +INSERT INTO `component` VALUES (10,'Precios Especiales',4,NULL,NULL,1,'specialPrices'),(14,'porte extra por dia semana',6,NULL,NULL,1,'extraCostPerWeekDay'),(15,'reparto',6,NULL,NULL,1,'delivery'),(17,'recobro',5,NULL,NULL,1,'debtCollection'),(21,'ajuste',11,NULL,NULL,1,'adjustment'),(22,'venta por paquete',9,1,NULL,0,'salePerPackage'),(23,'venta por caja',9,2,NULL,0,'salePerBox'),(28,'valor de compra',1,NULL,NULL,1,'purchaseValue'),(29,'margen',4,NULL,NULL,1,'margin'),(32,'descuento ultimas unidades',9,3,-0.05,0,'lastUnitsDiscount'),(33,'venta por caja',9,1,NULL,0,'salePerBox'),(34,'descuento comprador',4,NULL,NULL,1,'buyerDiscount'),(35,'cartera comprador',10,NULL,NULL,1,NULL),(36,'descuadre',12,NULL,NULL,1,'imbalance'),(37,'maná',7,4,NULL,0,'mana'),(38,'embolsado',9,NULL,NULL,1,'bagged'),(39,'maná auto',7,NULL,NULL,1,'autoMana'),(40,'cambios Santos 2016',4,NULL,NULL,1,NULL),(41,'bonificacion porte',4,NULL,NULL,1,'freightCharge'),(42,'promocion Francia',4,NULL,NULL,1,'frenchOffer'); /*!40000 ALTER TABLE `component` ENABLE KEYS */; UNLOCK TABLES; @@ -380,7 +380,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:40 +-- Dump completed on 2020-11-25 12:04:00 USE `cache`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -418,7 +418,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:41 +-- Dump completed on 2020-11-25 12:04:01 USE `hedera`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -443,7 +443,7 @@ USE `hedera`; LOCK TABLES `imageCollection` WRITE; /*!40000 ALTER TABLE `imageCollection` DISABLE KEYS */; -INSERT INTO `imageCollection` VALUES (1,'catalog','Artículo',3840,2160,'Item','image','vn','item','image'),(4,'link','Enlace',200,200,'Link','image','hedera','link','image'),(5,'news','Noticias',800,1200,'New','image','hedera','news','image'),('6','user','Usuario','800','1200','Account','image','account','user','image'); +INSERT INTO `imageCollection` VALUES (1,'catalog','Artículo',3840,2160,'Item','image','vn','item','image'),(4,'link','Enlace',200,200,'Link','image','hedera','link','image'),(5,'news','Noticias',800,1200,'New','image','hedera','news','image'),(6,'user','Usuario',800,1200,'Account','image','account','user','image'); /*!40000 ALTER TABLE `imageCollection` ENABLE KEYS */; UNLOCK TABLES; @@ -466,6 +466,16 @@ LOCK TABLES `tpvResponse` WRITE; INSERT INTO `tpvResponse` VALUES (101,'Tarjeta Caducada'),(102,'Tarjeta en excepción transitoria o bajo sospecha de fraude'),(104,'Operación no permitida para esa tarjeta o terminal'),(106,'Intentos de PIN excedidos'),(116,'Disponible Insuficiente'),(118,'Tarjeta no Registrada'),(125,'Tarjeta no efectiva'),(129,'Código de seguridad (CVV2/CVC2) incorrecto'),(180,'Tarjeta ajena al servicio'),(184,'Error en la autenticación del titular'),(190,'Denegación sin especificar motivo'),(191,'Fecha de caducidad errónea'),(202,'Tarjeta en excepción transitoria o bajo sospecha de fraude con retirada de tarjeta'),(904,'Comercio no registrado en FUC'),(909,'Error de sistema'),(912,'Emisor no Disponible'),(913,'Pedido repetido'),(944,'Sesión Incorrecta'),(950,'Operación de devolución no permitida'),(9064,'Número de posiciones de la tarjeta incorrecto'),(9078,'No existe método de pago válido para esa tarjeta'),(9093,'Tarjeta no existente'),(9094,'Rechazo servidores internacionales'),(9104,'A petición del usuario se ha cancelado el pago'),(9218,'El comercio no permite op. seguras por entrada /operaciones'),(9253,'Tarjeta no cumple el check-digit'),(9256,'El comercio no puede realizar preautorizaciones'),(9257,'Esta tarjeta no permite operativa de preautorizaciones'),(9261,'Operación detenida por superar el control de restricciones en la entrada al SIS'),(9912,'Emisor no Disponible'),(9913,'Error en la confirmación que el comercio envía al TPV Virtual (solo aplicable en la opción de sincronización SOAP)'),(9914,'Confirmación “KO” del comercio (solo aplicable en la opción de sincronización SOAP)'),(9915,'A petición del usuario se ha cancelado el pago'),(9928,'Anulación de autorización en diferido realizada por el SIS (proceso batch)'),(9929,'Anulación de autorización en diferido realizada por el comercio'),(9998,'Operación en proceso de solicitud de datos de tarjeta'),(9999,'Operación que ha sido redirigida al emisora autenticar'); /*!40000 ALTER TABLE `tpvResponse` ENABLE KEYS */; UNLOCK TABLES; + +-- +-- Dumping data for table `imageCollectionSize` +-- + +LOCK TABLES `imageCollectionSize` WRITE; +/*!40000 ALTER TABLE `imageCollectionSize` DISABLE KEYS */; +INSERT INTO `imageCollectionSize` VALUES (2,1,50,50,1),(3,1,200,200,1),(5,5,200,200,1),(6,1,70,70,1),(8,5,50,50,1),(9,1,1600,900,0),(13,6,160,160,1),(14,6,520,520,1),(15,6,1600,1600,1); +/*!40000 ALTER TABLE `imageCollectionSize` ENABLE KEYS */; +UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -476,7 +486,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:42 +-- Dump completed on 2020-11-25 12:04:02 USE `postgresql`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -551,7 +561,7 @@ UNLOCK TABLES; LOCK TABLES `workcenter` WRITE; /*!40000 ALTER TABLE `workcenter` DISABLE KEYS */; -INSERT INTO `workcenter` VALUES (1,'Silla',20,1081,1,'Av espioca 100',552703),(2,'Mercaflor',19,NULL,NULL,NULL,NULL),(3,'Marjales',26,20008,NULL,NULL,NULL),(4,'VNH',NULL,NULL,3,NULL,NULL),(5,'Madrid',28,2853,5,'Av constitución 3',554145),(6,'Vilassar',88,88031,2,'Cami del Crist, 33',556412),(7,'Tenerife',NULL,NULL,10,NULL,NULL); +INSERT INTO `workcenter` VALUES (1,'Silla',20,1082,1,'Av espioca 100',552703),(2,'Mercaflor',19,NULL,NULL,NULL,NULL),(3,'Marjales',26,20008,NULL,NULL,NULL),(4,'VNH',NULL,NULL,3,NULL,NULL),(5,'Madrid',28,2856,5,'Av constitución 3',554145),(6,'Vilassar',88,88031,2,'Cami del Crist, 33',556412),(7,'Tenerife',NULL,NULL,10,NULL,NULL); /*!40000 ALTER TABLE `workcenter` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -564,7 +574,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:44 +-- Dump completed on 2020-11-25 12:04:04 USE `sage`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -614,24 +624,6 @@ INSERT INTO `TiposRetencion` VALUES (1,'RETENCION ESTIMACION OBJETIVA',1.0000000 UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; --- --- Dumping data for table `TiposRetencion` --- - -LOCK TABLES `TiposRetencion` WRITE; -/*!40000 ALTER TABLE `TiposRetencion` DISABLE KEYS */; -INSERT INTO `TiposRetencion` (`CodigoRetencion`, `Retencion`, `PorcentajeRetencion`, `CuentaCargo`, `CuentaAbono`, `ClaveIrpf`, `CuentaCargoANT_`, `CuentaAbonoANT_`, `IdTipoRetencion`) VALUES -(1, 'RETENCION ESTIMACION OBJETIVA', '1.0000000000', '4730000000', '4751000000', NULL, NULL, NULL, '03811652-0F3A-44A1-AE1C-B19624525D7F'), -(2, 'ACTIVIDADES AGRICOLAS O GANADERAS', '2.0000000000', '4730000000', '4751000000', NULL, NULL, NULL, 'F3F91EF3-FED6-444D-B03C-75B639D13FB4'), -(9, 'ACTIVIDADES PROFESIONALES 2 PRIMEROS AÑOS', '9.0000000000', '4730000000', '4751000000', NULL, NULL, NULL, '73F95642-E951-4C91-970A-60C503A4792B'), -(15, 'ACTIVIDADES PROFESIONALES', '15.0000000000', '4730000000', '4751000000', '6', NULL, NULL, 'F6BDE0EE-3B01-4023-8FFF-A73AE9AC50D7'), -(19, 'ARRENDAMIENTO Y SUBARRENDAMIENTO', '19.0000000000', '4730000000', '4751000000', '8', NULL, NULL, '09B033AE-16E5-4057-8D4A-A7710C8A4FB9'); -/*!40000 ALTER TABLE `TiposRetencion` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - - - /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; @@ -640,4 +632,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:45 +-- Dump completed on 2020-11-25 12:04:05 diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index ad8474e38..cffce3ae7 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -92,6 +92,13 @@ INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossF (109, 'HLK', 'Bruce' , 'Banner', 109, 19, 432978109), (110, 'JJJ', 'Jessica' , 'Jones' , 110, 19, 432978110); +INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`) + VALUES + (1, 'EUR', 'Euro', 1), + (2, 'USD', 'Dollar USA', 1.4), + (3, 'GBP', 'Libra', 1), + (4, 'JPY', 'Yen Japones', 1); + INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`) VALUES (1, 'España', 1, 'ES', 1, 24), @@ -149,13 +156,6 @@ INSERT INTO `vn`.`accountingType`(`id`, `description`, `receiptDescription`) (4, 'Stolen Money', ''), (5, 'Miscellaneous', ''); -INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`) - VALUES - (1, 'EUR', 'Euro', 1), - (2, 'USD', 'Dollar USA', 1.4), - (3, 'GBP', 'Libra', 1), - (4, 'JPY', 'Yen Japones', 1); - INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`, `currencyFk`) VALUES (1, 'Pay on receipt', '0000000000', 3, 0, 1, 1), diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 2573e2b1b..c5303eec2 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -86,13 +86,13 @@ DROP TABLE IF EXISTS `accountConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `accountConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `homedir` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The base folder for users home directories', + `homedir` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The base folder for users home directory', `shell` varchar(50) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The default shell', - `idBase` int(11) NOT NULL, + `idBase` int(11) NOT NULL COMMENT 'Base id for Posix users and groups', `min` smallint(6) NOT NULL, - `max` smallint(6) NOT NULL, - `warn` smallint(6) NOT NULL, - `inact` smallint(6) NOT NULL, + `max` smallint(6) NOT NULL COMMENT 'Maximum password age (seconds)', + `warn` smallint(6) NOT NULL COMMENT 'Warn to change password when elapsed (seconds)', + `inact` smallint(6) NOT NULL COMMENT 'Maximum inactivity time (seconds)', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration parameters for accounts'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -151,12 +151,11 @@ DROP TABLE IF EXISTS `ldapConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ldapConfig` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `host` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The hostname of LDAP server', + `server` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The LDAP server access url', `rdn` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The LDAP user', - `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Base64 encoded password', - `baseDn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The base DN to do the query', - `filter` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Filter to apply to the query', - `groupDn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The LDAP password', + `userDn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The base DN for users', + `groupDn` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The base DN for groups', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='LDAP server configuration parameters'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -357,10 +356,12 @@ DROP TABLE IF EXISTS `roleRole`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `roleRole` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `role` int(10) unsigned NOT NULL, `inheritsFrom` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), UNIQUE KEY `role` (`role`,`inheritsFrom`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Calculated role inheritance'; +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Calculated role inheritance'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -372,10 +373,11 @@ DROP TABLE IF EXISTS `sambaConfig`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sambaConfig` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `host` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT 'The hosname of Samba server', - `sshUser` varchar(30) CHARACTER SET utf8 DEFAULT NULL COMMENT 'The SSH user to connect to servers', - `sshPass` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The SSH password base64 encoded', - `uidBase` int(10) unsigned NOT NULL DEFAULT '10000' COMMENT 'The base for Unix uids', + `adDomain` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Active directory domain', + `adController` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The hosname of domain controller', + `adUser` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Active directory user', + `adPassword` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Active directory password', + `verifyCert` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT 'Whether to verify server certificate', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Global configuration parameters for accounts'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -389,19 +391,22 @@ DROP TABLE IF EXISTS `user`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `realm` varchar(512) CHARACTER SET utf8 DEFAULT NULL, `name` varchar(30) CHARACTER SET utf8 NOT NULL, `nickname` varchar(127) COLLATE utf8_unicode_ci NOT NULL, - `bcryptPassword` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `bcryptPassword` varchar(512) COLLATE utf8_unicode_ci DEFAULT NULL, `role` int(10) unsigned NOT NULL DEFAULT '2', `active` tinyint(1) NOT NULL DEFAULT '1', `email` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + `emailVerified` tinyint(1) DEFAULT NULL, + `verificationToken` varchar(512) CHARACTER SET utf8 DEFAULT NULL, `lang` char(2) CHARACTER SET utf8 DEFAULT NULL, - `sync` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Deprecated', `recoverPass` tinyint(3) unsigned NOT NULL DEFAULT '1', `lastPassChange` datetime DEFAULT NULL, `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `password` char(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Deprecated', + `sync` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Deprecated', PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `role` (`role`), @@ -556,11 +561,11 @@ DROP TABLE IF EXISTS `userPassword`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `userPassword` ( `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, - `length` tinyint(3) unsigned NOT NULL, - `nAlpha` tinyint(3) unsigned NOT NULL, - `nUpper` tinyint(3) unsigned NOT NULL, - `nDigits` tinyint(3) unsigned NOT NULL, - `nPunct` tinyint(3) unsigned NOT NULL, + `length` tinyint(3) unsigned NOT NULL COMMENT 'Minimal length', + `nAlpha` tinyint(3) unsigned NOT NULL COMMENT 'Minimum of alphabetic characters', + `nUpper` tinyint(3) unsigned NOT NULL COMMENT 'Minimum of uppercase letters', + `nDigits` tinyint(3) unsigned NOT NULL COMMENT 'Minimum of digits', + `nPunct` tinyint(3) unsigned NOT NULL COMMENT 'Minimum of symbols', PRIMARY KEY (`id`) ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Restrictions on user passwords'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -573,9 +578,9 @@ DROP TABLE IF EXISTS `userSync`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `userSync` ( - `name` varchar(30) NOT NULL, + `name` varchar(30) NOT NULL COMMENT 'The user name', PRIMARY KEY (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Users pending to be synchronized'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -876,52 +881,52 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `passwordGenerate`() RETURNS text CHARSET utf8 COLLATE utf8_unicode_ci READS SQL DATA -BEGIN -/** - * Generates a random password that meets the minimum requirements. - * - * @return Generated password - */ - DECLARE vMinLength TINYINT; - DECLARE vMinAlpha TINYINT; - DECLARE vMinUpper TINYINT; - DECLARE vMinDigits TINYINT; - DECLARE vMinPunct TINYINT; - DECLARE vAlpha TINYINT DEFAULT 0; - DECLARE vUpper TINYINT DEFAULT 0; - DECLARE vDigits TINYINT DEFAULT 0; - DECLARE vPunct TINYINT DEFAULT 0; - DECLARE vRandIndex INT; - DECLARE vPwd TEXT DEFAULT ''; - - DECLARE vAlphaChars TEXT DEFAULT 'abcdefghijklmnopqrstuvwxyz'; - DECLARE vUpperChars TEXT DEFAULT 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - DECLARE vDigitChars TEXT DEFAULT '1234567890'; - DECLARE vPunctChars TEXT DEFAULT '!$%&()=.'; - - SELECT length, nAlpha, nUpper, nDigits, nPunct - INTO vMinLength, vMinAlpha, vMinUpper, vMinDigits, vMinPunct FROM userPassword; - - WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha - OR vUpper < vMinUpper OR vDigits < vMinDigits OR vPunct < vMinPunct DO - SET vRandIndex = FLOOR((RAND() * 4) + 1); - - CASE - WHEN vRandIndex = 1 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vAlphaChars, FLOOR((RAND() * 26) + 1), 1)); - SET vAlpha = vAlpha + 1; - WHEN vRandIndex = 2 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vUpperChars, FLOOR((RAND() * 26) + 1), 1)); - SET vUpper = vUpper + 1; - WHEN vRandIndex = 3 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vDigitChars, FLOOR((RAND() * 10) + 1), 1)); - SET vDigits = vDigits + 1; - WHEN vRandIndex = 4 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vPunctChars, FLOOR((RAND() * LENGTH(vPunctChars)) + 1), 1)); - SET vPunct = vPunct + 1; - END CASE; - END WHILE; - RETURN vPwd; +BEGIN +/** + * Generates a random password that meets the minimum requirements. + * + * @return Generated password + */ + DECLARE vMinLength TINYINT; + DECLARE vMinAlpha TINYINT; + DECLARE vMinUpper TINYINT; + DECLARE vMinDigits TINYINT; + DECLARE vMinPunct TINYINT; + DECLARE vAlpha TINYINT DEFAULT 0; + DECLARE vUpper TINYINT DEFAULT 0; + DECLARE vDigits TINYINT DEFAULT 0; + DECLARE vPunct TINYINT DEFAULT 0; + DECLARE vRandIndex INT; + DECLARE vPwd TEXT DEFAULT ''; + + DECLARE vAlphaChars TEXT DEFAULT 'abcdefghijklmnopqrstuvwxyz'; + DECLARE vUpperChars TEXT DEFAULT 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + DECLARE vDigitChars TEXT DEFAULT '1234567890'; + DECLARE vPunctChars TEXT DEFAULT '!$%&()=.'; + + SELECT length, nAlpha, nUpper, nDigits, nPunct + INTO vMinLength, vMinAlpha, vMinUpper, vMinDigits, vMinPunct FROM userPassword; + + WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha + OR vUpper < vMinUpper OR vDigits < vMinDigits OR vPunct < vMinPunct DO + SET vRandIndex = FLOOR((RAND() * 4) + 1); + + CASE + WHEN vRandIndex = 1 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vAlphaChars, FLOOR((RAND() * 26) + 1), 1)); + SET vAlpha = vAlpha + 1; + WHEN vRandIndex = 2 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vUpperChars, FLOOR((RAND() * 26) + 1), 1)); + SET vUpper = vUpper + 1; + WHEN vRandIndex = 3 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vDigitChars, FLOOR((RAND() * 10) + 1), 1)); + SET vDigits = vDigits + 1; + WHEN vRandIndex = 4 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vPunctChars, FLOOR((RAND() * LENGTH(vPunctChars)) + 1), 1)); + SET vPunct = vPunct + 1; + END CASE; + END WHILE; + RETURN vPwd; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -1014,11 +1019,11 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `userGetNameFromId__`(vSelf INT) RETURNS varchar(30) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC -BEGIN -/** - * @deprecated Use user_getNameFromId(); - */ - RETURN user_getNameFromId(vSelf); +BEGIN +/** + * @deprecated Use user_getNameFromId(); + */ + RETURN user_getNameFromId(vSelf); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -1083,22 +1088,22 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `user_getMysqlRole`(vUserName VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC -BEGIN -/** - * From a username, it returns the associated MySQL wich should be used when - * using external authentication systems. - * - * @param vUserName The user name - * @return The associated MySQL role - */ - DECLARE vRole VARCHAR(255); - - SELECT CONCAT(IF(r.hasLogin, 'z-', ''), r.name) INTO vRole - FROM role r - JOIN user u ON u.role = r.id - WHERE u.name = vUserName; - - RETURN vRole; +BEGIN +/** + * From a username, it returns the associated MySQL wich should be used when + * using external authentication systems. + * + * @param vUserName The user name + * @return The associated MySQL role + */ + DECLARE vRole VARCHAR(255); + + SELECT CONCAT(IF(r.hasLogin, 'z-', ''), r.name) INTO vRole + FROM role r + JOIN user u ON u.role = r.id + WHERE u.name = vUserName; + + RETURN vRole; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -1117,20 +1122,20 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `user_getNameFromId`(vSelf INT) RETURNS varchar(30) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC -BEGIN -/** - * Gets user name from it's id. - * - * @param vSelf The user id - * @return The user name - */ - DECLARE vName VARCHAR(30); - - SELECT `name` INTO vName - FROM user - WHERE id = vSelf; - - RETURN vName; +BEGIN +/** + * Gets user name from it's id. + * + * @param vSelf The user id + * @return The user name + */ + DECLARE vName VARCHAR(30); + + SELECT `name` INTO vName + FROM user + WHERE id = vSelf; + + RETURN vName; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -1620,8 +1625,13 @@ BEGIN SET vPrefixedLike = CONCAT(vPrefix, '%'); - DELETE FROM mysql.user - WHERE `User` LIKE vPrefixedLike; + IF vIsMysql THEN + DELETE FROM mysql.user + WHERE `User` LIKE vPrefixedLike; + ELSE + DELETE FROM mysql.global_priv + WHERE `User` LIKE vPrefixedLike; + END IF; DELETE FROM mysql.db WHERE `User` LIKE vPrefixedLike; @@ -1789,7 +1799,8 @@ BEGIN JSON_OBJECT( 'mysql_old_password', JSON_VALUE(t.`Priv`, '$.mysql_old_password'), 'mysql_native_password', JSON_VALUE(t.`Priv`, '$.mysql_native_password'), - 'authentication_string', JSON_VALUE(t.`Priv`, '$.authentication_string') + 'authentication_string', JSON_VALUE(t.`Priv`, '$.authentication_string'), + 'ssl_type', JSON_VALUE(t.`Priv`, '$.ssl_type') ) ) FROM tRole r @@ -1800,7 +1811,7 @@ BEGIN ON u.`User` = r.role AND u.`Host` = vRoleHost; END IF; - + INSERT INTO mysql.proxies_priv ( `User`, `Host`, @@ -4741,16 +4752,16 @@ BEGIN * La tabla mana_spellers es una caché * */ - - UPDATE mana_spellers me - JOIN - (SELECT Id_Trabajador, FLOOR(SUM(importe)/12) as pesoCarteraMensual - FROM bs.vendedores - WHERE año * 100 + mes >= (YEAR(CURDATE()) -1) * 100 + MONTH(CURDATE()) - GROUP BY Id_Trabajador - ) lastYearSales USING(Id_Trabajador) - SET me.prices_modifier_rate = GREATEST(me.minRate,LEAST(me.maxRate,ROUND(- me.used/lastYearSales.pesoCarteraMensual,3))) ; - + + UPDATE mana_spellers me + JOIN + (SELECT Id_Trabajador, FLOOR(SUM(importe)/12) as pesoCarteraMensual + FROM bs.vendedores + WHERE año * 100 + mes >= (YEAR(CURDATE()) -1) * 100 + MONTH(CURDATE()) + GROUP BY Id_Trabajador + ) lastYearSales USING(Id_Trabajador) + SET me.prices_modifier_rate = GREATEST(me.minRate,LEAST(me.maxRate,ROUND(- me.used/lastYearSales.pesoCarteraMensual,3))) ; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -5151,6 +5162,62 @@ DO SET vDateStart = DATE_ADD(vDateStart, INTERVAL 1 DAY); END WHILE; +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 `saleGraphic` */; +/*!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 = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`z-developer`@`%` PROCEDURE `saleGraphic`(vItemFk INT, + vTypeFk INT, + vCategoryFk INT, + vFromDate DATE, + vToDate DATE, + vProducerFk INT) +BEGIN + + DECLARE vFromDateLastYear DATE; + DECLARE vToDateLastYear DATE; + DECLARE vFromDateTwoYearsAgo DATE; + DECLARE vToDateTwoYearsAgo DATE; + + SET vItemFk = IFNULL(vItemFk,0); + SET vTypeFk = IFNULL(vTypeFk, 0); + SET vCategoryFk = IFNULL(vCategoryFk,0); + SET vFromDate = IFNULL(vFromDate,CURDATE()); + SET vToDate = IFNULL(vToDate,CURDATE()); + SET vProducerFk = IFNULL(vProducerFk,0); + + SET vFromDateLastYear = TIMESTAMPADD(YEAR,-1,vFromDate); + SET vToDateLastYear = TIMESTAMPADD(YEAR,-1,vToDate); + SET vFromDateTwoYearsAgo = TIMESTAMPADD(YEAR,-2,vFromDate); + SET vToDateTwoYearsAgo = TIMESTAMPADD(YEAR,-2,vToDate); + + SELECT s.quantity, CAST(v.importe AS DECIMAL(10,0)) importe, v.fecha + FROM bs.ventas v + JOIN vn.sale s ON s.id = v.Id_Movimiento + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + WHERE vItemFk IN (i.id, 0) + AND vTypeFk IN (i.typeFk, 0) + AND vCategoryFk IN (it.categoryFk, 0) + AND vProducerFk IN (i.producerFk, 0) + AND (v.fecha BETWEEN vFromDate AND vToDate + OR v.fecha BETWEEN vFromDateLastYear AND vToDateLastYear + OR v.fecha BETWEEN vFromDateTwoYearsAgo AND vToDateTwoYearsAgo + ); + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -6999,9 +7066,9 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cacheCalc_clean`() -BEGIN - DECLARE vCleanTime DATETIME DEFAULT TIMESTAMPADD(MINUTE, -5, NOW()); - DELETE FROM cache_calc WHERE expires < vCleanTime; +BEGIN + DECLARE vCleanTime DATETIME DEFAULT TIMESTAMPADD(MINUTE, -5, NOW()); + DELETE FROM cache_calc WHERE expires < vCleanTime; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7019,27 +7086,27 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_calc_end`(IN `v_calc` INT) -BEGIN - DECLARE v_cache_name VARCHAR(255); - DECLARE v_params VARCHAR(255); - - -- Libera el bloqueo y actualiza la fecha de ultimo refresco. - - UPDATE cache_calc cc JOIN cache c ON c.id = cc.cache_id - SET - cc.last_refresh = NOW(), - cc.expires = ADDTIME(NOW(), c.lifetime), - cc.connection_id = NULL - WHERE cc.id = v_calc; - - SELECT c.name, ca.params INTO v_cache_name, v_params - FROM cache c - JOIN cache_calc ca ON c.id = ca.cache_id - WHERE ca.id = v_calc; - - IF v_cache_name IS NOT NULL THEN - DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); - END IF; +BEGIN + DECLARE v_cache_name VARCHAR(255); + DECLARE v_params VARCHAR(255); + + -- Libera el bloqueo y actualiza la fecha de ultimo refresco. + + UPDATE cache_calc cc JOIN cache c ON c.id = cc.cache_id + SET + cc.last_refresh = NOW(), + cc.expires = ADDTIME(NOW(), c.lifetime), + cc.connection_id = NULL + WHERE cc.id = v_calc; + + SELECT c.name, ca.params INTO v_cache_name, v_params + FROM cache c + JOIN cache_calc ca ON c.id = ca.cache_id + WHERE ca.id = v_calc; + + IF v_cache_name IS NOT NULL THEN + DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); + END IF; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7057,88 +7124,88 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_calc_start`(OUT `v_calc` INT, INOUT `v_refresh` INT, IN `v_cache_name` VARCHAR(50), IN `v_params` VARCHAR(100)) -proc: BEGIN - DECLARE v_valid BOOL; - DECLARE v_lock_id VARCHAR(100); - DECLARE v_cache_id INT; - DECLARE v_expires DATETIME; - DECLARE v_clean_time DATETIME; - - DECLARE EXIT HANDLER FOR SQLEXCEPTION - BEGIN - IF v_lock_id IS NOT NULL THEN - DO RELEASE_LOCK(v_lock_id); - END IF; - - RESIGNAL; - END; - - SET v_params = IFNULL(v_params, ''); - - -- Si el servidor se ha reiniciado invalida todos los calculos. - - SELECT COUNT(*) > 0 INTO v_valid FROM cache_valid; - - IF !v_valid - THEN - DELETE FROM cache_calc; - INSERT INTO cache_valid (valid) VALUES (TRUE); - END IF; - - -- Obtiene un bloqueo exclusivo para que no haya problemas de concurrencia. - - SET v_lock_id = CONCAT_WS('/', v_cache_name, v_params); - - IF !GET_LOCK(v_lock_id, 30) - THEN - SET v_calc = NULL; - SET v_refresh = FALSE; - LEAVE proc; - END IF; - - -- Comprueba si el calculo solicitado existe y esta actualizado. - - SELECT c.id, ca.id, ca.expires - INTO v_cache_id, v_calc, v_expires - FROM cache c - LEFT JOIN cache_calc ca - ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci' - WHERE c.name = v_cache_name COLLATE 'utf8_general_ci'; - - -- Si existe una calculo valido libera el bloqueo y devuelve su identificador. - - IF !v_refresh AND NOW() < v_expires - THEN - DO RELEASE_LOCK(v_lock_id); - SET v_refresh = FALSE; - LEAVE proc; - END IF; - - -- Si el calculo no existe le crea una entrada en la tabla de calculos. - - IF v_calc IS NULL - THEN - INSERT INTO cache_calc SET - cache_id = v_cache_id, - cacheName = v_cache_name, - params = v_params, - last_refresh = NULL, - expires = NULL, - connection_id = CONNECTION_ID(); - - SET v_calc = LAST_INSERT_ID(); - ELSE - UPDATE cache_calc - SET - last_refresh = NULL, - expires = NULL, - connection_id = CONNECTION_ID() - WHERE id = v_calc; - END IF; - - -- Si se debe recalcular mantiene el bloqueo y devuelve su identificador. - - SET v_refresh = TRUE; +proc: BEGIN + DECLARE v_valid BOOL; + DECLARE v_lock_id VARCHAR(100); + DECLARE v_cache_id INT; + DECLARE v_expires DATETIME; + DECLARE v_clean_time DATETIME; + + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + IF v_lock_id IS NOT NULL THEN + DO RELEASE_LOCK(v_lock_id); + END IF; + + RESIGNAL; + END; + + SET v_params = IFNULL(v_params, ''); + + -- Si el servidor se ha reiniciado invalida todos los calculos. + + SELECT COUNT(*) > 0 INTO v_valid FROM cache_valid; + + IF !v_valid + THEN + DELETE FROM cache_calc; + INSERT INTO cache_valid (valid) VALUES (TRUE); + END IF; + + -- Obtiene un bloqueo exclusivo para que no haya problemas de concurrencia. + + SET v_lock_id = CONCAT_WS('/', v_cache_name, v_params); + + IF !GET_LOCK(v_lock_id, 30) + THEN + SET v_calc = NULL; + SET v_refresh = FALSE; + LEAVE proc; + END IF; + + -- Comprueba si el calculo solicitado existe y esta actualizado. + + SELECT c.id, ca.id, ca.expires + INTO v_cache_id, v_calc, v_expires + FROM cache c + LEFT JOIN cache_calc ca + ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci' + WHERE c.name = v_cache_name COLLATE 'utf8_general_ci'; + + -- Si existe una calculo valido libera el bloqueo y devuelve su identificador. + + IF !v_refresh AND NOW() < v_expires + THEN + DO RELEASE_LOCK(v_lock_id); + SET v_refresh = FALSE; + LEAVE proc; + END IF; + + -- Si el calculo no existe le crea una entrada en la tabla de calculos. + + IF v_calc IS NULL + THEN + INSERT INTO cache_calc SET + cache_id = v_cache_id, + cacheName = v_cache_name, + params = v_params, + last_refresh = NULL, + expires = NULL, + connection_id = CONNECTION_ID(); + + SET v_calc = LAST_INSERT_ID(); + ELSE + UPDATE cache_calc + SET + last_refresh = NULL, + expires = NULL, + connection_id = CONNECTION_ID() + WHERE id = v_calc; + END IF; + + -- Si se debe recalcular mantiene el bloqueo y devuelve su identificador. + + SET v_refresh = TRUE; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7156,24 +7223,24 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_calc_unlock`(IN `v_calc` INT) -proc: BEGIN - DECLARE v_cache_name VARCHAR(50); - DECLARE v_params VARCHAR(100); - - IF v_calc IS NULL THEN - LEAVE proc; - END IF; - - SELECT c.name, ca.params INTO v_cache_name, v_params - FROM cache c - JOIN cache_calc ca ON c.id = ca.cache_id - WHERE ca.id = v_calc; - - DELETE FROM cache_calc WHERE id = v_calc; - - IF v_cache_name IS NOT NULL THEN - DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); - END IF; +proc: BEGIN + DECLARE v_cache_name VARCHAR(50); + DECLARE v_params VARCHAR(100); + + IF v_calc IS NULL THEN + LEAVE proc; + END IF; + + SELECT c.name, ca.params INTO v_cache_name, v_params + FROM cache c + JOIN cache_calc ca ON c.id = ca.cache_id + WHERE ca.id = v_calc; + + DELETE FROM cache_calc WHERE id = v_calc; + + IF v_cache_name IS NOT NULL THEN + DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); + END IF; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7192,9 +7259,9 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_clean`() NO SQL -BEGIN - CALL available_clean; - CALL visible_clean; +BEGIN + CALL available_clean; + CALL visible_clean; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7212,13 +7279,13 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `clean`() -BEGIN - - DECLARE vDateShort DATETIME; - - SET vDateShort = TIMESTAMPADD(MONTH, -1, CURDATE()); - - DELETE FROM cache.departure_limit WHERE Fecha < vDateShort; +BEGIN + + DECLARE vDateShort DATETIME; + + SET vDateShort = TIMESTAMPADD(MONTH, -1, CURDATE()); + + DELETE FROM cache.departure_limit WHERE Fecha < vDateShort; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7880,6 +7947,20 @@ DROP TABLE IF EXISTS `VMPSettings`; CREATE TABLE `VMPSettings` ( `VMPID` int(11) NOT NULL, `MessageID` int(11) NOT NULL, + `dateTimeTry` timestamp NULL DEFAULT NULL, + `isVmpBA` tinyint(4) DEFAULT NULL COMMENT 'Basic authentication', + `vmpVersion` int(11) DEFAULT NULL, + `vmpUrl` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `loginName` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, + `loginPassword` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL, + `refreshRate` int(11) DEFAULT NULL, + `eanBuyer` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `eanSupplier` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `eanAgent` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, + `dateTimeLastSync` timestamp NULL DEFAULT NULL, + `closedFrom` int(11) DEFAULT NULL, + `closedTo` int(11) DEFAULT NULL, + `totalRefreshHours` int(11) DEFAULT NULL, PRIMARY KEY (`VMPID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -8276,7 +8357,6 @@ CREATE TABLE `item_groupToOffer` ( KEY `item_groupToOffer_fk2_idx` (`itemTypeFk`), KEY `item_groupToOffer_fk3_idx` (`intrastatFk`), KEY `item_groupToOffer_fk4_idx` (`originFk`), - CONSTRAINT `item_groupToOffer_fk1` FOREIGN KEY (`group_code`) REFERENCES `item_group` (`group_code`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `item_groupToOffer_fk2` FOREIGN KEY (`itemTypeFk`) REFERENCES `vn`.`itemType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `item_groupToOffer_fk3` FOREIGN KEY (`intrastatFk`) REFERENCES `vn`.`intrastat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `item_groupToOffer_fk4` FOREIGN KEY (`originFk`) REFERENCES `vn`.`origin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -8455,11 +8535,11 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!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' */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `edi`.`putOrder_AFTER_UPDATE` AFTER UPDATE ON `putOrder` FOR EACH ROW BEGIN @@ -8484,7 +8564,8 @@ BEGIN CONCAT(account.user_getNameFromId(c.salesPersonFk), '@verdnatura.es') ), 'Producto no disponible en Floramondo', - CONCAT('El artículo ', s.concept, ' del ticket ', t.id , ' ha sido cancelado por Floramondo. ', ' Se ha actualizado la cantidad a 0. ', + CONCAT('El artículo ', s.concept, ' del ticket ', t.id , ' ha sido cancelado por Floramondo. ', + ' Se ha actualizado la cantidad de ', OLD.quantity,' a 0. ', IF (u.id IS NOT NULL AND c.email IS NOT NULL , CONCAT('https://verdnatura.es/#!form=ecomerce%2Fticket&ticket=', t.id ), CONCAT('https://salix.verdnatura.es/#!/ticket/', t.id ,'/summary'))) @@ -8642,13 +8723,16 @@ CREATE TABLE `supplyResponse` ( `MarketPlaceID` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `MarketFormCode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '"002" Standard Sales\n"005" Catalogue (optional)\n"001" Committed (optional)\n"003" Buffer (optional, Clock Pre Sales) ', `FlowerColor` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `vmpID` int(11) DEFAULT NULL, PRIMARY KEY (`ID`), UNIQUE KEY `ID_UNIQUE` (`ID`), KEY `IX_TransNumber` (`TransactionNumber`) COMMENT 'Agregado por Ernesto 11.6.2019\nSe ejecutaba 1 consulta por segundo desde MAIL y consumia un 20% de CPU de todo el servidor !!!!!\nCPU usada es mas estable que Indice en SendererID, cpu vs espacio que ocupa?\n', KEY `supplyResponse_Ix1` (`Item_ArticleCode`), KEY `supplyResponseMarcketIdx` (`MarketPlaceID`), KEY `supplyResponseNumberOfUnitsIdx` (`NumberOfUnits`), - KEY `supplyResponseEmbalageCodeIdx` (`EmbalageCode`) + KEY `supplyResponseEmbalageCodeIdx` (`EmbalageCode`), + KEY `supplyResponseputOrder_FK` (`vmpID`), + CONSTRAINT `supplyResponseputOrder_FK` FOREIGN KEY (`vmpID`) REFERENCES `VMPSettings` (`VMPID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -9230,154 +9314,154 @@ CREATE DEFINER=`root`@`%` PROCEDURE `exchange_new`( IN `vAuction` SMALLINT, IN `vPackage` INT, IN `vPutOrderFk` INT) -BEGIN +BEGIN /** * Adds a new exchange, generates it's barcode and * inserts/updates the transaction. When the referenced * transaction exists as provisional, updates it with - * the new values. - */ - DECLARE vEkt INT; - DECLARE vRewriteKop INT DEFAULT NULL; - DECLARE vBarcode CHAR(15) DEFAULT NULL; - DECLARE vIsDuplicated BOOL; + * the new values. + */ + DECLARE vEkt INT; + DECLARE vRewriteKop INT DEFAULT NULL; + DECLARE vBarcode CHAR(15) DEFAULT NULL; + DECLARE vIsDuplicated BOOL; DECLARE vUpdateExistent BOOL DEFAULT FALSE; - DECLARE duplicateKey CONDITION FOR 1062; - - DECLARE CONTINUE HANDLER FOR duplicateKey - SET vIsDuplicated = TRUE; - - -- Generates the barcode - - IF vAgj != 0 AND vAgj IS NOT NULL - THEN - SET vBarcode = CONCAT( - LPAD(vAuction, 2, 0), - LPAD(IFNULL(vClock, 99), 2, 0), - LPAD(DAYOFYEAR(vDate), 3, 0), - IF(vClock IS NULL OR vClock = 99, - LPAD(vAgj, 7, 0), - CONCAT(LPAD(vAgj, 5, 0), '01') - ), - '0' - ); - END IF; - - -- Rewrites the kop parameter - - IF vKop IS NULL THEN - SELECT defaultKop INTO vKop FROM exchangeConfig; - END IF; - - SELECT e.kop INTO vRewriteKop - FROM mailSender e - JOIN mail m ON m.senderFk = e.id - WHERE m.id = vMailFk; - - SET vKop = IFNULL(vRewriteKop, vKop); - - -- Inserts the new transaction + DECLARE duplicateKey CONDITION FOR 1062; - SET vIsDuplicated = FALSE; - INSERT INTO ekt SET - barcode = IFNULL(vBarcode, barcode) - ,deliveryNumber = vDeliveryNumber - ,entryYear = YEAR(vDate) - ,fec = vDate - ,hor = vHour - ,ref = vRef - ,item = vItem - ,agj = vAgj - ,cat = vCat - ,pac = vPac - ,sub = vSub - ,kop = vKop - ,ptd = vPtd - ,pro = vPro - ,ori = vOrigin - ,ptj = vPtj - ,qty = vQuantiy - ,pri = vPrice - ,klo = vClock - ,s1 = vS1 - ,s2 = vS2 - ,s3 = vS3 - ,s4 = vS4 - ,s5 = vS5 - ,s6 = vS6 - ,k1 = vK1 - ,k2 = vK2 - ,k3 = vP1 - ,k4 = vP2 - ,auction = vAuction - ,package = vPackage - ,putOrderFk = vPutOrderFk; - - -- If it exists duplicado updates it - - IF NOT vIsDuplicated - THEN - SET vEkt = LAST_INSERT_ID(); - CALL ekt_load (vEkt); - - ELSEIF vDeliveryNumber != 0 - AND vDeliveryNumber IS NOT NULL - THEN - SELECT id INTO vEkt - FROM ekt - WHERE deliveryNumber = vDeliveryNumber; - - SELECT COUNT(*) = 0 INTO vUpdateExistent - FROM ekt t - JOIN `exchange` b ON b.ektFk = t.id - JOIN exchangeConfig c - WHERE t.deliveryNumber = vDeliveryNumber - AND t.entryYear = YEAR(vDate) - AND b.typeFk != c.presaleFk; - END IF; - - IF vUpdateExistent - THEN - UPDATE ekt SET - barcode = IFNULL(vBarcode, barcode) - ,fec = vDate - ,hor = vHour - ,ref = vRef - ,item = vItem - ,agj = vAgj - ,cat = vCat - ,pac = vPac - ,sub = vSub - ,kop = vKop - ,ptd = vPtd - ,pro = vPro - ,ori = vOrigin - ,ptj = vPtj - ,qty = vQuantiy - ,pri = vPrice - ,klo = vClock - ,s1 = vS1 - ,s2 = vS2 - ,s3 = vS3 - ,s4 = vS4 - ,s5 = vS5 - ,s6 = vS6 - ,k1 = vK1 - ,k2 = vK2 - ,k3 = vP1 - ,k4 = vP2 - ,auction = vAuction - ,package = vPackage - ,putOrderFk = IFNULL(vPutOrderFk, putOrderFk) - WHERE id = vEkt; - END IF; - - -- Registers the exchange - - INSERT INTO `exchange` SET - mailFk = vMailFk - ,typeFk = vType - ,ektFk = vEkt; + DECLARE CONTINUE HANDLER FOR duplicateKey + SET vIsDuplicated = TRUE; + + -- Generates the barcode + + IF vAgj != 0 AND vAgj IS NOT NULL + THEN + SET vBarcode = CONCAT( + LPAD(vAuction, 2, 0), + LPAD(IFNULL(vClock, 99), 2, 0), + LPAD(DAYOFYEAR(vDate), 3, 0), + IF(vClock IS NULL OR vClock = 99, + LPAD(vAgj, 7, 0), + CONCAT(LPAD(vAgj, 5, 0), '01') + ), + '0' + ); + END IF; + + -- Rewrites the kop parameter + + IF vKop IS NULL THEN + SELECT defaultKop INTO vKop FROM exchangeConfig; + END IF; + + SELECT e.kop INTO vRewriteKop + FROM mailSender e + JOIN mail m ON m.senderFk = e.id + WHERE m.id = vMailFk; + + SET vKop = IFNULL(vRewriteKop, vKop); + + -- Inserts the new transaction + + SET vIsDuplicated = FALSE; + INSERT INTO ekt SET + barcode = IFNULL(vBarcode, barcode) + ,deliveryNumber = vDeliveryNumber + ,entryYear = YEAR(vDate) + ,fec = vDate + ,hor = vHour + ,ref = vRef + ,item = vItem + ,agj = vAgj + ,cat = vCat + ,pac = vPac + ,sub = vSub + ,kop = vKop + ,ptd = vPtd + ,pro = vPro + ,ori = vOrigin + ,ptj = vPtj + ,qty = vQuantiy + ,pri = vPrice + ,klo = vClock + ,s1 = vS1 + ,s2 = vS2 + ,s3 = vS3 + ,s4 = vS4 + ,s5 = vS5 + ,s6 = vS6 + ,k1 = vK1 + ,k2 = vK2 + ,k3 = vP1 + ,k4 = vP2 + ,auction = vAuction + ,package = vPackage + ,putOrderFk = vPutOrderFk; + + -- If it exists duplicado updates it + + IF NOT vIsDuplicated + THEN + SET vEkt = LAST_INSERT_ID(); + CALL ekt_load (vEkt); + + ELSEIF vDeliveryNumber != 0 + AND vDeliveryNumber IS NOT NULL + THEN + SELECT id INTO vEkt + FROM ekt + WHERE deliveryNumber = vDeliveryNumber; + + SELECT COUNT(*) = 0 INTO vUpdateExistent + FROM ekt t + JOIN `exchange` b ON b.ektFk = t.id + JOIN exchangeConfig c + WHERE t.deliveryNumber = vDeliveryNumber + AND t.entryYear = YEAR(vDate) + AND b.typeFk != c.presaleFk; + END IF; + + IF vUpdateExistent + THEN + UPDATE ekt SET + barcode = IFNULL(vBarcode, barcode) + ,fec = vDate + ,hor = vHour + ,ref = vRef + ,item = vItem + ,agj = vAgj + ,cat = vCat + ,pac = vPac + ,sub = vSub + ,kop = vKop + ,ptd = vPtd + ,pro = vPro + ,ori = vOrigin + ,ptj = vPtj + ,qty = vQuantiy + ,pri = vPrice + ,klo = vClock + ,s1 = vS1 + ,s2 = vS2 + ,s3 = vS3 + ,s4 = vS4 + ,s5 = vS5 + ,s6 = vS6 + ,k1 = vK1 + ,k2 = vK2 + ,k3 = vP1 + ,k4 = vP2 + ,auction = vAuction + ,package = vPackage + ,putOrderFk = IFNULL(vPutOrderFk, putOrderFk) + WHERE id = vEkt; + END IF; + + -- Registers the exchange + + INSERT INTO `exchange` SET + mailFk = vMailFk + ,typeFk = vType + ,ektFk = vEkt; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -9388,9 +9472,9 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!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 ;; @@ -9402,6 +9486,8 @@ proc: BEGIN DECLARE vFreeId INT; DECLARE vSupplyResponseFk INT; DECLARE vLastInserted DATETIME; + DECLARE vVNH_WarehouseFk INT; + DECLARE vFloramondo_WarehouseFk INT; DECLARE cur1 CURSOR FOR SELECT id @@ -9419,6 +9505,14 @@ proc: BEGIN END; START TRANSACTION; + + SELECT id INTO vVNH_WarehouseFk + FROM vn.warehouse + WHERE name = 'VNH'; + + SELECT id INTO vFloramondo_WarehouseFk + FROM vn.warehouse + WHERE name = 'Floramondo'; -- select now(),'Antes de borrar'; DELETE itf.* FROM edi.item_free itf @@ -9487,25 +9581,7 @@ proc: BEGIN AND (di.LatestOrderDateTime < NOW() OR di.ID IS NULL) AND it.isInventory ; - -- Actualizamos el campo supplyResponseFk para aquellos articulos que ya estan creados y reutilizamos -/* UPDATE IGNORE edi.offer o - LEFT JOIN vn.item iExist ON iExist.supplyResponseFk = o.srID - JOIN vn.item i - ON i.name = o.product_name - AND i.subname <=> o.company_name - AND i.value5 <=> o.s1Value - AND i.value6 <=> o.s2Value - AND i.value7 <=> o.s3Value - AND i.value8 <=> o.s4Value - AND i.value9 <=> o.s5Value - AND i.value10 <=> o.s6Value - AND i.NumberOfItemsPerCask <=> o.NumberOfItemsPerCask - AND i.EmbalageCode <=> o.EmbalageCode - AND i.quality <=> o.Quality - SET i.supplyResponseFk = o.srID - WHERE iExist.id IS NULL - ; - */ -- select now(),'Antes de crear ITO'; + -- select now(),'Antes de crear ITO'; DROP TEMPORARY TABLE IF EXISTS itemToInsert; CREATE TEMPORARY TABLE itemToInsert ENGINE = MEMORY SELECT o.*, CAST(NULL AS DECIMAL(6,0)) as itemFk @@ -9672,9 +9748,12 @@ proc: BEGIN JOIN marketPlace mp ON mp.id = o.MarketPlaceID WHERE mp.isLatestOrderDateTimeRelevant; - SET @myEntry := vn.floramondo_getEntry(vLanded); + SET @myEntry := vn.floramondo_getEntry(vLanded, vVNH_WarehouseFk); + IF @myEntry THEN + SELECT @myEntry; + -- Elimina la oferta obsoleta DELETE b FROM vn.buy b JOIN vn.item i ON i.id = b.itemFk @@ -9734,7 +9813,79 @@ proc: BEGIN SELECT id from vn.buy where entryFk = @myEntry AND created >= vLastInserted; CALL vn.buy_recalcPrices(); + END IF; + /* + -- Ara la entrada per a Floramondo + SET @myFloramondoEntry := vn.floramondo_getEntry(vLanded, vFloramondo_WarehouseFk); + + IF @myFloramondoEntry THEN + + SELECT @myFloramondoEntry; + + -- Elimina la oferta obsoleta + DELETE b FROM vn.buy b + JOIN vn.item i ON i.id = b.itemFk + LEFT JOIN edi.offer o ON i.supplyResponseFk = o.`srId` + LEFT JOIN putOrder po ON b.deliveryFk = po.deliveryInformationID + WHERE b.entryFk = @myFloramondoEntry + AND o.`srId` IS NULL + AND po.id IS NULL; + + UPDATE vn.buy b + JOIN vn.item i ON i.id = b.itemFk + LEFT JOIN edi.offer o ON i.supplyResponseFk = o.`srId` + SET b.quantity = 0 + WHERE b.entryFk = @myFloramondoEntry + AND o.`srId` IS NULL; + + -- actualiza la oferta existente + UPDATE vn.buy b + JOIN vn.item i ON i.id = b.itemFk + JOIN edi.offer o ON i.supplyResponseFk = o.`srId` + SET b.quantity = o.NumberOfUnits * o.NumberOfItemsPerCask, + b.buyingValue = o.price + WHERE b.entryFk = @myFloramondoEntry + AND (b.quantity <> o.NumberOfUnits * o.NumberOfItemsPerCask OR b.buyingValue <> o.price); + + SET vLastInserted := NOW(); + -- Inserta la oferta + INSERT INTO vn.buy(entryFk, + itemFk, + quantity, + buyingValue, + stickers, + packing, + `grouping`, + groupingMode, + packageFk, + deliveryFk) + + SELECT @myFloramondoEntry, + i.id, + o.NumberOfUnits * o.NumberOfItemsPerCask as quantity, + o.Price, + o.NumberOfUnits as etiquetas, + o.NumberOfItemsPerCask as packing, + o.MinimumQuantity * o.NumberOfItemsPerCask as `grouping`, + 1, -- Obliga al Packing + o.embalageCode, + o.diId + FROM edi.offer o + JOIN vn.item i ON i.supplyResponseFk = o.srId + LEFT JOIN vn.buy b ON i.id = b.itemFk AND b.entryFk = @myFloramondoEntry + JOIN vn.packaging p ON p.id LIKE o.embalageCode -- llevar esta linea i mirar de crear els packages a temps real + WHERE b.id IS NULL; + + DROP TEMPORARY TABLE IF EXISTS tmp.buyRecalc; + CREATE TEMPORARY TABLE tmp.buyRecalc + SELECT id from vn.buy where entryFk = @myFloramondoEntry AND created >= vLastInserted; + + CALL vn.buy_recalcPrices(); + + + END IF; + */ DROP TEMPORARY TABLE edi.offer, itemToInsert; @@ -12156,30 +12307,30 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `item_listAllocation`(IN `vWh` TINYINT, IN `vDate` DATE, IN `vType` INT, IN `vPrefix` VARCHAR(255), IN `vUseIds` BOOLEAN) -BEGIN -/** - * Lists visible items and it's box sizes of the specified - * type at specified date. - * - * @param vWh The warehouse id - * @param vDate The visible date - * @param vType The type id - * @param vPrefix The article prefix to filter or %NULL for all - * @param vUseIds Whether to order the result by item id - * @select List of visible items with it's box sizes - */ - CALL item_getVisible(vWh, vDate, vType, vPrefix); - - IF vUseIds - THEN - SELECT * FROM tmp.itemVisible - ORDER BY Id_Article; - ELSE - SELECT * FROM tmp.itemVisible - ORDER BY Article, packing; - END IF; - - DROP TEMPORARY TABLE tmp.itemVisible; +BEGIN +/** + * Lists visible items and it's box sizes of the specified + * type at specified date. + * + * @param vWh The warehouse id + * @param vDate The visible date + * @param vType The type id + * @param vPrefix The article prefix to filter or %NULL for all + * @param vUseIds Whether to order the result by item id + * @select List of visible items with it's box sizes + */ + CALL item_getVisible(vWh, vDate, vType, vPrefix); + + IF vUseIds + THEN + SELECT * FROM tmp.itemVisible + ORDER BY Id_Article; + ELSE + SELECT * FROM tmp.itemVisible + ORDER BY Article, packing; + END IF; + + DROP TEMPORARY TABLE tmp.itemVisible; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -13677,9 +13828,10 @@ BEGIN END IF; UPDATE order_row SET Id_Movimiento = vSale WHERE id = vRowId; - + SELECT (warehouseInFk = vWarehouse) INTO vIsFloramondoWarehouse FROM vn.floramondoConfig; - IF vIsFloramondoWarehouse THEN + + IF vIsFloramondoWarehouse THEN INSERT INTO edi.putOrder (deliveryInformationID, supplyResponseId, quantity, @@ -13692,13 +13844,13 @@ BEGIN WHERE i.id = vItem -- AND di.LatestDeliveryDateTime > NOW() AND vAmount / sr.NumberOfItemsPerCask LIMIT 1; + END IF; END LOOP; CLOSE cRows; -- Fija el coste - DROP TEMPORARY TABLE IF EXISTS tComponents; CREATE TEMPORARY TABLE tComponents (INDEX (saleFk)) @@ -14113,11 +14265,11 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!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' */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `order_getTax`() READS SQL DATA @@ -14176,6 +14328,8 @@ BEGIN SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax FROM tmp.orderTax GROUP BY orderFk, `code`; + + DROP TEMPORARY TABLE tmp.addressTaxArea; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -17690,6 +17844,7 @@ TRUNCATE TABLE clientesProveedores; Nacion, Telefono, Telefono2, + CodigoTransaccion, CodigoRetencion, Email1, iban) @@ -17701,7 +17856,7 @@ TRUNCATE TABLE clientesProveedores; cl.street Domicilio, cl.accountingAccount CodigoCuenta, TRIM(IF(co.code = LEFT(cl.fi,2), MID(cl.fi,3, length(cl.fi)-1), cl.fi)) AS CifDni, - TRIM(CONCAT(co.code, IF(co.code = LEFT(cl.fi,2), MID(cl.fi,3, length(cl.fi)-1), cl.fi))) AS CifEuropeo, + IF(sn.NacionCEE,TRIM(CONCAT(co.code, IF(co.code = LEFT(cl.fi,2), MID(cl.fi,3, length(cl.fi)-1), cl.fi))) , "")AS CifEuropeo, cl.postcode CodigoPostal, cl.city Municipio, sp.CodigoProvincia CodigoProvincia, @@ -17710,12 +17865,14 @@ TRUNCATE TABLE clientesProveedores; IF (sn.SiglaNacion = "XB",IF(sp.CodigoProvincia IN (51,52), "XC",IF (sp.CodigoProvincia IN (35,38), "XB", sn.SiglaNacion)), sn.SiglaNacion) SiglaNacion, IF((cl.fi REGEXP '^([[:blank:]]|[[:digit:]])'), 'J','F') PersonaFisicaJuridica, IF((co.id = 1), 1, IF((co.isUeeMember = 1), 2, 4)) TipoDocumentoPersona, - IF(cl.isEqualizated, 'R', IF ((cl.isVies AND cl.countryFk <> 1) OR (NOT co.isUeeMember),'E','I'))AS CodigoIva, - IF(sn.SiglaNacion = "XB", IF(sp.CodigoProvincia IN (51,52), "CEUTA Y MELILLA", IF (sp.CodigoProvincia IN (35,38), "ISLAS CANARIAS",sn.Nacion)) , sn.Nacion) Nacion, + -- IF(cl.isEqualizated, 'R', IF ((cl.isVies AND cl.countryFk <> 1) OR (NOT co.isUeeMember),'E','I'))AS CodigoIva, + cl.taxTypeSageFk CodigoIva, + IF(sn.SiglaNacion = "XB", IF(sp.CodigoProvincia IN (51,52), "CEUTA Y MELILLA", IF (sp.CodigoProvincia IN (35,38), "ISLAS CANARIAS",sn.Nacion)) , sn.Nacion) Nacion, cl.phone Telefono, cl.mobile Telefono2, - 0 CodigoRetencion, - SUBSTR(cl.email, 1, LOCATE(',', CONCAT(cl.email,','))-1) Email1, + cl.transactionTypeSageFk CodigoTransaccion, + 0 CodigoRetencion, + SUBSTR(cl.email, 1, LOCATE(',', CONCAT(cl.email,','))-1) Email1, cl.iban iban FROM vn.client cl JOIN vn2008.v_xsubclien ON v_xsubclien.Id_Cliente = cl.id @@ -17734,7 +17891,7 @@ TRUNCATE TABLE clientesProveedores; s.street Domicilio, s.account CodigoCuenta, TRIM(IF(co.code = LEFT(s.nif,2), MID(s.nif,3, length(s.nif)-1), s.nif)) CifDni, - TRIM(CONCAT(co.code, IF(co.code = LEFT(s.nif,2), MID(s.nif,3, length(s.nif)-1), s.nif))) AS CifEuropeo, + IF(sn.NacionCEE,TRIM(CONCAT(co.code, IF(co.code = LEFT(s.nif,2), MID(s.nif,3, length(s.nif)-1), s.nif))), "") AS CifEuropeo, s.postCode CodigoPostal, s.city Municipio, sp.CodigoProvincia CodigoProvincia, @@ -17743,16 +17900,14 @@ TRUNCATE TABLE clientesProveedores; sn.SiglaNacion SiglaNacion, IF((s.nif REGEXP '^([[:blank:]]|[[:digit:]])'),'J','F') PersonaFisicaJuridica, IF((co.id = 1),1,IF((co.isUeeMember = 1), 2, 4)) TipoDocumentoPersona, - 'I' CodigoIva, + -- 'I' CodigoIva, + s.taxTypeSageFk CodigoIva, sn.Nacion Nacion, con.Telefono Telefono, con.Movil Telefono2, - CASE - WHEN s.account LIKE '_____4____' THEN 2 - WHEN s.account LIKE '_____3____' THEN 18 - ELSE 0 - END CodigoRetencion, - SUBSTR(con.email,1,(COALESCE(NULLIF(LOCATE(',', con.email), 0), 99) - 1)) Email1, + s.transactionTypeSageFk CodigoTransaccion, + s.withholdingSageFk CodigoRetencion, + SUBSTR(con.email,1,(COALESCE(NULLIF(LOCATE(',', con.email), 0), 99) - 1)) Email1, sa.iban iban FROM vn.supplier s JOIN vn2008.v_xsubprov xsp ON xsp.proveedor_id = s.id -- Proveedores activos los últimos 3 meses @@ -17793,8 +17948,8 @@ BEGIN TRUNCATE XDiario_movConta_IVA; DELETE FROM movConta WHERE enlazadoSage = FALSE ; - -- CALL clientesProveedoresAdd; - -- CALL planCuentasPgcAdd; + CALL clientesProveedoresAdd; + CALL planCuentasPgcAdd; CALL XDiario_movConta_IVA_InvoiceOutAdd_Manager; CALL XDiario_movConta_IVA_InvoiceInAdd_Manager; INSERT INTO movConta( @@ -17890,7 +18045,7 @@ BEGIN YEAR(x.FECHA) AS Ejercicio, IF (@@hostname = 'db', c.companyCode, companyCodeTest) AS CodigoEmpresa, -- ENT(2) c.companyCode AS CodigoEmpresa, x.ASIEN AS Asiento, -- LONG(4), nº ASIENTO - IF(EURODEBE IS NULL,"H","D") AS CargoAbono, -- VARCHAR(1) "D" debe ó "H" haber + IF(EURODEBE<>0 OR (EURODEBE=0 AND EUROHABER IS NULL),'D','H')AS CargoAbono, -- IF(EURODEBE IS NULL,"H","D") AS CargoAbono, VARCHAR(1) "D" debe ó "H" haber x.SUBCTA AS CodigoCuenta, -- VARCHAR(15) partida contable x.CONTRA AS Contrapartida, -- VARCHAR(15) partida contable x.FECHA AS FechaAsiento, -- FECHA(8) @@ -17898,7 +18053,7 @@ BEGIN IF(x.EURODEBE,x.EURODEBE,x.EUROHABER) AS ImporteAsiento, -- DOBLE(19) MONTH(x.FECHA) AS NumeroPeriodo, -- ENT(2) "-1" Al informar este valor se calcula automát. A partir de la fecha de asiento IF( sub2.FECREGCON IS NULL, sub2.FECHA_EX, sub2.FECREGCON) FechaGrabacion, -- FECHA(8) - IFNULL(xmi.CodigoDivisa, cu.code) CodigoDivisa, -- VARCHAR(3) + IFNULL(xmi.CodigoDivisa, sub3.code) CodigoDivisa, -- VARCHAR(3) x.CAMBIO AS ImporteCambio, -- DOBLE(19) IFNULL(x.DEBEME,x.HABERME) AS ImporteDivisa, -- DOBLE(19) IF(x.CAMBIO,1,0) AS FactorCambio, -- DOBLE(19) @@ -17982,8 +18137,10 @@ BEGIN ORDER BY ASIEN, FECREGCON DESC, FECHA_EX DESC ) sub GROUP BY ASIEN )sub2 ON sub2.ASIEN = x.ASIEN - LEFT JOIN vn.bank b ON b.account = x.SUBCTA - LEFT JOIN vn.currency cu ON cu.id = b.currencyFk + LEFT JOIN ( SELECT DISTINCT(account),cu.code + FROM vn.bank b + JOIN vn.currency cu ON cu.id = b.currencyFk + )sub3 ON sub3.account = x.SUBCTA WHERE x.enlazadoSage = 0 AND c.companyCode; @@ -19078,7 +19235,7 @@ BEGIN SET xmi.CodigoRetencion = t.CodigoRetencion, xmi.BaseRetencion = IF (t.CodigoRetencion = 2, sub.taxableBase + sub.taxBase, sub.taxableBase), xmi.PorRetencion = t.PorcentajeRetencion, - xmi.ImporteRetencion = iit.taxableBase + xmi.ImporteRetencion = iit.taxableBase * - 1 WHERE xmi.id = vXDiarioId AND iit.expenceFk= 4751000000 ; END ;; @@ -19353,6 +19510,169 @@ BEGIN DROP TEMPORARY TABLE tmp.invoiceDua; DROP TEMPORARY TABLE tmp.invoiceInList; + + -- ASIENTOS CON IVA SOPORTADO 472. y 477. hay que informar 2 líneas la info de facturas una como tipo de factura emitida y otra como recibida + DROP TEMPORARY TABLE IF EXISTS tmp.XDiario_movConta_IVA; + CREATE TEMPORARY TABLE tmp.XDiario_movConta_IVA + SELECT + sub3.id, + mc.CodigoDivisa, + mc.BaseIva1, + mc.PorBaseCorrectora1, + mc.PorIva1, + mc.CuotaIva1, + mc.PorRecargoEquivalencia1, + mc.RecargoEquivalencia1, + mc.CodigoTransaccion1, + mc.CodigoIva1, + mc.BaseIva2, + mc.PorBaseCorrectora2, + mc.PorIva2, + mc.CuotaIva2, + mc.PorRecargoEquivalencia2, + mc.RecargoEquivalencia2, + mc.CodigoTransaccion2, + mc.CodigoIva2, + mc.BaseIva3, + mc.PorBaseCorrectora3, + mc.PorIva3, + mc.CuotaIva3, + mc.PorRecargoEquivalencia3, + mc.RecargoEquivalencia3, + mc.CodigoTransaccion3, + mc.CodigoIva3, + mc.BaseIva4, + mc.PorBaseCorrectora4, + mc.PorIva4, + mc.CuotaIva4, + mc.PorRecargoEquivalencia4, + mc.RecargoEquivalencia4, + mc.CodigoTransaccion4, + mc.CodigoIva4, + mc.Año, + mc.Serie, + mc.Factura, + mc.SuFacturaNo, + mc.FechaFactura, + mc.ImporteFactura, + 'E', + mc.CodigoCuentaFactura, + mc.CifDni, + mc.Nombre, + mc.CodigoRetencion, + mc.BaseRetencion, + mc.PorRetencion, + mc.ImporteRetencion, + mc.SiglaNacion, + mc.EjercicioFactura, + mc.FechaOperacion, + mc.Exclusion347, + mc.MantenerAsiento, + mc.Metalico347, + mc.ClaveOperacionFactura, + mc.TipoRectificativa, + mc.FechaFacturaOriginal, + mc.CuotaIvaOriginal, + mc.BaseImponibleOriginal, + mc.ClaseAbonoRectificativas, + mc.RecargoEquivalenciaOriginal, + mc.LibreA1, + mc.IvaDeducible1, + mc.IvaDeducible2, + mc.IvaDeducible3, + mc.IvaDeducible4, + mc.FechaGrabacion, + mc.Intracomunitaria, + mc.moveData + FROM sage.XDiario_movConta_IVA mc + JOIN vn.XDiario x ON x.id = mc.id + JOIN (SELECT x.ASIEN, x.id + FROM vn.XDiario x + JOIN(SELECT DISTINCT(x.ASIEN) ASIEN + FROM (SELECT DISTINCT(ASIEN) + FROM vn.XDiario x + WHERE SUBCTA LIKE '472%' AND x.enlazadoSage = FALSE + ) sub JOIN vn.XDiario x ON x.ASIEN = sub.ASIEN + WHERE x.SUBCTA LIKE '477%' + )sub2 ON sub2.ASIEN = x.ASIEN + WHERE x.CONTRA IS NOT NULL AND x.SUBCTA LIKE '477%' + GROUP BY x.ASIEN + )sub3 ON sub3.ASIEN = x.ASIEN; + + INSERT INTO sage.XDiario_movConta_IVA + (`id`, + `CodigoDivisa`, + `BaseIva1`, + `PorBaseCorrectora1`, + `PorIva1`, + `CuotaIva1`, + `PorRecargoEquivalencia1`, + `RecargoEquivalencia1`, + `CodigoTransaccion1`, + `CodigoIva1`, + `BaseIva2`, + `PorBaseCorrectora2`, + `PorIva2`, + `CuotaIva2`, + `PorRecargoEquivalencia2`, + `RecargoEquivalencia2`, + `CodigoTransaccion2`, + `CodigoIva2`, + `BaseIva3`, + `PorBaseCorrectora3`, + `PorIva3`, + `CuotaIva3`, + `PorRecargoEquivalencia3`, + `RecargoEquivalencia3`, + `CodigoTransaccion3`, + `CodigoIva3`, + `BaseIva4`, + `PorBaseCorrectora4`, + `PorIva4`, + `CuotaIva4`, + `PorRecargoEquivalencia4`, + `RecargoEquivalencia4`, + `CodigoTransaccion4`, + `CodigoIva4`, + `Año`, + `Serie`, + `Factura`, + `SuFacturaNo`, + `FechaFactura`, + `ImporteFactura`, + `TipoFactura`, + `CodigoCuentaFactura`, + `CifDni`, + `Nombre`, + `CodigoRetencion`, + `BaseRetencion`, + `PorRetencion`, + `ImporteRetencion`, + `SiglaNacion`, + `EjercicioFactura`, + `FechaOperacion`, + `Exclusion347`, + `MantenerAsiento`, + `Metalico347`, + `ClaveOperacionFactura`, + `TipoRectificativa`, + `FechaFacturaOriginal`, + `CuotaIvaOriginal`, + `BaseImponibleOriginal`, + `ClaseAbonoRectificativas`, + `RecargoEquivalenciaOriginal`, + `LibreA1`, + `IvaDeducible1`, + `IvaDeducible2`, + `IvaDeducible3`, + `IvaDeducible4`, + `FechaGrabacion`, + `Intracomunitaria`, + `moveData`) + SELECT * + FROM tmp.XDiario_movConta_IVA; + DROP TEMPORARY TABLE tmp.XDiario_movConta_IVA; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -20050,6 +20370,24 @@ SET character_set_client = utf8; 1 AS `roleId`*/; SET character_set_client = @saved_cs_client; +-- +-- Temporary table structure for view `User` +-- + +DROP TABLE IF EXISTS `User`; +/*!50001 DROP VIEW IF EXISTS `User`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `User` AS SELECT + 1 AS `id`, + 1 AS `realm`, + 1 AS `username`, + 1 AS `password`, + 1 AS `email`, + 1 AS `emailVerified`, + 1 AS `verificationToken`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `fieldAcl` -- @@ -20067,25 +20405,6 @@ CREATE TABLE `fieldAcl` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `user` --- - -DROP TABLE IF EXISTS `user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `realm` varchar(512) CHARACTER SET utf8 DEFAULT NULL, - `username` varchar(512) CHARACTER SET utf8 DEFAULT NULL, - `password` varchar(512) CHARACTER SET utf8 NOT NULL, - `email` varchar(512) CHARACTER SET utf8 NOT NULL, - `emailVerified` tinyint(1) DEFAULT NULL, - `verificationToken` varchar(512) CHARACTER SET utf8 DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `userConfigView` -- @@ -20728,8 +21047,8 @@ DELIMITER ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `log_add_beta__`(IN `vTableName` VARCHAR(255), IN `vNewId` VARCHAR(255), IN `vOldId` VARCHAR(255)) -proc: BEGIN - -- XXX: Disabled while testing +proc: BEGIN + -- XXX: Disabled while testing DECLARE vLanded DATE; DECLARE vWarehouseFk INT; DECLARE vBuyerFk INT; @@ -20737,20 +21056,20 @@ proc: BEGIN DECLARE vItemFk INT; DECLARE vItemName VARCHAR(50); - -- LEAVE proc; + -- LEAVE proc; - IF vOldId IS NOT NULL AND !(vOldId <=> vNewId) THEN - INSERT IGNORE INTO `log` SET - tableName = vTableName, - tableId = vOldId, - operation = 'delete'; - END IF; - - IF vNewId IS NOT NULL THEN - INSERT IGNORE INTO `log` SET - tableName = vTableName, - tableId = vNewId, - operation = 'insert'; + IF vOldId IS NOT NULL AND !(vOldId <=> vNewId) THEN + INSERT IGNORE INTO `log` SET + tableName = vTableName, + tableId = vOldId, + operation = 'delete'; + END IF; + + IF vNewId IS NOT NULL THEN + INSERT IGNORE INTO `log` SET + tableName = vTableName, + tableId = vNewId, + operation = 'insert'; END IF; IF vTableName = 'buy' THEN @@ -20780,7 +21099,7 @@ proc: BEGIN END IF; END IF; - + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -21048,29 +21367,29 @@ CREATE DEFINER=`root`@`%` PROCEDURE `log_refreshSale`( BEGIN DROP TEMPORARY TABLE IF EXISTS tValues; CREATE TEMPORARY TABLE tValues - ENGINE = MEMORY - SELECT - m.id saleFk, - m.ticketFk, - m.itemFk, - t.warehouseFk, - t.shipped, + ENGINE = MEMORY + SELECT + m.id saleFk, + m.ticketFk, + m.itemFk, + t.warehouseFk, + t.shipped, ABS(m.quantity) quantity, m.created, TIMESTAMPADD(DAY, tp.life, t.shipped) expired, m.quantity < 0 isIn, - m.isPicked OR s.alertLevel > 1 isPicked - FROM vn.sale m - JOIN vn.ticket t ON t.id = m.ticketFk + m.isPicked OR s.alertLevel > 1 isPicked + FROM vn.sale m + JOIN vn.ticket t ON t.id = m.ticketFk JOIN vn.ticketState s ON s.ticketFk = t.id JOIN vn.item i ON i.id = m.itemFk - JOIN vn.itemType tp ON tp.id = i.typeFk + JOIN vn.itemType tp ON tp.id = i.typeFk WHERE ( - vTableId IS NULL - OR (vTableName = 'ticket' AND t.id = vTableId) - OR (vTableName = 'sale' AND m.id = vTableId) - ) - AND t.shipped >= vn.getInventoryDate() + vTableId IS NULL + OR (vTableName = 'ticket' AND t.id = vTableId) + OR (vTableName = 'sale' AND m.id = vTableId) + ) + AND t.shipped >= vn.getInventoryDate() AND m.quantity != 0; REPLACE INTO inbound ( @@ -21103,7 +21422,7 @@ BEGIN FROM tValues WHERE !isIn; - DROP TEMPORARY TABLE tValues; + DROP TEMPORARY TABLE tValues; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -21530,6 +21849,7 @@ DROP TABLE IF EXISTS `version`; CREATE TABLE `version` ( `code` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `number` char(11) COLLATE utf8_unicode_ci NOT NULL, + `gitCommit` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -21546,6 +21866,7 @@ CREATE TABLE `versionUser` ( `code` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `user` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `number` char(11) COLLATE utf8_unicode_ci NOT NULL, + `gitCommit` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`code`,`user`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -22788,6 +23109,23 @@ SET character_set_client = utf8; 1 AS `holidayEntitlementRate`*/; SET character_set_client = @saved_cs_client; +-- +-- Temporary table structure for view `accounting` +-- + +DROP TABLE IF EXISTS `accounting`; +/*!50001 DROP VIEW IF EXISTS `accounting`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `accounting` AS SELECT + 1 AS `id`, + 1 AS `bank`, + 1 AS `account`, + 1 AS `accountingTypeFk`, + 1 AS `entityFk`, + 1 AS `isActive`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `accountingType` -- @@ -23380,6 +23718,7 @@ CREATE TABLE `botanicExport` ( `restriction` enum('Sin restriccion','Importacion Prohibida','pasaporte fitosanitario','pasaporte individual','declaracion origen') CHARACTER SET utf8 NOT NULL, `description` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `isProtectedZone` tinyint(1) NOT NULL DEFAULT '0', + `code` enum('importProhibited','phytosanitaryPassport','individualPassport') COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `Id_Paises` (`countryFk`), KEY `botanicExport_ibfk_2_idx` (`ediGenusFk`), @@ -23725,6 +24064,19 @@ CREATE TABLE `buyMark` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Temporary table structure for view `buyer` +-- + +DROP TABLE IF EXISTS `buyer`; +/*!50001 DROP VIEW IF EXISTS `buyer`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `buyer` AS SELECT + 1 AS `userFk`, + 1 AS `nickname`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `calendar` -- @@ -24796,6 +25148,26 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +-- +-- Table structure for table `cmr_expeditionPallet` +-- + +DROP TABLE IF EXISTS `cmr_expeditionPallet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `cmr_expeditionPallet` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cmrFk` int(11) NOT NULL, + `expeditionPalletFk` int(11) NOT NULL, + `scanned` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `cmr_expeditionPallet_fk1_idx` (`cmrFk`), + KEY `cmr_expeditionPallet_fk2_idx` (`expeditionPalletFk`), + CONSTRAINT `cmr_expeditionPallet_fk1` FOREIGN KEY (`cmrFk`) REFERENCES `cmr` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `cmr_expeditionPallet_fk2` FOREIGN KEY (`expeditionPalletFk`) REFERENCES `expeditionPallet` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='relaciona los cmr con los pallets de expediciones'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Temporary table structure for view `cmr_list` -- @@ -24828,6 +25200,7 @@ SET character_set_client = utf8; 1 AS `warehouseAddress`, 1 AS `shipped`, 1 AS `clientOficialName`, + 1 AS `supplierFk`, 1 AS `carrierName`, 1 AS `carrierStreet`, 1 AS `carrierPostCode`, @@ -25366,7 +25739,9 @@ CREATE TABLE `country` ( `isUeeMember` tinyint(4) NOT NULL DEFAULT '0', `ibanLength` tinyint(4) DEFAULT NULL, PRIMARY KEY (`id`), - KEY `Id_Paisreal` (`politicalCountryFk`) + KEY `Id_Paisreal` (`politicalCountryFk`), + KEY `currency_id_fk_idx` (`currencyFk`), + CONSTRAINT `currency_id_fk` FOREIGN KEY (`currencyFk`) REFERENCES `currency` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; @@ -26673,13 +27048,13 @@ CREATE TABLE `entryLog` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `entryShelving` +-- Table structure for table `entryShelving__` -- -DROP TABLE IF EXISTS `entryShelving`; +DROP TABLE IF EXISTS `entryShelving__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `entryShelving` ( +CREATE TABLE `entryShelving__` ( `id` int(11) NOT NULL AUTO_INCREMENT, `entryFk` int(11) NOT NULL DEFAULT '204539', `shelvingFk` varchar(10) CHARACTER SET utf8 NOT NULL, @@ -27405,7 +27780,7 @@ DROP TABLE IF EXISTS `floramondoConfig`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `floramondoConfig` ( - `id` int(11) NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, `entryFk` int(11) DEFAULT NULL COMMENT 'ultima entrada de floramondo', `nextLanded` datetime DEFAULT NULL, `warehouseInFk` smallint(6) unsigned DEFAULT NULL, @@ -27418,8 +27793,26 @@ CREATE TABLE `floramondoConfig` ( CONSTRAINT `floramondoConfigAgencyModeFk` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `floramondoConfigWarehouseInFk` FOREIGN KEY (`warehouseInFk`) REFERENCES `warehouse` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `floramondoConfigWarehouseOutFk` FOREIGN KEY (`warehouseOutFk`) REFERENCES `warehouse` (`id`) ON DELETE SET NULL ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDBDEFAULT 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 */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`floramondoConfig_AFTER_INSERT` AFTER INSERT ON `floramondoConfig` FOR EACH ROW +BEGIN + CALL util.throw ("Tabla config no permite añadir más registros"); +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 */ ; -- -- Table structure for table `fuelType` @@ -27786,6 +28179,24 @@ SET character_set_client = utf8; 1 AS `dua`*/; SET character_set_client = @saved_cs_client; +-- +-- Temporary table structure for view `invoiceInDueDay__` +-- + +DROP TABLE IF EXISTS `invoiceInDueDay__`; +/*!50001 DROP VIEW IF EXISTS `invoiceInDueDay__`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `invoiceInDueDay__` AS SELECT + 1 AS `id`, + 1 AS `invoiceInFk`, + 1 AS `dueDated`, + 1 AS `bankFk`, + 1 AS `amount`, + 1 AS `foreignValue`, + 1 AS `created`*/; +SET character_set_client = @saved_cs_client; + -- -- Temporary table structure for view `invoiceInEntry__` -- @@ -27803,6 +28214,20 @@ SET character_set_client = utf8; 1 AS `isBooked`*/; SET character_set_client = @saved_cs_client; +-- +-- Temporary table structure for view `invoiceInIntrastat__` +-- + +DROP TABLE IF EXISTS `invoiceInIntrastat__`; +/*!50001 DROP VIEW IF EXISTS `invoiceInIntrastat__`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `invoiceInIntrastat__` AS SELECT + 1 AS `invoiceInFk`, + 1 AS `intrastatFk`, + 1 AS `amount`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `invoiceInSerial` -- @@ -27974,12 +28399,12 @@ DELIMITER ; /*!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' */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_beforeUpdate` BEFORE UPDATE ON `vn`.`invoiceOut` FOR EACH ROW BEGIN - CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount); - CALL clientRisk_update (NEW.clientFk, NEW.companyFk, NEW.amount); +CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount); +CALL clientRisk_update (NEW.clientFk, NEW.companyFk, NEW.amount); END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -28084,7 +28509,7 @@ CREATE TABLE `item` ( `stems` int(11) DEFAULT '1', `minPrice` double DEFAULT '0', `isToPrint` tinyint(1) NOT NULL DEFAULT '0', - `isDeliveryNote` tinyint(1) NOT NULL DEFAULT '0', + `isDeliveryNote__` tinyint(1) NOT NULL DEFAULT '0', `taxClassFk` tinyint(4) unsigned NOT NULL DEFAULT '1', `family` varchar(3) COLLATE utf8_unicode_ci DEFAULT 'VT', `box` tinyint(1) NOT NULL DEFAULT '0', @@ -28819,6 +29244,7 @@ CREATE TABLE `itemShelving` ( `packagingFk` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL, `level` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', `userFk` int(10) unsigned DEFAULT NULL, + `stars` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `itemShelving_fk1_idx` (`itemFk`), KEY `itemShelving_fk2_idx` (`shelvingFk`), @@ -29491,19 +29917,6 @@ SET character_set_client = utf8; 1 AS `newId`*/; SET character_set_client = @saved_cs_client; --- --- Table structure for table `kk` --- - -DROP TABLE IF EXISTS `kk`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `kk` ( - `pasillo` varchar(3) COLLATE utf8_unicode_ci NOT NULL, - PRIMARY KEY (`pasillo`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Temporary table structure for view `labelInfo` -- @@ -31902,6 +32315,7 @@ CREATE TABLE `saleMistake` ( `saleFk` int(11) NOT NULL, `userFk` int(11) NOT NULL, `typeFk` int(11) NOT NULL, + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `saleMistake_fk1_idx` (`saleFk`), KEY `saleMistake_fk2_idx` (`userFk`), @@ -31912,6 +32326,23 @@ CREATE TABLE `saleMistake` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Temporary table structure for view `saleMistake_list` +-- + +DROP TABLE IF EXISTS `saleMistake_list`; +/*!50001 DROP VIEW IF EXISTS `saleMistake_list`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `saleMistake_list` AS SELECT + 1 AS `saleFk`, + 1 AS `sacador`, + 1 AS `created`, + 1 AS `revisador`, + 1 AS `description`, + 1 AS `controlled`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `saleState` -- @@ -32709,6 +33140,54 @@ CREATE TABLE `supplierAccount` ( KEY `fk_banco_prov_account_idx` (`bankFk`) ) ENGINE=InnoDBDEFAULT 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 */ ; +/*!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 ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER supplierAccount_AfterInsert +AFTER INSERT +ON supplierAccount FOR EACH ROW +BEGIN + + INSERT INTO vn.mail(`sender`, subject, `body`) + SELECT 'finanzas@verdnatura.es', + CONCAT('Añadida cuenta bancaria al proveedor: ', NEW.supplierFk), + CONCAT(account.myUserGetName(), ' ha añadido: ', + NEW.iban, ', entidad: ', be.name, ', bic: ', be.bic) + FROM bankEntity be + WHERE be.id = NEW.bankEntityFk; +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 */ ; + +-- +-- Table structure for table `supplierContact` +-- + +DROP TABLE IF EXISTS `supplierContact`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `supplierContact` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `supplierFk` int(11) DEFAULT NULL, + `phone` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `mobile` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, + `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `observation` text COLLATE utf8_unicode_ci, + `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `supplier_id` (`supplierFk`), + CONSTRAINT `supplier_id` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `supplierExpense` @@ -33103,16 +33582,17 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!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' */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `ticket_beforeUpdate` BEFORE UPDATE ON `ticket` FOR EACH ROW BEGIN + DECLARE vNewTime TIME; IF !(NEW.shipped <=> OLD.shipped) THEN IF YEAR(NEW.shipped) < 2000 THEN SIGNAL SQLSTATE '46000' @@ -33134,6 +33614,25 @@ BEGIN IF NEW.routeFk AND NEW.isDeleted THEN CALL util.throw ('This ticket is deleted'); END IF; + + IF !(NEW.routeFk <=> OLD.routeFk) AND NEW.routeFk IS NOT NULL THEN + SELECT MAX(TIME(shipped)) INTO vNewTime + FROM vn.ticket + WHERE routeFk = NEW.routeFk + HAVING MAX(TIME(shipped)) > TIME(NEW.shipped); + + IF vNewTime THEN + SET NEW.shipped = TIMESTAMP(DATE(NEW.shipped), vNewTime); + INSERT INTO vn.ticketLog + SET originFk = NEW.id, + userFk = account.myUser_getId(), + `action` = 'update', + description = CONCAT('Cambia la hora por cambio de ruta de ', + TIME(OLD.shipped), + ' a ', + TIME(NEW.shipped)); + END IF; + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -33143,9 +33642,9 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!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 ;; @@ -33158,25 +33657,7 @@ BEGIN OR !(NEW.shipped <=> OLD.shipped) THEN CALL stock.log_add('ticket', NEW.id, OLD.id); END IF; - - IF !(NEW.addressFk <=> OLD.addressFk) THEN - DELETE t - FROM ticketObservation t - JOIN observationType ot ON ot.id = t.observationTypeFk - WHERE t.ticketFk = NEW.id AND - ot.description = 'Repartidor'; - IF ROW_COUNT() > 0 THEN - INSERT INTO ticketLog (originFk, userFk, action, description) - VALUES (NEW.id, account.userGetId(), 'delete', CONCAT ('Notas de repartidor por cambio de consignatario')); - END IF; - INSERT INTO ticketObservation(ticketFk, observationTypeFk, description) - SELECT NEW.id, ao.observationTypeFk, ao.description - FROM addressObservation ao - JOIN address a ON a.id = ao.addressFk - JOIN observationType ot ON ot.id = ao.observationTypeFk - WHERE a.id = NEW.addressFk AND - ot.description = 'Repartidor'; - END IF; + IF NEW.clientFk = 2067 AND !(NEW.clientFk <=> OLD.clientFk) THEN -- Fallo que se insertan no se sabe como tickets en este cliente INSERT INTO vn.mail SET @@ -33834,13 +34315,13 @@ CREATE TABLE `ticketWeekly` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `ticket_print` +-- Table structure for table `ticket_print__` -- -DROP TABLE IF EXISTS `ticket_print`; +DROP TABLE IF EXISTS `ticket_print__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `ticket_print` ( +CREATE TABLE `ticket_print__` ( `ticketFk` int(11) NOT NULL, `isPrinted` tinyint(1) NOT NULL DEFAULT '0', `counter` int(11) NOT NULL DEFAULT '0', @@ -34386,6 +34867,23 @@ CREATE TABLE `travelThermograph` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Registra cada termografo que se ha introducido en cada travel'; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `trolley` +-- + +DROP TABLE IF EXISTS `trolley`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `trolley` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `workerFk` int(11) DEFAULT NULL, + `coupled` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `trolley_FK` (`workerFk`), + CONSTRAINT `trolley_FK` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE SET NULL ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Temporary table structure for view `user` -- @@ -34510,6 +35008,41 @@ CREATE TABLE `vehicle` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `wagon` +-- + +DROP TABLE IF EXISTS `wagon`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wagon` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `volume` int(11) NOT NULL DEFAULT '150' COMMENT 'Volumen en litros', + `plate` varchar(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Matrícula', + PRIMARY KEY (`id`) +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `wagonVolumetry` +-- + +DROP TABLE IF EXISTS `wagonVolumetry`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `wagonVolumetry` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `level` int(10) unsigned NOT NULL DEFAULT '0', + `lines` int(10) unsigned NOT NULL DEFAULT '1', + `liters` int(10) unsigned NOT NULL DEFAULT '0', + `height` int(10) unsigned NOT NULL DEFAULT '20', + `wagonFk` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `wagonVolumetry_FK` (`wagonFk`), + CONSTRAINT `wagonVolumetry_FK` FOREIGN KEY (`wagonFk`) REFERENCES `wagon` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `warehouse` -- @@ -35864,90 +36397,90 @@ DELIMITER ;; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`z-sysadmin`@`%`*/ /*!50106 EVENT `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2019-11-08 00:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Notifica en caso de que el servidor de impresión este parado' DO BEGIN - - DECLARE vCurrentCount INT; - DECLARE vCheckSum INT; - DECLARE vIsAlreadyNotified BOOLEAN; - DECLARE vTableQueue TEXT; - DECLARE vLineQueue TEXT; - DECLARE vDone BOOL DEFAULT FALSE; - DECLARE vCur CURSOR FOR - SELECT CONCAT(' - ', IFNULL(pq.id, ''), ' - ', IFNULL(p.path, ''),' - ', IFNULL(i.Informe, ''),' - ', IFNULL(e.Estado, ''),' - ', IFNULL(w.firstname, ''), " ", IFNULL(w.lastName, ''),' - ', IFNULL(pq.`error`, ''),' - ') - FROM vn.printingQueue pq - LEFT JOIN vn.worker w ON w.id = pq.worker - LEFT JOIN vn.printer p ON p.id = pq.printer - LEFT JOIN vn2008.Informes i ON i.Id_Informe = pq.report - JOIN vn2008.Estados e ON e.Id_Estado = pq.state - LIMIT 30; - - DECLARE CONTINUE HANDLER FOR NOT FOUND - SET vDone = TRUE; - - SELECT COUNT(*), IFNULL(SUM(id),0) INTO vCurrentCount, vCheckSum - FROM vn.printingQueue WHERE state = 1; - - SELECT isAlreadyNotified INTO vIsAlreadyNotified - FROM printingQueueCheck; - - IF (SELECT lastCount FROM printingQueueCheck) = vCurrentCount AND - (SELECT lastCheckSum FROM printingQueueCheck) = vCheckSum AND - vIsAlreadyNotified = FALSE AND vCurrentCount > 0 - THEN - - SELECT ' - - - - - - - - ' INTO vTableQueue; - - OPEN vCur; - - l: LOOP - - SET vDone = FALSE; - - FETCH vCur INTO vLineQueue; - - IF vDone THEN - LEAVE l; - END IF; - - SELECT CONCAT(vTableQueue, vLineQueue) INTO vTableQueue; - - END LOOP; - - CLOSE vCur; - - INSERT INTO vn2008.mail (`to`, subject, text) - VALUES ('cau@verdnatura.es, sysadmin@verdnatura.es', - 'servidor de impresion parado', - CONCAT('Hay ', vCurrentCount, ' lineas bloqueadas', vTableQueue, '
Id ColaRuta ImpresoraInformeEstadoTrabajadorError
')); - - UPDATE printingQueueCheck SET isAlreadyNotified = TRUE; - END IF; - - IF (SELECT lastCount FROM printingQueueCheck) > vCurrentCount AND - vIsAlreadyNotified = TRUE - THEN - UPDATE printingQueueCheck SET isAlreadyNotified = FALSE; - END IF; - - UPDATE printingQueueCheck - SET lastCount = vCurrentCount, - lastCheckSum = vCheckSum; - +/*!50106 CREATE*/ /*!50117 DEFINER=`z-sysadmin`@`%`*/ /*!50106 EVENT `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2019-11-08 00:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Notifica en caso de que el servidor de impresión este parado' DO BEGIN + + DECLARE vCurrentCount INT; + DECLARE vCheckSum INT; + DECLARE vIsAlreadyNotified BOOLEAN; + DECLARE vTableQueue TEXT; + DECLARE vLineQueue TEXT; + DECLARE vDone BOOL DEFAULT FALSE; + DECLARE vCur CURSOR FOR + SELECT CONCAT(' + ', IFNULL(pq.id, ''), ' + ', IFNULL(p.path, ''),' + ', IFNULL(i.Informe, ''),' + ', IFNULL(e.Estado, ''),' + ', IFNULL(w.firstname, ''), " ", IFNULL(w.lastName, ''),' + ', IFNULL(pq.`error`, ''),' + ') + FROM vn.printingQueue pq + LEFT JOIN vn.worker w ON w.id = pq.worker + LEFT JOIN vn.printer p ON p.id = pq.printer + LEFT JOIN vn2008.Informes i ON i.Id_Informe = pq.report + JOIN vn2008.Estados e ON e.Id_Estado = pq.state + LIMIT 30; + + DECLARE CONTINUE HANDLER FOR NOT FOUND + SET vDone = TRUE; + + SELECT COUNT(*), IFNULL(SUM(id),0) INTO vCurrentCount, vCheckSum + FROM vn.printingQueue WHERE state = 1; + + SELECT isAlreadyNotified INTO vIsAlreadyNotified + FROM printingQueueCheck; + + IF (SELECT lastCount FROM printingQueueCheck) = vCurrentCount AND + (SELECT lastCheckSum FROM printingQueueCheck) = vCheckSum AND + vIsAlreadyNotified = FALSE AND vCurrentCount > 0 + THEN + + SELECT ' + + + + + + + + ' INTO vTableQueue; + + OPEN vCur; + + l: LOOP + + SET vDone = FALSE; + + FETCH vCur INTO vLineQueue; + + IF vDone THEN + LEAVE l; + END IF; + + SELECT CONCAT(vTableQueue, vLineQueue) INTO vTableQueue; + + END LOOP; + + CLOSE vCur; + + INSERT INTO vn2008.mail (`to`, subject, text) + VALUES ('cau@verdnatura.es, sysadmin@verdnatura.es', + 'servidor de impresion parado', + CONCAT('Hay ', vCurrentCount, ' lineas bloqueadas', vTableQueue, '
Id ColaRuta ImpresoraInformeEstadoTrabajadorError
')); + + UPDATE printingQueueCheck SET isAlreadyNotified = TRUE; + END IF; + + IF (SELECT lastCount FROM printingQueueCheck) > vCurrentCount AND + vIsAlreadyNotified = TRUE + THEN + UPDATE printingQueueCheck SET isAlreadyNotified = FALSE; + END IF; + + UPDATE printingQueueCheck + SET lastCount = vCurrentCount, + lastCheckSum = vCheckSum; + END */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; @@ -36008,6 +36541,45 @@ DELIMITER ;; /*!50003 SET character_set_client = @saved_cs_client */ ;; /*!50003 SET character_set_results = @saved_cs_results */ ;; /*!50003 SET collation_connection = @saved_col_connection */ ;; +/*!50106 DROP EVENT IF EXISTS `workerTimeControl_sendMail` */;; +DELIMITER ;; +/*!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 = utf8mb4 */ ;; +/*!50003 SET character_set_results = utf8mb4 */ ;; +/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ;; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; +/*!50003 SET @saved_time_zone = @@time_zone */ ;; +/*!50003 SET time_zone = 'SYSTEM' */ ;; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`%`*/ /*!50106 EVENT `workerTimeControl_sendMail` ON SCHEDULE EVERY 1 WEEK STARTS '2020-11-25 08:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN + DECLARE vDone BOOL; + DECLARE vWeek,vYear INT; + DECLARE rs CURSOR FOR + SELECT week,year + FROM vn.time + WHERE dated IN (DATE_ADD(CURDATE(), INTERVAL -10 DAY), DATE_ADD(CURDATE(), INTERVAL -4 DAY)) + GROUP BY year,week; + DECLARE CONTINUE HANDLER FOR NOT FOUND + SET vDone = TRUE; + + OPEN rs; + myLoop: LOOP + SET vDone = FALSE; + FETCH rs INTO vWeek, vYear; + IF vDone THEN + LEAVE myLoop; + END IF; + CALL vn.workerTimeControl_sendMail(vWeek, vYear, NULL); + END LOOP; + CLOSE rs; +END */ ;; +/*!50003 SET time_zone = @saved_time_zone */ ;; +/*!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 */ ;; /*!50106 DROP EVENT IF EXISTS `zoneGeo_doCalc` */;; DELIMITER ;; /*!50003 SET @saved_cs_client = @@character_set_client */ ;; @@ -36394,7 +36966,7 @@ BEGIN JOIN itemBotanical ib ON be.ediGenusFk = ib.genusFk AND IFNULL(be.ediSpecieFk, ib.specieFk) = ib.specieFk - AND be.restriction = 'pasaporte fitosanitario' + AND be.`code` = 'phytosanitaryPassport' JOIN item i ON i.id = ib.itemFk JOIN itemType it ON it.id = i.typeFk WHERE ib.itemFk = vItemFk @@ -37381,13 +37953,13 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!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`@`%` FUNCTION `floramondo_getEntry`(vLanded DATETIME) RETURNS int(11) +CREATE DEFINER=`root`@`%` FUNCTION `floramondo_getEntry`(vLanded DATETIME, vWarehouseFk INT) RETURNS int(11) READS SQL DATA BEGIN @@ -37395,9 +37967,10 @@ BEGIN DECLARE vEntryFk INT; DECLARE previousEntryFk INT; - SET vTravelFk = floramondo_getTravel(vLanded); + SET vTravelFk = floramondo_getTravel(vLanded, vWarehouseFk); IF vLanded THEN + SELECT IFNULL(MAX(id),0) INTO vEntryFk FROM vn.entry WHERE travelFk = vTravelFk AND isRaid; @@ -37416,18 +37989,32 @@ BEGIN WHERE travelFk = vTravelFk; END IF; + END IF; - SELECT entryFk INTO previousEntryFk FROM floramondoConfig; + SELECT entryFk INTO previousEntryFk + FROM floramondoConfig + WHERE warehouseInFk = vWarehouseFk; + IF NOT (previousEntryFk <=> vEntryFk) THEN + DELETE FROM buy WHERE entryFk = previousEntryFk; + DELETE FROM entry WHERE id = previousEntryFk; - UPDATE floramondoConfig SET entryFk = vEntryFk; - UPDATE floramondoConfig SET nextLanded = vLanded - WHERE vLanded IS NOT NULL; + + UPDATE floramondoConfig + SET entryFk = vEntryFk + WHERE warehouseInFk = vWarehouseFk; + + UPDATE floramondoConfig + SET nextLanded = vLanded + WHERE vLanded IS NOT NULL + AND warehouseInFk = vWarehouseFk; + END IF; RETURN vEntryFk; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -37438,19 +38025,19 @@ DELIMITER ; /*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!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`@`%` FUNCTION `floramondo_getTravel`(vLanded DATE) RETURNS int(11) +CREATE DEFINER=`root`@`%` FUNCTION `floramondo_getTravel`(vLanded DATE, vWarehouseFk INT) RETURNS int(11) READS SQL DATA BEGIN DECLARE vTravelFk INT; DECLARE vWarehouseOutName VARCHAR(50) DEFAULT 'Holanda'; - DECLARE vWarehouseInName VARCHAR(50) DEFAULT 'VNH'; + -- DECLARE vWarehouseInName VARCHAR(50) DEFAULT 'VNH'; DECLARE vAgencyModeName VARCHAR(50) DEFAULT 'HOLANDA DIRECTO'; IF vLanded THEN @@ -37459,7 +38046,7 @@ BEGIN JOIN vn.warehouse wIn ON wIn.id = tr.warehouseInFk JOIN vn.warehouse wOut ON wOut.id = tr.warehouseOutFk JOIN vn.agencyMode am ON am.id = tr.agencyFk - WHERE wIn.name = vWarehouseInName + WHERE wIn.id = vWarehouseFk AND wOut.name = vWarehouseOutName AND am.name = vAgencyModeName AND landed = vLanded; @@ -37467,22 +38054,24 @@ BEGIN IF NOT vTravelFk THEN INSERT INTO vn.travel(landed, shipped, warehouseInFk, warehouseOutFk, agencyFk) - SELECT vLanded, curdate(), wIn.id, wOut.id, am.id - FROM vn.warehouse wIn - JOIN vn.warehouse wOut ON wOut.name = vWarehouseOutName + SELECT vLanded, curdate(), vWarehouseFk, wOut.id, am.id + FROM vn.warehouse wOut JOIN vn.agencyMode am ON am.name = vAgencyModeName - WHERE wIn.name = vWarehouseInName; + WHERE wOut.name = vWarehouseOutName; SELECT MAX(tr.id) INTO vTravelFk FROM vn.travel tr JOIN vn.warehouse wIn ON wIn.id = tr.warehouseInFk JOIN vn.warehouse wOut ON wOut.id = tr.warehouseOutFk - WHERE wIn.name = vWarehouseInName + WHERE wIn.id = vWarehouseFk AND wOut.name = vWarehouseOutName AND landed = vLanded; END IF; + END IF; + RETURN vTravelFk; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -38717,6 +39306,35 @@ DELIMITER ; /*!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 FUNCTION IF EXISTS `item_getFhImage` */; +/*!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 = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` FUNCTION `item_getFhImage`(itemFk INT) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci + DETERMINISTIC +BEGIN + DECLARE vImageUrl VARCHAR(255); + SELECT sr.PictureReference INTO vImageUrl + FROM vn.buy b + JOIN edi.ekt e ON b.ektFk = e.id + JOIN edi.supplyResponse sr ON sr.Item_ArticleCode =e.`ref` + JOIN vn.item i ON i.id = b.itemFk + WHERE b.itemFk = itemFk + ORDER BY (sr.EmbalageCode = e.package) DESC + LIMIT 1; + RETURN vImageUrl; +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 FUNCTION IF EXISTS `item_getVolume` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -38742,7 +39360,7 @@ BEGIN SELECT SUM(IF(p.volume > 0, p.volume, - p.width * p.depth * IF(p.height, p.height, IFNULL(i.size,60) + 10) + p.width * p.depth * IF(IFNULL(p.height,0), p.height, IFNULL(i.size,60) + 10) )) INTO vVolume FROM packaging p JOIN item i ON i.id = vSelf @@ -38995,13 +39613,14 @@ DELIMITER ; /*!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 character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `phytoPassport`(vRef VARCHAR(15)) RETURNS text CHARSET utf8 + DETERMINISTIC BEGIN DECLARE vPhyto TEXT CHARSET utf8 COLLATE utf8_unicode_ci; SELECT @@ -39026,7 +39645,7 @@ FROM JOIN itemBotanicalWithGenus ib ON ib.itemFk = i.id JOIN - botanicExport be ON be.restriction = 'pasaporte fitosanitario' + botanicExport be ON be.`code` = 'phytosanitaryPassport' LEFT JOIN ediGenus eg ON eg.id = be.ediGenusFk LEFT JOIN @@ -40170,11 +40789,11 @@ DELIMITER ; /*!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' */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `addNoteFromDelivery`(idTicket INT,nota TEXT) BEGIN - + DECLARE observationTypeFk INT DEFAULT 3; /*3 = REPARTIDOR*/ INSERT INTO ticketObservation(ticketFk,observationTypeFk,description) @@ -40451,7 +41070,7 @@ DELIMITER ; /*!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 `algemesi_silla` */; +/*!50003 DROP PROCEDURE IF EXISTS `algemesi_silla__` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -40461,7 +41080,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`%` PROCEDURE `algemesi_silla`(vDate DATE, vItemFk INT, vQuantity INT) +CREATE DEFINER=`root`@`%` PROCEDURE `algemesi_silla__`(vDate DATE, vItemFk INT, vQuantity INT) BEGIN DECLARE done INT DEFAULT FALSE; @@ -41843,6 +42462,9 @@ proc: BEGIN DECLARE vDiscountLastItemComponent INT DEFAULT 32; DECLARE vExtraBaggedComponent INT DEFAULT 38; DECLARE vManaAutoComponent INT DEFAULT 39; + DECLARE vFrenchOffer INT DEFAULT 42; + DECLARE vIsFrenchVNHBuyer BOOLEAN DEFAULT FALSE; + DECLARE vVNHWarehouseFk INT DEFAULT 7; SELECT volume INTO vBoxVolume FROM vn.packaging @@ -41851,6 +42473,14 @@ proc: BEGIN SELECT clientFk INTO vClientFK FROM address WHERE id = vAddressFk; + + SELECT (c.country = 'FRANCIA' AND vWarehouseFk = vVNHWarehouseFk) + INTO vIsFrenchVNHBuyer + FROM vn.country c + JOIN vn.province p ON p.countryFk = c.id + JOIN vn.address a ON a.provinceFk = p.id + WHERE a.id = vAddressFk; + SET @rate2 := 0; SET @rate3 := 0; @@ -41889,6 +42519,7 @@ proc: BEGIN WHERE b.buyingValue + b.freightValue + b.packageValue + b.comissionValue > 0.01 AND ic.display <> 0 AND tl.zoneFk = vZoneFk AND tl.warehouseFk = vWarehouseFk; + -- Coste INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost) SELECT tcc.warehouseFk, @@ -41897,7 +42528,8 @@ proc: BEGIN b.buyingValue + b.freightValue + b.packageValue + b.comissionValue FROM tmp.ticketComponentCalculate tcc JOIN buy b ON b.id = tcc.buyFk; - + + -- Margen INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost) SELECT tcc.warehouseFk, @@ -41906,6 +42538,19 @@ proc: BEGIN tcc.rate3 - b.buyingValue - b.freightValue - b.packageValue - b.comissionValue FROM tmp.ticketComponentCalculate tcc JOIN buy b ON b.id = tcc.buyFk; + + -- French Offer: revisar a partir de Mayo 2021 + IF vIsFrenchVNHBuyer THEN + + INSERT INTO tmp.ticketComponent(warehouseFk, itemFk, componentFk, cost) + SELECT tcc.warehouseFk, + tcc.itemFk, + vFrenchOffer, + - tcc.rate3 + b.buyingValue + b.freightValue + b.packageValue + b.comissionValue + ((b.buyingValue + b.freightValue + b.packageValue + b.comissionValue) * 0.06) + FROM tmp.ticketComponentCalculate tcc + JOIN buy b ON b.id = tcc.buyFk; + + END IF; DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentBase; CREATE TEMPORARY TABLE tmp.ticketComponentBase ENGINE = MEMORY @@ -41951,6 +42596,9 @@ proc: BEGIN LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk WHERE sp.value IS NULL; + + + DROP TEMPORARY TABLE IF EXISTS tmp.zone; CREATE TEMPORARY TABLE IF NOT EXISTS tmp.zone (INDEX (id)) ENGINE = MEMORY @@ -41963,7 +42611,7 @@ proc: BEGIN tcc.itemFk, vDeliveryComponent, vGeneralInflationCoefficient - * ROUND(ic.cm3delivery * IFNULL((zo.price - zo.bonus),50) / vBoxVolume, 4) cost + * ROUND(ic.cm3delivery * (IFNULL(zo.price,5000) - IFNULL(zo.bonus,0)) / vBoxVolume, 4) cost /* * ROUND(( i.compression -- PAK 2020/06/19 @@ -42263,6 +42911,21 @@ BEGIN FROM vn.entry e JOIN tmp.entryToDelete tmp ON tmp.id = e.id; + -- borrar de route registros menores a 4 años + DROP TEMPORARY TABLE IF EXISTS tmp.routeToDelete; + CREATE TEMPORARY TABLE tmp.routeToDelete + SELECT * + FROM vn.route r + WHERE created < TIMESTAMPADD(YEAR,-4,CURDATE()); + + UPDATE tmp.routeToDelete tmp + JOIN vn.dms d ON d.id = tmp.gestdocFk + SET d.dmsTypeFk = vTrashId; + + DELETE r + FROM tmp.routeToDelete tmp + JOIN vn.route r ON r.id = tmp.id; + DROP TEMPORARY TABLE IF EXISTS tmp.thermographToDelete; DROP TEMPORARY TABLE IF EXISTS tmp.entryToDelete; @@ -43207,54 +43870,54 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `clientRemoveWorker__`() -BEGIN - DECLARE done BOOL DEFAULT FALSE; - DECLARE vClientFk INT; - - DECLARE rs CURSOR FOR - SELECT c.clientFk - FROM tmp.clientGetDebt c - LEFT JOIN tmp.risk r ON r.clientFk = c.clientFk - WHERE IFNULL(r.risk,0) = 0; - - DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - - DROP TEMPORARY TABLE IF EXISTS tmp.clientGetDebt; - CREATE TEMPORARY TABLE tmp.clientGetDebt - SELECT cd.id as clientFk - FROM bs.clientDied cd - LEFT JOIN vn.clientProtected cp ON cp.clientFk = cd.id - JOIN vn.client c ON c.id = cd.id - JOIN vn.province p ON p.id = c.provinceFk - JOIN vn.country co ON co.id = p.countryFk - WHERE cd.Aviso = 'TERCER AVISO' - AND cp.clientFk IS NULL - AND co.country NOT IN ('Portugal','Francia','España exento') - AND c.salesPersonFk IS NOT NULL; - - CALL vn.clientGetDebt(curdate()); - - DROP TEMPORARY TABLE IF EXISTS tmp.contador; - CREATE TEMPORARY TABLE tmp.contador (id INT) - ENGINE = MEMORY; - - OPEN rs; - FETCH rs INTO vClientFk; - - WHILE NOT done DO - INSERT INTO tmp.contador SET id = vClientFk; - CALL vn.clientGreugeSpray(vClientFk, TRUE, '',TRUE); +BEGIN + DECLARE done BOOL DEFAULT FALSE; + DECLARE vClientFk INT; + + DECLARE rs CURSOR FOR + SELECT c.clientFk + FROM tmp.clientGetDebt c + LEFT JOIN tmp.risk r ON r.clientFk = c.clientFk + WHERE IFNULL(r.risk,0) = 0; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + DROP TEMPORARY TABLE IF EXISTS tmp.clientGetDebt; + CREATE TEMPORARY TABLE tmp.clientGetDebt + SELECT cd.id as clientFk + FROM bs.clientDied cd + LEFT JOIN vn.clientProtected cp ON cp.clientFk = cd.id + JOIN vn.client c ON c.id = cd.id + JOIN vn.province p ON p.id = c.provinceFk + JOIN vn.country co ON co.id = p.countryFk + WHERE cd.Aviso = 'TERCER AVISO' + AND cp.clientFk IS NULL + AND co.country NOT IN ('Portugal','Francia','España exento') + AND c.salesPersonFk IS NOT NULL; + + CALL vn.clientGetDebt(curdate()); + + DROP TEMPORARY TABLE IF EXISTS tmp.contador; + CREATE TEMPORARY TABLE tmp.contador (id INT) + ENGINE = MEMORY; + + OPEN rs; + FETCH rs INTO vClientFk; + + WHILE NOT done DO + INSERT INTO tmp.contador SET id = vClientFk; + CALL vn.clientGreugeSpray(vClientFk, TRUE, '',TRUE); UPDATE vn.client SET salesPersonFk = NULL WHERE id = vClientFk; INSERT INTO vn.clientLog (originFk, userFk, `action`, description) VALUES (vClientFk, account.userGetId(), 'update', CONCAT('Se ha desasignado el cliente por que no ha comprado en 3 meses')); - + REPLACE bs.clientNewBorn(clientFk, shipped) - VALUES(vClientFk, CURDATE()); - FETCH rs INTO vClientFk; - END WHILE; - - CLOSE rs; + VALUES(vClientFk, CURDATE()); + FETCH rs INTO vClientFk; + END WHILE; + + CLOSE rs; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -44703,10 +45366,20 @@ BEGIN DECLARE vClientName VARCHAR(50); DECLARE vConsignatario INT; DECLARE vOriginalQuantity INT; + DECLARE vDescription VARCHAR(100); + DECLARE vConcept VARCHAR(100); + DECLARE vOrigin INT; IF vIsTrash THEN SELECT 200 INTO vClientFk; END IF; + + SELECT concept INTO vConcept FROM vn.sale WHERE id = vSaleFk; + SELECT ticketFk INTO vOrigin FROM vn.sale WHERE id = vSaleFk; + SELECT CONCAT("Cambio cantidad ",vConcept," de ", vQuantity ," a ", vNewQuantity) INTO vDescription; + + INSERT INTO vn.ticketLog (originFk, userFk, action , description) + VALUES(vOrigin, vn.getUser(), 'update', vDescription); SELECT t.id INTO vTicketFk FROM vn.ticket t WHERE t.created > DATE_SUB(NOW(), INTERVAL 1 DAY) AND t.clientFk = vClientFk AND t.warehouseFk = vWarehouseFk LIMIT 1; @@ -44725,7 +45398,7 @@ BEGIN END IF; INSERT INTO vn.sale (itemFk, ticketFk, concept, quantity, originalQuantity, price, discount, priceFixed, reserved, isPicked, isPriceFixed, created, isAdded) - SELECT itemFk, vTicketFk, concept, vQuantity, originalQuantity, price, discount, priceFixed, reserved, isPicked, isPriceFixed, created, isAdded + SELECT itemFk, vTicketFk, CONCAT(concept," ",vn.getWorkerCode(), " ",LEFT(CAST(NOW() AS TIME),5)), vQuantity, originalQuantity, price, discount, priceFixed, reserved, isPicked, isPriceFixed, created, isAdded FROM vn.sale s WHERE s.id = vSaleFk; SELECT quantity INTO vOriginalQuantity FROM vn.sale WHERE id = vSaleFk; @@ -44828,7 +45501,7 @@ proc:BEGIN FROM vn.worker w WHERE w.id = account.myUser_getId(); - IF vWorkerCode = 'LOM' THEN + IF vWorkerCode = 'ATM' THEN SET vMaxTickets = 8; @@ -44869,15 +45542,13 @@ proc:BEGIN AND (r.id IS NOT NULL OR a.isOwn = FALSE OR a.name = 'REC_ALGEMESI') AND s.isPrintable AND (pb.m3 > 0.05 OR s.isOK) - ORDER BY IF(pb.ubicacion IS NOT NULL, 1, 2), - (Hora - 1) * 60 + minuto > hour(now()) * 60 + minute(now()) , + ORDER BY (Hora - 1) * 60 + minuto > hour(now()) * 60 + minute(now()) , s.order DESC, Hora, minuto, IFNULL(r.priority,99999), - IFNULL(r.id,999999) - /*, - pb.m3 DESC*/ + IFNULL(r.id,999999), + pb.m3 DESC LIMIT vMaxTicketPrinted; END IF; @@ -45436,341 +46107,6 @@ proc:BEGIN END IF; -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 `collection_new_Basic__` */; -/*!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 `collection_new_Basic__`(vSectorFk INT) -proc:BEGIN - - DECLARE vIsPreviousPrepared BOOLEAN; - DECLARE vCollectionFk INT; - DECLARE vWarehouseFk INT; - DECLARE vMaxTickets INT DEFAULT 4; - DECLARE vStateFk INT; - DECLARE vFirstTicketFk INT; - DECLARE vWorkerCode VARCHAR(3); - DECLARE vShelve INT; - DECLARE vTicket INT; - DECLARE myUserIsSalesPersonRole BOOLEAN; - DECLARE vPrintedTickets INT; - DECLARE vMaxTicketPrinted INT DEFAULT 10; - - -- Se comprueba si existe coleccion pendiente, en cuyo caso se devuelve esa colección - SELECT collectionFk INTO vCollectionFk - FROM - ( - SELECT tc.collectionFk, COUNT(*) as lineas, sum(IF(st.id,0,1)) as libres - FROM vn.collection c - JOIN vn.ticketCollection tc ON tc.collectionFk = c.id - JOIN vn.ticket t ON t.id = tc.ticketFk - JOIN vn.sale s ON s.ticketFk = t.id - LEFT JOIN vn.saleTracking st ON st.saleFk = s.id - WHERE c.workerFk = vn.getUser() - AND s.quantity - AND c.created > CURDATE() - GROUP BY c.id - HAVING libres = lineas) sub - LIMIT 1; - - IF vCollectionFk THEN - - SELECT vCollectionFk; - - LEAVE proc; - - END IF; - - IF /*vSectorFk = 37*/ FALSE THEN - - CALL vn.collectionTrain_new(9,3); - - ELSE - - -- Establecemos el almacén y si es un sector de preparación previa, así como el estado para los tickets que se vayan preparando - SELECT isPreviousPrepared, warehouseFk - INTO vIsPreviousPrepared, vWarehouseFk - FROM vn.sector - WHERE id = vSectorFk; - - IF vIsPreviousPrepared THEN - - SELECT id INTO vStateFk - FROM vn.state - WHERE `code` = 'PREVIOUS_PREPARATION'; - ELSE - - SELECT id INTO vStateFk - FROM vn.state - WHERE `code` = 'ON_PREPARATION'; - - END IF; - - -- Averiguamos si es comercial el usuario - SELECT FALSE -- (r.name = 'salesPerson') - INTO myUserIsSalesPersonRole - FROM account.user u - JOIN account.role r ON r.id = u.role - WHERE u.id = vn.getUser(); - - -- Obtenemos el código del usuario - SELECT w.code - INTO vWorkerCode - FROM vn.worker w - WHERE w.id = account.myUserGetId(); - - -- Se obtiene nº de colección y el buffer con los pedidos preparables - INSERT INTO vn.collection - SET workerFk = account.myUserGetId(); - - SELECT LAST_INSERT_ID() INTO vCollectionFk; - - CALL vn2008.production_control_source(vWarehouseFk, 0); - - SELECT COUNT(*) INTO vPrintedTickets - FROM tmp.production_buffer pb - JOIN vn.state s ON s.id = pb.state - WHERE pb.Fecha = CURDATE() - AND s.isPreparable; - - SET vMaxTicketPrinted = vMaxTicketPrinted - vPrintedTickets; - - -- AutoPRINT - - IF vMaxTicketPrinted > 0 THEN - - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) - SELECT s2.id, pb.Id_Ticket, vn.getUser() - FROM tmp.production_buffer pb - JOIN vn.agency a ON a.id = pb.agency_id - JOIN vn.warehouse w ON w.id = pb.warehouse_id - JOIN vn.state s ON s.id = pb.state - JOIN vn.state s2 ON s2.code = 'PRINTED_AUTO' - LEFT JOIN vn.route r ON r.id = pb.Id_Ruta - WHERE pb.Fecha = CURDATE() - AND NOT pb.problems - AND a.name != 'REC_SILLA' - AND (pb.ubicacion IS NOT NULL OR a.isOwn = FALSE ) - AND s.isPrintable - AND (pb.m3 > 0.05 OR s.isOK) - ORDER BY - (Hora - 1) * 60 + minuto > hour(now()) * 60 + minute(now()) , - s.order DESC, - Hora, - minuto, - IFNULL(r.priority,99999), - IFNULL(r.id,999999), - pb.m3 DESC - LIMIT vMaxTicketPrinted; - - END IF; - - -- SELECT vMaxTicketPrinted; - -- Se seleccionan los primeros tickets, asignando colección para dejarlos bloqueados a otros sacadores. - - INSERT IGNORE INTO vn.ticketCollection(ticketFk, collectionFk) - SELECT pb.Id_Ticket, - vCollectionFk - FROM tmp.production_buffer pb - JOIN vn.ticketStateToday tst ON tst.ticket = pb.Id_Ticket - JOIN vn.state s ON s.id = tst.state - LEFT JOIN vn.route r ON r.id = pb.Id_Ruta - WHERE pb.collectionFk IS NULL - AND ( - (s.isPreparable AND NOT myUserIsSalesPersonRole AND pb.Agencia != 'REC_SILLA') - OR - (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) - ) - ORDER BY (s.code = 'PICKER_DESIGNED' AND pb.CodigoTrabajador = vWorkerCode) DESC, - pb.Hora, - pb.Minuto, - IF(IFNULL(r.priority,0) = 0, 999, r.priority), - IFNULL(r.id,99999), - pb.m3 DESC - LIMIT vMaxTickets; - - - -- Creamos una tabla temporal con los datos que necesitamos para depurar la colección - DROP TEMPORARY TABLE IF EXISTS tmp.ticket; - CREATE TEMPORARY TABLE tmp.ticket - SELECT pb.Id_Ticket ticketFk, - pb.lines, - pb.m3 * 1000 liters, - 0 as height, - 0 as shelve - FROM tmp.production_buffer pb - JOIN vn.ticketCollection tc ON tc.ticketFk = pb.Id_Ticket - WHERE tc.collectionFk = vCollectionFk; - - SELECT ticketFk - INTO vFirstTicketFk - FROM tmp.ticket - LIMIT 1; - - IF (SELECT pb.Agencia FROM tmp.production_buffer pb WHERE Id_Ticket = vFirstTicketFk) = 'REC_SILLA' THEN - - DELETE FROM tmp.ticket WHERE ticketFk != vFirstTicketFk; - - UPDATE tmp.ticket SET shelve = 1; - -- Como sólo hay un ticket, se le asigna el nivel 1 y acabamos - - ELSE - - -- Eliminamos los de recogida, puesto que el primero sabemos que no es de rec_silla - DELETE t.* - FROM tmp.ticket t - JOIN tmp.production_buffer pb ON pb.Id_Ticket = t.ticketFk - WHERE pb.Agencia = 'REC_SILLA'; - - -- Establece altura máxima por pedido, porque las plantas no se pueden recostar. - UPDATE tmp.ticket t - JOIN - ( SELECT MAX(i.size) maxHeigth, - tc.ticketFk - FROM vn.ticketCollection tc - JOIN vn.sale s ON s.ticketFk = tc.ticketFk - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - WHERE ic.isReclining = FALSE - AND tc.collectionFk = vCollectionFk - GROUP BY tc.ticketFk) sub ON sub.ticketFk = t.ticketFk - SET t.height = sub.maxHeigth; - - -- Vamos a generar una tabla con todas las posibilidades de asignacion de pedido - DROP TEMPORARY TABLE IF EXISTS tmp.ticketShelve; - CREATE TEMPORARY TABLE tmp.ticketShelve - SELECT ticketFk, shelve, linesDif, LitersDif, heightDif - FROM ( - SELECT t.ticketFk, - cv.`level` shelve, - CAST(cv.lines AS SIGNED) - t.lines as linesDif, - CAST(cv.liters AS SIGNED) - t.liters as litersDif, - CAST(cv.height AS SIGNED) - t.height as heightDif - FROM vn.collectionVolumetry cv - JOIN tmp.ticket t - ORDER BY (t.ticketFk = vFirstTicketFk) DESC, linesDif - ) sub - WHERE linesDif >= 0 - AND litersDif >= 0 - AND heightDif >= 0 - ORDER BY linesDif; - - -- Asignamos la primera balda util al primer pedido - SELECT IFNULL(shelve,0) INTO vShelve - FROM tmp.ticketShelve - WHERE ticketFk = vFirstTicketFk - ORDER BY heightDif, litersDif, linesDif - LIMIT 1; - - IF vShelve THEN - - UPDATE tmp.ticket - SET shelve = vShelve - WHERE ticketFk = vFirstTicketFk; - - DELETE FROM tmp.ticketShelve - WHERE ticketFk = vFirstTicketFk - OR shelve = vShelve; - - WHILE (SELECT COUNT(*) FROM tmp.ticketShelve) DO - - SELECT ticketFk, shelve - INTO vTicket, vShelve - FROM tmp.ticketShelve - LIMIT 1; - - UPDATE tmp.ticket - SET shelve = vShelve - WHERE ticketFk = vTicket; - - DELETE FROM tmp.ticketShelve - WHERE ticketFk = vTicket - OR shelve = vShelve; - - END WHILE; - - ELSE - - UPDATE tmp.ticket - SET shelve = 1 - WHERE ticketFk = vFirstTicketFk; - - END IF; - - END IF; - - -- Eliminamos los que se han quedado sin balda - DELETE FROM tmp.ticket WHERE shelve = 0 ; - - -- Elimina los tickets bloqueados que no se van a preparar - DELETE tc.* - FROM vn.ticketCollection tc - LEFT JOIN tmp.ticket t ON t.ticketFk = tc.ticketFk - WHERE tc.collectionFk = vCollectionFk - AND t.ticketFk IS NULL; - - -- Actualiza el estado de la colección - UPDATE vn.collection c - JOIN vn.state st ON st.code = 'ON_PREPARATION' - SET c.stateFk = st.id - WHERE c.id = vCollectionFk; - - -- Asigna las bandejas - UPDATE vn.ticketCollection tc - JOIN tmp.ticket t ON t.ticketFk = tc.ticketFk - SET tc.level = t.shelve; - - -- Actualiza el estado de los tickets - INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) - SELECT vStateFk, ticketFk, account.myUserGetId() - FROM vn.ticketCollection tc - WHERE tc.collectionFk = vCollectionFk - UNION ALL - SELECT vStateFk, sw.id, account.myUserGetId() - FROM vn.stowaway sw - JOIN vn.ticketCollection tc ON tc.ticketFk = sw.shipFk - WHERE tc.collectionFk = vCollectionFk; - - -- Avisa los preparados previos que hay que bajar del altillo imprimiendo etiqueta - INSERT IGNORE INTO vn.ticketDown(ticketFk) - SELECT DISTINCT tc.ticketFk - FROM vn.ticketCollection tc - JOIN vncontrol.inter vi ON vi.Id_Ticket = tc.ticketFk - JOIN vn.state st ON st.id = vi.state_id - JOIN vn.ticket t ON t.id = tc.ticketFk - JOIN vn.warehouse w ON w.id = t.warehouseFk - WHERE tc.collectionFk = vCollectionFk - AND w.name = 'Silla FV' - AND st.code = 'PREVIOUS_PREPARATION'; - - IF (SELECT COUNT(*) FROM vn.ticketCollection WHERE collectionFk = vCollectionFk) THEN - - CALL vn.salesMerge_byCollection(vCollectionFk); - - SELECT vCollectionFk; - - ELSE - - DELETE FROM vn.collection WHERE id = vCollectionFk; - SELECT 0; - - END IF; - - END IF; - END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -47412,216 +47748,216 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `entryConverter`(IN `vEntry` INT) -BEGIN - - DECLARE vWarehouseIn INT; - DECLARE vWarehouseOut INT; - DECLARE vTravel INT; - - DECLARE done BOOL DEFAULT FALSE; - - DECLARE vId_Entrada INT; - DECLARE vId_Article INT; - DECLARE vEtiquetas INT; - DECLARE vId_Cubo VARCHAR(10); - DECLARE vPacking INT; - DECLARE vGrouping INT; - DECLARE vCantidad INT; - DECLARE vCostefijo DECIMAL(10,3); - DECLARE vPortefijo DECIMAL(10,3); - DECLARE vEmbalajefijo DECIMAL(10); - DECLARE vComisionfija DECIMAL(10,3); - DECLARE vCaja INT; - DECLARE vNicho VARCHAR(5); - DECLARE vTarifa1 DECIMAL(10,2); - DECLARE vTarifa2 DECIMAL(10,2); - DECLARE vTarifa3 DECIMAL(10,2); - DECLARE vPVP DECIMAL(10,2); - DECLARE vCompra INT; - - DECLARE rs CURSOR FOR - SELECT - b.Id_Entrada, - b.Id_Article, - b.Etiquetas, - b.Id_Cubo, - b.Packing, - b.`grouping`, - b.Cantidad, - b.Costefijo, - b.Portefijo, - b.Embalajefijo, - b.Comisionfija, - b.caja, - b.Nicho, - b.Tarifa1, - b.Tarifa2, - b.Tarifa3, - b.PVP - FROM vn2008.Compres b - JOIN vn.itemConversor ic ON ic.espItemFk = b.Id_Article - WHERE Id_Entrada = vEntry; - - DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - - SELECT warehouseInFk, warehouseOutFk, tr.id - INTO vWarehouseIn, vWarehouseOut, vTravel - FROM travel tr - JOIN entry e ON e.travelFk = tr.id - WHERE e.id = vEntry; - - UPDATE travel - SET warehouseInFk = vWarehouseOut, - warehouseOutFk = vWarehouseIn - WHERE id = vTravel; - - UPDATE vn2008.Compres c - LEFT JOIN vn.itemConversor ic ON ic.espItemFk = c.Id_Article - SET Etiquetas = 0, Cantidad = 0 - WHERE c.Id_Entrada = vEntry - AND ic.espItemFk IS NULL; - - OPEN rs; - - DELETE FROM vn2008.Compres WHERE Id_Entrada = vEntry; - - FETCH rs INTO - vId_Entrada, - vId_Article, - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP; - - WHILE NOT done DO - - -- Primero la linea original con las cantidades invertidas - INSERT INTO vn2008.Compres - ( - Id_Entrada, - Id_Article, - Etiquetas, - Id_Cubo, - Packing, - `grouping`, - Cantidad, - Costefijo, - Portefijo, - Embalajefijo, - Comisionfija, - caja, - Nicho, - Tarifa1, - Tarifa2, - Tarifa3, - PVP - ) - VALUES - ( - vId_Entrada, - vId_Article, - - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP); - - -- Ahora la linea nueva, con el item genérico - INSERT INTO vn2008.Compres - ( - Id_Entrada, - Id_Article, - Etiquetas, - Id_Cubo, - Packing, - `grouping`, - Cantidad, - Costefijo, - Portefijo, - Embalajefijo, - Comisionfija, - caja, - Nicho, - Tarifa1, - Tarifa2, - Tarifa3, - PVP - ) - SELECT - vId_Entrada, - genItemFk as Id_Article, - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP - FROM itemConversor - WHERE espItemFk = vId_Article; - - SELECT LAST_INSERT_ID() - INTO vCompra; - - REPLACE vn2008.Compres_mark(Id_Compra,`comment`) - SELECT vCompra, vId_Article; - - - FETCH rs INTO - vId_Entrada, - vId_Article, - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP; - - END WHILE; - - - CLOSE rs; - - - +BEGIN + + DECLARE vWarehouseIn INT; + DECLARE vWarehouseOut INT; + DECLARE vTravel INT; + + DECLARE done BOOL DEFAULT FALSE; + + DECLARE vId_Entrada INT; + DECLARE vId_Article INT; + DECLARE vEtiquetas INT; + DECLARE vId_Cubo VARCHAR(10); + DECLARE vPacking INT; + DECLARE vGrouping INT; + DECLARE vCantidad INT; + DECLARE vCostefijo DECIMAL(10,3); + DECLARE vPortefijo DECIMAL(10,3); + DECLARE vEmbalajefijo DECIMAL(10); + DECLARE vComisionfija DECIMAL(10,3); + DECLARE vCaja INT; + DECLARE vNicho VARCHAR(5); + DECLARE vTarifa1 DECIMAL(10,2); + DECLARE vTarifa2 DECIMAL(10,2); + DECLARE vTarifa3 DECIMAL(10,2); + DECLARE vPVP DECIMAL(10,2); + DECLARE vCompra INT; + + DECLARE rs CURSOR FOR + SELECT + b.Id_Entrada, + b.Id_Article, + b.Etiquetas, + b.Id_Cubo, + b.Packing, + b.`grouping`, + b.Cantidad, + b.Costefijo, + b.Portefijo, + b.Embalajefijo, + b.Comisionfija, + b.caja, + b.Nicho, + b.Tarifa1, + b.Tarifa2, + b.Tarifa3, + b.PVP + FROM vn2008.Compres b + JOIN vn.itemConversor ic ON ic.espItemFk = b.Id_Article + WHERE Id_Entrada = vEntry; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + SELECT warehouseInFk, warehouseOutFk, tr.id + INTO vWarehouseIn, vWarehouseOut, vTravel + FROM travel tr + JOIN entry e ON e.travelFk = tr.id + WHERE e.id = vEntry; + + UPDATE travel + SET warehouseInFk = vWarehouseOut, + warehouseOutFk = vWarehouseIn + WHERE id = vTravel; + + UPDATE vn2008.Compres c + LEFT JOIN vn.itemConversor ic ON ic.espItemFk = c.Id_Article + SET Etiquetas = 0, Cantidad = 0 + WHERE c.Id_Entrada = vEntry + AND ic.espItemFk IS NULL; + + OPEN rs; + + DELETE FROM vn2008.Compres WHERE Id_Entrada = vEntry; + + FETCH rs INTO + vId_Entrada, + vId_Article, + vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP; + + WHILE NOT done DO + + -- Primero la linea original con las cantidades invertidas + INSERT INTO vn2008.Compres + ( + Id_Entrada, + Id_Article, + Etiquetas, + Id_Cubo, + Packing, + `grouping`, + Cantidad, + Costefijo, + Portefijo, + Embalajefijo, + Comisionfija, + caja, + Nicho, + Tarifa1, + Tarifa2, + Tarifa3, + PVP + ) + VALUES + ( + vId_Entrada, + vId_Article, + - vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + - vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP); + + -- Ahora la linea nueva, con el item genérico + INSERT INTO vn2008.Compres + ( + Id_Entrada, + Id_Article, + Etiquetas, + Id_Cubo, + Packing, + `grouping`, + Cantidad, + Costefijo, + Portefijo, + Embalajefijo, + Comisionfija, + caja, + Nicho, + Tarifa1, + Tarifa2, + Tarifa3, + PVP + ) + SELECT + vId_Entrada, + genItemFk as Id_Article, + vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP + FROM itemConversor + WHERE espItemFk = vId_Article; + + SELECT LAST_INSERT_ID() + INTO vCompra; + + REPLACE vn2008.Compres_mark(Id_Compra,`comment`) + SELECT vCompra, vId_Article; + + + FETCH rs INTO + vId_Entrada, + vId_Article, + vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP; + + END WHILE; + + + CLOSE rs; + + + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -47683,62 +48019,62 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `entryPrepare`(IN `idE` BIGINT) -BEGIN - SELECT - b.quantity / b.packing AS Paquetes, - b.packing AS `Grouping`, - barcode, - 'ASEGURADO' AS asegurado, - ic.name, - ic.order, - s.name AS Consignatario, - e.supplierFk AS Id_Cliente, - e.isOrdered, - e.isConfirmed, - 10 AS Calidad, - LPAD(IFNULL(cpd.id, ip.code), - 5, - '0') AS path, - b.entryFk AS Id_Ticket, - t.landed AS Fecha, - b.itemFk, - b.quantity, - i.name AS Concepte, - i.size, - i.inkFk, - i.category, - o.code AS Origen, - 0 AS Bultos, - wIn.`name` AS Tipo, - 0 AS OK, - 0 AS Reservado, - i.stems, - b.id AS Id_Movimiento, - ip.code, - 'PEDIDO ASEGURADO' AS MSG, - 0 AS Seguro, - i.image, - pr.name AS producer - FROM vn.buy b - JOIN vn.entry e ON b.entryFk = e.id - JOIN vn.travel t ON t.id = e.travelFk - JOIN vn.warehouse wIn ON wIn.id = t.warehouseInFk - JOIN vn.warehouse wOut ON wOut.id = t.warehouseOutFk - JOIN vn.item i ON i.id = b.itemFk - JOIN vn.itemType it ON it.id =i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - JOIN vn.packaging pkg ON pkg.id = b.packageFk - LEFT JOIN vn.itemPlacement ip ON i.id = ip.itemFk AND ip.warehouseFk = wIn.id AND ip.warehouseFk = t.warehouseOutFk - LEFT JOIN (SELECT itemFk, code AS barcode FROM vn.itemBarcode GROUP BY itemFk) ib ON ib.itemFk = b.itemFk - LEFT JOIN vn.origin o ON o.id = i.originFk - LEFT JOIN vn.supplier s ON s.id = e.supplierFk - LEFT JOIN vn.producer pr on pr.id = i.producerFk - LEFT JOIN vn.coolerPathDetail cpd ON LEFT(ip.code, 3) = cpd.hallway - WHERE - NOT wIn.isFeedStock AND NOT e.isInventory AND NOT e.isRaid - AND e.id = 158772 - AND i.typeFk IS NOT NULL - AND ic.merchandise IS NOT FALSE; +BEGIN + SELECT + b.quantity / b.packing AS Paquetes, + b.packing AS `Grouping`, + barcode, + 'ASEGURADO' AS asegurado, + ic.name, + ic.order, + s.name AS Consignatario, + e.supplierFk AS Id_Cliente, + e.isOrdered, + e.isConfirmed, + 10 AS Calidad, + LPAD(IFNULL(cpd.id, ip.code), + 5, + '0') AS path, + b.entryFk AS Id_Ticket, + t.landed AS Fecha, + b.itemFk, + b.quantity, + i.name AS Concepte, + i.size, + i.inkFk, + i.category, + o.code AS Origen, + 0 AS Bultos, + wIn.`name` AS Tipo, + 0 AS OK, + 0 AS Reservado, + i.stems, + b.id AS Id_Movimiento, + ip.code, + 'PEDIDO ASEGURADO' AS MSG, + 0 AS Seguro, + i.image, + pr.name AS producer + FROM vn.buy b + JOIN vn.entry e ON b.entryFk = e.id + JOIN vn.travel t ON t.id = e.travelFk + JOIN vn.warehouse wIn ON wIn.id = t.warehouseInFk + JOIN vn.warehouse wOut ON wOut.id = t.warehouseOutFk + JOIN vn.item i ON i.id = b.itemFk + JOIN vn.itemType it ON it.id =i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.packaging pkg ON pkg.id = b.packageFk + LEFT JOIN vn.itemPlacement ip ON i.id = ip.itemFk AND ip.warehouseFk = wIn.id AND ip.warehouseFk = t.warehouseOutFk + LEFT JOIN (SELECT itemFk, code AS barcode FROM vn.itemBarcode GROUP BY itemFk) ib ON ib.itemFk = b.itemFk + LEFT JOIN vn.origin o ON o.id = i.originFk + LEFT JOIN vn.supplier s ON s.id = e.supplierFk + LEFT JOIN vn.producer pr on pr.id = i.producerFk + LEFT JOIN vn.coolerPathDetail cpd ON LEFT(ip.code, 3) = cpd.hallway + WHERE + NOT wIn.isFeedStock AND NOT e.isInventory AND NOT e.isRaid + AND e.id = 158772 + AND i.typeFk IS NOT NULL + AND ic.merchandise IS NOT FALSE; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -53554,17 +53890,12 @@ BEGIN FROM vn.worker w JOIN vn.sector s ON s.code = w.code WHERE s.id = vSectorFk; - - IF vWarehouseFk = 1 THEN - - SET vSectorFk = 9; - - ELSEIF vWarehouseFk = 44 THEN - - SET vSectorFk = 6; - - END IF; + SELECT s.id INTO vSectorFk + FROM vn.sector s + WHERE s.warehouseFk = vWarehouseFk + AND s.isMain; + SELECT COUNT(*) INTO hasFatherSector FROM vn.sector WHERE sonFk = vSectorFk; @@ -53572,7 +53903,7 @@ BEGIN SELECT warehouseFk, sonFk INTO vWarehouseFk, vSonSectorFk FROM vn.sector WHERE id = vSectorFk; - + SELECT vSectorFk, vWarehouseFk, hasFatherSector , vSonSectorFk; CALL cache.visible_refresh(vCalcVisibleFk, TRUE, vWarehouseFk); CALL cache.available_refresh(vCalcAvailableFk, FALSE, vWarehouseFk, CURDATE()); @@ -53588,10 +53919,10 @@ BEGIN i.longName, i.size, i.subName producer, - a.available, - SUM(IF(s.sonFk = vSectorFk, iss.visible, 0)) upstairs, - SUM(IF(iss.sectorFk = vSectorFk, iss.visible, 0)) downstairs, - IF(it.isPackaging, NULL, IFNULL(v.visible,0)) as visible, + IFNULL(a.available,0) available, + SUM(IF(s.sonFk = vSectorFk, IFNULL(iss.visible,0), 0)) upstairs, + SUM(IF(iss.sectorFk = vSectorFk, IFNULL(iss.visible,0), 0)) downstairs, + IF(it.isPackaging, null, IFNULL(v.visible,0)) as visible, vSectorFk as sectorFk FROM vn.itemShelvingStock iss @@ -53601,6 +53932,7 @@ BEGIN LEFT JOIN cache.available a ON a.item_id = iss.itemFk AND a.calc_id = vCalcAvailableFk LEFT JOIN cache.visible v ON v.item_id = iss.itemFk AND v.calc_id = vCalcVisibleFk WHERE vSectorFk IN (iss.sectorFk, s.sonFk) + AND it.workerFk != 3366 GROUP BY iss.itemFk @@ -53679,14 +54011,9 @@ BEGIN ) ips ON ips.itemFk = i.id WHERE IFNULL(iss.sectorFk,0) IN (0, vSectorFk) OR iss.sectorFk = vSectorFk; - /* - UPDATE tmp.itemShelvingRadar isr - JOIN vn.itemShelvingStock iss ON iss.itemFk = isr.itemFk - SET isr.dayEndVisible = isr.dayEndVisible + iss.visible, - isr.firstNegative = isr.firstNegative + iss.visible, - isr.itemPlacementVisible = isr.itemPlacementVisible + iss.visible - WHERE iss.sectorFk = vSonSectorFk; - */ + + SELECT * FROM tmp.itemShelvingRadar; + DROP TEMPORARY TABLE IF EXISTS tmp.itemOutTime; CREATE TEMPORARY TABLE tmp.itemOutTime SELECT *,SUM(amount) quantity @@ -53940,6 +54267,89 @@ BEGIN SELECT true; +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 `itemShelving_BuyerGet` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `itemShelving_BuyerGet`( ) +BEGIN + + SELECT * FROM vn.buyer; + +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 `itemShelving_BuyerTask` */; +/*!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 `itemShelving_BuyerTask`(vWorkerFk INT ) +BEGIN + + SELECT ish.id, + ish.itemFk, + i.longName, + i.image, + p.code as parking, + ish.shelvingFk, + ish.visible, + ish.created, + ish.stars + FROM vn.itemShelving ish + JOIN vn.item i ON i.id = ish.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.shelving sh ON sh.code = ish.shelvingFk + JOIN vn.parking p ON p.id = sh.parkingFk + JOIN vn.sector s ON s.id = p.sectorFk + WHERE s.warehouseFk = 1 + AND it.workerFk = vWorkerFk + AND ish.stars IS NULL + ORDER BY p.pickingOrder; + +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 `itemShelving_StarsUpdate` */; +/*!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=`z-developer`@`%` PROCEDURE `itemShelving_StarsUpdate`(vId INT, vStars INT) +BEGIN + + UPDATE vn.itemShelving + SET stars = vStars + WHERE id = vId; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -54187,13 +54597,93 @@ DELIMITER ; /*!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 character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `itemTagReorder`(itemTypeFk INT) +BEGIN + + SET @isTriggerDisabled = TRUE; + + -- No se puede usar temporary porque da error Error Code: 1137. No puedo reabrir tabla: 'i + DROP TABLE IF EXISTS tmp.item; + CREATE TABLE tmp.item + SELECT DISTINCT i.id + FROM vn.item i + WHERE i.typeFk = itemTypeFk; + + UPDATE itemTag it + JOIN tmp.item i ON i.id = it.itemFk + JOIN vn.item ON item.id = i.id + JOIN itemTypeTag itt ON itt.itemTypeFk = item.typeFk AND itt.tagFk = it.tagFk + SET it.priority = itt.priority + WHERE itt.itemTypeFk = itemTypeFk; + + CALL item_refreshTags(); + + SET @isTriggerDisabled = FALSE; + + DROP TABLE tmp.item; +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 `itemTagReorderByName` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `itemTagReorderByName`(vName VARCHAR(255)) +BEGIN + + SET @isTriggerDisabled = TRUE; + + -- No se puede usar temporary porque da error Error Code: 1137. No puedo reabrir tabla: 'i + DROP TABLE IF EXISTS tmp.item; + CREATE TABLE tmp.item + SELECT DISTINCT i.id + FROM vn.item i + WHERE i.`name` LIKE CONCAT(vName,'%'); + + UPDATE itemTag it + JOIN tmp.item i ON i.id = it.itemFk + JOIN vn.item ON item.id = i.id + JOIN itemTypeTag itt ON itt.itemTypeFk = item.typeFk AND itt.tagFk = it.tagFk + SET it.priority = itt.priority + WHERE itt.itemTypeFk = itemTypeFk; + + CALL item_refreshTags(); + + SET @isTriggerDisabled = FALSE; + + DROP TABLE tmp.item; +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 `itemTagReorderByName__` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `itemTagReorderByName__`(vName VARCHAR(255)) BEGIN DECLARE vDone BOOL DEFAULT FALSE; @@ -54205,13 +54695,13 @@ DECLARE vDone BOOL DEFAULT FALSE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - SET @isTriggerDisabled = TRUE; - + SET @isTriggerDisabled = TRUE; + DROP TEMPORARY TABLE IF EXISTS upda; - create temporary table upda + CREATE TEMPORARY TABLE upda SELECT DISTINCT i.id FROM vn.item i - WHERE i.typeFk = itemTypeFk; + WHERE i.name LIKE CONCAT(vName,'%'); UPDATE itemTag it JOIN item i ON i.id = it.itemFk @@ -54236,17 +54726,17 @@ DELIMITER ; /*!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 `itemTagReorderByName` */; +/*!50003 DROP PROCEDURE IF EXISTS `itemTagReorder__` */; /*!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 character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`%` PROCEDURE `itemTagReorderByName`(vName VARCHAR(255)) +CREATE DEFINER=`root`@`%` PROCEDURE `itemTagReorder__`(itemTypeFk INT) BEGIN DECLARE vDone BOOL DEFAULT FALSE; @@ -54258,13 +54748,13 @@ DECLARE vDone BOOL DEFAULT FALSE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - SET @isTriggerDisabled = TRUE; - + SET @isTriggerDisabled = TRUE; + DROP TEMPORARY TABLE IF EXISTS upda; - CREATE TEMPORARY TABLE upda + create temporary table upda SELECT DISTINCT i.id FROM vn.item i - WHERE i.name LIKE CONCAT(vName,'%'); + WHERE i.typeFk = itemTypeFk; UPDATE itemTag it JOIN item i ON i.id = it.itemFk @@ -54387,6 +54877,67 @@ BEGIN DROP TABLE IF EXISTS topSellerMin; DROP TABLE IF EXISTS tmp.topSeller; +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 `itemTrash` */; +/*!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 `itemTrash`( + vItemFk INT, + vWarehouseFk INT, + vQuantity INT, + vIsTrash BOOLEAN) +BEGIN + + DECLARE vTicketFk INT; + DECLARE vClientFk INT; + DECLARE vCompanyVnlFk INT DEFAULT 442; + DECLARE vAgencyModeOthersFk INT DEFAULT 2; + DECLARE vCurrentTime VARCHAR(5); + DECLARE vCalc INT; + + SELECT vn.barcodeToItem(vItemFk) INTO vItemFk; + + SELECT IF(vIsTrash,200,400) INTO vClientFk; + + SELECT t.id INTO vTicketFk + FROM vn.ticket t + JOIN vn.address a ON a.id=t.addressFk + WHERE t.warehouseFk = vWarehouseFk + AND t.clientFk = vClientFk + AND DATE(t.shipped) = CURDATE() + AND a.isDefaultAddress + LIMIT 1; + + CALL cache.visible_refresh(vCalc, TRUE, vWarehouseFk); + + IF vTicketFk IS NULL THEN + + CALL vn.ticketCreateWithoutZone(vClientFk, CURDATE(), vWarehouseFk, vCompanyVnlFk, NULL, vAgencyModeOthersFk, NULL, CURDATE(), account.userGetId(),vTicketFk); + + END IF; + + INSERT INTO sale(ticketFk, itemFk, concept, quantity, price, discount) + SELECT vTicketFk, vItemFk, CONCAT(longName," ",vn.getWorkerCode(), " ",LEFT(CAST(NOW() AS TIME),5)), vQuantity,0,0 + FROM vn.item + WHERE id = vItemFk; + + UPDATE cache.visible + SET visible = visible - vQuantity + WHERE calc_id = vCalc + AND item_id = vItemFk; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -54726,9 +55277,9 @@ DELIMITER ; /*!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 character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; @@ -54745,7 +55296,6 @@ BEGIN CREATE TEMPORARY TABLE tmp.itemToRefresh SELECT id from tmp.item; - UPDATE item i JOIN tmp.itemToRefresh tmpI ON tmpI.id = i.id LEFT JOIN itemTag it1 ON it1.priority = 1 AND it1.itemFk = i.id @@ -54763,7 +55313,7 @@ BEGIN LEFT JOIN tagAbbreviation ta3 ON ta3.`value` = it3.`value` SET i.`name` = CONCAT_WS(' ', IFNULL(ta1.abbreviation,it1.`value`), - IF(i.id > 400000,'',IFNULL(ta2.abbreviation,it2.`value`)), + IFNULL(ta2.abbreviation,it2.`value`), IF(i.id > 400000,'',IFNULL(ta3.abbreviation,it3.`value`))); UPDATE item i @@ -55431,7 +55981,7 @@ DELIMITER ; /*!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 `kk_` */; +/*!50003 DROP PROCEDURE IF EXISTS `ledger_doCompensation` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -55439,71 +55989,7 @@ DELIMITER ; /*!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=`z-developer`@`%` PROCEDURE `kk_`() -BEGIN - - DECLARE i INT DEFAULT 1; - DECLARE vPasillos VARCHAR(4) DEFAULT 'ABCD'; - DECLARE vPasilloLetra VARCHAR(1); - DECLARE vPasillo INT DEFAULT 0; - DECLARE vEstanteria INT DEFAULT 0; - DECLARE vEstanteriaMax INT DEFAULT 54; - - WHILE i < 100 DO - - INSERT INTO vn.parking(code, sectorFk, pickingOrder, `column`, `row`) - VALUES(CONCAT('A-',RIGHT(CONCAT('0',i),2)),37,i, 0, i); - - SET i = i + 1; - - END WHILE; - - SET i = 0; - - WHILE vPasillo < LENGTH(vPasillos) DO - - SET vPasillo = vPasillo + 1; - - SET vPasilloLetra = MID(vPasillos,vPasillo,1); - - WHILE vEstanteria < vEstanteriaMax DO - - SET vEstanteria = vEstanteria + 1; - - WHILE i < 4 DO - - SET i = i + 1; - - INSERT INTO vn.parking(code, sectorFk) - VALUES(CONCAT(vPasilloLetra,'-',RIGHT(CONCAT('0',vEstanteria),2),'-',i),37); - - END WHILE; - - SET i = 0; - - END WHILE; - - SET vEstanteria = 0; - - END WHILE; - -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 `ledger_doCompensation` */; -/*!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 = utf8mb4 */ ; -/*!50003 SET character_set_results = utf8mb4 */ ; -/*!50003 SET collation_connection = utf8mb4_general_ci */ ; -/*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `ledger_doCompensation`(vDated DATE, vCompensationAccount VARCHAR(10) , vBankFk VARCHAR(10), vConcept VARCHAR(255), vAmount DECIMAL(10,2), vCompanyFk INT, vOriginalAccount VARCHAR(10)) BEGIN @@ -55511,40 +55997,155 @@ BEGIN * Compensa un pago o un recibo insertando en contabilidad * * @param vDated fecha en la cual se anota - * @param vCompensationAccount cuenta contablo contra la que se contabiliza + * @param vCompensationAccount cuenta contable contra la que se compensa * @param vBankFk banco de la compensacion * @param vConcept descripcion * @param vAmount cantidad que se compensa * @param vCompany empresa + * @param vOriginalAccount cuenta contable desde la cual se compensa + * */ DECLARE vNewBookEntry INT; - DECLARE vClientCompensation INT; - DECLARE vSupplierCompensation INT; + DECLARE vIsClientCompensation INT; + DECLARE vClientFk INT; + DECLARE vSupplierFk INT; + DECLARE vIsOriginalAClient BOOL; DECLARE vPayMethodCompensation INT; + DECLARE vAmountCompensation DECIMAL(10,2); - CALL vn.ledger_next(vNewBookEntry); - - INSERT INTO XDiario (ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, empresa_id) - VALUES (vNewBookEntry, vDated, vOriginalAccount, vCompensationAccount, vConcept, vAmount, 0, vCompanyFk), - (vNewBookEntry, vDated, vCompensationAccount, vOriginalAccount, vConcept, 0, vAmount, vCompanyFk); - - SELECT id INTO vClientCompensation FROM vn.`client` WHERE accountingAccount LIKE vCompensationAccount COLLATE utf8_general_ci; - SELECT id INTO vSupplierCompensation FROM vn.supplier WHERE `account` LIKE vCompensationAccount COLLATE utf8_general_ci; + CALL ledger_next(vNewBookEntry); + + SELECT COUNT(id) INTO vIsOriginalAClient FROM client WHERE accountingAccount LIKE vOriginalAccount COLLATE utf8_general_ci; + + SELECT id, COUNT(id) INTO vClientFk, vIsClientCompensation + FROM client + WHERE accountingAccount LIKE vCompensationAccount COLLATE utf8_general_ci; - IF MID(vCompensationAccount, 1, 2) = MID(vOriginalAccount, 1, 2) THEN - SET vAmount = -vAmount; - END IF; + SET @vAmount1:= 0; + SET @vAmount2:= 0; + INSERT INTO XDiario (ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, empresa_id) + VALUES ( vNewBookEntry, + vDated, + vOriginalAccount, + vCompensationAccount, + vConcept, + @vAmount1:= IF( + (vIsOriginalAClient OR NOT vIsOriginalAClient) + AND vAmount > 0, + 0, + ABS(vAmount) + ), + @vAmount2:= IF(@vAmount1, + 0, + ABS(vAmount) + ), + vCompanyFk + ), + ( vNewBookEntry, + vDated, + vCompensationAccount, + vOriginalAccount, + vConcept, + @vAmount2, + @vAmount1, + vCompanyFk); + + IF vIsClientCompensation THEN - IF vClientCompensation THEN INSERT INTO receipt(invoiceFk, amountPaid, payed, bankFk, companyFk, clientFk, isConciliate) - VALUES (vConcept, vAmount, vDated, vBankFk, vCompanyFk, vClientCompensation, TRUE); - END IF; + VALUES (vConcept, vAmount, vDated, vBankFk, vCompanyFk, vClientFk, TRUE); + ELSE - IF vSupplierCompensation THEN + SELECT id INTO vSupplierFk FROM supplier WHERE `account` LIKE vCompensationAccount COLLATE utf8_general_ci; SELECT id INTO vPayMethodCompensation FROM payMethod WHERE `code` = 'compensation'; + INSERT INTO vn2008.pago (fecha, dueDated, id_proveedor, importe, id_banco, pay_met_id, concepte, empresa_id, conciliado) - VALUES(vDated, vDated, vSupplierCompensation, vAmount, vBankFk, vPayMethodCompensation, vConcept, vCompanyFk, TRUE); + VALUES(vDated, vDated, vSupplierFk, vAmount, vBankFk, vPayMethodCompensation, vConcept, vCompanyFk, TRUE); + END IF; +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 `ledger_doCompensation__` */; +/*!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 = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `ledger_doCompensation__`(vDated DATE, vCompensationAccount VARCHAR(10) , vBankFk VARCHAR(10), vConcept VARCHAR(255), vAmount DECIMAL(10,2), vCompanyFk INT, vOriginalAccount VARCHAR(10)) +BEGIN +/** + * Compensa un pago o un recibo insertando en contabilidad + * + * @param vDated fecha en la cual se anota + * @param vCompensationAccount cuenta contable contra la que se compensa + * @param vBankFk banco de la compensacion + * @param vConcept descripcion + * @param vAmount cantidad que se compensa + * @param vCompany empresa + * @param vOriginalAccount cuenta contable desde la cual se compensa + * + */ + + DECLARE vNewBookEntry INT; + DECLARE vIsClientCompensation INT; + DECLARE vClientFk INT; + DECLARE vSupplierFk INT; + DECLARE vIsOriginalAClient BOOL; + DECLARE vPayMethodCompensation INT; + DECLARE vAmountCompensation INT; + + CALL ledger_next(vNewBookEntry); + + SELECT COUNT(id) INTO vIsOriginalAClient FROM client WHERE accountingAccount LIKE vOriginalAccount COLLATE utf8_general_ci; + + SELECT id, COUNT(id) INTO vClientFk, vIsClientCompensation + FROM client + WHERE accountingAccount LIKE vCompensationAccount COLLATE utf8_general_ci; + + IF vIsOriginalAClient = vIsClientCompensation THEN + SET vAmountCompensation = -vAmount; + ELSE + SET vAmountCompensation = vAmount; + END IF; + + INSERT INTO XDiario (ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, empresa_id) + VALUES ( vNewBookEntry, + vDated, + vOriginalAccount, + vCompensationAccount, + vConcept, + IF(vIsOriginalAClient, 0, vAmount), + IF(vIsOriginalAClient, vAmount, 0), + vCompanyFk + ), + ( vNewBookEntry, + vDated, + vCompensationAccount, + vOriginalAccount, + vConcept, + IF(vIsClientCompensation, 0, vAmountCompensation), + IF(vIsClientCompensation, vAmountCompensation, 0), + vCompanyFk); + + IF vIsClientCompensation THEN + + INSERT INTO receipt(invoiceFk, amountPaid, payed, bankFk, companyFk, clientFk, isConciliate) + VALUES (vConcept, vAmount, vDated, vBankFk, vCompanyFk, vClientFk, TRUE); + ELSE + + SELECT id INTO vSupplierFk FROM supplier WHERE `account` LIKE vCompensationAccount COLLATE utf8_general_ci; + SELECT id INTO vPayMethodCompensation FROM payMethod WHERE `code` = 'compensation'; + + INSERT INTO vn2008.pago (fecha, dueDated, id_proveedor, importe, id_banco, pay_met_id, concepte, empresa_id, conciliado) + VALUES(vDated, vDated, vSupplierFk, vAmount, vBankFk, vPayMethodCompensation, vConcept, vCompanyFk, TRUE); END IF; END ;; DELIMITER ; @@ -57269,7 +57870,90 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`%` PROCEDURE `rate_getPrices`(vLanded DATE, vWarehouseFk INT) +CREATE DEFINER=`root`@`%` PROCEDURE `rate_getPrices`(vDated DATE, vWarehouseFk INT) +BEGIN +/** + * Prepara una tabla con las tarifas aplicables en funcion de la fecha y el almacén + * + * @param vDated fecha para la cual calcula la tarifa + * @param vWarehouseFk warehouse para el cual calcula la tafia + * @return tmp.rate(rate0, rate1, rate2, rate3) + */ + DROP TEMPORARY TABLE IF EXISTS tRate; + CREATE TEMPORARY TABLE tRate + SELECT rate0, rate1, rate2, rate3 + FROM vn.rate + WHERE dated <= vDated + AND warehouseFk = vWarehouseFk + ORDER BY dated DESC; + + DROP TEMPORARY TABLE IF EXISTS tmp.rate; + CREATE TEMPORARY TABLE tmp.rate + ENGINE = MEMORY + SELECT * FROM + ( + SELECT * FROM tRate + UNION ALL + SELECT rate0, rate1, rate2, rate3 FROM rateConfig + ) sub2 + LIMIT 1; + DROP TEMPORARY TABLE tRate; +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 `rate_getPrices2` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `rate_getPrices2`(vLanded DATE, vWarehouseFk INT) +BEGIN + + -- Prepara una tabla con las tarifas aplicables en funcion de la fecha y el almacén + DROP TEMPORARY TABLE IF EXISTS tRate; + CREATE TEMPORARY TABLE tRate + SELECT rate0, rate1, rate2, rate3 + FROM vn.rate + WHERE dated <= vLanded + AND warehouseFk = vWarehouseFk + ORDER BY dated DESC; + + DROP TEMPORARY TABLE IF EXISTS tmp.rate; + CREATE TEMPORARY TABLE tmp.rate + ENGINE = MEMORY + SELECT * FROM + ( + SELECT * FROM tRate + UNION ALL + SELECT rate0, rate1, rate2, rate3 FROM rateConfig + ) sub2 + LIMIT 1; + DROP TEMPORARY TABLE tRate; +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 `rate_getPrices__` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `rate_getPrices__`(vLanded DATE, vWarehouseFk INT) BEGIN -- Prepara una tabla con las tarifas aplicables en funcion de la fecha y el almacén @@ -58130,77 +58814,77 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `saleItemShelvingMake`(IN `vTicketFk` INT, IN `vSectorFk` INT) -BEGIN - - SET @rest:= CAST(0 AS DECIMAL(10,0)); - SET @saleFk := CAST(0 AS DECIMAL(10,0)); - SET @reserved := CAST(0 AS DECIMAL(10,0)); - - UPDATE vn.itemShelving ish - JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id - JOIN sale s ON s.id = sis.saleFk - SET ish.visible = sis.quantity + ish.visible, - ish.available = sis.quantity + ish.visible - WHERE s.ticketFk = vTicketFk; - - DELETE sis.* - FROM saleItemShelving sis - JOIN sale s ON s.id = sis.saleFk - WHERE s.ticketFk = vTicketFk; - - INSERT INTO saleItemShelving( saleFk, - itemShelvingFk, - quantity, - ubication) - SELECT saleFk, - itemShelvingFk, - CAST(Reserved as DECIMAL(10,0)) as Reserved, - ubication - FROM - (SELECT saleFk, - itemShelvingFk, - ubication, - @rest := IF(@saleFk = saleFk, @rest, quantity) as Falta, - @reserved := IF(available < @rest, available, IF(@rest < packing,0,@rest)) as Reserved, - @rest := @rest - @reserved, - @saleFk := saleFk - FROM - ( SELECT s.id as saleFk, - ish.created, - ish.id as itemShelvingFk, - ish.available, - s.quantity, - ish.packing, - CONCAT(p.`column`, '-',p.`row`,': ', sh.code ) as ubication - FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.sector sc ON sc.warehouseFk = t.warehouseFk - JOIN vn.parking p ON p.sectorFk = sc.id - JOIN vn.shelving sh ON sh.parkingFk = p.id - JOIN vn.itemShelving ish ON ish.shelvingFk = sh.code AND ish.itemFk = s.itemFk - WHERE t.id = vTicketFk - AND sc.id = vSectorFk - AND s.quantity MOD ish.packing = 0 - AND s.quantity >= ish.packing - ORDER BY s.id, - sh.priority DESC, - ish.packing DESC, - ish.created - ) sub - ) sub2 - WHERE Reserved > 0; - - UPDATE vn.itemShelving ish - JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id - JOIN vn.sale s ON s.id = sis.saleFk - SET ish.available = ish.visible - sis.quantity, - ish.visible = ish.visible - sis.quantity - WHERE s.ticketFk = vTicketFk - AND s.isPicked = FALSE; - - CALL vn.saleItemShelvingIsPicked(vTicketFk, TRUE); - - +BEGIN + + SET @rest:= CAST(0 AS DECIMAL(10,0)); + SET @saleFk := CAST(0 AS DECIMAL(10,0)); + SET @reserved := CAST(0 AS DECIMAL(10,0)); + + UPDATE vn.itemShelving ish + JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id + JOIN sale s ON s.id = sis.saleFk + SET ish.visible = sis.quantity + ish.visible, + ish.available = sis.quantity + ish.visible + WHERE s.ticketFk = vTicketFk; + + DELETE sis.* + FROM saleItemShelving sis + JOIN sale s ON s.id = sis.saleFk + WHERE s.ticketFk = vTicketFk; + + INSERT INTO saleItemShelving( saleFk, + itemShelvingFk, + quantity, + ubication) + SELECT saleFk, + itemShelvingFk, + CAST(Reserved as DECIMAL(10,0)) as Reserved, + ubication + FROM + (SELECT saleFk, + itemShelvingFk, + ubication, + @rest := IF(@saleFk = saleFk, @rest, quantity) as Falta, + @reserved := IF(available < @rest, available, IF(@rest < packing,0,@rest)) as Reserved, + @rest := @rest - @reserved, + @saleFk := saleFk + FROM + ( SELECT s.id as saleFk, + ish.created, + ish.id as itemShelvingFk, + ish.available, + s.quantity, + ish.packing, + CONCAT(p.`column`, '-',p.`row`,': ', sh.code ) as ubication + FROM vn.sale s + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.sector sc ON sc.warehouseFk = t.warehouseFk + JOIN vn.parking p ON p.sectorFk = sc.id + JOIN vn.shelving sh ON sh.parkingFk = p.id + JOIN vn.itemShelving ish ON ish.shelvingFk = sh.code AND ish.itemFk = s.itemFk + WHERE t.id = vTicketFk + AND sc.id = vSectorFk + AND s.quantity MOD ish.packing = 0 + AND s.quantity >= ish.packing + ORDER BY s.id, + sh.priority DESC, + ish.packing DESC, + ish.created + ) sub + ) sub2 + WHERE Reserved > 0; + + UPDATE vn.itemShelving ish + JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id + JOIN vn.sale s ON s.id = sis.saleFk + SET ish.available = ish.visible - sis.quantity, + ish.visible = ish.visible - sis.quantity + WHERE s.ticketFk = vTicketFk + AND s.isPicked = FALSE; + + CALL vn.saleItemShelvingIsPicked(vTicketFk, TRUE); + + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -58811,7 +59495,7 @@ DELIMITER ; /*!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' */ ; +/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `sale_checkNoComponents`(vCreatedFrom DATETIME, vCreatedTo DATETIME) BEGIN @@ -58823,28 +59507,28 @@ BEGIN */ DECLARE v_done BOOL DEFAULT FALSE; DECLARE vSaleFk INTEGER; - DECLARE vTicketFk INTEGER; - DECLARE vConcept VARCHAR(50); + DECLARE vTicketFk INTEGER; + DECLARE vConcept VARCHAR(50); DECLARE vCur CURSOR FOR - SELECT s.id - FROM sale s - JOIN item i ON i.id = s.itemFk - JOIN itemType tp ON tp.id = i.typeFk - JOIN itemCategory ic ON ic.id = tp.categoryFk - LEFT JOIN tmp.coste c ON c.id = s.id - WHERE s.created >= vCreatedFrom AND s.created <= vCreatedTo - AND c.id IS NULL - AND ic.merchandise != FALSE - GROUP BY s.id; - - DECLARE CONTINUE HANDLER FOR NOT FOUND + SELECT s.id + FROM sale s + JOIN item i ON i.id = s.itemFk + JOIN itemType tp ON tp.id = i.typeFk + JOIN itemCategory ic ON ic.id = tp.categoryFk + LEFT JOIN tmp.coste c ON c.id = s.id + WHERE s.created >= vCreatedFrom AND s.created <= vCreatedTo + AND c.id IS NULL + AND ic.merchandise != FALSE + GROUP BY s.id; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE; DROP TEMPORARY TABLE IF EXISTS tmp.coste; DROP TEMPORARY TABLE IF EXISTS tmp.coste; CREATE TEMPORARY TABLE tmp.coste - (primary key (id)) ENGINE = MEMORY + (PRIMARY KEY (id)) ENGINE = MEMORY SELECT s.id FROM sale s JOIN item i ON i.id = s.itemFk @@ -58855,7 +59539,7 @@ BEGIN JOIN componentType ct ON ct.id = c.typeFk AND ct.id = 1 WHERE s.created >= vCreatedFrom AND ic.merchandise != FALSE; - + OPEN vCur; l: LOOP @@ -58865,16 +59549,19 @@ BEGIN IF v_done THEN LEAVE l; END IF; - select ticketFk INTO vTicketFk FROM sale where id = vSaleFk; - select concept INTO vConcept FROM sale where id = vSaleFk; - - CALL util.debug(ticketFk, concept); + + SELECT ticketFk, concept + INTO vTicketFk, vConcept + FROM sale + WHERE id = vSaleFk; + + CALL util.debug(vTicketFk, vConcept); -- CALL sale_calculateComponent(vSaleFk, 1); END LOOP; - CLOSE vCur; + CLOSE vCur; DROP TEMPORARY TABLE tmp.coste; - END ;; +END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; /*!50003 SET character_set_client = @saved_cs_client */ ; @@ -58938,33 +59625,33 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `scanTreeCreate__`() -BEGIN - CALL nestTree( - 'vn2008', - 'scan', - 'vn2008', - 'scanTree' - ); - - UPDATE vn2008.scanTree st - JOIN ( - SELECT sl.scan_id, - MAX(sl.odbc_date) lastScanned, - COUNT(DISTINCT t.routeFk) routeCount, - MIN(t.routeFk) mod 1000 as minRoute, - MAX(t.routeFk) mod 1000 as maxRoute, - COUNT(sl.scan_line_id) as scanned - FROM vn2008.scan_line sl - JOIN expedition e ON e.id = sl.`code` - JOIN ticket t ON t.id = e.ticketFk - WHERE t.routeFk - GROUP BY sl.scan_id - ) rs ON rs.scan_id = st.id - SET st.lastScanned = rs.lastScanned, - st.routeCount = rs.routeCount, - st.minRoute = rs.minRoute, - st.maxRoute = IF(rs.minRoute != rs.maxRoute, rs.maxRoute,NULL), - st.scanned = rs.scanned; +BEGIN + CALL nestTree( + 'vn2008', + 'scan', + 'vn2008', + 'scanTree' + ); + + UPDATE vn2008.scanTree st + JOIN ( + SELECT sl.scan_id, + MAX(sl.odbc_date) lastScanned, + COUNT(DISTINCT t.routeFk) routeCount, + MIN(t.routeFk) mod 1000 as minRoute, + MAX(t.routeFk) mod 1000 as maxRoute, + COUNT(sl.scan_line_id) as scanned + FROM vn2008.scan_line sl + JOIN expedition e ON e.id = sl.`code` + JOIN ticket t ON t.id = e.ticketFk + WHERE t.routeFk + GROUP BY sl.scan_id + ) rs ON rs.scan_id = st.id + SET st.lastScanned = rs.lastScanned, + st.routeCount = rs.routeCount, + st.minRoute = rs.minRoute, + st.maxRoute = IF(rs.minRoute != rs.maxRoute, rs.maxRoute,NULL), + st.scanned = rs.scanned; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -59435,7 +60122,7 @@ DELIMITER ; /*!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 `silla_algemesi` */; +/*!50003 DROP PROCEDURE IF EXISTS `silla_algemesi__` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; /*!50003 SET @saved_col_connection = @@collation_connection */ ; @@ -59445,7 +60132,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`%` PROCEDURE `silla_algemesi`(vDate DATE, vItemFk INT, vQuantity INT) +CREATE DEFINER=`root`@`%` PROCEDURE `silla_algemesi__`(vDate DATE, vItemFk INT, vQuantity INT) BEGIN DECLARE done INT DEFAULT FALSE; @@ -62389,113 +63076,6 @@ DELIMITER ; /*!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 `ticketGetTax` */; -/*!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 `ticketGetTax`() - READS SQL DATA -BEGIN -/** - * Calcula la base imponible, el IVA y el recargo de equivalencia para - * un conjunto de tickets. - * - * @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular - * @return tmp.ticketAmount - * @return tmp.ticketTax Impuesto desglosado para cada ticket. - - */ - DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; - CREATE TEMPORARY TABLE tmp.addressCompany - (INDEX (addressFk, companyFk)) - ENGINE = MEMORY - SELECT DISTINCT t.addressFk, t.companyFk - FROM tmp.ticket tmpTicket - JOIN ticket t ON t.id = tmpTicket.ticketFk; - - CALL addressTaxArea (); - - - /** Solo se calcula la base imponible (taxableBase) y el impuesto se calculará posteriormente - * No se debería cambiar el sistema por problemas con los decimales - */ - - DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax; - CREATE TEMPORARY TABLE tmp.ticketTax - (INDEX (ticketFk)) - ENGINE = MEMORY - SELECT tmpTicket.ticketFk, - bp.pgcFk, - SUM(s.quantity * s.price * (100 - s.discount)/100 ) AS taxableBase, - pgc.rate, - tc.code - FROM tmp.ticket tmpTicket - JOIN sale s ON s.ticketFk = tmpTicket.ticketFk - JOIN item i ON i.id = s.itemFk - JOIN ticket t ON t.id = tmpTicket.ticketFk - JOIN supplier su ON su.id = t.companyFk - JOIN tmp.addressTaxArea ata - ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk - JOIN itemTaxCountry itc - ON itc.itemFk = i.id AND itc.countryFk = su.countryFk - JOIN bookingPlanner bp - ON bp.countryFk = su.countryFk - AND bp.taxAreaFk = ata.areaFk - AND bp.taxClassFk = itc.taxClassFk - JOIN pgc ON pgc.code = bp.pgcFk - JOIN taxClass tc ON tc.id = bp.taxClassFk - GROUP BY tmpTicket.ticketFk, pgc.code,pgc.rate - HAVING taxableBase != 0; - - DROP TEMPORARY TABLE IF EXISTS tmp.ticketServiceTax; - CREATE TEMPORARY TABLE tmp.ticketServiceTax - (INDEX (ticketFk)) - ENGINE = MEMORY - SELECT tt.ticketFk, - SUM(ts.quantity * ts.price) AS taxableBase, - pgc.rate, - tc.code - FROM tmp.ticketTax tt - JOIN ticketService ts ON ts.ticketFk = tt.ticketFk - JOIN ticket t ON t.id = tt.ticketFk - JOIN supplier su ON su.id = t.companyFk - JOIN tmp.addressTaxArea ata - ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk - JOIN bookingPlanner bp - ON bp.countryFk = su.countryFk - AND bp.taxAreaFk = ata.areaFk - AND bp.taxClassFk = ts.taxClassFk - JOIN pgc ON pgc.code = bp.pgcFk AND pgc.rate = tt.rate - JOIN taxClass tc ON tc.id = bp.taxClassFk - GROUP BY tt.ticketFk, tt.code,tt.rate - HAVING taxableBase != 0; - - UPDATE tmp.ticketTax tt - JOIN tmp.ticketServiceTax ts ON tt.ticketFk = ts.ticketFk AND tt.code = ts.code AND tt.rate = ts.rate - SET tt.taxableBase = tt.taxableBase + ts.taxableBase; - - DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount; - CREATE TEMPORARY TABLE tmp.ticketAmount - (INDEX (ticketFk)) - ENGINE = MEMORY - SELECT ticketFk, taxableBase, SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax,code - FROM tmp.ticketTax - GROUP BY ticketFk, code; - - DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; - DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea; -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 `ticketGetTaxAdd` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -62726,13 +63306,33 @@ DELIMITER ; /*!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 `ticketGetTax__2` */; +/*!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 = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +CREATE DEFINER=`root`@`%` PROCEDURE `ticketGetTax__2`() + READS SQL DATA +BEGIN + CALL ticket_getTax(NULL); +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 `ticketGetTotal` */; /*!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 character_set_client = utf8mb4 */ ; +/*!50003 SET character_set_results = utf8mb4 */ ; +/*!50003 SET collation_connection = utf8mb4_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; @@ -62745,8 +63345,8 @@ BEGIN * @table tmp.ticket(ticketFk) Identificadores de los tickets a calcular * @return tmp.ticketTotal Total para cada ticket */ - CALL vn.ticketGetTax(); - + CALL ticket_getTax(NULL); + DROP TEMPORARY TABLE IF EXISTS tmp.ticketTotal; CREATE TEMPORARY TABLE tmp.ticketTotal (INDEX (ticketFk)) @@ -63615,89 +64215,6 @@ DELIMITER ; /*!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 `ticket_checkNoComponents__` */; -/*!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 `ticket_checkNoComponents__`(vShippedFrom DATETIME, vShippedTo DATETIME) -BEGIN - -/** - * Comprueba que los tickets entre un rango de fechas tienen componentes - * - * @param vShippedFrom inicio del rango - * @param vShippedTo fin del rango - */ - DECLARE v_done BOOL DEFAULT FALSE; - DECLARE vSaleFk INTEGER; - DECLARE vTicketFk INTEGER; - DECLARE vConcept VARCHAR(50); - DECLARE vCur CURSOR FOR - SELECT s.id - FROM ticket t - JOIN client clt ON clt.id = t.clientFk - JOIN sale s ON s.ticketFk = t.id - JOIN item i ON i.id = s.itemFk - JOIN itemType tp ON tp.id = i.typeFk - JOIN itemCategory ic ON ic.id = tp.categoryFk - LEFT JOIN tmp.coste c ON c.id = s.id - WHERE t.shipped >= vShippedFrom AND t.shipped <= vShippedTo - AND c.id IS NULL - AND clt.isActive != 0 - AND ic.merchandise != 0 - GROUP BY s.id; - - DECLARE CONTINUE HANDLER FOR NOT FOUND - SET v_done = TRUE; - - DROP TEMPORARY TABLE IF EXISTS tmp.coste; - - DROP TEMPORARY TABLE IF EXISTS tmp.coste; - CREATE TEMPORARY TABLE tmp.coste - (primary key (id)) ENGINE = MEMORY - SELECT s.id - FROM ticket t - JOIN client clt ON clt.id = t.clientFk - JOIN sale s ON s.ticketFk = t.id - JOIN item i ON i.id = s.itemFk - JOIN itemType tp ON tp.id = i.typeFk - JOIN itemCategory ic ON ic.id = tp.categoryFk - JOIN saleComponent sc ON sc.saleFk = s.id - JOIN component c ON c.id = sc.componentFk - JOIN componentType ct ON ct.id = c.typeFk AND ct.id = 1 - WHERE t.shipped >= vShippedFrom - AND ic.merchandise != 0; - - OPEN vCur; - - l: LOOP - SET v_done = FALSE; - FETCH vCur INTO vSaleFk; - - IF v_done THEN - LEAVE l; - END IF; - select ticketFk INTO vTicketFk FROM sale where id = vSaleFk; - select concept INTO vConcept FROM sale where id = vSaleFk; - - CALL util.debug(ticketFk, concept); - -- CALL sale_calculateComponent(vSaleFk, 1); - END LOOP; - - CLOSE vCur; - DROP TEMPORARY TABLE tmp.coste; - 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 `ticket_Clone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -64667,91 +65184,93 @@ BEGIN * @return tmp.ticketAmount * @return tmp.ticketTax Impuesto desglosado para cada ticket. */ - DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; - CREATE TEMPORARY TABLE tmp.addressCompany - (INDEX (addressFk, companyFk)) - ENGINE = MEMORY - SELECT DISTINCT t.addressFk, t.companyFk - FROM tmp.ticket tmpTicket - JOIN ticket t ON t.id = tmpTicket.ticketFk; + DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; + CREATE TEMPORARY TABLE tmp.addressCompany + (INDEX (addressFk, companyFk)) + ENGINE = MEMORY + SELECT DISTINCT t.addressFk, t.companyFk + FROM tmp.ticket tmpTicket + JOIN ticket t ON t.id = tmpTicket.ticketFk; - CALL addressTaxArea (); - - IF vTaxArea > '' THEN + CALL addressTaxArea (); + + IF vTaxArea > '' THEN UPDATE tmp.addressTaxArea SET areaFk = vTaxArea; END IF; - /** Solo se calcula la base imponible (taxableBase) y el impuesto se calculará posteriormente - * No se debería cambiar el sistema por problemas con los decimales - */ - - DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax; - CREATE TEMPORARY TABLE tmp.ticketTax - (INDEX (ticketFk)) - ENGINE = MEMORY + /* Solo se calcula la base imponible (taxableBase) y el impuesto se calculará posteriormente + * No se debería cambiar el sistema por problemas con los decimales + */ + + DROP TEMPORARY TABLE IF EXISTS tmp.ticketTax; + CREATE TEMPORARY TABLE tmp.ticketTax + (INDEX (ticketFk)) + ENGINE = MEMORY SELECT * FROM ( SELECT tmpTicket.ticketFk, - bp.pgcFk, - SUM(s.quantity * s.price * (100 - s.discount)/100 ) AS taxableBase, - pgc.rate, - tc.code, - bp.priority - FROM tmp.ticket tmpTicket - JOIN sale s ON s.ticketFk = tmpTicket.ticketFk - JOIN item i ON i.id = s.itemFk - JOIN ticket t ON t.id = tmpTicket.ticketFk - JOIN supplier su ON su.id = t.companyFk - JOIN tmp.addressTaxArea ata - ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk - JOIN itemTaxCountry itc - ON itc.itemFk = i.id AND itc.countryFk = su.countryFk - JOIN bookingPlanner bp - ON bp.countryFk = su.countryFk - AND bp.taxAreaFk = ata.areaFk - AND bp.taxClassFk = itc.taxClassFk - JOIN pgc ON pgc.code = bp.pgcFk - JOIN taxClass tc ON tc.id = bp.taxClassFk - GROUP BY tmpTicket.ticketFk, pgc.code,pgc.rate - HAVING taxableBase != 0) t + bp.pgcFk, + SUM(s.quantity * s.price * (100 - s.discount)/100 ) AS taxableBase, + pgc.rate, + tc.code, + bp.priority + FROM tmp.ticket tmpTicket + JOIN sale s ON s.ticketFk = tmpTicket.ticketFk + JOIN item i ON i.id = s.itemFk + JOIN ticket t ON t.id = tmpTicket.ticketFk + JOIN supplier su ON su.id = t.companyFk + JOIN tmp.addressTaxArea ata + ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk + JOIN itemTaxCountry itc + ON itc.itemFk = i.id AND itc.countryFk = su.countryFk + JOIN bookingPlanner bp + ON bp.countryFk = su.countryFk + AND bp.taxAreaFk = ata.areaFk + AND bp.taxClassFk = itc.taxClassFk + JOIN pgc ON pgc.code = bp.pgcFk + JOIN taxClass tc ON tc.id = bp.taxClassFk + GROUP BY tmpTicket.ticketFk, pgc.code,pgc.rate + HAVING taxableBase != 0) t ORDER BY priority; - DROP TEMPORARY TABLE IF EXISTS tmp.ticketServiceTax; - CREATE TEMPORARY TABLE tmp.ticketServiceTax - (INDEX (ticketFk)) - ENGINE = MEMORY - SELECT tt.ticketFk, - SUM(ts.quantity * ts.price) AS taxableBase, - pgc.rate, - tc.code - FROM tmp.ticketTax tt - JOIN ticketService ts ON ts.ticketFk = tt.ticketFk - JOIN ticket t ON t.id = tt.ticketFk - JOIN supplier su ON su.id = t.companyFk - JOIN tmp.addressTaxArea ata - ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk - JOIN bookingPlanner bp - ON bp.countryFk = su.countryFk - AND bp.taxAreaFk = ata.areaFk - AND bp.taxClassFk = ts.taxClassFk - JOIN pgc ON pgc.code = bp.pgcFk AND pgc.rate = tt.rate - JOIN taxClass tc ON tc.id = bp.taxClassFk - GROUP BY tt.ticketFk, tt.code,tt.rate - HAVING taxableBase != 0; + DROP TEMPORARY TABLE IF EXISTS tmp.ticketServiceTax; + CREATE TEMPORARY TABLE tmp.ticketServiceTax + (PRIMARY KEY (ticketFk, rate,code)) + ENGINE = MEMORY + SELECT tt.ticketFk, + pgc.code pgcFk, + SUM(ts.quantity * ts.price) AS taxableBase, + pgc.rate, + tc.code + FROM tmp.ticket tt + JOIN ticketService ts ON ts.ticketFk = tt.ticketFk + JOIN ticket t ON t.id = tt.ticketFk + JOIN supplier su ON su.id = t.companyFk + JOIN tmp.addressTaxArea ata + ON ata.addressFk = t.addressFk AND ata.companyFk = t.companyFk + JOIN bookingPlanner bp + ON bp.countryFk = su.countryFk + AND bp.taxAreaFk = ata.areaFk + AND bp.taxClassFk = ts.taxClassFk + JOIN pgc ON pgc.code = bp.pgcFk + JOIN taxClass tc ON tc.id = bp.taxClassFk + GROUP BY tt.ticketFk, pgc.code + HAVING taxableBase != 0; - UPDATE tmp.ticketTax tt - JOIN tmp.ticketServiceTax ts ON tt.ticketFk = ts.ticketFk AND tt.code = ts.code AND tt.rate = ts.rate - SET tt.taxableBase = tt.taxableBase + ts.taxableBase; + INSERT INTO tmp.ticketTax (ticketFk, pgcFk, taxableBase, rate, code) + SELECT ts.ticketFk, ts.pgcFk, ts.taxableBase, ts.rate, ts.code + FROM tmp.ticketServiceTax ts + ON DUPLICATE KEY UPDATE ticketTax.taxableBase = ticketTax.taxableBase + VALUES (taxableBase); - DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount; - CREATE TEMPORARY TABLE tmp.ticketAmount - (INDEX (ticketFk)) - ENGINE = MEMORY - SELECT ticketFk, taxableBase, SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax,code - FROM tmp.ticketTax - GROUP BY ticketFk, code; + DROP TEMPORARY TABLE IF EXISTS tmp.ticketAmount; + CREATE TEMPORARY TABLE tmp.ticketAmount + (INDEX (ticketFk)) + ENGINE = MEMORY + SELECT ticketFk, taxableBase, SUM(CAST(taxableBase * rate / 100 AS DECIMAL(10, 2))) tax,code + FROM tmp.ticketTax + GROUP BY ticketFk, code; - DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; - DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea; + DROP TEMPORARY TABLE IF EXISTS tmp.addressCompany; + DROP TEMPORARY TABLE IF EXISTS tmp.addressTaxArea; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -65684,38 +66203,36 @@ BEGIN SET @vDated := NULL; DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate; - + CREATE TEMPORARY TABLE tmp.timeControlCalculate SELECT userFk, dated, IF( timeWork >= 18000, @timeWork:=timeWork + 1200, @timeWork:=timeWork) timeWorkSeconds, SEC_TO_TIME(@timeWork ) timeWorkSexagesimal, @timeWork / 3600 timeWorkDecimal, - timed + timed FROM (SELECT SUM(timeWork) timeWork, userFk, - dated, - GROUP_CONCAT(DATE_FORMAT(sub.timed,"%H:%i") ORDER BY sub.timed ASC SEPARATOR ' - ') timed + dated, + GROUP_CONCAT(DATE_FORMAT(sub.timed,"%H:%i") ORDER BY sub.timed ASC SEPARATOR ' - ') timed FROM (SELECT IF(@vUser = wtc.userFk, @vUser :=@vUser, @vUser := wtc.userFk ), IF(@vIsOdd, @vIsOdd := FALSE, @vIsOdd := TRUE ), IF(direction='in', @vIsOdd := TRUE, @vIsOdd := @vIsOdd ), IF(@vIsOdd, @vLastTimed:=UNIX_TIMESTAMP(timed),@vLastTimed:=@vLastTimed), IF(@vIsOdd, 0, UNIX_TIMESTAMP(timed)-@vLastTimed) timeWork, IF(direction='in', @vDated := DATE(wtc.timed), @vDated :=@vDated) dated, - wtc.userFk, wtc.timed timed, + wtc.userFk, direction - FROM (SELECT wtc.* + FROM (SELECT DISTINCT(wtc.id), wtc.userFk, wtc.timed, wtc.direction FROM workerTimeControl wtc JOIN tmp.`user` w ON w.userFk = wtc.userFk - WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo - ORDER BY userFk, timed ASC + WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo + ORDER BY userFk, timed ASC ) wtc WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo - ORDER BY userFk, timed ASC ) sub GROUP BY userFk, dated - ORDER BY userFk, dated )sub2; END ;; @@ -65900,10 +66417,12 @@ BEGIN dated, IF( timeWork >= 18000, @timeWork:=timeWork + 1200, @timeWork:=timeWork) timeWorkSeconds, SEC_TO_TIME(@timeWork ) timeWorkSexagesimal, - @timeWork / 3600 timeWorkDecimal + @timeWork / 3600 timeWorkDecimal, + timed FROM (SELECT SUM(timeWork) timeWork, userFk, - dated + dated, + GROUP_CONCAT(DATE_FORMAT(sub.timed,"%H:%i") ORDER BY sub.timed ASC SEPARATOR ' - ') timed FROM (SELECT IF(@vUser = wtc.userFk, @vUser :=@vUser, @vUser := wtc.userFk ), IF(@vIsOdd, @vIsOdd := FALSE, @vIsOdd := TRUE ), IF(direction='in', @vIsOdd := TRUE, @vIsOdd := @vIsOdd ), @@ -65913,8 +66432,12 @@ BEGIN wtc.userFk, wtc.timed timed, direction - FROM (SELECT * FROM workerTimeControl ORDER BY userFk, timed ASC) wtc - JOIN tmp.`user` w ON w.userFk = wtc.userFk + FROM (SELECT wtc.* + FROM workerTimeControl wtc + JOIN tmp.`user` w ON w.userFk = wtc.userFk + WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo + ORDER BY userFk, timed ASC + ) wtc WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo ORDER BY userFk, timed ASC ) sub @@ -68163,15 +68686,19 @@ BEGIN DECLARE vWorkerInfo VARCHAR(90); DECLARE vCursor CURSOR FOR - SELECT CONCAT(u.name, "@verdnatura.es"), u.id, tb.dated, tb.timeWorkDecimal, LEFT(tb.timeWorkSexagesimal,5) timeWorkSexagesimal, + SELECT CONCAT(u.name, '@verdnatura.es'), u.id, tb.dated, tb.timeWorkDecimal, LEFT(tb.timeWorkSexagesimal,5) timeWorkSexagesimal, tb.timeTable, tc.timeWorkDecimal timeWorkedDecimal, LEFT(tc.timeWorkSexagesimal,5) timeWorkedSexagesimal, tb.type, tb.businessFk FROM tmp.timeBusinessCalculate tb JOIN user u ON u.id = tb.userFk JOIN department d ON d.id = tb.departmentFk + JOIN postgresql.business b ON b.business_id = tb.businessFk + JOIN company c ON c.id = b.provider_id LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk AND tc.dated = tb.dated WHERE d.isTeleworking AND - IFNULL(vWorkerFk,u.id) = u.id + IFNULL(vWorkerFk,u.id) = u.id AND + c.code = 'VNL' ORDER BY u.id, tb.dated; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DROP TABLE IF EXISTS tmp.timeControlCalculate; @@ -68179,7 +68706,7 @@ BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate; DROP TEMPORARY TABLE IF EXISTS tmp.timeBusinessCalculate; - SELECT CONCAT (MIN(dated), " 00:00:00"), CONCAT (MAX(dated), " 23:59:59") INTO vStarted, vEnded + SELECT CONCAT (MIN(dated), ' 00:00:00'), CONCAT (MAX(dated), ' 23:59:59') INTO vStarted, vEnded FROM time WHERE year = vYear AND week = vWeek; @@ -68189,7 +68716,7 @@ BEGIN timed BETWEEN vStarted AND vEnded AND isSendMail; UPDATE workerTimeControlMail - SET updated = NOW(), state="SENDED" + SET updated = NOW(), state = 'SENDED' WHERE year = vYear AND week = vWeek AND IFNULL(vWorkerFk, workerFk) = workerFk ; @@ -68203,7 +68730,7 @@ BEGIN END IF; SET vTimeWorkDecimalTotal = 0; - SET vBody= ""; + SET vBody= ''; OPEN vCursor; FETCH vCursor INTO vSender, vWorkerFk, vDated, vTimeWorkDecimal, vTimeWorkSexagesimal, vTimeTable, vTimeWorkedDecimal, vTimeWorkedSexagesimal, vAbsenceType, vBusinessFk ; SET vWorkerFkOld = vWorkerFk ; @@ -68215,47 +68742,47 @@ BEGIN IF vTimeTable IS NULL AND vTimeWorkDecimal>0 AND vTimeWorkedDecimal IS NULL THEN INSERT INTO workerTimeControl (userFk, timed, manual, direction, isSendMail) - SELECT vWorkerFk, CONCAT(vDated," 08:00"), TRUE, "in", TRUE; + SELECT vWorkerFk, CONCAT(vDated,' 08:00'), TRUE, 'in', TRUE; IF vTimeWorkDecimal >= 5 THEN INSERT INTO workerTimeControl (userFk, timed, manual, direction, isSendMail) - SELECT vWorkerFk, CONCAT(vDated," 09:00"), TRUE, "middle", TRUE; + SELECT vWorkerFk, CONCAT(vDated,' 09:00'), TRUE, 'middle', TRUE; INSERT INTO workerTimeControl (userFk, timed, manual, direction, isSendMail) - SELECT vWorkerFk, CONCAT(vDated," 09:20"), TRUE, "middle", TRUE; + SELECT vWorkerFk, CONCAT(vDated,' 09:20'), TRUE, 'middle', TRUE; END IF; INSERT INTO workerTimeControl (userFk, timed, manual, direction, isSendMail) - SELECT vWorkerFk,CONCAT(vDated," ", LEFT (SEC_TO_TIME(28800 + (vTimeWorkDecimal * 3600)), 5)), TRUE, "out", TRUE; + SELECT vWorkerFk,CONCAT(vDated,' ', LEFT (SEC_TO_TIME(28800 + (vTimeWorkDecimal * 3600)), 5)), TRUE, 'out', TRUE; ELSEIF vTimeWorkDecimal>0 AND vTimeWorkedDecimal IS NULL THEN SELECT SUM(TIME_TO_SEC(j.end)-TIME_TO_SEC(j.start))/3600 INTO vTimeTableDecimal FROM postgresql.journey j WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; IF vTimeWorkDecimal = vTimeTableDecimal THEN INSERT INTO workerTimeControl (userFk, timed, manual, isSendMail) - SELECT vWorkerFk, CONCAT(vDated, " ", j.start), TRUE, TRUE + SELECT vWorkerFk, CONCAT(vDated, ' ', j.start), TRUE, TRUE FROM postgresql.journey j WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; INSERT INTO workerTimeControl (userFk, timed, manual, isSendMail) - SELECT vWorkerFk, CONCAT(vDated, " ", j.end), TRUE, TRUE + SELECT vWorkerFk, CONCAT(vDated, ' ', j.end), TRUE, TRUE FROM postgresql.journey j WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; ELSE INSERT INTO workerTimeControl (userFk, timed, manual, isSendMail) - SELECT vWorkerFk, CONCAT(vDated, " ", MIN(j.start)), TRUE, TRUE + SELECT vWorkerFk, CONCAT(vDated, ' ', MIN(j.start)), TRUE, TRUE FROM postgresql.journey j WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; INSERT INTO workerTimeControl (userFk, timed, manual, isSendMail) - SELECT vWorkerFk, CONCAT(vDated, " ", SEC_TO_TIME(TIME_TO_SEC(MIN(j.start)) + (vTimeWorkDecimal * 3600))), TRUE, TRUE + SELECT vWorkerFk, CONCAT(vDated, ' ', SEC_TO_TIME(TIME_TO_SEC(MIN(j.start)) + (vTimeWorkDecimal * 3600))), TRUE, TRUE FROM postgresql.journey j WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; END IF; IF vTimeWorkDecimal >= 5 THEN INSERT INTO workerTimeControl (userFk, timed, manual, isSendMail) - SELECT vWorkerFk, CONCAT(vDated, " ", SEC_TO_TIME(TIME_TO_SEC(MIN(j.start)) + 3600)), TRUE, TRUE + SELECT vWorkerFk, CONCAT(vDated, ' ', SEC_TO_TIME(TIME_TO_SEC(MIN(j.start)) + 3600)), TRUE, TRUE FROM postgresql.journey j WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; INSERT INTO workerTimeControl (userFk, timed, manual, isSendMail) - SELECT vWorkerFk, CONCAT(vDated, " ", SEC_TO_TIME(TIME_TO_SEC(MIN(j.start)) + 4800)), TRUE, TRUE + SELECT vWorkerFk, CONCAT(vDated, ' ', SEC_TO_TIME(TIME_TO_SEC(MIN(j.start)) + 4800)), TRUE, TRUE FROM postgresql.journey j WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; END IF; @@ -68263,18 +68790,18 @@ BEGIN UPDATE workerTimeControl wtc JOIN (SELECT id FROM workerTimeControl WHERE userFk = vWorkerFk AND - timed BETWEEN vDated AND CONCAT(vDated, " 23:59:59") + timed BETWEEN vDated AND CONCAT(vDated, ' 23:59:59') ORDER BY timed ASC LIMIT 1)sub on sub.id= wtc.id - SET direction = "in" ; + SET direction = 'in' ; UPDATE workerTimeControl wtc JOIN (SELECT id FROM workerTimeControl WHERE userFk = vWorkerFk AND - timed BETWEEN vDated AND CONCAT(vDated, " 23:59:59") + timed BETWEEN vDated AND CONCAT(vDated, ' 23:59:59') ORDER BY timed DESC LIMIT 1)sub on sub.id= wtc.id - SET direction = "out" ; + SET direction = 'out' ; END IF; @@ -68301,7 +68828,7 @@ BEGIN FETCH vCursor INTO vSender, vWorkerFk, vDated, vTimeWorkDecimal, vTimeWorkSexagesimal, vTimeTable, vTimeWorkedDecimal, vTimeWorkedSexagesimal, vAbsenceType, vBusinessFk ; IF vWorkerFk <> vWorkerFkOld OR vDone THEN - SELECT CONCAT( IFNULL(nif, ""), " - ", firstName, " ", name ) INTO vWorkerInfo + SELECT CONCAT( IFNULL(nif, ''), ' - ', firstName, ' ', name ) INTO vWorkerInfo FROM postgresql.person WHERE id_trabajador = vWorkerFkOld; SET vHeader = CONCAT("


@@ -68333,11 +68860,11 @@ BEGIN "); INSERT INTO mail(sender, replyto, subject, body) - VALUES (vSenderOld, "timecontrol@verdnatura.es", CONCAT("Registro de horas semana ", vWeek, " año ", vYear) , CONCAT(vHeader," " , vBody," ", vFooter)); + VALUES (vSenderOld, 'timecontrol@verdnatura.es', CONCAT('Registro de horas semana ', vWeek, ' año ', vYear) , CONCAT(vHeader,' ' , vBody,' ', vFooter)); INSERT IGNORE INTO workerTimeControlMail (workerFk, year,week) VALUES(vWorkerFkOld, vYear, vWeek); - SET vBody = ""; + SET vBody = ''; SET vTimeWorkDecimalTotal = 0; SET vWorkerFkOld = vWorkerFk ; SET vSenderOld = vSender; @@ -72246,6 +72773,24 @@ USE `salix`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `User` +-- + +/*!50001 DROP VIEW IF EXISTS `User`*/; +/*!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 `User` AS select `account`.`user`.`id` AS `id`,`account`.`user`.`realm` AS `realm`,`account`.`user`.`name` AS `username`,`account`.`user`.`bcryptPassword` AS `password`,`account`.`user`.`email` AS `email`,`account`.`user`.`emailVerified` AS `emailVerified`,`account`.`user`.`verificationToken` AS `verificationToken` from `account`.`user` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; + -- -- Current Database: `stock` -- @@ -72300,6 +72845,24 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `accounting` +-- + +/*!50001 DROP VIEW IF EXISTS `accounting`*/; +/*!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 = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `accounting` AS select `b`.`Id_Banco` AS `id`,`b`.`Banco` AS `bank`,`b`.`Cuenta` AS `account`,`b`.`cash` AS `accountingTypeFk`,`b`.`entity_id` AS `entityFk`,`b`.`activo` AS `isActive` from `vn2008`.`Bancos` `b` */; +/*!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 `agencyProvince__` -- @@ -72354,6 +72917,24 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `buyer` +-- + +/*!50001 DROP VIEW IF EXISTS `buyer`*/; +/*!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 `buyer` AS select distinct `u`.`id` AS `userFk`,`u`.`nickname` AS `nickname` from (`account`.`user` `u` join `vn`.`itemType` `it` on((`it`.`workerFk` = `u`.`id`))) where `u`.`active` order by `u`.`nickname` */; +/*!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 `calendar__` -- @@ -72434,12 +73015,12 @@ USE `vn`; /*!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 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_general_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `cmr_list` AS select `cmr`.`id` AS `cmrFk`,`cmr`.`ticketFk` AS `ticketFk`,`cmr`.`truckPlate` AS `truckPlate`,`cmr`.`observations` AS `observations`,`cmr`.`senderInstruccions` AS `senderInstruccions`,`cmr`.`paymentInstruccions` AS `paymentInstruccions`,`cmr`.`specialAgreements` AS `specialAgreements`,`cmr`.`created` AS `created`,`cmr`.`packagesList` AS `packagesList`,`aTo`.`nickname` AS `clientName`,`aTo`.`postalCode` AS `clientPostalCode`,`aTo`.`street` AS `clientStreet`,`aTo`.`city` AS `clientCity`,`pTo`.`name` AS `clientProvince`,`cTo`.`country` AS `clientCountry`,`su`.`name` AS `companyName`,`su`.`street` AS `companyStreet`,`su`.`postCode` AS `companyPostCode`,`su`.`city` AS `companyCity`,`cSu`.`country` AS `companyCountry`,concat(`aFrom`.`street`,' ',`aFrom`.`postalCode`,' ',`aFrom`.`city`,' (',`cFrom`.`country`,')') AS `warehouseAddress`,`cmr`.`created` AS `shipped`,`aTo`.`nickname` AS `clientOficialName`,`aSu`.`name` AS `carrierName`,`aSu`.`street` AS `carrierStreet`,`aSu`.`postCode` AS `carrierPostCode`,`aSu`.`city` AS `carrierCity`,`cAs`.`country` AS `carrierCountry`,ifnull(`aTo`.`phone`,`client`.`phone`) AS `phone`,ifnull(`aTo`.`mobile`,`client`.`mobile`) AS `mobile`,`aTo`.`id` AS `addressFk` from (((((((((((`cmr` left join `address` `aTo` on((`aTo`.`id` = `cmr`.`addressToFk`))) left join `province` `pTo` on((`pTo`.`id` = `aTo`.`provinceFk`))) left join `country` `cTo` on((`cTo`.`id` = `pTo`.`countryFk`))) left join `client` on((`client`.`id` = `aTo`.`clientFk`))) left join `supplier` `su` on((`su`.`id` = `cmr`.`companyFk`))) left join `country` `cSu` on((`cSu`.`id` = `su`.`countryFk`))) left join `address` `aFrom` on((`aFrom`.`id` = `cmr`.`addressFromFk`))) left join `province` `pFrom` on((`pFrom`.`id` = `aFrom`.`provinceFk`))) left join `country` `cFrom` on((`cFrom`.`id` = `pFrom`.`countryFk`))) left join `supplier` `aSu` on((`aSu`.`id` = `cmr`.`supplierFk`))) left join `country` `cAs` on((`cAs`.`id` = `aSu`.`countryFk`))) */; +/*!50001 VIEW `cmr_list` AS select `cmr`.`id` AS `cmrFk`,`cmr`.`ticketFk` AS `ticketFk`,`cmr`.`truckPlate` AS `truckPlate`,`cmr`.`observations` AS `observations`,`cmr`.`senderInstruccions` AS `senderInstruccions`,`cmr`.`paymentInstruccions` AS `paymentInstruccions`,`cmr`.`specialAgreements` AS `specialAgreements`,`cmr`.`created` AS `created`,`cmr`.`packagesList` AS `packagesList`,`aTo`.`nickname` AS `clientName`,`aTo`.`postalCode` AS `clientPostalCode`,`aTo`.`street` AS `clientStreet`,`aTo`.`city` AS `clientCity`,`pTo`.`name` AS `clientProvince`,`cTo`.`country` AS `clientCountry`,`su`.`name` AS `companyName`,`su`.`street` AS `companyStreet`,`su`.`postCode` AS `companyPostCode`,`su`.`city` AS `companyCity`,`cSu`.`country` AS `companyCountry`,concat(`aFrom`.`street`,' ',`aFrom`.`postalCode`,' ',`aFrom`.`city`,' (',`cFrom`.`country`,')') AS `warehouseAddress`,`cmr`.`created` AS `shipped`,`aTo`.`nickname` AS `clientOficialName`,`cmr`.`supplierFk` AS `supplierFk`,`aSu`.`name` AS `carrierName`,`aSu`.`street` AS `carrierStreet`,`aSu`.`postCode` AS `carrierPostCode`,`aSu`.`city` AS `carrierCity`,`cAs`.`country` AS `carrierCountry`,ifnull(`aTo`.`phone`,`client`.`phone`) AS `phone`,ifnull(`aTo`.`mobile`,`client`.`mobile`) AS `mobile`,`aTo`.`id` AS `addressFk` from (((((((((((`cmr` left join `address` `aTo` on((`aTo`.`id` = `cmr`.`addressToFk`))) left join `province` `pTo` on((`pTo`.`id` = `aTo`.`provinceFk`))) left join `country` `cTo` on((`cTo`.`id` = `pTo`.`countryFk`))) left join `client` on((`client`.`id` = `aTo`.`clientFk`))) left join `supplier` `su` on((`su`.`id` = `cmr`.`companyFk`))) left join `country` `cSu` on((`cSu`.`id` = `su`.`countryFk`))) left join `address` `aFrom` on((`aFrom`.`id` = `cmr`.`addressFromFk`))) left join `province` `pFrom` on((`pFrom`.`id` = `aFrom`.`provinceFk`))) left join `country` `cFrom` on((`cFrom`.`id` = `pFrom`.`countryFk`))) left join `supplier` `aSu` on((`aSu`.`id` = `cmr`.`supplierFk`))) left join `country` `cAs` on((`cAs`.`id` = `aSu`.`countryFk`))) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -72727,7 +73308,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8_general_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `expeditionPallet_Print` AS select `et2`.`description` AS `truck`,`t`.`routeFk` AS `routeFk`,`r`.`description` AS `zone`,count(`es`.`id`) AS `eti`,`ep`.`id` AS `palletFk`,(`et`.`id` <=> `rm`.`expeditionTruckFk`) AS `isMatch`,37 AS `warehouseFk` from (((((((`vn`.`expeditionTruck` `et` join `vn`.`expeditionPallet` `ep` on((`ep`.`truckFk` = `et`.`id`))) join `vn`.`expeditionScan` `es` on((`es`.`palletFk` = `ep`.`id`))) join `vn`.`expedition` `e` on((`e`.`id` = `es`.`expeditionFk`))) join `vn`.`ticket` `t` on((`t`.`id` = `e`.`ticketFk`))) join `vn`.`route` `r` on((`r`.`id` = `t`.`routeFk`))) left join `vn2008`.`Rutas_monitor` `rm` on((`rm`.`Id_Ruta` = `r`.`id`))) left join `vn`.`expeditionTruck` `et2` on((`et2`.`id` = `rm`.`expeditionTruckFk`))) where (`ep`.`isPrint` = 0) group by `ep`.`id`,`t`.`routeFk` */; +/*!50001 VIEW `expeditionPallet_Print` AS select `et2`.`description` AS `truck`,`t`.`routeFk` AS `routeFk`,`r`.`description` AS `zone`,count(`es`.`id`) AS `eti`,`ep`.`id` AS `palletFk`,(`et`.`id` <=> `rm`.`expeditionTruckFk`) AS `isMatch`,`t`.`warehouseFk` AS `warehouseFk` from (((((((`vn`.`expeditionTruck` `et` join `vn`.`expeditionPallet` `ep` on((`ep`.`truckFk` = `et`.`id`))) join `vn`.`expeditionScan` `es` on((`es`.`palletFk` = `ep`.`id`))) join `vn`.`expedition` `e` on((`e`.`id` = `es`.`expeditionFk`))) join `vn`.`ticket` `t` on((`t`.`id` = `e`.`ticketFk`))) join `vn`.`route` `r` on((`r`.`id` = `t`.`routeFk`))) left join `vn2008`.`Rutas_monitor` `rm` on((`rm`.`Id_Ruta` = `r`.`id`))) left join `vn`.`expeditionTruck` `et2` on((`et2`.`id` = `rm`.`expeditionTruckFk`))) where (`ep`.`isPrint` = 0) group by `ep`.`id`,`t`.`routeFk` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -72745,7 +73326,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8_general_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `expeditionRoute_Monitor` AS select `r`.`id` AS `routeFk`,count(distinct if(isnull(`e`.`id`),`t`.`id`,NULL)) AS `tickets`,count(distinct `e`.`id`) AS `expeditions`,count(distinct `es`.`id`) AS `scanned`,max(`e`.`created`) AS `lastPacked` from (((((`vn`.`route` `r` join `vn`.`routesMonitor` `rm` on((`r`.`id` = `rm`.`routeFk`))) join `vn`.`expeditionTruck` `et` on((`et`.`id` = `rm`.`expeditionTruckFk`))) join `vn`.`ticket` `t` on((`t`.`routeFk` = `r`.`id`))) left join `vn`.`expedition` `e` on((`e`.`ticketFk` = `t`.`id`))) left join `vn`.`expeditionScan` `es` on((`es`.`expeditionFk` = `e`.`id`))) where (`et`.`ETD` >= curdate()) group by `r`.`id` */; +/*!50001 VIEW `expeditionRoute_Monitor` AS select `r`.`id` AS `routeFk`,count(distinct if(isnull(`e`.`id`),`t`.`id`,NULL)) AS `tickets`,count(distinct `e`.`id`) AS `expeditions`,count(distinct `es`.`id`) AS `scanned`,max(`e`.`created`) AS `lastPacked` from ((((((`vn`.`route` `r` join `vn`.`routesMonitor` `rm` on((`r`.`id` = `rm`.`routeFk`))) join `vn`.`expeditionTruck` `et` on((`et`.`id` = `rm`.`expeditionTruckFk`))) join `vn`.`ticket` `t` on((`t`.`routeFk` = `r`.`id`))) left join `vn`.`expedition` `e` on((`e`.`ticketFk` = `t`.`id`))) left join `vn`.`expeditionScan` `es` on((`es`.`expeditionFk` = `e`.`id`))) left join `vn`.`stowaway` `st` on((`st`.`id` = `t`.`id`))) where ((`et`.`ETD` >= curdate()) and isnull(`st`.`id`)) group by `r`.`id` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -72758,12 +73339,12 @@ USE `vn`; /*!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 = utf8mb4 */; -/*!50001 SET character_set_results = utf8mb4 */; -/*!50001 SET collation_connection = utf8mb4_general_ci */; +/*!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 `expeditionRoute_freeTickets` AS select `t`.`routeFk` AS `routeFk`,`tss`.`ticket` AS `ticket`,`s`.`name` AS `code`,`w`.`name` AS `almacen`,`tss`.`updated` AS `updated` from (((`vn`.`ticketStateToday` `tss` join `vn`.`ticket` `t` on((`t`.`id` = `tss`.`ticket`))) join `vn`.`warehouse` `w` on((`w`.`id` = `t`.`warehouseFk`))) join `vn`.`state` `s` on((`s`.`id` = `tss`.`state`))) where (ifnull(`t`.`packages`,0) = 0) */; +/*!50001 VIEW `expeditionRoute_freeTickets` AS select `t`.`routeFk` AS `routeFk`,`tss`.`ticket` AS `ticket`,`s`.`name` AS `code`,`w`.`name` AS `almacen`,`tss`.`updated` AS `updated` from ((((`vn`.`ticketStateToday` `tss` join `vn`.`ticket` `t` on((`t`.`id` = `tss`.`ticket`))) join `vn`.`warehouse` `w` on((`w`.`id` = `t`.`warehouseFk`))) join `vn`.`state` `s` on((`s`.`id` = `tss`.`state`))) left join `vn`.`stowaway` `st` on((`st`.`id` = `t`.`id`))) where ((ifnull(`t`.`packages`,0) = 0) and isnull(`st`.`id`)) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -73020,6 +73601,24 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `invoiceInDueDay__` +-- + +/*!50001 DROP VIEW IF EXISTS `invoiceInDueDay__`*/; +/*!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 `invoiceInDueDay__` AS select `r`.`id` AS `id`,`r`.`recibida_id` AS `invoiceInFk`,`r`.`fecha` AS `dueDated`,`r`.`banco_id` AS `bankFk`,`r`.`cantidad` AS `amount`,`r`.`divisa` AS `foreignValue`,`r`.`stamp` AS `created` from `vn2008`.`recibida_vencimiento` `r` */; +/*!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 `invoiceInEntry__` -- @@ -73038,6 +73637,24 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `invoiceInIntrastat__` +-- + +/*!50001 DROP VIEW IF EXISTS `invoiceInIntrastat__`*/; +/*!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 `invoiceInIntrastat__` AS select `r`.`recibida_id` AS `invoiceInFk`,`r`.`Codintrastat` AS `intrastatFk`,`r`.`importe` AS `amount` from `vn2008`.`recibida_intrastat` `r` */; +/*!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 `itemBotanicalWithGenus` -- @@ -73668,6 +74285,24 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `saleMistake_list` +-- + +/*!50001 DROP VIEW IF EXISTS `saleMistake_list`*/; +/*!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=`z-developer`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `saleMistake_list` AS select `st`.`saleFk` AS `saleFk`,concat(`w2`.`firstName`,' ',`w2`.`lastName`) AS `sacador`,`st`.`created` AS `created`,concat(`w`.`firstName`,' ',`w`.`lastName`) AS `revisador`,`mt`.`description` AS `description`,`sm`.`created` AS `controlled` from (((((`vn`.`saleTracking` `st` join `vn`.`worker` `w2` on((`w2`.`id` = `st`.`workerFk`))) join `vncontrol`.`accion` `a` on(((`a`.`accion_id` = `st`.`actionFk`) and (`a`.`accion` = 'SACAR')))) left join `vn`.`saleMistake` `sm` on((`st`.`saleFk` = `sm`.`saleFk`))) left join `vn`.`mistakeType` `mt` on((`mt`.`id` = `sm`.`typeFk`))) left join `vn`.`worker` `w` on((`w`.`id` = `sm`.`userFk`))) where (`st`.`created` > '2020-10-01') */; +/*!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 `saleValue` -- @@ -74259,4 +74894,4 @@ USE `vncontrol`; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-11-02 10:31:18 +-- Dump completed on 2020-11-25 9:17:08 diff --git a/db/export-data.sh b/db/export-data.sh index db4e2a003..b2ba97569 100755 --- a/db/export-data.sh +++ b/db/export-data.sh @@ -69,6 +69,8 @@ TABLES=( imageCollection tpvError tpvResponse + imageCollectionSize + ) dump_tables ${TABLES[@]} diff --git a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js index 8dee7e4c6..fcf871d9b 100644 --- a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js +++ b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js @@ -7,7 +7,7 @@ describe('Client activeWorkersWithRole', () => { let isSalesPerson = await app.models.Account.hasRole(result[0].id, 'salesPerson'); - expect(result.length).toEqual(17); + expect(result.length).toEqual(19); expect(isSalesPerson).toBeTruthy(); }); @@ -17,7 +17,7 @@ describe('Client activeWorkersWithRole', () => { let isBuyer = await app.models.Account.hasRole(result[0].id, 'buyer'); - expect(result.length).toEqual(16); + expect(result.length).toEqual(17); expect(isBuyer).toBeTruthy(); }); }); diff --git a/modules/client/back/methods/client/specs/getCard.spec.js b/modules/client/back/methods/client/specs/getCard.spec.js index 18519d440..e8ac7b3bc 100644 --- a/modules/client/back/methods/client/specs/getCard.spec.js +++ b/modules/client/back/methods/client/specs/getCard.spec.js @@ -7,6 +7,6 @@ describe('Client get', () => { expect(result.id).toEqual(101); expect(result.name).toEqual('Bruce Wayne'); - expect(result.debt).toEqual(889.38); + expect(result.debt).toEqual(887.38); }); }); diff --git a/modules/client/back/methods/client/specs/getDebt.spec.js b/modules/client/back/methods/client/specs/getDebt.spec.js index 9e539c219..9d3061ebb 100644 --- a/modules/client/back/methods/client/specs/getDebt.spec.js +++ b/modules/client/back/methods/client/specs/getDebt.spec.js @@ -4,7 +4,7 @@ describe('client getDebt()', () => { it('should return the client debt', async() => { let result = await app.models.Client.getDebt(101); - expect(result.debt).toEqual(889.38); + expect(result.debt).toEqual(887.38); }); }); diff --git a/modules/client/back/methods/client/specs/listWorkers.spec.js b/modules/client/back/methods/client/specs/listWorkers.spec.js index 68eb84273..271347969 100644 --- a/modules/client/back/methods/client/specs/listWorkers.spec.js +++ b/modules/client/back/methods/client/specs/listWorkers.spec.js @@ -6,7 +6,7 @@ describe('Client listWorkers', () => { .then(result => { let amountOfEmployees = Object.keys(result).length; - expect(amountOfEmployees).toEqual(53); + expect(amountOfEmployees).toEqual(54); done(); }) .catch(done.fail); diff --git a/modules/client/back/methods/client/specs/summary.spec.js b/modules/client/back/methods/client/specs/summary.spec.js index e4ebd9c67..882abcab2 100644 --- a/modules/client/back/methods/client/specs/summary.spec.js +++ b/modules/client/back/methods/client/specs/summary.spec.js @@ -17,7 +17,7 @@ describe('client summary()', () => { it('should return a summary object containing debt', async() => { let result = await app.models.Client.summary(101); - expect(result.debt.debt).toEqual(889.38); + expect(result.debt.debt).toEqual(887.38); }); it('should return a summary object containing averageInvoiced', async() => { diff --git a/modules/ticket/back/methods/ticket/specs/getTotal.spec.js b/modules/ticket/back/methods/ticket/specs/getTotal.spec.js index c3494bba9..d0191e55a 100644 --- a/modules/ticket/back/methods/ticket/specs/getTotal.spec.js +++ b/modules/ticket/back/methods/ticket/specs/getTotal.spec.js @@ -4,7 +4,7 @@ describe('ticket getTotal()', () => { it('should return the total of a ticket', async() => { let result = await app.models.Ticket.getTotal(1); - expect(result).toEqual(893.87); + expect(result).toEqual(891.87); }); it(`should return zero if the ticket doesn't have lines`, async() => {