From 064b950773b3ba37bbb9520f6c5cc139674d2f66 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Thu, 16 Jul 2020 12:10:18 +0200 Subject: [PATCH] export production --- db/dump/dumpedFixtures.sql | 28 +- db/dump/fixtures.sql | 2 +- db/dump/structure.sql | 2816 +++++++++++++---- db/export-structure.sh | 1 - .../specs/activeWorkersWithRole.spec.js | 2 +- .../back/methods/ticket/specs/filter.spec.js | 2 +- 6 files changed, 2176 insertions(+), 675 deletions(-) diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql index 94c62e984..bd117cd30 100644 --- a/db/dump/dumpedFixtures.sql +++ b/db/dump/dumpedFixtures.sql @@ -36,7 +36,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 8:07:57 +-- Dump completed on 2020-07-16 9:52:59 USE `account`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -71,7 +71,7 @@ UNLOCK TABLES; LOCK TABLES `roleInherit` WRITE; /*!40000 ALTER TABLE `roleInherit` DISABLE KEYS */; -INSERT INTO `roleInherit` VALUES (9,0),(66,0),(5,1),(13,1),(18,1),(31,1),(32,1),(34,1),(35,1),(37,1),(40,1),(42,1),(44,1),(47,1),(51,1),(53,1),(54,1),(56,1),(58,1),(1,2),(1,3),(30,5),(39,5),(60,5),(67,5),(11,6),(2,11),(3,11),(70,11),(16,13),(20,13),(21,13),(22,13),(34,13),(41,13),(43,13),(45,13),(48,13),(50,13),(52,13),(55,13),(57,13),(59,13),(61,13),(16,15),(20,16),(21,18),(52,19),(65,19),(17,20),(30,20),(5,21),(19,21),(22,21),(39,21),(50,21),(30,22),(5,33),(34,33),(15,35),(41,35),(50,35),(52,35),(65,35),(69,35),(49,36),(61,36),(17,37),(38,37),(60,37),(67,37),(17,39),(41,40),(43,42),(36,44),(45,44),(36,47),(48,47),(69,47),(50,49),(60,50),(65,50),(52,51),(21,53),(30,53),(55,54),(57,56),(15,57),(39,57),(50,57),(60,57),(49,58),(59,58),(50,59),(17,64),(30,64),(38,64),(20,65),(1,70); +INSERT INTO `roleInherit` VALUES (9,0),(66,0),(5,1),(13,1),(18,1),(31,1),(32,1),(34,1),(35,1),(37,1),(40,1),(44,1),(47,1),(51,1),(53,1),(54,1),(56,1),(58,1),(1,2),(1,3),(30,5),(39,5),(60,5),(67,5),(11,6),(2,11),(3,11),(70,11),(16,13),(20,13),(21,13),(22,13),(34,13),(41,13),(43,13),(45,13),(48,13),(50,13),(52,13),(55,13),(57,13),(59,13),(61,13),(16,15),(20,16),(21,18),(52,19),(65,19),(17,20),(30,20),(5,21),(19,21),(22,21),(39,21),(50,21),(30,22),(5,33),(34,33),(15,35),(41,35),(42,35),(50,35),(52,35),(65,35),(69,35),(49,36),(61,36),(17,37),(38,37),(60,37),(67,37),(17,39),(41,40),(43,42),(36,44),(45,44),(36,47),(48,47),(69,47),(40,49),(42,49),(50,49),(59,49),(60,50),(65,50),(52,51),(21,53),(30,53),(55,54),(57,56),(15,57),(39,57),(50,57),(60,57),(49,58),(50,59),(17,64),(30,64),(38,64),(20,65),(1,70); /*!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),(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),(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,40),(40,70),(41,1),(41,2),(41,3),(41,6),(41,11),(41,13),(41,35),(41,40),(41,41),(41,70),(42,1),(42,2),(42,3),(42,6),(42,11),(42,42),(42,70),(43,1),(43,2),(43,3),(43,6),(43,11),(43,13),(43,42),(43,43),(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,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),(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); +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),(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),(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),(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); /*!40000 ALTER TABLE `roleRole` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -94,7 +94,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 8:07:57 +-- Dump completed on 2020-07-16 9:53:01 USE `salix`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -119,7 +119,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','removes','*','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,'WorkerCalendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'WorkerCalendar','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'),(229,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(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','hr'),(235,'CustomsAgent','*','*','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','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,'WorkerCalendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'WorkerCalendar','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','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'); /*!40000 ALTER TABLE `ACL` ENABLE KEYS */; UNLOCK TABLES; @@ -142,7 +142,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 8:07:58 +-- Dump completed on 2020-07-16 9:53:02 USE `vn`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -227,7 +227,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),(2,NULL,'Forma',1,0,NULL,NULL,NULL),(3,NULL,'Material',1,0,NULL,NULL,NULL),(4,NULL,'Longitud',1,1,NULL,'mm',NULL),(5,NULL,'Diámetro',1,1,NULL,'mm',NULL),(6,NULL,'Perímetro',1,1,NULL,'mm',NULL),(7,NULL,'Ancho de la base',1,1,NULL,'mm',NULL),(8,NULL,'Altura',1,1,NULL,'mm',NULL),(9,NULL,'Volumen',1,1,NULL,'ml',NULL),(10,NULL,'Densidad',1,1,NULL,NULL,NULL),(11,NULL,'Calidad',1,0,NULL,NULL,NULL),(12,NULL,'Textura',1,0,NULL,NULL,NULL),(13,NULL,'Material del mango',1,0,NULL,NULL,NULL),(14,NULL,'Compra mínima',1,0,NULL,NULL,NULL),(15,NULL,'Nº pétalos',1,1,NULL,NULL,NULL),(16,NULL,'Ancho',1,1,NULL,'mm',NULL),(18,NULL,'Profundidad',1,1,NULL,'mm',NULL),(19,NULL,'Largo',1,1,NULL,'mm',NULL),(20,NULL,'Ancho superior',1,1,NULL,'mm',NULL),(21,NULL,'Ancho inferior',1,1,NULL,'mm',NULL),(22,NULL,'Gramaje',1,1,NULL,'g',NULL),(23,'stems','Tallos',1,1,NULL,NULL,NULL),(24,NULL,'Estado',1,0,NULL,NULL,NULL),(25,NULL,'Color principal',0,0,'ink',NULL,NULL),(26,NULL,'Color secundario',0,0,'ink',NULL,NULL),(27,NULL,'Longitud(cm)',1,1,NULL,'cm',NULL),(28,NULL,'Diámetro base',1,1,'','mm',NULL),(29,NULL,'Colección',1,0,NULL,NULL,NULL),(30,NULL,'Uds / caja',1,1,NULL,NULL,NULL),(31,NULL,'Contenido',1,0,NULL,NULL,NULL),(32,NULL,'Peso',1,1,NULL,'g',NULL),(33,NULL,'Grosor',1,1,NULL,'mm',NULL),(34,NULL,'Marca',1,0,NULL,NULL,NULL),(35,'origin','Origen',0,0,'origin',NULL,NULL),(36,NULL,'Proveedor',1,0,NULL,NULL,NULL),(37,'producer','Productor',0,0,'producer',NULL,NULL),(38,NULL,'Duración',1,1,NULL,'s',NULL),(39,NULL,'Flor',1,0,NULL,NULL,NULL),(40,NULL,'Soporte',1,0,NULL,NULL,NULL),(41,NULL,'Tamaño flor',1,0,NULL,NULL,NULL),(42,NULL,'Apertura',1,0,NULL,NULL,NULL),(43,NULL,'Tallo',1,0,NULL,NULL,NULL),(44,NULL,'Nº hojas',1,1,NULL,NULL,NULL),(45,NULL,'Dimensiones',1,0,NULL,NULL,NULL),(46,NULL,'Diámetro boca',1,1,NULL,'mm',NULL),(47,NULL,'Nº flores',1,1,NULL,NULL,NULL),(48,NULL,'Uds / paquete',1,1,NULL,NULL,NULL),(49,NULL,'Maceta',1,1,NULL,'cm',NULL),(50,NULL,'Textura flor',1,0,NULL,NULL,NULL),(51,NULL,'Textura hoja',1,0,NULL,NULL,NULL),(52,NULL,'Tipo de IVA',1,0,NULL,NULL,NULL),(53,NULL,'Tronco',1,0,NULL,NULL,NULL),(54,NULL,'Hoja',1,0,NULL,NULL,NULL),(55,NULL,'Formato',1,0,NULL,NULL,NULL),(56,NULL,'Genero',1,0,NULL,NULL,NULL),(57,NULL,'Especie',1,0,NULL,NULL,NULL),(58,NULL,'Variedad',1,0,NULL,NULL,NULL),(59,NULL,'Medida grande',1,0,NULL,NULL,NULL),(60,NULL,'Medida mediano',1,0,NULL,NULL,NULL),(61,NULL,'Medida pequeño',1,0,NULL,NULL,NULL),(63,NULL,'Recipiente interior',1,0,NULL,NULL,NULL),(64,NULL,'Material secundario',1,0,NULL,NULL,NULL),(65,NULL,'Colores',1,0,NULL,NULL,NULL),(66,NULL,'Referencia',1,0,NULL,NULL,NULL),(67,NULL,'Categoria',1,0,NULL,NULL,NULL),(68,NULL,'Amb',1,0,NULL,NULL,NULL),(69,NULL,'Anchura',1,1,NULL,'cm',NULL),(70,NULL,'Hueco interior',1,0,NULL,NULL,NULL),(71,NULL,'Tamaño',1,0,NULL,NULL,NULL),(72,NULL,'Color botón',1,0,NULL,NULL,NULL),(73,NULL,'Tamaño minimo del botón',1,0,NULL,NULL,NULL),(74,NULL,'Obtentor',1,0,NULL,NULL,NULL),(75,NULL,'Longitud del brote',1,0,NULL,NULL,NULL),(76,NULL,'Tallos / u.v.',1,0,NULL,NULL,NULL),(77,NULL,'Madera de',1,0,NULL,NULL,NULL),(78,NULL,'Unidad de venta',1,0,NULL,NULL,NULL),(79,NULL,'Temporal',1,0,NULL,NULL,NULL),(80,NULL,'Gramaje/tallo',1,1,NULL,'g',NULL),(81,NULL,'Peso/paquete',1,1,NULL,'g',NULL),(82,NULL,'Flexibilidad del tallo',1,0,NULL,NULL,NULL),(83,NULL,'Nº planchas',1,1,NULL,NULL,NULL),(84,NULL,'Nº páginas',1,1,NULL,NULL,NULL),(85,NULL,'Editorial',1,0,NULL,NULL,NULL),(86,NULL,'Idioma',1,0,NULL,NULL,NULL),(87,NULL,'Fecha publicación',1,0,NULL,NULL,NULL),(88,NULL,'Cubierta',1,0,NULL,NULL,NULL),(89,NULL,'Encuadernación',1,0,NULL,NULL,NULL),(90,NULL,'Autor',1,0,NULL,NULL,NULL),(91,NULL,'Envoltorio',1,0,NULL,NULL,NULL),(92,NULL,'Nombre temporal',1,0,NULL,NULL,NULL),(93,NULL,'Modelo',1,0,NULL,NULL,NULL),(94,NULL,'Producto',1,0,NULL,NULL,NULL),(95,NULL,'Título',1,0,NULL,NULL,NULL),(96,NULL,'Tomo',1,0,NULL,NULL,NULL),(97,NULL,'Articulo',1,0,NULL,NULL,NULL),(98,NULL,'Metodo de cultivo',1,0,NULL,NULL,NULL),(99,NULL,'Edad',1,0,NULL,NULL,NULL),(100,NULL,'Agotado',1,0,NULL,NULL,NULL),(101,NULL,'Altura con asa',1,1,NULL,'cm',NULL),(102,NULL,'Nº tallos',1,1,NULL,NULL,NULL),(103,NULL,'Cultivo',1,0,NULL,NULL,NULL),(104,NULL,'Sabor',1,0,NULL,NULL,NULL),(105,NULL,'Talla',1,0,NULL,NULL,NULL),(106,NULL,'Calibre',1,1,NULL,NULL,NULL),(107,NULL,'Dulzura',1,1,NULL,'bx',NULL),(108,NULL,'Piezas',1,0,NULL,NULL,NULL),(109,NULL,'Altura con patas',1,0,NULL,NULL,NULL),(110,NULL,'Envase',1,0,NULL,NULL,NULL),(111,NULL,'Nº piezas',1,0,NULL,NULL,NULL),(112,NULL,'Uso',1,0,NULL,'cm',NULL),(113,NULL,'Color luz',1,0,NULL,NULL,NULL),(114,NULL,'Capacidad',1,0,NULL,NULL,NULL); +INSERT INTO `tag` VALUES (1,'color','Color',0,0,'ink',NULL,NULL),(2,NULL,'Forma',1,0,NULL,NULL,NULL),(3,NULL,'Material',1,0,NULL,NULL,NULL),(4,NULL,'Longitud',1,1,NULL,'mm',NULL),(5,NULL,'Diámetro',1,1,NULL,'mm',NULL),(6,NULL,'Perímetro',1,1,NULL,'mm',NULL),(7,NULL,'Ancho de la base',1,1,NULL,'mm',NULL),(8,NULL,'Altura',1,1,NULL,'mm',NULL),(9,NULL,'Volumen',1,1,NULL,'ml',NULL),(10,NULL,'Densidad',1,1,NULL,NULL,NULL),(11,NULL,'Calidad',1,0,NULL,NULL,NULL),(12,NULL,'Textura',1,0,NULL,NULL,NULL),(13,NULL,'Material del mango',1,0,NULL,NULL,NULL),(14,NULL,'Compra mínima',1,0,NULL,NULL,NULL),(15,NULL,'Nº pétalos',1,1,NULL,NULL,NULL),(16,NULL,'Ancho',1,1,NULL,'mm',NULL),(18,NULL,'Profundidad',1,1,NULL,'mm',NULL),(19,NULL,'Largo',1,1,NULL,'mm',NULL),(20,NULL,'Ancho superior',1,1,NULL,'mm',NULL),(21,NULL,'Ancho inferior',1,1,NULL,'mm',NULL),(22,NULL,'Gramaje',1,1,NULL,'g',NULL),(23,'stems','Tallos',1,1,NULL,NULL,NULL),(24,NULL,'Estado',1,0,NULL,NULL,NULL),(25,NULL,'Color principal',0,0,'ink',NULL,NULL),(26,NULL,'Color secundario',0,0,'ink',NULL,NULL),(27,NULL,'Longitud(cm)',1,1,NULL,'cm',NULL),(28,NULL,'Diámetro base',1,1,'','mm',NULL),(29,NULL,'Colección',1,0,NULL,NULL,NULL),(30,NULL,'Uds / caja',1,1,NULL,NULL,NULL),(31,NULL,'Contenido',1,0,NULL,NULL,NULL),(32,NULL,'Peso',1,1,NULL,'g',NULL),(33,NULL,'Grosor',1,1,NULL,'mm',NULL),(34,NULL,'Marca',1,0,NULL,NULL,NULL),(35,'origin','Origen',0,0,'origin',NULL,NULL),(36,NULL,'Proveedor',1,0,NULL,NULL,NULL),(37,'producer','Productor',0,0,'producer',NULL,NULL),(38,NULL,'Duración',1,1,NULL,'s',NULL),(39,NULL,'Flor',1,0,NULL,NULL,NULL),(40,NULL,'Soporte',1,0,NULL,NULL,NULL),(41,NULL,'Tamaño flor',1,0,NULL,NULL,NULL),(42,NULL,'Apertura',1,0,NULL,NULL,NULL),(43,NULL,'Tallo',1,0,NULL,NULL,NULL),(44,NULL,'Nº hojas',1,1,NULL,NULL,NULL),(45,NULL,'Dimensiones',1,0,NULL,NULL,NULL),(46,NULL,'Diámetro boca',1,1,NULL,'mm',NULL),(47,NULL,'Nº flores',1,1,NULL,NULL,NULL),(48,NULL,'Uds / paquete',1,1,NULL,NULL,NULL),(49,NULL,'Maceta',1,1,NULL,'cm',NULL),(50,NULL,'Textura flor',1,0,NULL,NULL,NULL),(51,NULL,'Textura hoja',1,0,NULL,NULL,NULL),(52,NULL,'Tipo de IVA',1,0,NULL,NULL,NULL),(53,NULL,'Tronco',1,0,NULL,NULL,NULL),(54,NULL,'Hoja',1,0,NULL,NULL,NULL),(55,NULL,'Formato',1,0,NULL,NULL,NULL),(56,NULL,'Genero',1,0,NULL,NULL,NULL),(57,NULL,'Especie',1,0,NULL,NULL,NULL),(58,NULL,'Variedad',1,0,NULL,NULL,NULL),(59,NULL,'Medida grande',1,0,NULL,NULL,NULL),(60,NULL,'Medida mediano',1,0,NULL,NULL,NULL),(61,NULL,'Medida pequeño',1,0,NULL,NULL,NULL),(63,NULL,'Recipiente interior',1,0,NULL,NULL,NULL),(64,NULL,'Material secundario',1,0,NULL,NULL,NULL),(65,NULL,'Colores',1,0,NULL,NULL,NULL),(66,NULL,'Referencia',1,0,NULL,NULL,NULL),(67,'category','Categoria',1,0,NULL,NULL,NULL),(68,NULL,'Amb',1,0,NULL,NULL,NULL),(69,NULL,'Anchura',1,1,NULL,'cm',NULL),(70,NULL,'Hueco interior',1,0,NULL,NULL,NULL),(71,NULL,'Tamaño',1,0,NULL,NULL,NULL),(72,NULL,'Color botón',1,0,NULL,NULL,NULL),(73,NULL,'Tamaño minimo del botón',1,0,NULL,NULL,NULL),(74,NULL,'Obtentor',1,0,NULL,NULL,NULL),(75,NULL,'Longitud del brote',1,0,NULL,NULL,NULL),(76,NULL,'Tallos / u.v.',1,0,NULL,NULL,NULL),(77,NULL,'Madera de',1,0,NULL,NULL,NULL),(78,NULL,'Unidad de venta',1,0,NULL,NULL,NULL),(79,NULL,'Temporal',1,0,NULL,NULL,NULL),(80,NULL,'Gramaje/tallo',1,1,NULL,'g',NULL),(81,NULL,'Peso/paquete',1,1,NULL,'g',NULL),(82,NULL,'Flexibilidad del tallo',1,0,NULL,NULL,NULL),(83,NULL,'Nº planchas',1,1,NULL,NULL,NULL),(84,NULL,'Nº páginas',1,1,NULL,NULL,NULL),(85,NULL,'Editorial',1,0,NULL,NULL,NULL),(86,NULL,'Idioma',1,0,NULL,NULL,NULL),(87,NULL,'Fecha publicación',1,0,NULL,NULL,NULL),(88,NULL,'Cubierta',1,0,NULL,NULL,NULL),(89,NULL,'Encuadernación',1,0,NULL,NULL,NULL),(90,NULL,'Autor',1,0,NULL,NULL,NULL),(91,NULL,'Envoltorio',1,0,NULL,NULL,NULL),(92,NULL,'Nombre temporal',1,0,NULL,NULL,NULL),(93,NULL,'Modelo',1,0,NULL,NULL,NULL),(94,NULL,'Producto',1,0,NULL,NULL,NULL),(95,NULL,'Título',1,0,NULL,NULL,NULL),(96,NULL,'Tomo',1,0,NULL,NULL,NULL),(97,NULL,'Articulo',1,0,NULL,NULL,NULL),(98,NULL,'Metodo de cultivo',1,0,NULL,NULL,NULL),(99,NULL,'Edad',1,0,NULL,NULL,NULL),(100,NULL,'Agotado',1,0,NULL,NULL,NULL),(101,NULL,'Altura con asa',1,1,NULL,'cm',NULL),(102,NULL,'Nº tallos',1,1,NULL,NULL,NULL),(103,NULL,'Cultivo',1,0,NULL,NULL,NULL),(104,NULL,'Sabor',1,0,NULL,NULL,NULL),(105,NULL,'Talla',1,0,NULL,NULL,NULL),(106,NULL,'Calibre',1,1,NULL,NULL,NULL),(107,NULL,'Dulzura',1,1,NULL,'bx',NULL),(108,NULL,'Piezas',1,0,NULL,NULL,NULL),(109,NULL,'Altura con patas',1,0,NULL,NULL,NULL),(110,NULL,'Envase',1,0,NULL,NULL,NULL),(111,NULL,'Nº piezas',1,0,NULL,NULL,NULL),(112,NULL,'Uso',1,0,NULL,'cm',NULL),(113,NULL,'Color luz',1,0,NULL,NULL,NULL),(114,NULL,'Capacidad',1,0,NULL,NULL,NULL),(115,NULL,'fout kenmerk',1,0,NULL,NULL,NULL),(116,NULL,'Potinhoud',1,0,NULL,NULL,NULL),(117,NULL,'Marketingconcept',1,0,NULL,NULL,NULL),(118,NULL,'Leeftijd',1,0,NULL,NULL,NULL),(119,NULL,'Uitgangsmateriaal',1,0,NULL,NULL,NULL),(120,NULL,'Kleurbehandeld',1,0,NULL,NULL,NULL),(121,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,NULL),(122,NULL,'Verzorging: Water',1,0,NULL,NULL,NULL),(123,NULL,'Verzorging: Voeding',1,0,NULL,NULL,NULL),(124,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,NULL),(125,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,NULL),(126,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,NULL),(127,NULL,'Nabehandeling',1,0,NULL,NULL,NULL),(128,NULL,'Artikel beeld',1,0,NULL,NULL,NULL),(129,NULL,'Hoofdkleur 1',1,0,NULL,NULL,NULL),(130,NULL,'Hoofdkleur 2',1,0,NULL,NULL,NULL),(131,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,NULL),(132,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,NULL),(133,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,NULL),(134,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,NULL),(135,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,NULL),(136,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,NULL),(137,NULL,'Botanisch beeld',1,0,NULL,NULL,NULL),(138,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,NULL),(139,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,NULL),(140,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,NULL),(141,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,NULL),(142,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,NULL),(143,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,NULL),(144,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,NULL),(145,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,NULL),(146,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,NULL),(147,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,NULL),(148,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,NULL),(149,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,NULL),(150,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,NULL),(151,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,NULL),(152,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,NULL),(153,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,NULL),(154,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,NULL),(155,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,NULL),(156,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,NULL),(157,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,NULL),(158,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,NULL),(159,NULL,'Certificaten biologisch',1,0,NULL,NULL,NULL),(160,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,NULL),(161,NULL,'Certificaten Florimark',1,0,NULL,NULL,NULL),(162,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,NULL),(163,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,NULL),(164,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,NULL),(165,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,NULL),(166,NULL,'Certificaten ISO',1,0,NULL,NULL,NULL),(167,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,NULL),(168,NULL,'Certificaten Florverde',1,0,NULL,NULL,NULL),(169,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,NULL),(170,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,NULL),(171,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,NULL),(172,NULL,'Certificaten SAN',1,0,NULL,NULL,NULL),(173,NULL,'Certificaten GRASP',1,0,NULL,NULL,NULL),(174,NULL,'Label Fair Flora',1,0,NULL,NULL,NULL),(175,NULL,'Fust',1,0,NULL,NULL,NULL),(176,NULL,'Stapelwagen',1,0,NULL,NULL,NULL),(177,NULL,'Aantal legborden veilings',1,0,NULL,NULL,NULL),(178,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,NULL),(179,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,NULL),(180,NULL,'Fustsoort',1,0,NULL,NULL,NULL),(181,NULL,'Fustmateriaal',1,0,NULL,NULL,NULL),(182,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,NULL),(183,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,NULL),(184,NULL,'Tallos por paquete',1,0,NULL,NULL,NULL),(185,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,NULL),(186,NULL,'Aantal stuks per fust',1,0,NULL,NULL,NULL),(187,NULL,'Aantal bossen per fust',1,0,NULL,NULL,NULL),(188,NULL,'Aantal bundels per fust',1,0,NULL,NULL,NULL),(189,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,NULL),(190,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,NULL),(191,NULL,'Fustlabel',1,0,NULL,NULL,NULL),(192,NULL,'Karlabel',1,0,NULL,NULL,NULL),(193,NULL,'Service productlabel',1,0,NULL,NULL,NULL),(194,NULL,'Service fustlabel',1,0,NULL,NULL,NULL),(195,NULL,'Service karlabel',1,0,NULL,NULL,NULL),(196,NULL,'Aantal fusten per laag',1,0,NULL,NULL,NULL),(197,NULL,'Presentatie per schapm2',1,0,NULL,NULL,NULL),(198,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,NULL),(199,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,NULL),(200,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,NULL),(201,NULL,'Potmaat',1,0,NULL,NULL,NULL),(202,NULL,'Minimum planthoogte',1,0,NULL,NULL,NULL),(203,NULL,'Min aantal stekken/plante',1,0,NULL,NULL,NULL),(204,NULL,'Minimum plantdiameter',1,0,NULL,NULL,NULL),(205,NULL,'Apertura',1,0,NULL,NULL,NULL),(206,NULL,'Combinatiehoogte',1,0,NULL,NULL,NULL),(207,NULL,'Min aantal koppen hoogste',1,0,NULL,NULL,NULL),(208,NULL,'Dikte',1,0,NULL,NULL,NULL),(209,NULL,'Min aantal bloemen/bloeiw',1,0,NULL,NULL,NULL),(210,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,NULL),(211,NULL,'Minimum aantal takken per',1,0,NULL,NULL,NULL),(212,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,NULL),(213,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,NULL),(214,NULL,'Minimum stamhoogte',1,0,NULL,NULL,NULL),(215,NULL,'Transporthoogte',1,0,NULL,NULL,NULL),(216,NULL,'Lengte scheuten',1,0,NULL,NULL,NULL),(217,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,NULL),(218,NULL,'Minimum bloemknophoogte',1,0,NULL,NULL,NULL),(219,NULL,'Altura min.',1,0,NULL,NULL,NULL),(220,NULL,'Gewicht (gemiddeld)',1,0,NULL,NULL,NULL),(221,NULL,'Aantal bloemknoppen snijb',1,0,NULL,NULL,NULL),(222,NULL,'Minimum bloemdiameter',1,0,NULL,NULL,NULL),(223,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,NULL),(224,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,NULL),(225,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL),(226,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL),(227,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL),(228,NULL,'Minimum bloeiwijzelengte',1,0,NULL,NULL,NULL),(229,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,NULL),(230,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,NULL),(231,NULL,'Minimum ranklengte',1,0,NULL,NULL,NULL),(232,NULL,'Jaartal sortering hout',1,0,NULL,NULL,NULL),(233,NULL,'Minimum bladdiameter',1,0,NULL,NULL,NULL),(234,NULL,'Minimum bundelgewicht',1,0,NULL,NULL,NULL),(235,NULL,'Maximum planthoogte',1,0,NULL,NULL,NULL),(236,NULL,'Maximum plantdiameter',1,0,NULL,NULL,NULL),(237,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,NULL),(238,NULL,'Maximum aantal takken per',1,0,NULL,NULL,NULL),(239,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,NULL),(240,NULL,'Maximum stamhoogte',1,0,NULL,NULL,NULL),(241,NULL,'Altura max.',1,0,NULL,NULL,NULL),(242,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,NULL),(243,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,NULL),(244,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,NULL),(245,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,NULL),(246,NULL,'Verpakkingswijze',1,0,NULL,NULL,NULL),(247,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,NULL),(248,NULL,'Bolomvang',1,0,NULL,NULL,NULL),(249,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,NULL),(250,NULL,'Potvorm',1,0,NULL,NULL,NULL),(251,NULL,'Potkleur',1,0,NULL,NULL,NULL),(252,NULL,'Potmateriaal',1,0,NULL,NULL,NULL),(253,NULL,'Plantvorm',1,0,NULL,NULL,NULL),(254,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,NULL),(255,NULL,'Teeltwijze',1,0,NULL,NULL,NULL),(256,NULL,'Teeltmedium',1,0,NULL,NULL,NULL),(257,NULL,'Hoesmateriaal',1,0,NULL,NULL,NULL),(258,NULL,'Hoesvorm',1,0,NULL,NULL,NULL),(259,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,NULL),(260,NULL,'Extra toevoegingen',1,0,NULL,NULL,NULL),(261,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,NULL),(262,NULL,'Verpakte orchidee',1,0,NULL,NULL,NULL),(263,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,NULL),(264,NULL,'Voorbehandeling',1,0,NULL,NULL,NULL),(265,NULL,'Overige niet in pot',1,0,NULL,NULL,NULL),(266,NULL,'Vorm snijbloemen',1,0,NULL,NULL,NULL),(267,NULL,'Buigzaamheid bloemsteel',1,0,NULL,NULL,NULL),(268,NULL,'Hoeskleur',1,0,NULL,NULL,NULL),(269,NULL,'Extra deco materiaal',1,0,NULL,NULL,NULL),(270,NULL,'Productkleur',1,0,NULL,NULL,NULL),(271,NULL,'Productmateriaal',1,0,NULL,NULL,NULL),(272,NULL,'Materiaalhoogte',1,0,NULL,NULL,NULL),(273,NULL,'Materiaaldiameter',1,0,NULL,NULL,NULL),(274,NULL,'Barcode',1,0,NULL,NULL,NULL),(275,NULL,'Productlabel',1,0,NULL,NULL,NULL),(276,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,NULL),(277,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,NULL),(278,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,NULL),(279,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,NULL),(280,NULL,'Maximum lengte verschil',1,0,NULL,NULL,NULL),(281,NULL,'Bladkleur',1,0,NULL,NULL,NULL),(282,NULL,'Plantgewicht',1,0,NULL,NULL,NULL),(283,NULL,'Gemiddelde bloemdiameter',1,0,NULL,NULL,NULL),(284,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,NULL),(285,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,NULL),(286,NULL,'Kleurbehandeld',1,0,NULL,NULL,NULL),(287,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,NULL),(288,NULL,'Minimum bloemknopdiameter',1,0,NULL,NULL,NULL),(289,NULL,'Volume inhoud',1,0,NULL,NULL,NULL),(290,NULL,'Vruchtbenaming',1,0,NULL,NULL,NULL),(291,NULL,'Vaaslevenindex',1,0,NULL,NULL,NULL),(292,NULL,'Overige informatie plante',1,0,NULL,NULL,NULL),(293,NULL,'Overige informatie snijbl',1,0,NULL,NULL,NULL),(294,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,NULL),(295,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,NULL),(296,NULL,'MPS certificering',1,0,NULL,NULL,NULL),(297,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,NULL),(298,NULL,'Artikelomschrijving',1,0,NULL,NULL,NULL),(299,NULL,'BTW-tarief',1,0,NULL,NULL,NULL),(300,NULL,'Prijseenheid',1,0,NULL,NULL,NULL),(301,NULL,'Transactievorm',1,0,NULL,NULL,NULL),(302,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,NULL),(303,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,NULL),(304,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,NULL),(305,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,NULL),(306,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,NULL),(307,NULL,'Algemene voorwaarden',1,0,NULL,NULL,NULL),(308,NULL,'Marktvorm',1,0,NULL,NULL,NULL),(309,NULL,'Themadagen',1,0,NULL,NULL,NULL),(310,NULL,'Handelscategorie',1,0,NULL,NULL,NULL),(311,NULL,'Producentengroepen',1,0,NULL,NULL,NULL),(312,NULL,'Favorieten Id',1,0,NULL,NULL,NULL),(313,NULL,'Verkoopeenheid',1,0,NULL,NULL,NULL),(314,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,NULL),(315,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(316,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,NULL),(317,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,NULL),(318,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,NULL),(319,NULL,'FloraHolland Financial',1,0,NULL,NULL,NULL),(320,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(321,NULL,'Benefiet veiling',1,0,NULL,NULL,NULL),(322,NULL,'Kloksoort',1,0,NULL,NULL,NULL),(323,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,NULL),(324,NULL,'Rest aantallen',1,0,NULL,NULL,NULL),(325,NULL,'Veilsoort',1,0,NULL,NULL,NULL),(326,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(327,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(328,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(329,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(330,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(331,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(332,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL),(333,NULL,'Gereserveerd',1,0,NULL,NULL,NULL),(334,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,NULL),(335,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,NULL),(336,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,NULL),(337,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(338,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(339,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(340,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(341,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(342,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(343,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(344,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(345,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(346,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(347,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(348,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(349,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(350,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(351,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(352,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL),(353,NULL,'Gereserveerd',1,0,NULL,NULL,NULL),(354,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,NULL),(355,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,NULL),(356,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,NULL),(357,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(358,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(359,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(360,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(361,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(362,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(363,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(364,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(365,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(366,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(367,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(368,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(369,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(370,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(371,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(372,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(373,NULL,'Gereserveerd',1,0,NULL,NULL,NULL),(374,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,NULL),(375,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(376,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(377,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(378,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(379,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(380,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(381,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(382,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(383,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(384,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(385,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(386,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(387,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(388,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL),(389,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL),(390,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL),(391,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL),(392,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL),(393,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(394,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(395,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(396,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(397,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(398,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(399,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(400,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(401,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(402,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL),(403,NULL,'Veiling',1,0,NULL,NULL,NULL),(404,NULL,'kopersaantallen',1,0,NULL,NULL,NULL),(552,NULL,'fout kenmerk',1,0,NULL,NULL,'081'),(553,NULL,'Potinhoud',1,0,NULL,NULL,'A01'),(554,NULL,'Marketingconcept',1,0,NULL,NULL,'A02'),(555,NULL,'Leeftijd',1,0,NULL,NULL,'A03'),(556,NULL,'Uitgangsmateriaal',1,0,NULL,NULL,'A04'),(557,NULL,'Kleurbehandeld',1,0,NULL,NULL,'A05'),(558,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,'A06'),(559,NULL,'Verzorging: Water',1,0,NULL,NULL,'A07'),(560,NULL,'Verzorging: Voeding',1,0,NULL,NULL,'A08'),(561,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,'A09'),(562,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,'A10'),(563,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,'A11'),(564,NULL,'Nabehandeling',1,0,NULL,NULL,'A13'),(565,NULL,'Artikel beeld',1,0,NULL,NULL,'A23'),(566,NULL,'Hoofdkleur 1',1,0,NULL,NULL,'B01'),(567,NULL,'Hoofdkleur 2',1,0,NULL,NULL,'B02'),(568,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,'B03'),(569,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,'B04'),(570,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,'B05'),(571,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,'B06'),(572,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,'B07'),(573,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,'B08'),(574,NULL,'Botanisch beeld',1,0,NULL,NULL,'B09'),(575,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,'B10'),(576,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,'B11'),(577,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,'B12'),(578,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,'B13'),(579,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,'B14'),(580,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,'B15'),(581,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,'B16'),(582,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,'K01'),(583,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,'K02'),(584,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,'K03'),(585,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K04'),(586,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,'K05'),(587,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,'K07'),(588,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,'K08'),(589,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,'K11'),(590,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,'K12'),(591,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,'K13'),(592,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,'K14'),(593,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,'K15'),(594,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,'K16'),(595,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,'K17'),(596,NULL,'Certificaten biologisch',1,0,NULL,NULL,'K18'),(597,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,'K19'),(598,NULL,'Certificaten Florimark',1,0,NULL,NULL,'K20'),(599,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,'K21'),(600,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,'K22'),(601,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,'K23'),(602,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,'K24'),(603,NULL,'Certificaten ISO',1,0,NULL,NULL,'K25'),(604,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K26'),(605,NULL,'Certificaten Florverde',1,0,NULL,NULL,'K27'),(606,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,'K28'),(607,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,'K29'),(608,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,'K30'),(609,NULL,'Certificaten SAN',1,0,NULL,NULL,'K31'),(610,NULL,'Certificaten GRASP',1,0,NULL,NULL,'K32'),(611,NULL,'Label Fair Flora',1,0,NULL,NULL,'K33'),(612,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,'K34'),(613,NULL,'Fust',1,0,NULL,NULL,'L01'),(614,NULL,'Stapelwagen',1,0,NULL,NULL,'L02'),(615,NULL,'Aantal legborden veilings',1,0,NULL,NULL,'L03'),(616,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,'L04'),(617,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,'L05'),(618,NULL,'Fustsoort',1,0,NULL,NULL,'L06'),(619,NULL,'Fustmateriaal',1,0,NULL,NULL,'L07'),(620,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,'L08'),(621,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,'L09'),(622,NULL,'Aantal stelen per bos',1,0,NULL,NULL,'L11'),(623,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,'L12'),(624,NULL,'Aantal stuks per fust',1,0,NULL,NULL,'L13'),(625,NULL,'Aantal bossen per fust',1,0,NULL,NULL,'L14'),(626,NULL,'Aantal bundels per fust',1,0,NULL,NULL,'L15'),(627,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,'L16'),(628,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,'L17'),(629,NULL,'Fustlabel',1,0,NULL,NULL,'L18'),(630,NULL,'Karlabel',1,0,NULL,NULL,'L19'),(631,NULL,'Service productlabel',1,0,NULL,NULL,'L20'),(632,NULL,'Service fustlabel',1,0,NULL,NULL,'L21'),(633,NULL,'Service karlabel',1,0,NULL,NULL,'L22'),(634,NULL,'Aantal fusten per laag',1,0,NULL,NULL,'L23'),(635,NULL,'Presentatie per schapm2',1,0,NULL,NULL,'L24'),(636,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,'P01'),(637,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,'P02'),(638,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,'P03'),(639,NULL,'Potmaat',1,0,NULL,NULL,'S01'),(640,NULL,'Minimum planthoogte',1,0,NULL,NULL,'S02'),(641,NULL,'Min aantal stekken/plante',1,0,NULL,NULL,'S03'),(642,NULL,'Minimum plantdiameter',1,0,NULL,NULL,'S04'),(643,NULL,'Rijpheidsstadium',1,0,NULL,NULL,'S05'),(644,NULL,'Combinatiehoogte',1,0,NULL,NULL,'S06'),(645,NULL,'Min aantal koppen hoogste',1,0,NULL,NULL,'S07'),(646,NULL,'Dikte',1,0,NULL,NULL,'S08'),(647,NULL,'Min aantal bloemen/bloeiw',1,0,NULL,NULL,'S09'),(648,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,'S10'),(649,NULL,'Minimum aantal takken per',1,0,NULL,NULL,'S11'),(650,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,'S12'),(651,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,'S13'),(652,NULL,'Minimum stamhoogte',1,0,NULL,NULL,'S14'),(653,NULL,'Transporthoogte',1,0,NULL,NULL,'S15'),(654,NULL,'Lengte scheuten',1,0,NULL,NULL,'S16'),(655,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,'S17'),(656,NULL,'Minimum bloemknophoogte',1,0,NULL,NULL,'S19'),(657,NULL,'Minimum steellengte',1,0,NULL,NULL,'S20'),(658,NULL,'Gewicht (gemiddeld)',1,0,NULL,NULL,'S21'),(659,NULL,'Aantal bloemknoppen snijb',1,0,NULL,NULL,'S22'),(660,NULL,'Minimum bloemdiameter',1,0,NULL,NULL,'S23'),(661,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,'S24'),(662,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,'S25'),(663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S26'),(664,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S27'),(665,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S28'),(666,NULL,'Minimum bloeiwijzelengte',1,0,NULL,NULL,'S29'),(667,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,'S30'),(668,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,'S31'),(669,NULL,'Minimum ranklengte',1,0,NULL,NULL,'S32'),(670,NULL,'Jaartal sortering hout',1,0,NULL,NULL,'S33'),(671,NULL,'Minimum bladdiameter',1,0,NULL,NULL,'S34'),(672,NULL,'Minimum bundelgewicht',1,0,NULL,NULL,'S35'),(673,NULL,'Maximum planthoogte',1,0,NULL,NULL,'S36'),(674,NULL,'Maximum plantdiameter',1,0,NULL,NULL,'S37'),(675,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,'S38'),(676,NULL,'Maximum aantal takken per',1,0,NULL,NULL,'S39'),(677,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,'S40'),(678,NULL,'Maximum stamhoogte',1,0,NULL,NULL,'S41'),(679,NULL,'Maximum steellengte',1,0,NULL,NULL,'S42'),(680,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,'S43'),(681,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,'S44'),(682,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,'S45'),(683,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,'S46'),(684,NULL,'Verpakkingswijze',1,0,NULL,NULL,'S47'),(685,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,'S48'),(686,NULL,'Bolomvang',1,0,NULL,NULL,'S49'),(687,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,'S50'),(688,NULL,'Potvorm',1,0,NULL,NULL,'S51'),(689,NULL,'Potkleur',1,0,NULL,NULL,'S52'),(690,NULL,'Potmateriaal',1,0,NULL,NULL,'S53'),(691,NULL,'Plantvorm',1,0,NULL,NULL,'S54'),(692,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S55'),(693,NULL,'Teeltwijze',1,0,NULL,NULL,'S56'),(694,NULL,'Teeltmedium',1,0,NULL,NULL,'S57'),(695,NULL,'Hoesmateriaal',1,0,NULL,NULL,'S58'),(696,NULL,'Hoesvorm',1,0,NULL,NULL,'S59'),(697,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,'S60'),(698,NULL,'Extra toevoegingen',1,0,NULL,NULL,'S61'),(699,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,'S62'),(700,NULL,'Verpakte orchidee',1,0,NULL,NULL,'S63'),(701,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,'S64'),(702,NULL,'Voorbehandeling',1,0,NULL,NULL,'S65'),(703,NULL,'Overige niet in pot',1,0,NULL,NULL,'S66'),(704,NULL,'Vorm snijbloemen',1,0,NULL,NULL,'S67'),(705,NULL,'Buigzaamheid bloemsteel',1,0,NULL,NULL,'S68'),(706,NULL,'Hoeskleur',1,0,NULL,NULL,'S69'),(707,NULL,'Extra deco materiaal',1,0,NULL,NULL,'S70'),(708,NULL,'Productkleur',1,0,NULL,NULL,'S71'),(709,NULL,'Productmateriaal',1,0,NULL,NULL,'S72'),(710,NULL,'Materiaalhoogte',1,0,NULL,NULL,'S73'),(711,NULL,'Materiaaldiameter',1,0,NULL,NULL,'S74'),(712,NULL,'Barcode',1,0,NULL,NULL,'S75'),(713,NULL,'Productlabel',1,0,NULL,NULL,'S76'),(714,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,'S77'),(715,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,'S78'),(716,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S79'),(717,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,'S80'),(718,NULL,'Maximum lengte verschil',1,0,NULL,NULL,'S81'),(719,NULL,'Bladkleur',1,0,NULL,NULL,'S82'),(720,NULL,'Plantgewicht',1,0,NULL,NULL,'S83'),(721,NULL,'Gemiddelde bloemdiameter',1,0,NULL,NULL,'S84'),(722,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,'S85'),(723,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,'S86'),(724,NULL,'Kleurbehandeld',1,0,NULL,NULL,'S87'),(725,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,'S88'),(726,NULL,'Minimum bloemknopdiameter',1,0,NULL,NULL,'S89'),(727,NULL,'Volume inhoud',1,0,NULL,NULL,'S90'),(728,NULL,'Vruchtbenaming',1,0,NULL,NULL,'S91'),(729,NULL,'Vaaslevenindex',1,0,NULL,NULL,'S92'),(730,NULL,'Overige informatie plante',1,0,NULL,NULL,'S93'),(731,NULL,'Overige informatie snijbl',1,0,NULL,NULL,'S94'),(732,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,'S95'),(733,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,'S96'),(734,NULL,'MPS certificering',1,0,NULL,NULL,'S97'),(735,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,'S98'),(736,NULL,'Artikelomschrijving',1,0,NULL,NULL,'S99'),(737,NULL,'BTW-tarief',1,0,NULL,NULL,'T01'),(738,NULL,'Prijseenheid',1,0,NULL,NULL,'T02'),(739,NULL,'Transactievorm',1,0,NULL,NULL,'T03'),(740,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,'T10'),(741,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,'T11'),(742,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,'T12'),(743,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,'T13'),(744,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,'T14'),(745,NULL,'Algemene voorwaarden',1,0,NULL,NULL,'T15'),(746,NULL,'Marktvorm',1,0,NULL,NULL,'T16'),(747,NULL,'Themadagen',1,0,NULL,NULL,'T17'),(748,NULL,'Handelscategorie',1,0,NULL,NULL,'T18'),(749,NULL,'Producentengroepen',1,0,NULL,NULL,'T19'),(750,NULL,'Favorieten Id',1,0,NULL,NULL,'T20'),(751,NULL,'Verkoopeenheid',1,0,NULL,NULL,'T21'),(752,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,'V01'),(753,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V02'),(754,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,'V03'),(755,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,'V04'),(756,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,'V05'),(757,NULL,'FloraHolland Financial',1,0,NULL,NULL,'V06'),(758,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V07'),(759,NULL,'Benefiet veiling',1,0,NULL,NULL,'V08'),(760,NULL,'Kloksoort',1,0,NULL,NULL,'V09'),(761,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,'V10'),(762,NULL,'Rest aantallen',1,0,NULL,NULL,'V11'),(763,NULL,'Veilsoort',1,0,NULL,NULL,'V12'),(764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V13'),(765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V14'),(766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V15'),(767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V16'),(768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V17'),(769,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V18'),(770,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V19'),(771,NULL,'Gereserveerd',1,0,NULL,NULL,'V20'),(772,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,'V21'),(773,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,'V22'),(774,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,'V23'),(775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V24'),(776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V25'),(777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V26'),(778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V27'),(779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V28'),(780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V29'),(781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V30'),(782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V31'),(783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V32'),(784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V33'),(785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V34'),(786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V35'),(787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V36'),(788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V37'),(789,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V38'),(790,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V39'),(791,NULL,'Gereserveerd',1,0,NULL,NULL,'V40'),(792,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,'V41'),(793,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,'V42'),(794,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,'V43'),(795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V44'),(796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V45'),(797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V46'),(798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V47'),(799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V48'),(800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V49'),(801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V50'),(802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V51'),(803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V52'),(804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V53'),(805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V54'),(806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V55'),(807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V56'),(808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V57'),(809,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V58'),(810,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V59'),(811,NULL,'Gereserveerd',1,0,NULL,NULL,'V60'),(812,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,'V61'),(813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V62'),(814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V63'),(815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V64'),(816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V65'),(817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V66'),(818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V67'),(819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V68'),(820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V69'),(821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V70'),(822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V71'),(823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V72'),(824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V73'),(825,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V74'),(826,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V75'),(827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V76'),(828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V77'),(829,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V78'),(830,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V79'),(831,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,'V80'),(832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V81'),(833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V82'),(834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V83'),(835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V84'),(836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V85'),(837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V86'),(838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V87'),(839,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V88'),(840,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V89'),(841,NULL,'Veiling',1,0,NULL,NULL,'V99'),(842,NULL,'kopersaantallen',1,0,NULL,NULL,'Z01'); /*!40000 ALTER TABLE `tag` ENABLE KEYS */; UNLOCK TABLES; @@ -287,7 +287,7 @@ UNLOCK TABLES; LOCK TABLES `state` WRITE; /*!40000 ALTER TABLE `state` DISABLE KEYS */; -INSERT INTO `state` VALUES (1,'Arreglar',2,0,'FIXING',NULL,1,0,0,0,0,0,0,4),(2,'Libre',2,0,'FREE',NULL,2,1,0,0,0,1,0,4),(3,'OK',3,0,'OK',3,28,1,0,0,0,1,1,3),(4,'Impreso',4,1,'PRINTED',2,29,1,0,1,0,0,0,2),(5,'Preparación',5,1,'ON_PREPARATION',7,5,0,0,0,2,0,0,2),(6,'En Revisión',7,1,'ON_CHECKING',NULL,6,0,1,0,3,0,0,1),(7,'Sin Acabar',1,0,'NOT_READY',NULL,7,0,0,0,0,1,0,4),(8,'Revisado',8,1,'CHECKED',NULL,8,0,1,0,3,0,0,1),(9,'Encajando',9,2,'PACKING',NULL,9,0,1,0,0,0,0,0),(10,'Encajado',10,2,'PACKED',NULL,10,0,1,0,0,0,0,0),(11,'Facturado',0,0,'INVOICED',NULL,11,0,1,0,0,0,0,0),(12,'Bloqueado',0,0,'BLOCKED',NULL,12,0,0,0,0,0,0,4),(13,'En Reparto',11,3,'ON_DELIVERY',NULL,13,0,1,0,0,0,0,0),(14,'Preparado',6,1,'PREPARED',NULL,14,0,1,0,2,0,0,1),(15,'Pte Recogida',12,3,'WAITING_FOR_PICKUP',NULL,15,0,1,0,0,0,0,0),(16,'Entregado',13,3,'DELIVERED',NULL,16,0,1,0,0,0,0,0),(17,'Eliminado',14,3,'ERASED',NULL,17,0,0,0,0,0,0,0),(20,'Asignado',4,1,'PICKER_DESIGNED',NULL,20,1,0,0,0,0,0,2),(21,'Retornado',4,1,'PRINTED_BACK',6,21,0,0,0,0,0,0,2),(22,'¿Fecha?',2,0,'WRONG_DATE',NULL,22,0,0,0,0,0,0,4),(23,'URGENTE',2,0,'LAST_CALL',NULL,23,1,0,0,0,0,0,4),(24,'Encadenado',4,0,'CHAINED',4,24,0,0,0,0,0,0,3),(25,'Embarcando',3,0,'BOARDING',5,25,1,0,0,0,1,0,3),(26,'Prep Previa',5,1,'PREVIOUS_PREPARATION',1,26,0,0,0,1,0,0,2),(27,'Prep Asistida',5,1,'ASSISTED_PREPARATION',7,27,0,0,0,0,0,0,2),(28,'Previa OK',3,1,'OK PREVIOUS',3,28,1,0,0,1,1,1,3),(29,'Previa Impreso',4,1,'PRINTED PREVIOUS',2,29,1,0,1,1,0,0,3),(30,'Embarcado',4,0,'BOARD',5,30,0,0,0,2,0,0,3),(31,'Polizon Impreso',4,1,'PRINTED STOWAWAY',2,29,1,0,1,0,0,0,3),(32,'Polizon OK',3,1,'OK STOWAWAY',3,31,1,0,0,1,1,1,3),(33,'Auto_Impreso',4,1,'PRINTED_AUTO',2,29,1,0,1,0,0,0,2); +INSERT INTO `state` VALUES (1,'Arreglar',2,0,'FIXING',NULL,1,0,0,0,0,0,0,4),(2,'Libre',2,0,'FREE',NULL,2,1,0,0,0,1,0,4),(3,'OK',3,0,'OK',3,28,1,0,0,0,1,1,3),(4,'Impreso',4,1,'PRINTED',2,29,1,0,1,0,0,0,2),(5,'Preparación',5,1,'ON_PREPARATION',7,5,0,0,0,2,0,0,2),(6,'En Revisión',7,1,'ON_CHECKING',NULL,6,0,1,0,3,0,0,1),(7,'Sin Acabar',1,0,'NOT_READY',NULL,7,0,0,0,0,1,0,4),(8,'Revisado',8,1,'CHECKED',NULL,8,0,1,0,3,0,0,1),(9,'Encajando',9,2,'PACKING',NULL,9,0,1,0,0,0,0,0),(10,'Encajado',10,2,'PACKED',NULL,10,0,1,0,0,0,0,0),(11,'Facturado',0,0,'INVOICED',NULL,11,0,1,0,0,0,0,0),(12,'Bloqueado',0,0,'BLOCKED',NULL,12,0,0,0,0,0,0,4),(13,'En Reparto',11,3,'ON_DELIVERY',NULL,13,0,1,0,0,0,0,0),(14,'Preparado',6,1,'PREPARED',NULL,14,0,1,0,2,0,0,1),(15,'Pte Recogida',12,3,'WAITING_FOR_PICKUP',NULL,15,0,1,0,0,0,0,0),(16,'Entregado',13,3,'DELIVERED',NULL,16,0,1,0,0,0,0,0),(20,'Asignado',4,1,'PICKER_DESIGNED',NULL,20,1,0,0,0,0,0,2),(21,'Retornado',4,1,'PRINTED_BACK',6,21,0,0,0,0,0,0,2),(22,'¿Fecha?',2,0,'WRONG_DATE',NULL,22,0,0,0,0,0,0,4),(23,'URGENTE',2,0,'LAST_CALL',NULL,23,1,0,0,0,0,0,4),(24,'Encadenado',4,0,'CHAINED',4,24,0,0,0,0,0,0,3),(25,'Embarcando',3,0,'BOARDING',5,25,1,0,0,0,1,0,3),(26,'Prep Previa',5,1,'PREVIOUS_PREPARATION',1,26,0,0,0,1,0,0,2),(27,'Prep Asistida',5,1,'ASSISTED_PREPARATION',7,27,0,0,0,0,0,0,2),(28,'Previa OK',3,1,'OK PREVIOUS',3,28,1,0,0,1,1,1,3),(29,'Previa Impreso',4,1,'PRINTED PREVIOUS',2,29,1,0,1,1,0,0,3),(30,'Embarcado',4,0,'BOARD',5,30,0,0,0,2,0,0,3),(31,'Polizon Impreso',4,1,'PRINTED STOWAWAY',2,29,1,0,1,0,0,0,3),(32,'Polizon OK',3,1,'OK STOWAWAY',3,31,1,0,0,1,1,1,3),(33,'Auto_Impreso',4,1,'PRINTED_AUTO',2,29,1,0,1,0,0,0,2); /*!40000 ALTER TABLE `state` ENABLE KEYS */; UNLOCK TABLES; @@ -307,7 +307,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),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/',NULL),(23,'CAMARA',14,19,NULL,72,604,2,6,1,0,1,2,37,'/37/',NULL),(31,'INFORMATICA',5,6,NULL,72,127,3,9,0,0,0,0,NULL,'/','informatica'),(34,'CONTABILIDAD',7,8,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(35,'FINANZAS',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(36,'LABORAL',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(37,'PRODUCCION',13,52,NULL,72,230,3,11,1,0,0,17,NULL,'/',NULL),(38,'SACADO',20,21,NULL,72,230,4,14,1,0,1,0,37,'/37/',NULL),(39,'ENCAJADO',22,23,NULL,72,230,4,12,1,0,1,0,37,'/37/',NULL),(41,'ADMINISTRACION',53,54,NULL,72,599,3,8,0,0,0,0,NULL,'/',NULL),(43,'VENTAS',55,78,NULL,0,NULL,NULL,NULL,0,0,0,11,NULL,'/',NULL),(44,'GERENCIA',79,80,NULL,72,300,2,7,0,0,0,0,NULL,'/',NULL),(45,'LOGISTICA',81,82,NULL,72,596,3,19,0,0,0,0,NULL,'/',NULL),(46,'REPARTO',83,86,NULL,72,659,3,10,0,0,0,1,NULL,'/',NULL),(48,'ALMACENAJE',87,88,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL),(49,'PROPIEDAD',89,90,NULL,72,1008,1,1,0,0,0,0,NULL,'/',NULL),(52,'CARGA AEREA',91,92,NULL,72,163,4,28,0,0,0,0,NULL,'/',NULL),(53,'MARKETING Y COMUNICACIÓN',93,94,NULL,72,1238,0,0,0,0,0,0,NULL,'/',NULL),(54,'ORNAMENTALES',95,96,NULL,72,433,3,21,0,0,0,0,NULL,'/',NULL),(55,'TALLER NATURAL',97,98,NULL,72,695,2,23,0,0,0,0,NULL,'/',NULL),(56,'TALLER ARTIFICIAL',99,100,NULL,72,1780,2,24,0,0,0,0,NULL,'/',NULL),(58,'CAMPOS',101,102,NULL,72,225,2,2,0,0,0,0,NULL,'/',NULL),(59,'MANTENIMIENTO',103,104,NULL,72,1907,4,16,0,0,0,0,NULL,'/',NULL),(60,'RECLAMACIONES',105,106,NULL,72,563,3,20,0,0,0,0,NULL,'/',NULL),(61,'VNH',107,108,NULL,73,1297,3,17,0,0,0,0,NULL,'/',NULL),(63,'VENTAS FRANCIA',56,57,NULL,72,277,2,27,0,0,1,0,43,'/43/',NULL),(66,'VERDNAMADRID',109,110,NULL,72,163,3,18,0,0,0,0,NULL,'/',NULL),(68,'COMPLEMENTOS',24,25,NULL,72,617,3,26,1,0,1,0,37,'/37/',NULL),(69,'VERDNABARNA',111,112,NULL,74,432,3,22,0,0,0,0,NULL,'/',NULL),(77,'PALETIZADO',84,85,NULL,72,230,4,15,1,0,1,0,46,'/46/',NULL),(80,'EQUIPO J VALLES',58,59,NULL,72,693,3,4,0,0,1,0,43,'/43/','jvp_equipo'),(86,'LIMPIEZA',113,114,NULL,72,599,0,0,0,0,0,0,NULL,'/',NULL),(89,'COORDINACION',115,116,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL),(90,'TRAILER',117,118,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(91,'ARTIFICIAL',26,27,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(92,'EQUIPO SILVERIO',60,61,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','sdc_equipo'),(93,'CONFECCION',119,120,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL),(94,'EQUIPO J BROCAL',62,63,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jes_equipo'),(95,'EQUIPO C ZAMBRANO',64,65,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','czg_equipo'),(96,'EQUIPO C LOPEZ',66,67,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','cla_equipo'),(97,'EQUIPO D SARRION',68,69,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','dsr_equipo'),(98,'EQUIPO RODRIGO',70,71,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','rhr_equipo'),(99,'EQUIPO MANOLI',72,73,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','man_equipo'),(101,'EQUIPO J IBAÑEZ',74,75,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jmi_equipo'),(102,'EQ ROJO FV RUBEN C',28,29,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(103,'EQ AZUL FV A FOLQUES',30,31,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(104,'EQ AMARILLO FV NORMAN G',32,33,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(105,'EQ MORADO FV MATOU',34,35,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(106,'EQ VERDE PCA KEVIN GIMENEZ',36,37,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(107,'EQ NARANJA PCA RUBEN ZANON',38,39,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(110,'EQ ROSA PCA J BONDIA',40,41,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(111,'EQ REPONEDOR CAJAS',42,43,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(112,'CAMARA EQ EDGAR LLEO',15,16,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL),(113,'CAMARA EQ MARC ROCA',17,18,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL),(114,'EQ MARRON PCA JL NUEVO',44,45,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(115,'EQUIPO CLAUDI',76,77,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','csr_equipo'),(120,'PCA PRODUCCION',46,47,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(121,'FV PRODUCCION',48,49,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL),(122,'PCA ALMACEN',50,51,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL); +INSERT INTO `department` VALUES (1,'VERDNATURA',1,2,763,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/',NULL,1),(23,'CAMARA',14,19,NULL,72,604,2,6,1,0,1,2,37,'/37/',NULL,0),(31,'INFORMATICA',5,6,NULL,72,127,3,9,0,0,0,0,NULL,'/','informatica',1),(34,'CONTABILIDAD',7,8,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(35,'FINANZAS',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(36,'LABORAL',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(37,'PRODUCCION',13,52,NULL,72,230,3,11,1,0,0,17,NULL,'/',NULL,0),(38,'SACADO',20,21,NULL,72,230,4,14,1,0,1,0,37,'/37/',NULL,0),(39,'ENCAJADO',22,23,NULL,72,230,4,12,1,0,1,0,37,'/37/',NULL,0),(41,'ADMINISTRACION',53,54,NULL,72,599,3,8,0,0,0,0,NULL,'/',NULL,1),(43,'VENTAS',55,80,NULL,0,NULL,NULL,NULL,0,0,0,12,NULL,'/',NULL,1),(44,'GERENCIA',81,82,NULL,72,300,2,7,0,0,0,0,NULL,'/',NULL,0),(45,'LOGISTICA',83,84,NULL,72,596,3,19,0,0,0,0,NULL,'/',NULL,1),(46,'REPARTO',85,88,NULL,72,659,3,10,0,0,0,1,NULL,'/',NULL,0),(48,'ALMACENAJE',89,90,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0),(49,'PROPIEDAD',91,92,NULL,72,1008,1,1,0,0,0,0,NULL,'/',NULL,0),(52,'CARGA AEREA',93,94,NULL,72,163,4,28,0,0,0,0,NULL,'/',NULL,0),(53,'MARKETING Y COMUNICACIÓN',95,96,NULL,72,1238,0,0,0,0,0,0,NULL,'/',NULL,1),(54,'ORNAMENTALES',97,98,NULL,72,433,3,21,0,0,0,0,NULL,'/',NULL,0),(55,'TALLER NATURAL',99,100,NULL,72,695,2,23,0,0,0,0,NULL,'/',NULL,0),(56,'TALLER ARTIFICIAL',101,102,NULL,72,1780,2,24,0,0,0,0,NULL,'/',NULL,0),(58,'CAMPOS',103,104,NULL,72,225,2,2,0,0,0,0,NULL,'/',NULL,0),(59,'MANTENIMIENTO',105,106,NULL,72,1907,4,16,0,0,0,0,NULL,'/',NULL,0),(60,'RECLAMACIONES',107,108,NULL,72,563,3,20,0,0,0,0,NULL,'/',NULL,1),(61,'VNH',109,110,NULL,73,1297,3,17,0,0,0,0,NULL,'/',NULL,0),(63,'VENTAS FRANCIA',56,57,NULL,72,277,2,27,0,0,1,0,43,'/43/',NULL,0),(66,'VERDNAMADRID',111,112,NULL,72,163,3,18,0,0,0,0,NULL,'/',NULL,0),(68,'COMPLEMENTOS',24,25,NULL,72,617,3,26,1,0,1,0,37,'/37/',NULL,0),(69,'VERDNABARNA',113,114,NULL,74,432,3,22,0,0,0,0,NULL,'/',NULL,0),(77,'PALETIZADO',86,87,NULL,72,230,4,15,1,0,1,0,46,'/46/',NULL,0),(80,'EQUIPO J VALLES',58,59,NULL,72,693,3,4,0,0,1,0,43,'/43/','jvp_equipo',1),(86,'LIMPIEZA',115,116,NULL,72,599,0,0,0,0,0,0,NULL,'/',NULL,0),(89,'COORDINACION',117,118,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0),(90,'TRAILER',119,120,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(91,'ARTIFICIAL',26,27,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(92,'EQUIPO SILVERIO',60,61,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','sdc_equipo',1),(93,'CONFECCION',121,122,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(94,'EQUIPO J BROCAL',62,63,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jes_equipo',1),(95,'EQUIPO C ZAMBRANO',64,65,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','czg_equipo',1),(96,'EQUIPO C LOPEZ',66,67,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','cla_equipo',1),(97,'EQUIPO D SARRION',68,69,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/',NULL,1),(98,'EQUIPO RODRIGO',70,71,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','rhr_equipo',1),(99,'EQUIPO MANOLI',72,73,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/',NULL,1),(101,'EQUIPO J IBAÑEZ',74,75,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jmi_equipo',1),(102,'EQ ROJO FV RUBEN C',28,29,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(103,'EQ AZUL FV A FOLQUES',30,31,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(104,'EQ AMARILLO FV NORMAN G',32,33,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(105,'EQ MORADO FV MATOU',34,35,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(106,'EQ VERDE PCA KEVIN GIMENEZ',36,37,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(107,'EQ NARANJA PCA RUBEN ZANON',38,39,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(110,'EQ ROSA PCA J BONDIA',40,41,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(111,'EQ REPONEDOR CAJAS',42,43,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(112,'CAMARA EQ EDGAR LLEO',15,16,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0),(113,'CAMARA EQ MARC ROCA',17,18,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0),(114,'EQ MARRON PCA JL NUEVO',44,45,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(115,'EQUIPO CLAUDI',76,77,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','csr_equipo',1),(120,'PCA PRODUCCION',46,47,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(121,'FV PRODUCCION',48,49,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(122,'PCA ALMACEN',50,51,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(123,'EQUIPO ELENA BASCUÑANA',78,79,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','ebt_equipo',0); /*!40000 ALTER TABLE `department` ENABLE KEYS */; UNLOCK TABLES; @@ -340,7 +340,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 8:08:02 +-- Dump completed on 2020-07-16 9:53:07 USE `cache`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -378,7 +378,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 8:08:02 +-- Dump completed on 2020-07-16 9:53:08 USE `hedera`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -436,7 +436,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 8:08:03 +-- Dump completed on 2020-07-16 9:53:09 USE `postgresql`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -511,7 +511,7 @@ UNLOCK TABLES; LOCK TABLES `workcenter` WRITE; /*!40000 ALTER TABLE `workcenter` DISABLE KEYS */; -INSERT INTO `workcenter` VALUES (1,'Silla',20,1037,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,2852,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,1040,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,2852,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 */; @@ -524,4 +524,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 8:08:05 +-- Dump completed on 2020-07-16 9:53:11 diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index e146ff893..e40bb505b 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -588,7 +588,7 @@ INSERT INTO `vn`.`ticketTracking`(`ticketFk`, `stateFk`, `workerFk`, `created`) (16, 3, 19, NOW()), (17, 3, 19, NOW()), (18, 3, 19, NOW()), - (19, 17, 19, NOW()), + (19, 3, 19, NOW()), (20, 1, 19, DATE_ADD(NOW(), INTERVAL +1 MONTH)), (21, 1, 19, DATE_ADD(NOW(), INTERVAL +1 MONTH)), (22, 1, 19, DATE_ADD(NOW(), INTERVAL +1 MONTH)), diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 95b056f3c..c0052acf9 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -1908,11 +1908,47 @@ DROP TABLE IF EXISTS `clientNewBorn`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `clientNewBorn` ( `clientFk` int(11) NOT NULL, - `shipped` date NOT NULL, + `firstShipped` date NOT NULL COMMENT 'Primer pedido o de la relacion comercial, o después de un año de inactividad', + `lastShipped` date NOT NULL COMMENT 'último pedido del cliente', PRIMARY KEY (`clientFk`), CONSTRAINT `clientNewBorn_fk1` FOREIGN KEY (`clientFk`) REFERENCES `vn`.`client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Listado de clientes que se consideran nuevos a efectos de cobrar la comision adicional del comercial'; /*!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 `bs`.`clientNewBorn_BEFORE_UPDATE` BEFORE UPDATE ON `clientNewBorn` FOR EACH ROW +BEGIN +-- Si ha pasado un año o mas +IF TIMESTAMPDIFF(YEAR,NEW.lastShipped, OLD.firstShipped) THEN +SET NEW.firstShipped = NEW.lastShipped; +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 */ ; + +-- +-- Table structure for table `clientNewBorn__` +-- + +DROP TABLE IF EXISTS `clientNewBorn__`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `clientNewBorn__` ( + `clientFk` int(11) NOT NULL, + `shipped` date NOT NULL, + PRIMARY KEY (`clientFk`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Listado de clientes que se consideran nuevos a efectos de cobrar la comision adicional del comercial'; +/*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `compradores` @@ -3051,18 +3087,23 @@ ALTER DATABASE `bs` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; /*!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 `clean`() BEGIN DECLARE vFourYearsAgo DATETIME; + DECLARE vOneYearAgo DATETIME; SET vFourYearsAgo = TIMESTAMPADD(YEAR, -4,CURDATE()); + SET vOneYearAgo = TIMESTAMPADD(YEAR, -1,CURDATE()); + DELETE FROM bs.clientNewBorn + WHERE lastShipped < vOneYearAgo; + DELETE FROM ventas WHERE fecha < vFourYearsAgo; END ;; @@ -3120,17 +3161,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 `clientNewBorn_Update` */; +/*!50003 DROP PROCEDURE IF EXISTS `clientNewBorn_Update__` */; /*!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 `clientNewBorn_Update`() +CREATE DEFINER=`root`@`%` PROCEDURE `clientNewBorn_Update__`() BEGIN DECLARE fromDated DATE DEFAULT '2019-04-01'; @@ -3157,9 +3198,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 ;; @@ -3253,7 +3294,7 @@ BEGIN LEFT JOIN tmp.itemTypeExcluded ite ON ite.itemTypeFk = v.tipo_id WHERE (c.Id_Trabajador = vWorker OR tr.boss = vWorker) AND ite.itemTypeFk IS NULL - AND (v.fecha BETWEEN TIMESTAMPADD(DAY, - DAY(vDate) + 1, vDate) AND TIMESTAMPADD(DAY, - 1, vDate)) + AND (v.fecha BETWEEN TIMESTAMPADD(DAY, - DAY(vDate) + 1, vDate) AND vDate) GROUP BY Id_Cliente) mes_actual ON mes_actual.Id_Cliente = c.Id_Cliente LEFT JOIN (SELECT @@ -3940,9 +3981,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 ;; @@ -3961,7 +4002,7 @@ BEGIN WHERE fecha >= datSTART; INSERT INTO bs.m3 (fecha, provinceFk, warehouseFk, m3, year, month, week, day, dayName, euros) - SELECT v.fecha, a.provinceFk, t.warehouseFk, sum(i.compression * s.quantity * r.cm3) / 1000000 AS m3, + SELECT v.fecha, a.provinceFk, t.warehouseFk, sum(s.quantity * ic.cm3delivery) / 1000000 AS m3, tm.year, tm.month, tm.week, tm.day, dayname(v.fecha), sum(importe) FROM vn.ticket t JOIN vn.sale s ON s.ticketFk = t.id @@ -3969,7 +4010,7 @@ BEGIN JOIN vn.itemType it ON it.id = i.typeFk JOIN bs.ventas v ON v.Id_Movimiento = s.id -- Filtra solo por ventas "buenas" JOIN vn.time tm ON tm.dated = v.fecha - JOIN bi.rotacion r ON r.Id_Article = s.itemFk AND r.warehouse_id = t.warehouseFk + JOIN vn.itemCost ic ON ic.itemFk = s.itemFk AND ic.warehouseFk = t.warehouseFk JOIN vn.address a ON a.id = t.addressFk WHERE v.fecha BETWEEN datSTART AND datEND AND s.quantity > 0 -- evita abonos @@ -4787,6 +4828,96 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `vendedores_add`(intYEAR INT, vQuarter INT) +BEGIN + + DECLARE vCommissionRate DOUBLE DEFAULT 0.008; + + -- vaciar tabla + DELETE v.* FROM vendedores v + JOIN vn.`time` t ON t.`year` = v.año AND t.`month` = v.mes + WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter; + + REPLACE vendedores(Id_Trabajador, año, mes, importe, comision) + SELECT c.Id_Trabajador + , intYEAR + , MONTH(v.fecha) intMONTH + , sum(v.importe) + , sum(v.importe) * vCommissionRate + FROM ventas v + JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente + JOIN vn.`time` t on t.dated = v.fecha + WHERE c.Id_Trabajador is not null + AND t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter + GROUP BY c.Id_Trabajador, t.`month`; + + -- Sustitucion cedidas - lended + INSERT INTO vendedores (Id_Trabajador, mes, año, comision) + SELECT c.salesPersonFk + , t.`month` + , t.`year` + , sum(importe) * vCommissionRate as lended + FROM ventas v + JOIN vn.client c ON c.id = v.Id_Cliente + JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha + JOIN vn.`time` t ON t.dated = v.fecha + WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter + GROUP BY c.salesPersonFk, t.`month` + ON DUPLICATE KEY UPDATE comision = comision - VALUES(comision); + + -- Sustitucion arrendadas - borrowed + INSERT INTO vendedores (Id_Trabajador, mes, año, sustitucionArrendada) + SELECT scd.substituteFk + , t.`month` + , t.`year` + , sum(importe) * vCommissionRate as borrowed + FROM ventas v + JOIN vn.`client` c ON c.id = v.Id_Cliente + JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha + JOIN vn.`time` t ON t.dated = v.fecha + WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter + GROUP BY scd.substituteFk, t.`month` + ON DUPLICATE KEY UPDATE sustitucionArrendada = VALUES(sustitucionArrendada); + +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 `vendedores_add_launcher` */; +/*!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 `vendedores_add_launcher`() +BEGIN + + CALL bs.vendedores_add(YEAR(CURDATE()),QUARTER(CURDATE())); + CALL bs.vendedores_evolution_add; + CALL bs.salesPersonClient_add(YEAR(CURDATE()), QUARTER(CURDATE())); + +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 `vendedores_add__` */; +/*!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 `vendedores_add__`(intYEAR INT, vQuarter INT) BEGIN DECLARE vCommissionRate DOUBLE DEFAULT 0.029; @@ -4823,6 +4954,7 @@ BEGIN JOIN vn2008.`time` t on t.`date` = v.fecha WHERE c.Id_Trabajador is not null AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter + AND cnb.firstShipped > DATE_ADD(v.fecha, INTERVAL -1 YEAR) GROUP BY c.Id_Trabajador, t.`month` ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año SET v.comisionNuevos = sub.comisionNueva, v.comision = v.comision - sub.comisionNueva; @@ -4928,282 +5060,6 @@ BEGIN DROP TEMPORARY TABLE tmp.workerItemType; -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 `vendedores_add_launcher` */; -/*!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 `vendedores_add_launcher`() -BEGIN - - CALL bs.vendedores_add(YEAR(CURDATE()),QUARTER(CURDATE())); - CALL bs.vendedores_evolution_add; - CALL bs.salesPersonClient_add(YEAR(CURDATE()), QUARTER(CURDATE())); - -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 `vendedores_add__` */; -/*!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 `vendedores_add__`(intYEAR INT, vQuarter INT) -BEGIN - - DECLARE vCommissionRate DOUBLE DEFAULT 0.029; - - -- vaciar tabla - DELETE v.* FROM vendedores v - JOIN vn.`time` t ON t.`year` = v.año AND t.`month` = v.mes - WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter; - - REPLACE vendedores(Id_Trabajador, año, mes, importe, comision) - SELECT c.Id_Trabajador - , intYEAR - , MONTH(v.fecha) intMONTH - , sum(v.importe) - , sum(v.importe) * vCommissionRate - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN vn.`time` t on t.dated = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter - GROUP BY c.Id_Trabajador, t.`month`; - - -- Ventas nuevas - UPDATE vendedores v - JOIN - ( - SELECT c.Id_Trabajador - , sum(importe) * vCommissionRate as comisionNueva - , t.`month` - , t.`year` - FROM ventas v - JOIN bs.clientNewBorn cnb on v.Id_Cliente = cnb.clientFk - JOIN vn2008.Clientes c ON c.Id_Cliente = v.Id_Cliente - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY c.Id_Trabajador, t.`month` - ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año - SET v.comisionNuevos = sub.comisionNueva, v.comision = v.comision - sub.comisionNueva; - - -- Ventas cedidas - UPDATE vendedores v - JOIN ( - SELECT cc.Id_Trabajador_old as Id_Trabajador - , sum(importe) * vCommissionRate * comision_old as cedido - , sum(importe) * vCommissionRate * comision_new as arrendada - , t.`month` - , t.`year` - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN vn2008.Clientes_cedidos cc on cc.Id_Cliente = c.Id_Cliente AND v.fecha between datSTART and datEND - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY cc.Id_Trabajador_old, t.`month` - ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año - SET v.comisionCedida = sub.cedido, v.comision = v.comision - sub.cedido - sub.arrendada; - - -- Ventas arrendadas - UPDATE vendedores v - JOIN ( - SELECT cc.Id_Trabajador_new as Id_Trabajador - , sum(importe) * vCommissionRate * comision_new as arrendada - , t.`month` - , t.`year` - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN vn2008.Clientes_cedidos cc on cc.Id_Cliente = c.Id_Cliente AND v.fecha between datSTART and datEND - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY cc.Id_Trabajador_new, t.`month` - ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año - SET v.comisionArrendada = sub.arrendada; - - -- Sustitucion cedidas - lended - INSERT INTO vendedores (Id_Trabajador, mes, año, comision) - SELECT c.salesPersonFk - , sum(importe) * vCommissionRate as lended - , t.`month` - , t.`year` - FROM ventas v - JOIN vn.client c ON c.id = v.Id_Cliente - JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha - JOIN vn.`time` t ON t.dated = v.fecha - WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter - GROUP BY c.salesPersonFk, t.`month` - ON DUPLICATE KEY UPDATE comision = comision - VALUES(comision); - - -- Sustitucion arrendadas - borrowed - INSERT INTO vendedores (Id_Trabajador, mes, año, sustitucionArrendada) - SELECT scd.substituteFk - , sum(importe) * vCommissionRate as borrowed - , t.`month` - , t.`year` - FROM ventas v - JOIN vn.client c ON c.id = v.Id_Cliente - JOIN vn.sharingCartDaily scd on scd.ownerFk = c.salesPersonFk AND scd.dated = v.fecha - JOIN vn.`time` t ON t.dated = v.fecha - WHERE t.`year` = intYEAR AND QUARTER(t.dated) = vQuarter - GROUP BY scd.substituteFk, t.`month` - ON DUPLICATE KEY UPDATE sustitucionArrendada = sustitucionArrendada + VALUES(sustitucionArrendada); - - DROP TEMPORARY TABLE IF EXISTS tmp.workerItemType; - CREATE TEMPORARY TABLE tmp.workerItemType - (INDEX(ownerWorkerFk, itemTypeFk)) - SELECT wd.workerFk ownerWorkerFk, itemTypeFk, dit.workerFk substituteFk - FROM vn.departmentItemType dit - JOIN vn.workerDepartment wd ON wd.departmentFk = dit.departmentFk; - - -- itemType Lended, prestado - UPDATE vendedores v - JOIN ( - SELECT c.Id_Trabajador - , sum(importe) * vCommissionRate as amount - , t.`month` - , t.`year` - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN tmp.workerItemType wit ON wit.ownerWorkerFk = c.Id_Trabajador AND wit.itemTypeFk = v.tipo_id - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY c.Id_Trabajador, t.`month` - ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año - SET v.comision = v.comision - sub.amount; - - -- itemType borrowed, tomado prestado - INSERT INTO vendedores (Id_Trabajador, año, mes, itemTypeBorrowed) - SELECT wit.substituteFk - , t.`year` - , t.`month` - , importe * vCommissionRate - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN tmp.workerItemType wit ON wit.ownerWorkerFk = c.Id_Trabajador AND wit.itemTypeFk = v.tipo_id - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - ON DUPLICATE KEY UPDATE itemTypeBorrowed = itemTypeBorrowed + values(itemTypeBorrowed); - - DROP TEMPORARY TABLE tmp.workerItemType; - -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 `vendedores_add___` */; -/*!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 `vendedores_add___`(intYEAR INT, vQuarter INT) -BEGIN - - DECLARE comisionRate DOUBLE DEFAULT 0.029; - - REPLACE vendedores - SELECT c.Id_Trabajador - , intYEAR - , MONTH(v.fecha) intMONTH - , sum(importe) as importe - , sum(importe) * 0.029 as comision - , 0 as comisionArrendada - , 0 as comisionCedida - , 0 as comisionNuevos - , 0 as sustitucionArrendada - , 0 as sustitucionCedida - , 0 as itemTypeLended - , 0 as itemTypeBorrowed - - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY c.Id_Trabajador, t.`month`; - - -- Ventas nuevas - UPDATE vendedores v - JOIN - ( - SELECT c.Id_Trabajador - , sum(importe) * 0.029 as comisionNueva - , t.`month` - , t.`year` - FROM ventas v - JOIN bs.clientNewBorn cnb on v.Id_Cliente = cnb.clientFk - JOIN vn2008.Clientes c ON c.Id_Cliente = v.Id_Cliente - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY c.Id_Trabajador, t.`month` - ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año - SET v.comisionNuevos = sub.comisionNueva, v.comision = v.comision - sub.comisionNueva; - - -- Ventas cedidas - UPDATE vendedores v - JOIN ( - SELECT cc.Id_Trabajador_old as Id_Trabajador - , sum(importe) * 0.029 * comision_old as cedido - , sum(importe) * 0.029 * comision_new as arrendada - , t.`month` - , t.`year` - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN vn2008.Clientes_cedidos cc on cc.Id_Cliente = c.Id_Cliente AND v.fecha between datSTART and datEND - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY cc.Id_Trabajador_old, t.`month` - ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año - SET v.comisionCedida = sub.cedido, v.comision = v.comision - sub.cedido - sub.arrendada; - - -- Ventas arrendadas - UPDATE vendedores v - JOIN ( - SELECT cc.Id_Trabajador_new as Id_Trabajador - , sum(importe) * 0.029 * comision_new as arrendada - , t.`month` - , t.`year` - FROM ventas v - JOIN vn2008.Clientes c on v.Id_Cliente = c.Id_Cliente - JOIN vn2008.Clientes_cedidos cc on cc.Id_Cliente = c.Id_Cliente AND v.fecha between datSTART and datEND - JOIN vn2008.`time` t on t.`date` = v.fecha - WHERE c.Id_Trabajador is not null - AND t.`year` = intYEAR AND QUARTER(v.fecha) = vQuarter - GROUP BY cc.Id_Trabajador_new, t.`month` - ) sub ON sub.Id_Trabajador = v.Id_Trabajador AND sub.`month` = v.mes AND sub.`year` = v.año - SET v.comisionArrendada = sub.arrendada; - END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7715,7 +7571,14 @@ CREATE TABLE `item_groupToOffer` ( `intrastatFk` int(8) unsigned zerofill NOT NULL, `originFk` tinyint(2) unsigned NOT NULL DEFAULT '17', `expenseFk` varchar(10) COLLATE utf8_unicode_ci DEFAULT '6001000001', - PRIMARY KEY (`group_code`) + PRIMARY KEY (`group_code`), + 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 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='se ofreceran para ser comprados'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -7794,7 +7657,7 @@ CREATE TABLE `marketPlace` ( `id` varchar(13) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL, `supplierFk` int(11) NOT NULL DEFAULT '1433', - `IsOffered` tinyint(2) NOT NULL DEFAULT '0', + `isOffered` tinyint(2) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -7977,6 +7840,7 @@ CREATE TABLE `supplyResponse` ( `PackingPriceQuantityType` tinyint(1) DEFAULT NULL COMMENT 'Unit: 1 = piece, 2 = bunch, 3 = box, 4 = layer, 5 = load carrier/trolley', `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, 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', @@ -8023,96 +7887,118 @@ CREATE TABLE `value` ( -- -- Dumping events for database 'edi' -- +/*!50106 SET @save_time_zone= @@TIME_ZONE */ ; +/*!50106 DROP EVENT IF EXISTS `floramondo` */; +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 @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=`z-sysadmin`@`%`*/ /*!50106 EVENT `floramondo` ON SCHEDULE EVERY 5 MINUTE STARTS '2020-06-25 13:39:59' ON COMPLETION NOT PRESERVE ENABLE DO CALL edi.floramondo_offerRefresh() */ ;; +/*!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 */ ;; +DELIMITER ; +/*!50106 SET TIME_ZONE= @save_time_zone */ ; -- -- Dumping routines for database 'edi' -- -/*!50003 DROP FUNCTION IF EXISTS `floramondoTodayEntryGet` */; +/*!50003 DROP FUNCTION IF EXISTS `floramondoTodayEntryGet__` */; /*!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 `floramondoTodayEntryGet`() RETURNS int(11) +CREATE DEFINER=`root`@`%` FUNCTION `floramondoTodayEntryGet__`() RETURNS int(11) READS SQL DATA BEGIN - DECLARE myTravel INT; - DECLARE myEntry INT; + DECLARE vTravelFk INT; + DECLARE vEntryFk INT; - SET myTravel = FloramondoTodayTravelGet(); + SET vTravelFk = FloramondoTodayTravelGet(); - SELECT IFNULL(MAX(id),0) INTO myEntry + SELECT IFNULL(MAX(id),0) INTO vEntryFk FROM vn.entry - WHERE travelFk = myTravel; + WHERE travelFk = vTravelFk; - IF NOT myEntry THEN + IF NOT vEntryFk THEN - INSERT INTO vn.entry(travelFk, supplierFk, commission, companyFk, currencyFk) - SELECT myTravel, s.id, 4, c.id, cu.id + INSERT INTO vn.entry(travelFk, supplierFk, commission, companyFk, currencyFk, isRaid) + SELECT vTravelFk, s.id, 4, c.id, cu.id, TRUE FROM vn.supplier s JOIN vn.company c ON c.code = 'VNL' JOIN vn.currency cu ON cu.code = 'EUR' WHERE s.name = 'KONINKLIJE COOPERATIEVE BLOEMENVEILING FLORAHOLLAN'; - SELECT IFNULL(MAX(id),0) INTO myEntry + SELECT IFNULL(MAX(id),0) INTO vEntryFk FROM vn.entry - WHERE travelFk = myTravel; + WHERE travelFk = vTravelFk; END IF; - RETURN myEntry; + RETURN vEntryFk; 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 `floramondoTodayTravelGet` */; +/*!50003 DROP FUNCTION IF EXISTS `floramondoTodayTravelGet__` */; /*!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 `floramondoTodayTravelGet`() RETURNS int(11) +CREATE DEFINER=`root`@`%` FUNCTION `floramondoTodayTravelGet__`() RETURNS int(11) READS SQL DATA BEGIN DECLARE myTravel INT; - + DECLARE vWarehouseOutName VARCHAR(50) DEFAULT 'Holanda'; + DECLARE vWarehouseInName VARCHAR(50) DEFAULT 'VNH'; +-- recuperar hora del delivery SELECT IFNULL(MAX(tr.id),0) INTO myTravel 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 = 'VNH' - AND wOut.name = 'Floramondo' - AND landed = CURDATE(); + WHERE wIn.name = vWarehouseInName + AND wOut.name = vWarehouseOutName + AND landed = util.tomorrow(); IF NOT myTravel THEN INSERT INTO vn.travel(landed, shipped, warehouseInFk, warehouseOutFk, agencyFk) - SELECT CURDATE(), util.yesterday(), wIn.id, wOut.id, am.id + SELECT util.tomorrow(), curdate(), wIn.id, wOut.id, am.id FROM vn.warehouse wIn - JOIN vn.warehouse wOut ON wOut.name = 'Floramondo' + JOIN vn.warehouse wOut ON wOut.name = vWarehouseOutName JOIN vn.agencyMode am ON am.name = 'HOLANDA DIRECTO' - WHERE wIn.name = 'VNH'; + WHERE wIn.name = vWarehouseInName; SELECT MAX(tr.id) INTO myTravel 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 = 'VNH' - AND wOut.name = 'Floramondo' - AND landed = CURDATE(); - + WHERE wIn.name = vWarehouseInName + AND wOut.name = vWarehouseOutName + AND landed = util.tomorrow(); END IF; RETURN myTravel; @@ -8127,21 +8013,24 @@ 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 `clean`() BEGIN - DELETE di.* - FROM edi.deliveryInformation di - -- LEFT JOIN vn.buy b ON b.deliveryFk = di.ID - WHERE LatestOrderDateTime < CURDATE() - -- AND b.id IS NULL - ; + DECLARE vFourYearsAgo DATE DEFAULT TIMESTAMPADD(YEAR,-4,CURDATE()); + DECLARE vOneWeekAgo DATE DEFAULT TIMESTAMPADD(WEEK,-1,CURDATE()); + + DELETE FROM ekt WHERE fec < vFourYearsAgo; + + DELETE sr.* + FROM supplyResponse sr + JOIN edi.deliveryInformation di ON sr.ID = di.supplyResponseID + WHERE di.LatestOrderDateTime < vOneWeekAgo; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -8152,13 +8041,195 @@ 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 `ekt_load`(IN `vSelf` INT) +BEGIN + DECLARE vRef INT; + DECLARE vBuy INT; + DECLARE vItem INT; + DECLARE vQty INT; + DECLARE vPackage INT; + DECLARE vPutOrderFk INT; + DECLARE vIsLot BOOLEAN; + DECLARE vForceToPacking INT DEFAULT 2; + + -- Carga los datos necesarios del EKT + + SELECT ref, qty, package, putOrderFk INTO vRef, vQty, vPackage, vPutOrderFk + FROM ekt e + LEFT JOIN item i ON e.ref = i.id + WHERE e.id = vSelf; + + -- Inserta el cubo si no existe + + IF vPackage = 800 + THEN + SET vPackage = 800 + vQty; + + INSERT IGNORE INTO vn2008.Cubos SET + Id_Cubo = vPackage, + x = 7200 / vQty, + y = 1; + ELSE + INSERT IGNORE INTO vn2008.Cubos (Id_Cubo, X, Y, Z) + SELECT bucket_id, ROUND(x_size/10), ROUND(y_size/10), ROUND(z_size/10) + FROM bucket WHERE bucket_id = vPackage; + + IF ROW_COUNT() > 0 + THEN + INSERT INTO vn2008.mail SET + `subject` = 'Cubo añadido', + `text` = CONCAT('Se ha añadido el cubo: ', vPackage), + `to` = 'ekt@verdnatura.es'; + END IF; + END IF; + + -- Si es una compra de Floramondo obtiene el articulo + IF vPutOrderFk THEN + SELECT b.itemFk, b.id INTO vItem, vBuy + FROM edi.putOrder po + JOIN vn.buy b ON b.deliveryFk = po.deliveryInformationID + WHERE po.id = vPutOrderFk + LIMIT 1; + END IF; + + IF IFNULL(vItem,0) = 0 THEN + -- Intenta obtener el artículo en base a los atributos holandeses + + INSERT IGNORE INTO item_track SET + item_id = vRef; + + SELECT c.Id_Compra, c.Id_Article INTO vBuy, vItem + FROM vn2008.buy_edi e + JOIN item_track t ON t.item_id = e.ref + LEFT JOIN vn2008.buy_edi l ON l.ref = e.ref + LEFT JOIN vn2008.Compres c ON c.buy_edi_id = l.id + JOIN vn2008.config cfg + WHERE e.id = vSelf + AND l.id != vSelf + AND c.Id_Article != cfg.generic_item + AND IF(t.s1, l.s1 = e.s1, TRUE) + AND IF(t.s2, l.s2 = e.s2, TRUE) + AND IF(t.s3, l.s3 = e.s3, TRUE) + AND IF(t.s4, l.s4 = e.s4, TRUE) + AND IF(t.s5, l.s5 = e.s5, TRUE) + AND IF(t.s6, l.s6 = e.s6, TRUE) + AND IF(t.kop, l.kop = e.kop, TRUE) + AND IF(t.pac, l.pac = e.pac, TRUE) + AND IF(t.cat, l.cat = e.cat, TRUE) + AND IF(t.ori, l.ori = e.ori, TRUE) + AND IF(t.pro, l.pro = e.pro, TRUE) + AND IF(t.sub, l.sub = e.sub, TRUE) + AND IF(t.package, l.package = e.package, TRUE) + AND c.Id_Article < 170000 + ORDER BY l.now DESC, c.Id_Compra ASC LIMIT 1; + END IF; + + -- Determina si el articulo se vende por lotes + IF vItem + THEN + SELECT COUNT(*) > 0 INTO vIsLot + FROM vn2008.Articles a + LEFT JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id + WHERE a.Id_Article = vItem + AND t.`transaction`; + + -- Si el articulo se vende por lotes se inserta un nuevo artículo + + IF vIsLot + THEN + INSERT INTO vn2008.Articles ( + Article + ,Medida + ,Categoria + ,Id_Origen + ,iva_group_id + ,Foto + ,Color + ,Codintrastat + ,tipo_id + ,Tallos + ) + SELECT + i.`name` + ,IFNULL(e.s1, e.pac) + ,e.cat + ,IFNULL(o.id, 17) + ,IFNULL(a.iva_group_id, 1) + ,a.Foto + ,a.Color + ,a.Codintrastat + ,IFNULL(a.tipo_id, 10) + ,IF(a.tipo_id = 15, 0, 1) + FROM vn2008.buy_edi e + LEFT JOIN item i ON i.id = e.ref + LEFT JOIN vn2008.Origen o ON o.Abreviatura = e.ori + LEFT JOIN vn2008.Articles a ON a.Id_Article = vItem + WHERE e.id = vSelf; + + SET vItem = LAST_INSERT_ID(); + END IF; + END IF; + + -- Inserta la compra asociada al EKT + + INSERT INTO vn2008.Compres + ( + Id_Entrada + ,buy_edi_id + ,Costefijo + ,Id_Article + ,`grouping` + ,caja + ,Packing + ,Cantidad + ,Productor + ,Etiquetas + ,Id_Cubo + ,`weight` + ) + SELECT + cfg.edi_entry + ,vSelf + ,(@t := IF(a.Tallos, a.Tallos, 1)) * e.pri + ,IFNULL(vItem, cfg.generic_item) + ,IFNULL(c.`grouping`, e.pac) + ,vForceToPacking + ,@pac := e.pac / @t + ,@pac * e.qty + ,s.company_name + ,e.qty + ,IFNULL(c.Id_Cubo, e.package) + ,a.density * (vn.item_getVolume(a.Id_Article, IFNULL(c.Id_Cubo, e.package)) / 1000000) + FROM vn2008.buy_edi e + LEFT JOIN vn2008.Compres c ON c.Id_Compra = vBuy + LEFT JOIN vn2008.Articles a ON a.Id_Article = c.Id_Article + LEFT JOIN supplier s ON e.pro = s.supplier_id + JOIN vn2008.config cfg + WHERE e.id = vSelf + LIMIT 1; +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 `ekt_load__` */; +/*!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 `ekt_load__`(IN `vSelf` INT) BEGIN DECLARE vRef INT; DECLARE vBuy INT; @@ -8319,175 +8390,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 `ekt_load__` */; -/*!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 `ekt_load__`(IN `vSelf` INT) -BEGIN - DECLARE vRef INT; - DECLARE vBuy INT; - DECLARE vItem INT; - DECLARE vQty INT; - DECLARE vPackage INT; - DECLARE vIsLot BOOLEAN; - DECLARE vForceToPacking INT DEFAULT 2; - - -- Carga los datos necesarios del EKT - - SELECT ref, qty, package INTO vRef, vQty, vPackage - FROM ekt e - LEFT JOIN item i ON e.ref = i.id - WHERE e.id = vSelf; - - -- Inserta el cubo si no existe - - IF vPackage = 800 - THEN - SET vPackage = 800 + vQty; - - INSERT IGNORE INTO vn2008.Cubos SET - Id_Cubo = vPackage, - x = 7200 / vQty, - y = 1; - ELSE - INSERT IGNORE INTO vn2008.Cubos (Id_Cubo, X, Y, Z) - SELECT bucket_id, ROUND(x_size/10), ROUND(y_size/10), ROUND(z_size/10) - FROM bucket WHERE bucket_id = vPackage; - - IF ROW_COUNT() > 0 - THEN - INSERT INTO vn2008.mail SET - `subject` = 'Cubo añadido', - `text` = CONCAT('Se ha añadido el cubo: ', vPackage), - `to` = 'ekt@verdnatura.es'; - END IF; - END IF; - - -- Intenta obtener el artículo en base a los atributos holandeses - - INSERT IGNORE INTO item_track SET - item_id = vRef; - - SELECT c.Id_Compra, c.Id_Article INTO vBuy, vItem - FROM vn2008.buy_edi e - JOIN item_track t ON t.item_id = e.ref - LEFT JOIN vn2008.buy_edi l ON l.ref = e.ref - LEFT JOIN vn2008.Compres c ON c.buy_edi_id = l.id - JOIN vn2008.config cfg - WHERE e.id = vSelf - AND l.id != vSelf - AND c.Id_Article != cfg.generic_item - AND IF(t.s1, l.s1 = e.s1, TRUE) - AND IF(t.s2, l.s2 = e.s2, TRUE) - AND IF(t.s3, l.s3 = e.s3, TRUE) - AND IF(t.s4, l.s4 = e.s4, TRUE) - AND IF(t.s5, l.s5 = e.s5, TRUE) - AND IF(t.s6, l.s6 = e.s6, TRUE) - AND IF(t.kop, l.kop = e.kop, TRUE) - AND IF(t.pac, l.pac = e.pac, TRUE) - AND IF(t.cat, l.cat = e.cat, TRUE) - AND IF(t.ori, l.ori = e.ori, TRUE) - AND IF(t.pro, l.pro = e.pro, TRUE) - AND IF(t.sub, l.sub = e.sub, TRUE) - AND IF(t.package, l.package = e.package, TRUE) - AND c.Id_Article < 170000 - ORDER BY l.now DESC, c.Id_Compra ASC LIMIT 1; - - -- Determina si el articulo se vende por lotes - - IF vItem - THEN - SELECT COUNT(*) > 0 INTO vIsLot - FROM vn2008.Articles a - LEFT JOIN vn2008.Tipos t ON t.tipo_id = a.tipo_id - WHERE a.Id_Article = vItem - AND t.`transaction`; - - -- Si el articulo se vende por lotes se inserta un nuevo artículo - - IF vIsLot - THEN - INSERT INTO vn2008.Articles ( - Article - ,Medida - ,Categoria - ,Id_Origen - ,iva_group_id - ,Foto - ,Color - ,Codintrastat - ,tipo_id - ,Tallos - ) - SELECT - i.`name` - ,IFNULL(e.s1, e.pac) - ,e.cat - ,IFNULL(o.id, 17) - ,IFNULL(a.iva_group_id, 1) - ,a.Foto - ,a.Color - ,a.Codintrastat - ,IFNULL(a.tipo_id, 10) - ,IF(a.tipo_id = 15, 0, 1) - FROM vn2008.buy_edi e - LEFT JOIN item i ON i.id = e.ref - LEFT JOIN vn2008.Origen o ON o.Abreviatura = e.ori - LEFT JOIN vn2008.Articles a ON a.Id_Article = vItem - WHERE e.id = vSelf; - - SET vItem = LAST_INSERT_ID(); - END IF; - END IF; - - -- Inserta la compra asociada al EKT - - INSERT INTO vn2008.Compres - ( - Id_Entrada - ,buy_edi_id - ,Costefijo - ,Id_Article - ,`grouping` - ,caja - ,Packing - ,Cantidad - ,Productor - ,Etiquetas - ,Id_Cubo - ) - SELECT - cfg.edi_entry - ,vSelf - ,(@t := IF(a.Tallos, a.Tallos, 1)) * e.pri - ,IFNULL(vItem, cfg.generic_item) - ,IFNULL(c.`grouping`, e.pac) - ,vForceToPacking - ,@pac := e.pac / @t - ,@pac * e.qty - ,s.company_name - ,e.qty - ,IFNULL(c.Id_Cubo, e.package) - FROM vn2008.buy_edi e - LEFT JOIN vn2008.Compres c ON c.Id_Compra = vBuy - LEFT JOIN vn2008.Articles a ON a.Id_Article = c.Id_Article - LEFT JOIN supplier s ON e.pro = s.supplier_id - JOIN vn2008.config cfg - WHERE e.id = vSelf - LIMIT 1; -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 `exchange_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -8685,6 +8587,220 @@ 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 `floramondo_offerRefresh` */; +/*!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 `floramondo_offerRefresh`() +BEGIN + DECLARE vLanded DATE; + + DROP TEMPORARY TABLE IF EXISTS tmp; + CREATE TEMPORARY TABLE tmp ENGINE = MEMORY + SELECT * FROM ( + SELECT * + FROM edi.supplyOffer + JOIN edi.marketPlace mp ON mp.id = MarketPlaceID + WHERE mp.isOffered = TRUE + ORDER BY NumberOfUnits DESC) t + JOIN edi.item_groupToOffer igo ON igo.group_code = t.group_id + GROUP BY Item_ArticleCode, s1, s2, s3, s4, s5, s6; + + DROP TEMPORARY TABLE IF EXISTS edi.offer; + CREATE TEMPORARY TABLE edi.offer ENGINE = MEMORY + SELECT so.*, ev1.type_description s1Value, ev2.type_description s2Value, ev3.type_description s3Value, + ev4.type_description s4Value, ev5.type_description s5Value, ev6.type_description s6Value, + eif1.feature ef1, eif2.feature ef2, eif3.feature ef3, eif4.feature ef4, eif5.feature ef5, eif6.feature ef6 + FROM tmp so + LEFT JOIN edi.item_feature eif1 ON eif1.item_id = so.Item_ArticleCode + AND eif1.presentation_order = 1 AND eif1.expiry_date IS NULL + LEFT JOIN edi.item_feature eif2 ON eif2.item_id = so.Item_ArticleCode + AND eif2.presentation_order = 2 AND eif2.expiry_date IS NULL + LEFT JOIN edi.item_feature eif3 ON eif3.item_id = so.Item_ArticleCode + AND eif3.presentation_order = 3 AND eif3.expiry_date IS NULL + LEFT JOIN edi.item_feature eif4 ON eif4.item_id = so.Item_ArticleCode + AND eif4.presentation_order = 4 AND eif4.expiry_date IS NULL + LEFT JOIN edi.item_feature eif5 ON eif5.item_id = so.Item_ArticleCode + AND eif5.presentation_order = 5 AND eif5.expiry_date IS NULL + LEFT JOIN edi.item_feature eif6 ON eif6.item_id = so.Item_ArticleCode + AND eif6.presentation_order = 6 AND eif6.expiry_date IS NULL + LEFT JOIN edi.`value` ev1 ON ev1.type_id = eif1.feature AND so.s1 = ev1.type_value + LEFT JOIN edi.`value` ev2 ON ev2.type_id = eif2.feature AND so.s2 = ev2.type_value + LEFT JOIN edi.`value` ev3 ON ev3.type_id = eif3.feature AND so.s3 = ev3.type_value + LEFT JOIN edi.`value` ev4 ON ev4.type_id = eif4.feature AND so.s4 = ev4.type_value + LEFT JOIN edi.`value` ev5 ON ev5.type_id = eif5.feature AND so.s5 = ev5.type_value + LEFT JOIN edi.`value` ev6 ON ev6.type_id = eif6.feature AND so.s6 = ev6.type_value; + + DROP TEMPORARY TABLE tmp; + + -- Actualizamos el campo supplyResponseFk para aquellos articulos que ya estan creados y reutilizamos + UPDATE edi.offer o + JOIN vn.item i ON i.name = o.product_name + AND value5 <=> s1Value AND value6 <=> s2Value + AND value7 <=> s3Value AND value8 <=> s4Value + AND value9 <=> s5Value AND value10 <=> s6Value + SET i.supplyResponseFk = o.srID; + + DROP TEMPORARY TABLE IF EXISTS itemToInsert; + CREATE TEMPORARY TABLE itemToInsert ENGINE = MEMORY + SELECT o.* + FROM edi.offer o + LEFT JOIN vn.item i ON i.supplyResponseFk = o.srId + WHERE i.id IS NULL; + + -- Insertamos todos los items en Articles de la oferta + INSERT INTO vn.item(`name`, + longName, + expenceFk, + typeFk, + intrastatFk, + originFk, + supplyResponseFk) + SELECT product_name, + product_name, + expenseFk, + itemTypeFk, + intrastatFk, + originFk, + srId + FROM itemToInsert; + + INSERT INTO vn.itemImageQueue(itemFk, url) + SELECT i.id, PictureReference + FROM itemToInsert ii + JOIN vn.item i ON i.supplyResponseFk = ii.srId; + + -- Inserta si se añadiesen tags nuevos + INSERT IGNORE INTO vn.tag (name, ediTypeFk) + SELECT description, type_id FROM edi.type; + + -- Inserta los tags sólo en los articulos nuevos + + -- desabilita el trigger para recalcular los tags al final + SET @isTriggerDisabled = TRUE; + + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) + SELECT i.id, t.id , product_name, 1 + FROM itemToInsert ii + JOIN vn.tag t ON t.`name` = 'Producto' + JOIN vn.item i ON i.supplyResponseFk = ii.srId; + + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) + SELECT i.id, t.id , company_name, 4 + FROM itemToInsert ii + JOIN vn.tag t ON t.`name` = 'Productor' + JOIN vn.item i ON i.supplyResponseFk = ii.srId + WHERE s1Value; + + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) + SELECT i.id, t.id , s1Value, 5 + FROM itemToInsert ii + JOIN vn.tag t ON t.ediTypeFk = ii.ef1 + JOIN vn.item i ON i.supplyResponseFk = ii.srId + WHERE s1Value; + + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) + SELECT i.id, t.id , s2Value, 6 + FROM itemToInsert ii + JOIN vn.tag t ON t.ediTypeFk = ii.ef2 + JOIN vn.item i ON i.supplyResponseFk = ii.srId + WHERE s2Value; + + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) + SELECT i.id, t.id , s3Value, 7 + FROM itemToInsert ii + JOIN vn.tag t ON t.ediTypeFk = ii.ef3 + JOIN vn.item i ON i.supplyResponseFk = ii.srId + WHERE s3Value; + + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) + SELECT i.id, t.id , s4Value, 8 + FROM itemToInsert ii + JOIN vn.tag t ON t.ediTypeFk = ii.ef4 + JOIN vn.item i ON i.supplyResponseFk = ii.srId + WHERE s4Value; + + INSERT INTO vn.itemTag(itemFk, tagFk, value, priority) + SELECT i.id, t.id , s5Value, 9 + FROM itemToInsert ii + JOIN vn.tag t ON t.ediTypeFk = ii.ef5 + JOIN vn.item i ON i.supplyResponseFk = ii.srId + WHERE s5Value; + + DROP TEMPORARY TABLE IF EXISTS tmp.item; + CREATE TEMPORARY TABLE tmp.item + (PRIMARY KEY (id)) ENGINE = MEMORY + SELECT i.id FROM vn.item i + JOIN itemToInsert ii ON i.supplyResponseFk = ii.srId; + + CALL vn.item_refreshTags(); + + SET @isTriggerDisabled = FALSE; + + SELECT LatestOrderDateTime INTO vLanded + FROM edi.offer + ORDER BY LatestOrderDateTime ASC + LIMIT 1; + SET @myEntry := vn.floramondo_getEntry(vLanded); + IF @myEntry THEN + -- Inserta 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 + WHERE b.entryFk = @myEntry AND o.id 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 quantity = o.NumberOfUnits * o.NumberOfItemsPerCask + WHERE b.entryFk = @myEntry; + + -- Inserta la oferta + INSERT INTO vn.buy(entryFk, + itemFk, + quantity, + buyingValue, + stickers, + packing, + `grouping`, + groupingMode, + packageFk, + deliveryFk) + + SELECT @myEntry, + 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 + WHERE b.id IS NULL AND NOT b.entryFk <=> @myEntry; + + CALL vn2008.buy_tarifas_entry(@myEntry); + END IF; + DROP TEMPORARY TABLE + tmp.item, + edi.offer, + itemToInsert; + +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 `mail_new` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -12031,9 +12147,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 ;; @@ -12231,7 +12347,7 @@ BEGIN concept = vConcept, quantity = vAmount, price = vPrice, - priceFixed = 0, + priceFixed = FALSE, isPriceFixed = TRUE; SET vSale = LAST_INSERT_ID(); @@ -12246,7 +12362,18 @@ BEGIN END IF; UPDATE order_row SET Id_Movimiento = vSale WHERE id = vRowId; - + + INSERT INTO edi.putOrder (deliveryInformationID, + supplyResponseId, + quantity, + EndUserPartyId, + EndUserPartyGLN) + SELECT di.ID, i.supplyResponseFk, vAmount / NumberOfItemsPerCask, FALSE, vClientId + FROM edi.deliveryInformation di + JOIN vn.item i ON i.supplyResponseFk = di.supplyResponseID + JOIN edi.supplyResponse sr ON sr.ID = i.supplyResponseFk + WHERE i.id = vItem + LIMIT 1; END LOOP; CLOSE cRows; @@ -12470,18 +12597,18 @@ BEGIN IF vDone THEN LEAVE lRows; END IF; - SET vSale = NULL; - SELECT s.id INTO vSale + SET vSale = NULL; + SELECT s.id INTO vSale FROM vn.sale s - WHERE ticketFk = vTicket + WHERE ticketFk = vTicket AND price = vPrice - AND itemFk = vItem + AND itemFk = vItem LIMIT 1; IF vSale THEN UPDATE vn.sale SET quantity = quantity + vAmount WHERE id = vSale; - ELSE + ELSE INSERT INTO vn.sale SET itemFk = vItem, @@ -14753,7 +14880,7 @@ CREATE TABLE `bank_account` ( KEY `bank_account_bank_account_type_id_fkey` (`bank_account_type_id`), KEY `bank_account_nation_id_fkey` (`nation_id`), CONSTRAINT `bank_account_bank_account_type_id_fkey` FOREIGN KEY (`bank_account_type_id`) REFERENCES `bank_account_type` (`bank_account_type_id`) ON UPDATE CASCADE, - CONSTRAINT `bank_account_nation_id_fkey` FOREIGN KEY (`nation_id`) REFERENCES `nation` (`nation_id`) ON UPDATE CASCADE, + CONSTRAINT `bank_account_nation_id_fkey` FOREIGN KEY (`nation_id`) REFERENCES `nation__` (`nation_id`) ON UPDATE CASCADE, CONSTRAINT `bank_profile` FOREIGN KEY (`client_id`) REFERENCES `profile` (`profile_id`) ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -14773,13 +14900,13 @@ CREATE TABLE `bank_account_type` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `bank_bic` +-- Table structure for table `bank_bic__` -- -DROP TABLE IF EXISTS `bank_bic`; +DROP TABLE IF EXISTS `bank_bic__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bank_bic` ( +CREATE TABLE `bank_bic__` ( `nrbe` int(11) NOT NULL, `denominacion` varchar(255) DEFAULT NULL, `bic` char(11) DEFAULT NULL, @@ -14866,31 +14993,28 @@ CREATE TABLE `business_labour_payroll` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `calendar_employee` +-- Temporary table structure for view `calendar_employee` -- DROP TABLE IF EXISTS `calendar_employee`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `calendar_employee` ( - `business_id` int(11) NOT NULL, - `calendar_state_id` int(11) NOT NULL, - `date` date NOT NULL, - PRIMARY KEY (`business_id`,`date`), - KEY `calendar_employee_business_labour_id_idx` (`business_id`), - KEY `calendar_employee_calendar_state_calendar_state_id_idx` (`calendar_state_id`), - CONSTRAINT `calendar_employee_state_id` FOREIGN KEY (`calendar_state_id`) REFERENCES `calendar_state` (`calendar_state_id`) ON DELETE NO ACTION ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; +/*!50001 DROP VIEW IF EXISTS `calendar_employee`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `calendar_employee` AS SELECT + 1 AS `id`, + 1 AS `business_id`, + 1 AS `calendar_state_id`, + 1 AS `date`*/; +SET character_set_client = @saved_cs_client; -- --- Table structure for table `calendar_free` +-- Table structure for table `calendar_free__` -- -DROP TABLE IF EXISTS `calendar_free`; +DROP TABLE IF EXISTS `calendar_free__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `calendar_free` ( +CREATE TABLE `calendar_free__` ( `calendar_free_id` int(11) NOT NULL AUTO_INCREMENT, `type` varchar(20) NOT NULL, `rgb` varchar(7) DEFAULT NULL, @@ -14918,7 +15042,7 @@ CREATE TABLE `calendar_labour__` ( KEY `fki_calendar_labour_legend_id` (`calendar_labour_legend_id`), KEY `fki_calendar_labour_person_day` (`person_id`,`day`), KEY `fki_workcenter_calendar` (`workcenter_id`), - CONSTRAINT `fk_calendar_labour_calendar_free1` FOREIGN KEY (`calendar_free_id`) REFERENCES `calendar_free` (`calendar_free_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, + CONSTRAINT `fk_calendar_labour_calendar_free1` FOREIGN KEY (`calendar_free_id`) REFERENCES `calendar_free__` (`calendar_free_id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_calendar_labour_legend_id` FOREIGN KEY (`calendar_labour_legend_id`) REFERENCES `calendar_labour_legend__` (`calendar_labour_legend_id`) ON DELETE NO ACTION ON UPDATE CASCADE, CONSTRAINT `workcenter_calendar` FOREIGN KEY (`workcenter_id`) REFERENCES `workcenter` (`workcenter_id`) ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8; @@ -14980,13 +15104,13 @@ CREATE TABLE `calendar_state` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `currency` +-- Table structure for table `currency__` -- -DROP TABLE IF EXISTS `currency`; +DROP TABLE IF EXISTS `currency__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `currency` ( +CREATE TABLE `currency__` ( `currency_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(15) NOT NULL, PRIMARY KEY (`currency_id`) @@ -15117,13 +15241,13 @@ CREATE TABLE `media_type` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `nation` +-- Table structure for table `nation__` -- -DROP TABLE IF EXISTS `nation`; +DROP TABLE IF EXISTS `nation__`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `nation` ( +CREATE TABLE `nation__` ( `nation_id` int(11) NOT NULL AUTO_INCREMENT, `currency_id` int(11) NOT NULL DEFAULT '1', `name` varchar(20) NOT NULL, @@ -15132,7 +15256,7 @@ CREATE TABLE `nation` ( PRIMARY KEY (`nation_id`), UNIQUE KEY `nation_name_key` (`name`), KEY `nation_currency_id_idx` (`currency_id`), - CONSTRAINT `nation_ibfk_1` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`currency_id`) ON DELETE NO ACTION ON UPDATE NO ACTION + CONSTRAINT `nation___ibfk_1` FOREIGN KEY (`currency_id`) REFERENCES `currency__` (`currency_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDBDEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -15298,7 +15422,7 @@ CREATE TABLE `province` ( PRIMARY KEY (`province_id`), UNIQUE KEY `province_name_key` (`name`), KEY `province_nation_id_idx` (`nation_id`), - CONSTRAINT `fk_province_nation1` FOREIGN KEY (`nation_id`) REFERENCES `nation` (`nation_id`) ON DELETE NO ACTION ON UPDATE NO ACTION + CONSTRAINT `fk_province_nation1` FOREIGN KEY (`nation_id`) REFERENCES `nation__` (`nation_id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDBDEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18519,11 +18643,11 @@ DROP TABLE IF EXISTS `agencyTerm`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `agencyTerm` ( `agencyFk` smallint(5) unsigned NOT NULL, - `minimumPackages` int(11) DEFAULT NULL COMMENT 'numero minimo de bultos', - `kmPrice` decimal(10,2) DEFAULT NULL COMMENT 'precio extra por km', - `packagePrice` decimal(10,2) DEFAULT NULL COMMENT 'precio extra por bulto', + `minimumPackages` int(11) NOT NULL DEFAULT '0' COMMENT 'numero minimo de bultos', + `kmPrice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'precio extra por km', + `packagePrice` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT 'precio extra por bulto', `routePrice` decimal(10,2) DEFAULT NULL COMMENT 'precio fijo por ruta', - `minimumKm` int(11) DEFAULT NULL, + `minimumKm` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`agencyFk`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18775,6 +18899,21 @@ DELIMITER ; /*!50003 SET character_set_results = @saved_cs_results */ ; /*!50003 SET collation_connection = @saved_col_connection */ ; +-- +-- Temporary table structure for view `businessCalendar` +-- + +DROP TABLE IF EXISTS `businessCalendar`; +/*!50001 DROP VIEW IF EXISTS `businessCalendar`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `businessCalendar` AS SELECT + 1 AS `id`, + 1 AS `businessFk`, + 1 AS `absenceTypeFk`, + 1 AS `dated`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `businessReasonEnd` -- @@ -18827,6 +18966,7 @@ CREATE TABLE `buy` ( `__cm2` int(10) unsigned NOT NULL DEFAULT '0', `ektFk` int(11) DEFAULT NULL, `weight` decimal(10,2) unsigned DEFAULT NULL, + `deliveryFk` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `CompresId_Trabajador` (`workerFk`), KEY `Id_Cubo` (`packageFk`), @@ -18834,6 +18974,9 @@ CREATE TABLE `buy` ( KEY `container_id` (`containerFk`), KEY `buy_edi_id` (`ektFk`), KEY `itemFk_entryFk` (`itemFk`,`entryFk`), + KEY `buy_fk_4_idx` (`deliveryFk`), + CONSTRAINT `buy_ektFk` FOREIGN KEY (`ektFk`) REFERENCES `edi`.`ekt` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `buy_fk_4` FOREIGN KEY (`deliveryFk`) REFERENCES `edi`.`deliveryInformation` (`ID`) ON DELETE SET NULL ON UPDATE SET NULL, CONSTRAINT `buy_ibfk_1` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON UPDATE CASCADE, CONSTRAINT `buy_ibfk_2` FOREIGN KEY (`packageFk`) REFERENCES `packaging` (`id`) ON UPDATE CASCADE, CONSTRAINT `buy_id` FOREIGN KEY (`entryFk`) REFERENCES `entry` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE, @@ -19071,6 +19214,27 @@ CREATE TABLE `buyMark` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `calendar` +-- + +DROP TABLE IF EXISTS `calendar`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `calendar` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `businessFk` int(11) NOT NULL, + `dayOffTypeFk` int(11) NOT NULL, + `dated` date NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `business_id_date` (`businessFk`,`dated`), + KEY `calendar_employee_business_labour_id_idx` (`businessFk`), + KEY `calendar_employee_calendar_state_calendar_state_id_idx` (`dayOffTypeFk`), + KEY `id_index` (`id`), + CONSTRAINT `calendar_employee_state_id` FOREIGN KEY (`dayOffTypeFk`) REFERENCES `postgresql`.`calendar_state` (`calendar_state_id`) ON DELETE NO ACTION ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `calendarHolidays` -- @@ -19122,6 +19286,21 @@ CREATE TABLE `calendarHolidaysType` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Temporary table structure for view `calendar__` +-- + +DROP TABLE IF EXISTS `calendar__`; +/*!50001 DROP VIEW IF EXISTS `calendar__`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `calendar__` AS SELECT + 1 AS `id`, + 1 AS `businessFk`, + 1 AS `dayOffTypeFk`, + 1 AS `dated`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `category` -- @@ -21016,6 +21195,7 @@ CREATE TABLE `department` ( `parentFk` int(10) unsigned DEFAULT NULL, `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `chatName` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, + `isTeleworking` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `name_UNIQUE` (`name`), KEY `fk_department_Trabajadores1_idx` (`workerFk`), @@ -22222,7 +22402,7 @@ CREATE TABLE `expeditionScan` ( UNIQUE KEY `expeditionFk_UNIQUE` (`expeditionFk`), KEY `expeditionScan_fk1_idx` (`expeditionFk`), KEY `expeditionScan_fk2_idx` (`palletFk`), - CONSTRAINT `expeditionScan_fk1` FOREIGN KEY (`expeditionFk`) REFERENCES `expedition` (`id`) ON UPDATE CASCADE, + CONSTRAINT `expeditionScan_fk1` FOREIGN KEY (`expeditionFk`) REFERENCES `expedition` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expeditionScan_fk2` FOREIGN KEY (`palletFk`) REFERENCES `expeditionPallet` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -22427,6 +22607,20 @@ SET character_set_client = utf8; 1 AS `companyFk`*/; SET character_set_client = @saved_cs_client; +-- +-- Table structure for table `floramondoConfig` +-- + +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, + `entryFk` int(11) DEFAULT NULL COMMENT 'ultima entrada de floramondo', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `fuelType` -- @@ -23113,10 +23307,12 @@ CREATE TABLE `item` ( `compression` decimal(5,2) NOT NULL DEFAULT '1.00' COMMENT 'Relacion de compresividad entre el volumen de las entradas en Silla y el empaquetado en los envios a clientes.\n\nMenor que 1 significa que se puede comprimir más que el volumen original.', `minimum` decimal(10,0) unsigned NOT NULL DEFAULT '3' COMMENT 'Cantidad máxima de cajas / cubos que cabe en un nicho', `upToDown` decimal(10,0) unsigned NOT NULL DEFAULT '0' COMMENT 'Se muestra el precio por kilo ', + `supplyResponseFk` int(11) DEFAULT NULL, `hasKgPrice` tinyint(1) NOT NULL DEFAULT '0', `sectorFk` int(11) DEFAULT '2', `isFloramondo` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), + UNIQUE KEY `item_supplyResponseFk_idx` (`supplyResponseFk`), KEY `Article` (`name`), KEY `Color` (`inkFk`), KEY `id_origen` (`originFk`), @@ -23133,15 +23329,16 @@ CREATE TABLE `item` ( CONSTRAINT `item_ibfk_4` FOREIGN KEY (`taxClassFk`) REFERENCES `taxClass` (`id`) ON UPDATE CASCADE, CONSTRAINT `item_ibfk_5` FOREIGN KEY (`typeFk`) REFERENCES `itemType` (`id`) ON UPDATE CASCADE, CONSTRAINT `item_ibfk_6` FOREIGN KEY (`sectorFk`) REFERENCES `sector` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `itemsupplyResponseFk` FOREIGN KEY (`supplyResponseFk`) REFERENCES `edi`.`supplyResponse` (`ID`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `producer_id` FOREIGN KEY (`producerFk`) REFERENCES `producer` (`id`) 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 */ ; /*!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 ;; @@ -23149,6 +23346,7 @@ DELIMITER ;; BEFORE INSERT ON `item` FOR EACH ROW BEGIN DECLARE vDensity DOUBLE; + DECLARE vCompression DOUBLE; IF NEW.density IS NULL THEN SELECT density INTO vDensity @@ -23156,7 +23354,13 @@ BEGIN SET NEW.density = vDensity; END IF; - + + IF NEW.compression IS NULL OR NEW.compression = 1 THEN + SELECT compression INTO vCompression + FROM itemType WHERE id = NEW.typeFk; + + SET NEW.compression = vCompression; + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -23532,6 +23736,21 @@ CREATE TABLE `itemFreeNumber` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `itemImageQueue` +-- + +DROP TABLE IF EXISTS `itemImageQueue`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `itemImageQueue` ( + `itemFk` int(11) NOT NULL, + `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`itemFk`), + CONSTRAINT `itemImageQueueItemIdx` FOREIGN KEY (`itemFk`) REFERENCES `item` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Cola para añadir las imagenes al campo vn.item.image a partir de una url'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `itemLabel` -- @@ -24313,6 +24532,7 @@ CREATE TABLE `itemType` ( `hasComponents` tinyint(1) NOT NULL DEFAULT '1', `roleCodeFk__` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `warehouseFk` smallint(6) unsigned NOT NULL DEFAULT '1', + `compression` decimal(5,2) DEFAULT '1.00', PRIMARY KEY (`code`), UNIQUE KEY `tipo_id_UNIQUE` (`id`), UNIQUE KEY `Tipo_UNIQUE` (`name`,`categoryFk`), @@ -24436,6 +24656,32 @@ CREATE TABLE `kk` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Temporary table structure for view `labelInfo` +-- + +DROP TABLE IF EXISTS `labelInfo`; +/*!50001 DROP VIEW IF EXISTS `labelInfo`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `labelInfo` AS SELECT + 1 AS `itemId`, + 1 AS `itemName`, + 1 AS `colorCode`, + 1 AS `stems`, + 1 AS `category`, + 1 AS `productor`, + 1 AS `value`, + 1 AS `packing`, + 1 AS `warehouse_id`, + 1 AS `size`, + 1 AS `isPickedOff`, + 1 AS `notes`, + 1 AS `wh_in`, + 1 AS `entryId`, + 1 AS `buyId`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `labourTree` -- @@ -25719,6 +25965,35 @@ CREATE TABLE `producer` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Temporary table structure for view `productionVolume` +-- + +DROP TABLE IF EXISTS `productionVolume`; +/*!50001 DROP VIEW IF EXISTS `productionVolume`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `productionVolume` AS SELECT + 1 AS `hora`, + 1 AS `minuto`, + 1 AS `cm3`, + 1 AS `warehouseFk`, + 1 AS `created`*/; +SET character_set_client = @saved_cs_client; + +-- +-- Temporary table structure for view `productionVolume_LastHour` +-- + +DROP TABLE IF EXISTS `productionVolume_LastHour`; +/*!50001 DROP VIEW IF EXISTS `productionVolume_LastHour`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `productionVolume_LastHour` AS SELECT + 1 AS `m3`, + 1 AS `warehouseFk`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `professionalCategory` -- @@ -27527,7 +27802,7 @@ DROP TABLE IF EXISTS `tag`; CREATE TABLE `tag` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(45) CHARACTER SET utf8 DEFAULT NULL, - `name` varchar(35) COLLATE utf8_unicode_ci NOT NULL, + `name` varchar(25) COLLATE utf8_unicode_ci NOT NULL, `isFree` tinyint(1) NOT NULL DEFAULT '1', `isQuantitatif` tinyint(4) NOT NULL DEFAULT '0', `sourceTable` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -27793,14 +28068,9 @@ BEGIN FROM state WHERE `code` = vStateCode COLLATE utf8_general_ci; - -- Borrar al acabar el proceso de cambio de nichos a carros - /* IF NEW.warehouseFk IN (1,44) THEN - - INSERT INTO vn.ticketObservation(ticketFk, description, observationTypeFk) - VALUES(NEW.id,'NO OLVIDES ESCANEAR LAS MATRICULAS',1) - ON DUPLICATE KEY UPDATE description = CONCAT(description,'. Y NO OLVIDES ESCANEAR LAS MATRICULAS'); - - END IF; */ + INSERT INTO bs.clientNewBorn(clientFk, firstShipped, lastShipped) + VALUES(NEW.clientFk, NEW.shipped, NEW.shipped) + ON DUPLICATE KEY UPDATE lastShipped = NEW.shipped; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -28567,6 +28837,49 @@ CREATE TABLE `tillConfig` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `time` +-- + +DROP TABLE IF EXISTS `time`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `time` ( + `dated` date NOT NULL, + `period` int(6) NOT NULL, + `month` int(2) NOT NULL, + `year` int(4) NOT NULL, + `day` int(2) NOT NULL, + `week` int(2) NOT NULL, + `yearMonth` int(6) NOT NULL, + PRIMARY KEY (`dated`), + KEY `day_index` (`day`) USING HASH, + KEY `week_index` (`week`) USING HASH, + KEY `year_index` (`year`) USING HASH, + KEY `month_index` (`month`) USING HASH, + KEY `periodo` (`period`) USING HASH, + KEY `yearMonth` (`yearMonth`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Tabla de referencia para las semanas, años y meses'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Temporary table structure for view `time__` +-- + +DROP TABLE IF EXISTS `time__`; +/*!50001 DROP VIEW IF EXISTS `time__`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `time__` AS SELECT + 1 AS `dated`, + 1 AS `period`, + 1 AS `month`, + 1 AS `year`, + 1 AS `day`, + 1 AS `week`, + 1 AS `yearMonth`*/; +SET character_set_client = @saved_cs_client; + -- -- Table structure for table `town` -- @@ -29640,6 +29953,7 @@ CREATE TABLE `workerTimeControl` ( `order` int(11) DEFAULT NULL, `warehouseFk` smallint(6) unsigned DEFAULT NULL, `direction` enum('in','out','middle') COLLATE utf8_unicode_ci DEFAULT 'middle', + `isSendMail` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Fichadas generadas autómaticamente con el procedimiento vn.workerTimeControl_sendMail', PRIMARY KEY (`id`), UNIQUE KEY `userFk_Timed_uniq` (`userFk`,`timed`), KEY `warehouseFkfk1_idx` (`warehouseFk`), @@ -29681,6 +29995,27 @@ CREATE TABLE `workerTimeControlLog` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Log de fichadas, se rellena cuando el fichador(tablet) no autoriza el fichaje (PROC:vn.workerTimeControl_check)'; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `workerTimeControlMail` +-- + +DROP TABLE IF EXISTS `workerTimeControlMail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `workerTimeControlMail` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `workerFk` int(10) NOT NULL, + `year` int(4) NOT NULL, + `week` int(2) NOT NULL, + `state` enum('SENDED','CONFIRMED','ANSWERED') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'SENDED', + `updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Fecha/hora último cambio de estado', + PRIMARY KEY (`id`), + UNIQUE KEY `workerFk_UNIQUE` (`workerFk`,`year`,`week`), + KEY `workerFk_idx` (`workerFk`), + CONSTRAINT `workerTimeControlMail_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Guarda las respuestas de mail de los correos generados automáticamente por la procedimiento workerTimeControl_sendMail'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `workerTimeControlParams` -- @@ -30081,7 +30416,7 @@ CREATE TABLE `zoneEvent` ( `bonus` decimal(10,2) DEFAULT NULL, `m3Max` decimal(10,2) unsigned DEFAULT NULL, PRIMARY KEY (`id`), - KEY `zoneFk` (`zoneFk`), + UNIQUE KEY `zoneFk` (`zoneFk`,`type`,`dated`), CONSTRAINT `zoneEvent_ibfk_1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -31701,17 +32036,18 @@ 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 `floramondoNewItemFk` */; +/*!50003 DROP FUNCTION IF EXISTS `floramondoNewItemFk__` */; /*!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 `floramondoNewItemFk`() RETURNS int(11) +CREATE DEFINER=`root`@`%` FUNCTION `floramondoNewItemFk__`() RETURNS int(11) + DETERMINISTIC BEGIN DECLARE vItemFk INT; @@ -31722,6 +32058,112 @@ BEGIN RETURN vItemFk; +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 `floramondo_getEntry` */; +/*!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`@`%` FUNCTION `floramondo_getEntry`(vLanded DATE) RETURNS int(11) + READS SQL DATA +BEGIN + + DECLARE vTravelFk INT; + DECLARE vEntryFk INT; + DECLARE previousEntryFk INT; + + SET vTravelFk = floramondo_getTravel(vLanded); + + IF vLanded THEN + SELECT IFNULL(MAX(id),0) INTO vEntryFk + FROM vn.entry + WHERE travelFk = vTravelFk AND isRaid; + + IF NOT vEntryFk THEN + + INSERT INTO vn.entry(travelFk, supplierFk, commission, companyFk, currencyFk, isRaid) + SELECT vTravelFk, s.id, 4, c.id, cu.id, TRUE + FROM vn.supplier s + JOIN vn.company c ON c.code = 'VNL' + JOIN vn.currency cu ON cu.code = 'EUR' + WHERE s.name = 'KONINKLIJE COOPERATIEVE BLOEMENVEILING FLORAHOLLAN'; + + SELECT MAX(id) INTO vEntryFk + FROM vn.entry + WHERE travelFk = vTravelFk; + + END IF; + END IF; + SELECT entryFk INTO previousEntryFk FROM floramondoConfig; + IF NOT (previousEntryFk <=> vEntryFk) THEN + DELETE FROM buy WHERE entryFk = previousEntryFk; + REPLACE INTO floramondoConfig SET entryFk = vEntryFk; + END IF; + + RETURN vEntryFk; +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 `floramondo_getTravel` */; +/*!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`@`%` FUNCTION `floramondo_getTravel`(vLanded DATE) RETURNS int(11) + READS SQL DATA +BEGIN + + DECLARE vTravelFk INT; + DECLARE vWarehouseOutName VARCHAR(50) DEFAULT 'Holanda'; + DECLARE vWarehouseInName VARCHAR(50) DEFAULT 'VNH'; + + IF vLanded THEN + SELECT IFNULL(MAX(tr.id),0) 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 + AND wOut.name = vWarehouseOutName + AND landed = vLanded; + + 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 + JOIN vn.agencyMode am ON am.name = 'HOLANDA DIRECTO' + WHERE wIn.name = vWarehouseInName; + + 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 + AND wOut.name = vWarehouseOutName + AND landed = vLanded; + END IF; + END IF; + RETURN vTravelFk; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -32928,7 +33370,7 @@ BEGIN SELECT SUM(IF(p.volume > 0, p.volume, - p.width * p.depth * IF(p.height, p.height, i.size + 10) + p.width * p.depth * IF(p.height, p.height, IFNULL(i.size,60) + 10) )) INTO vVolume FROM packaging p JOIN item i ON i.id = vSelf @@ -33128,7 +33570,7 @@ BEGIN DECLARE vWarehouseId INTEGER; DECLARE vVolume DECIMAL(10,3); - SELECT IFNULL(SUM(o.amount * i.compression * ic.cm3)/1000000,0) INTO vVolume + SELECT IFNULL(SUM(o.amount * ic.cm3delivery)/1000000,0) INTO vVolume FROM hedera.orderRow o JOIN item i ON i.id = o.itemFk JOIN itemCost ic on ic.itemFk = o.itemFk AND ic.warehouseFk = o.warehouseFk @@ -34645,9 +35087,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 ;; @@ -34687,10 +35129,18 @@ BEGIN WHERE i.id = vItemFk; IF vIsMerchandise THEN - REPLACE itemCost SET + + REPLACE itemCost SET itemFk = vItemFk, warehouseFk = vWarehouse, cm3 = buy_getUnitVolume(vSelf); + + UPDATE vn.itemCost ic + JOIN vn.item i ON i.id = ic.itemFk + SET ic.cm3delivery = i.compression * ic.cm3 + WHERE ic.itemFk = vItemFk + AND ic.warehouseFk = vWarehouse; + END IF; SELECT isFeedStock INTO vIsFeedStock @@ -35686,10 +36136,10 @@ proc: BEGIN tcc.itemFk, vDeliveryComponent, vGeneralInflationCoefficient - * ROUND(ic.cm3 * IFNULL((zo.price - zo.bonus),50) / vBoxVolume, 4) cost + * ROUND(ic.cm3delivery * IFNULL((zo.price - zo.bonus),50) / vBoxVolume, 4) cost /* * ROUND(( - i.compression -- PAK 2020/06/19 ic.cm3 ya incorpora el volumen de entrada multiplicado por la compresion + i.compression -- PAK 2020/06/19 * ic.cm3 * IF(am.deliveryMethodFk = 1, (GREATEST(i.density, vMinimumDensityWeight) / vMinimumDensityWeight), 1) -- el packingOut soluciona este problema * IFNULL((zo.price - zo.bonus) @@ -37480,6 +37930,198 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `collectionSale_get`(vCollectionFk INT) +BEGIN + + DROP TEMPORARY TABLE IF EXISTS tmp.ticket; + CREATE TEMPORARY TABLE tmp.ticket + SELECT t.id, clientFk, id as showTicketFk + FROM vn.ticket t + WHERE id = vCollectionFk + AND shipped > '2020-01-01' + UNION ALL + SELECT tc.ticketFk id, clientFk, tc.ticketFk as showTicketFk + FROM vn.ticketCollection tc + JOIN vn.ticket t ON t.id = tc.ticketFk + WHERE tc.collectionFk = vCollectionFk; + + DROP TEMPORARY TABLE IF EXISTS tmp.ticket2; + CREATE TEMPORARY TABLE tmp.ticket2 + SELECT sw.id, t.clientFk, sw.shipFk showTicketFk + FROM vn.stowaway sw + JOIN tmp.ticket t ON t.id = sw.shipFk; + + INSERT INTO tmp.ticket + SELECT * FROM tmp.ticket2; + + SELECT showTicketFk ticketFk, + s.id as saleFk, + s.itemFk, + s.quantity, + i.longName, + i.size, + s.reserved, + MAX(IF(st.semaphore <=> 1, TRUE, FALSE)) as isPreviousPrepared, + MAX(IF(st.semaphore <=> 2, TRUE, FALSE)) as isPrepared, + MAX(IF(st.semaphore <=> 3, TRUE, FALSE)) as isControlled, + ic.color, + ip.productor, + s.discount, + s.price, + i.stems, + i.category, + o.code AS origin, + t.clientFk, + s.originalQuantity, + TRIM(CONCAT(LPAD(i.longName,30,' '), ' ',RPAD(IFNULL(i.size,''),5,' '))) as line1, + TRIM(CONCAT(LPAD(IFNULL(ip.productor,''),30,' '), ' ',LPAD(IFNULL(o.code,''),4,' '))) as line2, + TRIM(CONCAT(ic.color, IF(MAX(IF(st.semaphore <=> 1, TRUE, FALSE)) AND t.id != t.showTicketFk, CONCAT(' [ TICKET ',t.id,' ] '),''), IFNULL(LPAD(st.parkingCode,40,' '),''))) as line3, + s.isAdded, + str.originalQuantity as startQuantity, -- eliminar cuando tengamos la nueva apk + c.workerFk, + IFNULL(SUM(iss.quantity),0) as pickedQuantity + FROM vn.sale s + JOIN tmp.ticket t ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk + LEFT JOIN vn.saleTracking str ON str.saleFk = s.id AND str.isChecked = 1 + LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id + LEFT JOIN vn.state st ON st.id = str.stateFk + LEFT JOIN vn.itemColor ic ON ic.itemFk = s.itemFk + LEFT JOIN vn.itemProductor ip ON ip.itemFk = s.itemFk + LEFT JOIN vn.origin o ON o.id = i.originFk + LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = t.id + LEFT JOIN vn.collection c ON c.id = tc.collectionFk + LEFT JOIN (SELECT st.saleFk, p.`code` as parkingCode + FROM vn.saleTracking st + JOIN vn.state s ON s.id = st.stateFk + JOIN vn.sale sa ON sa.id = st.saleFk + JOIN vn.ticketParking tp ON tp.ticketFk = sa.ticketFk + JOIN vn.parking p ON p.id = tp.parkingFk + WHERE st.isChecked + AND s.semaphore = 1 + GROUP BY st.saleFk) st ON st.saleFk = s.id + GROUP BY s.id + HAVING quantity > 0 OR workerFk != vn.getUser() + ; + + + + DROP TEMPORARY TABLE tmp.ticket; + DROP TEMPORARY TABLE tmp.ticket2; + + +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 `collectionSale_get_beta` */; +/*!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 `collectionSale_get_beta`(vCollectionFk INT) +BEGIN + + DROP TEMPORARY TABLE IF EXISTS tmp.ticket; + CREATE TEMPORARY TABLE tmp.ticket + SELECT t.id, clientFk, id as showTicketFk + FROM vn.ticket t + WHERE id = vCollectionFk + AND shipped > '2020-01-01' + UNION ALL + SELECT tc.ticketFk id, clientFk, tc.ticketFk as showTicketFk + FROM vn.ticketCollection tc + JOIN vn.ticket t ON t.id = tc.ticketFk + WHERE tc.collectionFk = vCollectionFk; + + DROP TEMPORARY TABLE IF EXISTS tmp.ticket2; + CREATE TEMPORARY TABLE tmp.ticket2 + SELECT sw.id, t.clientFk, sw.shipFk showTicketFk + FROM vn.stowaway sw + JOIN tmp.ticket t ON t.id = sw.shipFk; + + INSERT INTO tmp.ticket + SELECT * FROM tmp.ticket2; + + SELECT showTicketFk ticketFk, + s.id as saleFk, + s.itemFk, + s.quantity, + i.longName, + i.size, + s.reserved, + MAX(IF(st.semaphore <=> 1, TRUE, FALSE)) as isPreviousPrepared, + MAX(IF(st.semaphore <=> 2, TRUE, FALSE)) as isPrepared, + MAX(IF(st.semaphore <=> 3, TRUE, FALSE)) as isControlled, + ic.color, + ip.productor, + s.discount, + s.price, + i.stems, + i.category, + o.code AS origin, + t.clientFk, + s.originalQuantity, + TRIM(CONCAT(LPAD(i.longName,30,' '), ' ',RPAD(IFNULL(i.size,''),5,' '))) as line1, + TRIM(CONCAT(LPAD(IFNULL(ip.productor,''),30,' '), ' ',LPAD(IFNULL(o.code,''),4,' '))) as line2, + TRIM(CONCAT(ic.color, IF(MAX(IF(st.semaphore <=> 1, TRUE, FALSE)) AND t.id != t.showTicketFk, CONCAT(' [ TICKET ',t.id,' ] '),''), IFNULL(LPAD(st.parkingCode,40,' '),''))) as line3, + s.isAdded, + str.originalQuantity as startQuantity, + c.workerFk, + IFNULL(SUM(iss.quantity),0) as pickedQuantity + FROM vn.sale s + JOIN tmp.ticket t ON t.id = s.ticketFk + JOIN vn.item i ON i.id = s.itemFk + LEFT JOIN vn.saleTracking str ON str.saleFk = s.id AND str.isChecked = 1 + LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id + LEFT JOIN vn.state st ON st.id = str.stateFk + LEFT JOIN vn.itemColor ic ON ic.itemFk = s.itemFk + LEFT JOIN vn.itemProductor ip ON ip.itemFk = s.itemFk + LEFT JOIN vn.origin o ON o.id = i.originFk + LEFT JOIN vn.ticketCollection tc ON tc.ticketFk = t.id + LEFT JOIN vn.collection c ON c.id = tc.collectionFk + LEFT JOIN (SELECT st.saleFk, p.`code` as parkingCode + FROM vn.saleTracking st + JOIN vn.state s ON s.id = st.stateFk + JOIN vn.sale sa ON sa.id = st.saleFk + JOIN vn.ticketParking tp ON tp.ticketFk = sa.ticketFk + JOIN vn.parking p ON p.id = tp.parkingFk + WHERE st.isChecked + AND s.semaphore = 1 + GROUP BY st.saleFk) st ON st.saleFk = s.id + GROUP BY s.id + HAVING quantity > 0 OR workerFk != vn.getUser() + ; + + + + DROP TEMPORARY TABLE tmp.ticket; + DROP TEMPORARY TABLE tmp.ticket2; + + +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 `collectionSale_get__` */; +/*!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 `collectionSale_get__`(vCollectionFk INT) BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.ticket; @@ -38017,19 +38659,19 @@ DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `collection_addItem`(vItemFk INT, vQuantity INT, vTicketFk INT) BEGIN DECLARE vConcept VARCHAR(50); - DECLARE vPrice DOUBLE default 0.0; DECLARE itemFk INT; + DECLARE vSaleFk INT default 0; SELECT barcodeToItem(vItemFk) INTO itemFk; SELECT CONCAT(vn.getUser()," ",DATE_FORMAT(NOW( ), "%H:%i" )," ",i.name) INTO vConcept FROM vn.item i WHERE i.id = itemFk; - SELECT i.minPrice INTO vPrice FROM vn.item i WHERE i.id = itemFk; + INSERT INTO vn.sale (itemFk,ticketFk,concept,quantity,isAdded) + VALUES (itemFk,vTicketFk,vConcept,vQuantity,1); - INSERT INTO vn.sale (itemFk,ticketFk,concept,quantity,price) - VALUES (itemFk,vTicketFk,vConcept,vQuantity,vPrice); + SELECT last_insert_id() INTO vSaleFk; - CALL vn.ticket_recalcComponents(vTicketFk,null); + CALL vn.sale_calculateComponent(vSaleFk, null); END ;; DELIMITER ; @@ -38103,6 +38745,53 @@ BEGIN JOIN vn.state s ON c.stateFk = s.id WHERE c.workerFk = vWorkerFk AND s.code = 'ON_PREPARATION'; +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_missingTrash` */; +/*!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 `collection_missingTrash`(vSaleFk BIGINT, vQuantity INT, vIsTrash BOOLEAN, vWarehouseFk INT) +BEGIN + DECLARE vTicketFk INT; + DECLARE vClientFk INT DEFAULT 400; + DECLARE vClientName VARCHAR(50); + DECLARE vConsignatario INT; + + IF vIsTrash THEN + SELECT 200 INTO vClientFk; + END IF; + + 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; + + IF vTicketFk IS NULL THEN + SELECT c.name , co.id INTO vClientName,vConsignatario + FROM vn.client c + INNER JOIN vn.address co ON c.id = co.clientFk + WHERE c.id = vClientFk + LIMIT 1; + + INSERT INTO vn.ticket (clientFk,warehouseFk,shipped,nickname,addressFk,workerFk,agencyModeFk) + VALUES (vClientFk,vWarehouseFk,NOW(),vClientName,vConsignatario,vn.getUser(),2); + + 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; + + 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 + FROM vn.sale s WHERE s.id = vSaleFk; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -38526,6 +39215,47 @@ 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_updateState` */; +/*!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 `collection_updateState`(vTicketFk INT, vState VARCHAR(50)) +BEGIN + +DECLARE vCollectionFk INT; +DECLARE vStateFk INT; + +SELECT collectionFk INTO vCollectionFk FROM vn.ticketCollection WHERE ticketFk = vTicketFk; + +SELECT id INTO vStateFk + FROM vn.state + WHERE `code` = vState COLLATE utf8_unicode_ci; + +-- Actualiza el estado del ticket + INSERT INTO vncontrol.inter(state_id, Id_Ticket, Id_Trabajador) + SELECT vStateFk, ticketFk, account.myUserGetId() + FROM vn.ticketCollection tc + WHERE tc.ticketFk = vTicketFk + UNION ALL + SELECT vStateFk, sw.id, account.myUserGetId() + FROM vn.stowaway sw + JOIN vn.ticketCollection tc ON tc.ticketFk = sw.shipFk + WHERE tc.ticketFk = vTicketFk; + +-- Actualiza la colección + CALL vn.collection_update(vTicketFk); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -42010,7 +42740,7 @@ BEGIN INTO vSerial FROM newInvoiceIn; - SELECT SUM(iit.taxableBase * IF(vSerial = 'R', 1 +(tc.rate/100),1)), + SELECT SUM(iit.taxableBase * IF(vSerial = 'R' AND tc.`type` <> 'I', 1 +(tc.rate/100),1)), SUM(iit.foreignValue * IF(vSerial = 'R', 1 +(tc.rate/100),1)), iit.taxableBase/iit.foreignValue INTO vTotalAmount, vTotalAmountDivisa, vRate @@ -44390,9 +45120,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 ;; @@ -45377,9 +46107,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 ;; @@ -45392,9 +46122,9 @@ BEGIN ish.visible as visible, ceil(ish.visible/ish.packing) as stickers, ish.packing as packing, - p.`column` as col, - p.`row` as `row`, - p.`code` as `code`, + IF (p.`column` IS NULL,"",p.`column`) as col, + IF (p.`row` IS NULL,"",p.`row`) as `row`, + IF (p.`code` IS NULL,"",p.`code`) as `code`, ish.id, s.priority FROM vn.itemShelving ish @@ -46994,7 +47724,7 @@ BEGIN -- Al insertar el tag medida se modifica también en la tabla item UPDATE item i JOIN tmp.item tmpI ON tmpI.id = i.id - JOIN itemTag it ON it.itemFk = i.id AND it.tagFk IN (4, 8) + JOIN itemTag it ON it.itemFk = i.id AND it.tagFk IN (4, 8, 219) SET i.size = it.`value`; -- Al insertar el tag productor se modifica también en la tabla item @@ -48468,7 +49198,7 @@ BEGIN o.itemFk, i.description, o.amount, - round(ic.cm3 * i.compression * o.amount / 1000000,3) as volume + round(ic.cm3delivery * o.amount / 1000000,3) as volume FROM hedera.orderRow o JOIN item i ON i.id = o.itemFk JOIN itemCost ic ON ic.itemFk = o.itemFk AND ic.warehouseFk = o.warehouseFk @@ -49590,9 +50320,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 ;; @@ -49602,6 +50332,7 @@ BEGIN DECLARE vPackages INT; DECLARE vM3 INT; DECLARE vKg INT; + DECLARE vMatricula varchar(50); SELECT sum(packages) as bultos INTO vPackages @@ -49613,10 +50344,17 @@ BEGIN FROM vn.saleVolume sv WHERE sv.routeFk = vRouteFk; + SELECT v.numberPlate as matricula + INTO vMatricula + FROM vn.route r + JOIN vn.vehicle v ON r.vehicleFk = v.id + WHERE r.id = vRouteFk; + SELECT vRouteFk as Ruta, vPackages as Bultos, vM3 as m3, - vKg as Kg; + vKg as Kg, + vMatricula as Matricula; END ;; DELIMITER ; @@ -50354,9 +51092,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 ;; @@ -50377,7 +51115,7 @@ BEGIN SELECT vSaleFk, vIsChecked, vOriginalQuantity, - vWorkerFk, + IFNULL(vWorkerFk, vn.getUser()), a.accion_id, s.id FROM vncontrol.accion a @@ -50395,18 +51133,16 @@ 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 `saleTracking_Replace`(vSaleFk INT, vIsChecked INT, vOriginalQuantity INT, vStateFk INT) BEGIN - - REPLACE vn.saleTracking(saleFk, isChecked, originalQuantity, workerFk, stateFk) - VALUES(vSaleFk, vIsChecked, vOriginalQuantity, vn.getUser(), vStateFk); - + REPLACE vn.saleTracking(saleFk, isChecked, originalQuantity, stateFk) + VALUES(vSaleFk, vIsChecked, vOriginalQuantity, vStateFk); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -53629,9 +54365,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 ;; @@ -53702,7 +54438,7 @@ BEGIN SELECT DISTINCT tl.ticketFk, 1 FROM tmp.ticketList tl JOIN vn.ticketRequest tr ON tr.ticketFk = tl.ticketFk - WHERE tr.isOK IS NULL + WHERE tr.isOK IS NULL AND tr.saleFk IS NOT NULL ON DUPLICATE KEY UPDATE hasTicketRequest = 1; @@ -54003,6 +54739,113 @@ 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 = 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__`() + 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 `ticketGetTotal` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -54137,13 +54980,12 @@ BEGIN SELECT warehouseFk, shipped INTO vWarehouseId,vShippedDate FROM ticket WHERE id = vTicketId; SELECT s.quantity, - round(ic.cm3 * i.compression * s.quantity / 1000000,3) as m3, + round(ic.cm3delivery * s.quantity / 1000000,3) as m3, s.itemFk, s.id AS saleFk, s.concept, t.agencyModeFk FROM sale s - JOIN item i ON i.id = s.itemFk JOIN ticket t on t.id = s.ticketFk JOIN itemCost ic ON ic.itemFk = s.itemFk AND ic.warehouseFk = t.warehouseFk WHERE s.ticketFk = vTicketId; @@ -54705,9 +55547,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 ;; @@ -54722,14 +55564,14 @@ BEGIN CREATE TEMPORARY TABLE tmp.ticketVolumeByDate ENGINE = MEMORY SELECT s.ticketFk, - CAST(SUM(r.cm3 * s.quantity) / 1000000 AS DECIMAL(10,2)) as m3 + CAST(SUM(ic.cm3delivery * s.quantity) / 1000000 AS DECIMAL(10,2)) as m3 FROM sale s 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 + JOIN vn.itemCategory c ON c.id = it.categoryFk JOIN vn.ticket t on t.id = s.ticketFk - JOIN bi.rotacion r ON r.Id_Article = s.itemFk AND r.warehouse_id = t.warehouseFk - WHERE ic.merchandise + JOIN vn.itemCost ic ON ic.itemFk = s.itemFk AND ic.warehouseFk = t.warehouseFk + WHERE c.merchandise AND t.shipped BETWEEN vDateStart AND vDateEnd GROUP BY s.ticketFk; END ;; @@ -55808,9 +56650,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 ;; @@ -55916,6 +56758,118 @@ 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_getTax__` */; +/*!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 `ticket_getTax__`(vTaxArea VARCHAR(25)) + 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 (); + + 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 + 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 + 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; + + 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 `ticket_insertZone` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -56318,6 +57272,7 @@ BEGIN departmentFk, hourStart, hourEnd, + timeTable, timeWorkSeconds, SEC_TO_TIME(timeWorkSeconds) timeWorkSexagesimal, timeWorkSeconds / 3600 timeWorkDecimal, @@ -56332,8 +57287,9 @@ BEGIN b.business_id businessFk, w.userFk, bl.department_id departmentFk, - IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.start,2) ORDER BY j.start ASC SEPARATOR '-')) hourStart , - IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.end,2) ORDER BY j.end ASC SEPARATOR '-')) hourEnd, + IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.start,5) ORDER BY j.start ASC SEPARATOR ' - ')) hourStart , + IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.end,5) ORDER BY j.end ASC SEPARATOR ' - ')) hourEnd, + IF(j.start = NULL, NULL, GROUP_CONCAT(DISTINCT LEFT(j.start,5), " - ", LEFT(j.end,5) ORDER BY j.end ASC SEPARATOR ' - ')) timeTable, IF(j.start = NULL, 0, IFNULL(SUM(TIME_TO_SEC(j.end)) - SUM(TIME_TO_SEC(j.start)),0)) timeWorkSeconds, cs.type, cs.permissionRate, @@ -56370,7 +57326,7 @@ BEGIN UPDATE tmp.timeBusinessCalculate t SET t.timeWorkSeconds = t.timeWorkSeconds - (t.timeWorkSeconds * permissionRate) , - t.timeWorkSexagesimal = SEC_TO_TIME(t.timeWorkSeconds - (t.timeWorkSeconds * permissionRate)), + t.timeWorkSexagesimal = SEC_TO_TIME ((t.timeWorkDecimal - (t.timeWorkDecimal * permissionRate)) * 3600), t.timeWorkDecimal = t.timeWorkDecimal - (t.timeWorkDecimal * permissionRate) WHERE permissionRate <> 0; @@ -56567,10 +57523,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 ), @@ -57593,9 +58551,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 ;; @@ -57627,7 +58585,7 @@ BEGIN JOIN vn.time tm ON tm.dated BETWEEN b.date_start AND IFNULL(b.date_end,CURDATE()) WHERE b.date_start <= vToDate AND IFNULL(b.date_end, CURDATE()) >= vFromDate - AND bl.porhoras + -- AND bl.porhoras AND vUserFk IN (0,w.userFk); @@ -58806,6 +59764,240 @@ 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 `workerTimeControl_sendMail` */; +/*!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 `workerTimeControl_sendMail`(vWeek INT, vYear INT, vWorkerFk INT) +BEGIN +/** + * Inserta en la tabla vn.mail para notificar a los empleados que teletrabajan de las jornadas que se han registrado. + * Inserta fichadas en el casos que se determina que el empleado está realizando teletrabajo + * + * @param vWeek + * @param vYear + * @param vWorkerFk -> En el caso de querer generarlo para todos los empleados deberá de informarse como NULL + */ + DECLARE vStarted VARCHAR(25); + DECLARE vEnded VARCHAR(25); + DECLARE vDone BOOL; + DECLARE vSender VARCHAR(255); + DECLARE vSenderOld VARCHAR(255); + DECLARE vDated DATE; + DECLARE vTimeWorkDecimal DECIMAL(5,2); + DECLARE vTimeWorkSexagesimal VARCHAR(5); + DECLARE vTimeWorkedDecimal DECIMAL(5,2); + DECLARE vTimeWorkedSexagesimal VARCHAR(5); + DECLARE vTimeWorkDecimalTotal DECIMAL(5,2); + DECLARE vTimeTable VARCHAR(100); + DECLARE vTimeTableDecimal DECIMAL(5,2); + DECLARE vWorkerFkOld INTEGER; + DECLARE vBusinessFk INTEGER; + DECLARE vHeader TEXT; + DECLARE vBody TEXT; + DECLARE vFooter TEXT; + DECLARE vReturn INTEGER; + DECLARE vAbsenceType VARCHAR(50); + 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, + 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 + 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 + ORDER BY u.id, tb.dated; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; + SELECT CONCAT( IFNULL(nif, ""), " - ", firstName, " ", name ) INTO vWorkerInfo + FROM postgresql.person + WHERE id_trabajador = vWorkerFk; + SET vHeader = CONCAT("


+
+

", vWorkerInfo , "

+ + + + + + + + + + + + "); + + 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 + FROM time + WHERE year = vYear AND + week = vWeek; + + DELETE FROM workerTimeControl + WHERE IFNULL(vWorkerFk, userFk) = userFk AND + timed BETWEEN vStarted AND vEnded AND isSendMail; + + UPDATE workerTimeControlMail + SET updated = NOW(), state="SENDED" + WHERE year = vYear AND + week = vWeek AND + IFNULL(vWorkerFk, workerFk) = workerFk ; + + IF vWorkerFk IS NULL THEN + CALL timeControl_calculateAll(vStarted,vEnded); + CALL timeBusiness_calculateAll(vStarted,vEnded); + ELSE + CALL timeControl_calculateByUser(vWorkerFk,vStarted,vEnded); + CALL timeBusiness_calculateByUser(vWorkerFk,vStarted,vEnded); + END IF; + + SET vTimeWorkDecimalTotal = 0; + SET vBody= ""; + + OPEN vCursor; + FETCH vCursor INTO vSender, vWorkerFk, vDated, vTimeWorkDecimal, vTimeWorkSexagesimal, vTimeTable, vTimeWorkedDecimal, vTimeWorkedSexagesimal, vAbsenceType, vBusinessFk ; + proc: LOOP + IF vDone THEN + LEAVE proc; + END IF; + + 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; + IF vTimeWorkDecimal >= 5 THEN + INSERT INTO workerTimeControl (userFk, timed, manual, direction, isSendMail) + 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; + 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; + 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 + 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 + 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 + 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 + 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 + 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 + FROM postgresql.journey j + WHERE j.business_id = vBusinessFk AND j.day_id = WEEKDAY(vDated)+1; + END IF; + + UPDATE workerTimeControl wtc + JOIN (SELECT id FROM workerTimeControl + WHERE userFk = vWorkerFk AND + timed BETWEEN vDated AND CONCAT(vDated, " 23:59:59") + ORDER BY timed ASC + LIMIT 1)sub on sub.id= wtc.id + SET direction = "in" ; + + UPDATE workerTimeControl wtc + JOIN (SELECT id FROM workerTimeControl + WHERE userFk = vWorkerFk AND + timed BETWEEN vDated AND CONCAT(vDated, " 23:59:59") + ORDER BY timed DESC + LIMIT 1)sub on sub.id= wtc.id + SET direction = "out" ; + + + END IF; + + SELECT CONCAT(IFNULL(vBody,""), " + + + + + + ") INTO vBody + FROM workerTimeControl + WHERE userFk = vWorkerFk AND + timed BETWEEN vDated AND CONCAT(vDated," 23:59:59"); + SET vTimeWorkDecimalTotal = vTimeWorkDecimalTotal + IFNULL(vTimeWorkedDecimal, vTimeWorkDecimal); + SET vDone = FALSE; + FETCH vCursor INTO vSender, vWorkerFk, vDated, vTimeWorkDecimal, vTimeWorkSexagesimal, vTimeTable, vTimeWorkedDecimal, vTimeWorkedSexagesimal, vAbsenceType, vBusinessFk ; + + IF vWorkerFk <> vWorkerFkOld OR vDone THEN + SET vFooter = CONCAT(" + + + + +
+ Según la información recogida en el sistema adjuntamos la tabla con los registros de las horas trabajadas en el período indicado. + Si está conforme tiene que contestar indicando únicamente la palabra OK, en caso contrario puede contestar detallando la causa de la disconformidad. + Rogamos nos conteste lo antes posible. +

+
FechaDíaFichadasDescripciónHoras
", DATE_FORMAT(vDated, "%d/%m/%Y"), "", CASE WEEKDAY(vDated)+1 + WHEN 1 THEN 'Lunes' + WHEN 2 THEN 'Martes' + WHEN 3 THEN 'Miércoles' + WHEN 4 THEN 'Jueves' + WHEN 5 THEN 'Viernes' + WHEN 6 THEN 'Sábado' + WHEN 7 THEN 'Domingo' + END , "", IFNULL(GROUP_CONCAT(MID(timed,12,5) ORDER BY timed ASC SEPARATOR ' - '), " - "),"", IFNULL(vAbsenceType, IF (vTimeWorkedDecimal>0, "Presencial", IF(vTimeWorkDecimal>0,"Teletrabajo", " - "))), "", IFNULL(vTimeWorkedSexagesimal, vTimeWorkSexagesimal) , "
TOTAL", IFNULL(LEFT (SEC_TO_TIME(vTimeWorkDecimalTotal * 3600), 5), 0), "
+
"); + 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)); + + INSERT IGNORE INTO workerTimeControlMail (workerFk, year,week) + VALUES(vWorkerFk, vYear, vWeek); + + SET vBody = ""; + SET vTimeWorkDecimalTotal = 0; + + END IF; + + SET vWorkerFkOld = vWorkerFk ; + SET vSenderOld = vSender; + + END LOOP; + CLOSE vCursor; + + DROP TEMPORARY TABLE tmp.timeBusinessCalculate; + DROP TEMPORARY TABLE tmp.timeControlCalculate; +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 `workerWeekControl` */; /*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_results = @@character_set_results */ ; @@ -59446,15 +60638,84 @@ proc: BEGIN TRUNCATE TABLE zoneClosure; WHILE vCounter <= vScope DO + CALL zone_getOptionsForShipment(vShipped, TRUE); - INSERT INTO zoneClosure(zoneFk, dated, `hour`) - SELECT zoneFk, vShipped, `hour` FROM tmp.zoneOption; + + REPLACE zoneClosure(zoneFk, dated, `hour`) + SELECT zoneFk, vShipped, `hour` + FROM tmp.zoneOption; SET vCounter = vCounter + 1; SET vShipped = TIMESTAMPADD(DAY, 1, vShipped); END WHILE; - DROP TEMPORARY TABLE tmp.zone; + -- DROP TEMPORARY TABLE tmp.zone; + DO RELEASE_LOCK('vn.zoneClosure_recalc'); +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 `zoneClosure_recalc_beta` */; +/*!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 `zoneClosure_recalc_beta`() +proc: BEGIN +/** + * Recalculates the delivery time (hour) for every zone in days + scope in future + */ + DECLARE vScope INT; + DECLARE vCounter INT DEFAULT 0; + DECLARE vShipped DATE DEFAULT CURDATE(); + + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION + BEGIN + DO RELEASE_LOCK('vn.zoneClosure_recalc'); + RESIGNAL; + END; + + IF NOT GET_LOCK('vn.zoneClosure_recalc', 0) THEN + LEAVE proc; + END IF; + + SELECT scope INTO vScope + FROM zoneConfig; + + DROP TEMPORARY TABLE IF EXISTS tmp.zone; + CREATE TEMPORARY TABLE tmp.zone + (INDEX (id)) + ENGINE = MEMORY + SELECT id FROM zone; + + WHILE vCounter <= vScope DO + + DELETE FROM zoneClosure + WHERE dated = vShipped; + + SELECT vShipped; + + CALL zone_getOptionsForShipment_beta(vShipped, TRUE); + + REPLACE zoneClosure(zoneFk, dated, `hour`) + SELECT zoneFk, vShipped, `hour` + FROM tmp.zoneOption; + + SET vCounter = vCounter + 1; + SET vShipped = TIMESTAMPADD(DAY, 1, vShipped); + END WHILE; + + SELECT * + FROM tmp.zoneOption; + + -- DROP TEMPORARY TABLE tmp.zone; DO RELEASE_LOCK('vn.zoneClosure_recalc'); END ;; DELIMITER ; @@ -60668,6 +61929,123 @@ BEGIN WHERE vShipped < CURDATE() OR (vShipped = CURDATE() AND CURTIME() > `hour`); 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 `zone_getOptionsForShipment_beta` */; +/*!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 `zone_getOptionsForShipment_beta`(vShipped DATE, vShowExpiredZones BOOLEAN) +BEGIN +/** + * Gets computed options for the passed zones and shipping date. + * + * @table tmp.zones(id) The zones ids + * @param vShipped The shipping date + * @return tmp.zoneOption(zoneFk, hour, travelingDays, price, bonus, specificity) The computed options + */ + DECLARE vHour TIME DEFAULT TIME(NOW()); + + DROP TEMPORARY TABLE IF EXISTS tLandings; + CREATE TEMPORARY TABLE tLandings + (INDEX (eventFk)) + ENGINE = MEMORY + SELECT e.id eventFk, + @travelingDays := IFNULL(e.travelingDays, z.travelingDays) travelingDays, + TIMESTAMPADD(DAY, @travelingDays, vShipped) landed + FROM tmp.zone t + JOIN zone z ON z.id = t.id + JOIN zoneEvent e ON e.zoneFk = t.id; + + SELECT * FROM tLandings + JOIN vn.zoneEvent ze ON ze.id = eventFk + WHERE ze.zoneFk = 25; + + DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption; + CREATE TEMPORARY TABLE tmp.zoneOption + ENGINE = MEMORY + SELECT * + FROM ( + SELECT t.id zoneFk, + TIME(IFNULL(e.`hour`, z.`hour`)) `hour`, + l.travelingDays, + IFNULL(e.price, z.price) price, + IFNULL(e.bonus, z.bonus) bonus, + l.landed + FROM tmp.zone t + JOIN zone z ON z.id = t.id + JOIN zoneEvent e ON e.zoneFk = t.id + JOIN tLandings l ON l.eventFk = e.id + WHERE ( + e.`type` = 'day' + AND e.`dated` = l.landed + ) OR ( + e.`type` != 'day' + AND e.weekDays & (1 << WEEKDAY(l.landed)) + AND (e.`started` IS NULL OR l.landed >= e.`started`) + AND (e.`ended` IS NULL OR l.landed <= e.`ended`) + ) + ORDER BY + zoneFk, + CASE + WHEN e.`type` = 'day' + THEN -1 + WHEN e.`type` = 'range' + THEN 2 + ELSE 3 + END + ) t + GROUP BY zoneFk; + + SELECT e.id, e.type, (e.`dated` = l.landed), e.`dated` , l.landed, t.id zoneFk, + TIME(IFNULL(e.`hour`, z.`hour`)) `hour`, + l.travelingDays, + IFNULL(e.price, z.price) price, + IFNULL(e.bonus, z.bonus) bonus, + l.landed + FROM tmp.zone t + JOIN zone z ON z.id = t.id + JOIN zoneEvent e ON e.zoneFk = t.id + JOIN tLandings l ON l.eventFk = e.id + WHERE zoneFk = 25 + ORDER BY + zoneFk, + CASE + WHEN e.`type` = 'day' + THEN 1 + WHEN e.`type` = 'range' + THEN 2 + ELSE 3 + END; + + SELECT * FROm tmp.zoneOption WHERE zoneFk = 25; + + DROP TEMPORARY TABLE tLandings; + + DELETE t FROM tmp.zoneOption t + JOIN zoneExclusion e + ON e.zoneFk = t.zoneFk AND e.`dated` = t.landed; + + SELECT * FROm tmp.zoneOption WHERE zoneFk = 25; + + IF NOT vShowExpiredZones THEN + DELETE FROM tmp.zoneOption + WHERE vShipped < CURDATE() + OR (vShipped = CURDATE() AND CURTIME() > `hour`); + END IF; + + + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -61217,13 +62595,11 @@ DELIMITER ;; FOR EACH ROW BEGIN - REPLACE vn.ticketLastState(ticketFk, ticketTrackingFk, name) SELECT NEW.Id_Ticket, NEW.inter_id, `name` FROM vn.state WHERE id = NEW.state_id; - END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -61297,18 +62673,18 @@ BEGIN WHERE ticketFk = OLD.Id_Ticket; END; - SELECT i.Id_Ticket, i.inter_id, s.`name` - INTO vTicketFk, vTicketTrackingFk, vStateName - FROM vncontrol.inter i - JOIN vn.state s ON i.state_id = s.id - WHERE Id_Ticket = OLD.Id_Ticket - ORDER BY odbc_date DESC - LIMIT 1; + SELECT i.Id_Ticket, i.inter_id, s.`name` + INTO vTicketFk, vTicketTrackingFk, vStateName + FROM vncontrol.inter i + JOIN vn.state s ON i.state_id = s.id + WHERE Id_Ticket = OLD.Id_Ticket + ORDER BY odbc_date DESC + LIMIT 1; - IF vTicketFk > 0 THEN - REPLACE INTO vn.ticketLastState(ticketFk, ticketTrackingFk,name) - VALUES(vTicketFk, vTicketTrackingFk, vStateName); - END IF; + IF vTicketFk > 0 THEN + REPLACE INTO vn.ticketLastState(ticketFk, ticketTrackingFk,name) + VALUES(vTicketFk, vTicketTrackingFk, vStateName); + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -62084,6 +63460,24 @@ USE `pbx`; USE `postgresql`; +-- +-- Final view structure for view `calendar_employee` +-- + +/*!50001 DROP VIEW IF EXISTS `calendar_employee`*/; +/*!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 `calendar_employee` AS select `ce`.`id` AS `id`,`ce`.`businessFk` AS `business_id`,`ce`.`dayOffTypeFk` AS `calendar_state_id`,`ce`.`dated` AS `date` from `vn`.`calendar` `ce` */; +/*!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: `salix` -- @@ -62234,6 +63628,42 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `businessCalendar` +-- + +/*!50001 DROP VIEW IF EXISTS `businessCalendar`*/; +/*!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 `businessCalendar` AS select `ce`.`id` AS `id`,`ce`.`business_id` AS `businessFk`,`ce`.`calendar_state_id` AS `absenceTypeFk`,`ce`.`date` AS `dated` from `postgresql`.`calendar_employee` `ce` */; +/*!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__` +-- + +/*!50001 DROP VIEW IF EXISTS `calendar__`*/; +/*!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 `calendar__` AS select `ce`.`id` AS `id`,`ce`.`business_id` AS `businessFk`,`ce`.`calendar_state_id` AS `dayOffTypeFk`,`ce`.`date` AS `dated` from `postgresql`.`calendar_employee` `ce` */; +/*!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 `claimRatio__` -- @@ -62751,7 +64181,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8mb4_general_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `holidayType__` AS select `cf`.`calendar_free_id` AS `id`,`cf`.`type` AS `name`,`cf`.`rgb` AS `rgb` from `postgresql`.`calendar_free` `cf` */; +/*!50001 VIEW `holidayType__` AS select `cf`.`calendar_free_id` AS `id`,`cf`.`type` AS `name`,`cf`.`rgb` AS `rgb` from `postgresql`.`calendar_free__` `cf` */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -63152,6 +64582,24 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `labelInfo` +-- + +/*!50001 DROP VIEW IF EXISTS `labelInfo`*/; +/*!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 `labelInfo` AS select `i`.`id` AS `itemId`,`i`.`name` AS `itemName`,`i`.`inkFk` AS `colorCode`,`i`.`stems` AS `stems`,`i`.`category` AS `category`,`i`.`subName` AS `productor`,`it`.`value` AS `value`,`b`.`packing` AS `packing`,`clb`.`warehouse_id` AS `warehouse_id`,`i`.`size` AS `size`,`b`.`isPickedOff` AS `isPickedOff`,`e`.`evaNotes` AS `notes`,`w`.`name` AS `wh_in`,`e`.`id` AS `entryId`,`b`.`id` AS `buyId` from (((((((`vn`.`item` `i` join `vn`.`itemTag` `it` on((`it`.`itemFk` = `i`.`id`))) join `vn`.`tag` `t` on((`t`.`id` = `it`.`tagFk`))) join `cache`.`last_buy` `clb` on((`clb`.`item_id` = `i`.`id`))) join `vn`.`buy` `b` on((`b`.`id` = `clb`.`buy_id`))) join `vn`.`entry` `e` on((`e`.`id` = `b`.`entryFk`))) left join `vn`.`travel` `tr` on((`tr`.`id` = `e`.`travelFk`))) join `vn`.`warehouse` `w` on((`w`.`id` = `tr`.`warehouseInFk`))) */; +/*!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 `lastHourProduction` -- @@ -63242,6 +64690,42 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `productionVolume` +-- + +/*!50001 DROP VIEW IF EXISTS `productionVolume`*/; +/*!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 `productionVolume` AS select hour(`e`.`created`) AS `hora`,minute(`e`.`created`) AS `minuto`,ifnull(`p`.`volume`,ifnull(((`p`.`width` * `p`.`height`) * `p`.`depth`),94500)) AS `cm3`,`t`.`warehouseFk` AS `warehouseFk`,`e`.`created` AS `created` from (((`expedition` `e` left join `packaging` `p` on((`p`.`itemFk` = `e`.`itemFk`))) join `ticket` `t` on((`t`.`id` = `e`.`ticketFk`))) join `client` `c` on((`c`.`id` = `t`.`clientFk`))) where ((`e`.`created` between curdate() and `util`.`dayend`(curdate())) and `c`.`isRelevant`) */; +/*!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 `productionVolume_LastHour` +-- + +/*!50001 DROP VIEW IF EXISTS `productionVolume_LastHour`*/; +/*!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 `productionVolume_LastHour` AS select cast(sum((`productionVolume`.`cm3` / 1000000)) as decimal(10,0)) AS `m3`,`productionVolume`.`warehouseFk` AS `warehouseFk` from `productionVolume` where ((`productionVolume`.`created` > (now() + interval -(1) hour)) and (`productionVolume`.`warehouseFk` in (1,44))) group by `productionVolume`.`warehouseFk` */; +/*!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 `role` -- @@ -63309,7 +64793,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8_general_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `saleVolume` AS select `s`.`ticketFk` AS `ticketFk`,`s`.`id` AS `saleFk`,ifnull(round(((((greatest(`i`.`density`,167) / 167) * `ic`.`cm3`) * `s`.`quantity`) / 1000),2),0) AS `litros`,`t`.`routeFk` AS `routeFk`,`t`.`shipped` AS `shipped`,((`s`.`quantity` * `ic`.`cm3`) / 1000000) AS `volume`,((`s`.`quantity` * `ic`.`grams`) / 1000) AS `physicalWeight`,((((`s`.`quantity` * `ic`.`cm3`) * greatest(`i`.`density`,167)) / 167) / 1000000) AS `weight`,((`s`.`quantity` * `ic`.`cm3`) / 1000000) AS `physicalVolume`,(((`s`.`quantity` * `ic`.`cm3`) * `t`.`zonePrice`) / `cb`.`volume`) AS `freight`,`t`.`zoneFk` AS `zoneFk`,`t`.`clientFk` AS `clientFk`,`s`.`isPicked` AS `isPicked` from ((((`sale` `s` join `item` `i` on((`i`.`id` = `s`.`itemFk`))) join `ticket` `t` on((`t`.`id` = `s`.`ticketFk`))) join `packaging` `cb` on((`cb`.`id` = '94'))) join `itemCost` `ic` on(((`ic`.`itemFk` = `s`.`itemFk`) and (`ic`.`warehouseFk` = `t`.`warehouseFk`)))) */; +/*!50001 VIEW `saleVolume` AS select `s`.`ticketFk` AS `ticketFk`,`s`.`id` AS `saleFk`,round(((`ic`.`cm3delivery` * `s`.`quantity`) / 1000),0) AS `litros`,`t`.`routeFk` AS `routeFk`,`t`.`shipped` AS `shipped`,((`s`.`quantity` * `ic`.`cm3delivery`) / 1000000) AS `volume`,((`s`.`quantity` * `ic`.`grams`) / 1000) AS `physicalWeight`,(((`s`.`quantity` * `ic`.`cm3delivery`) * greatest(`i`.`density`,167)) / 1000000) AS `weight`,((`s`.`quantity` * `ic`.`cm3delivery`) / 1000000) AS `physicalVolume`,(((`s`.`quantity` * `ic`.`cm3delivery`) * `t`.`zonePrice`) / `cb`.`volume`) AS `freight`,`t`.`zoneFk` AS `zoneFk`,`t`.`clientFk` AS `clientFk`,`s`.`isPicked` AS `isPicked` from ((((`sale` `s` join `item` `i` on((`i`.`id` = `s`.`itemFk`))) join `ticket` `t` on((`t`.`id` = `s`.`ticketFk`))) join `packaging` `cb` on((`cb`.`id` = '94'))) join `itemCost` `ic` on(((`ic`.`itemFk` = `s`.`itemFk`) and (`ic`.`warehouseFk` = `t`.`warehouseFk`)))) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -63345,7 +64829,7 @@ USE `vn`; /*!50001 SET collation_connection = utf8_general_ci */; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ -/*!50001 VIEW `salesPreparedLastHour` AS select `t`.`warehouseFk` AS `warehouseFk`,`st`.`saleFk` AS `saleFk`,`st`.`isChecked` AS `isChecked`,`st`.`originalQuantity` AS `originalQuantity`,`a`.`accion` AS `accion`,`st`.`created` AS `created`,`e`.`code` AS `code`,`w`.`firstName` AS `firstname`,`w`.`lastName` AS `lastName`,`w`.`code` AS `workerCode`,((`r`.`cm3` * `s`.`quantity`) / 1000) AS `litros`,`s`.`concept` AS `concept`,`d`.`name` AS `departmentName` from (((((((((`vn`.`saleTracking` `st` left join `vn`.`salesPreviousPreparated` `prevPrepSales` on((`prevPrepSales`.`saleFk` = `st`.`saleFk`))) join `vn`.`sale` `s` on((`s`.`id` = `st`.`saleFk`))) join `vn`.`ticket` `t` on((`t`.`id` = `s`.`ticketFk`))) join `bi`.`rotacion` `r` on(((`r`.`warehouse_id` = `t`.`warehouseFk`) and (`r`.`Id_Article` = `s`.`itemFk`)))) join `vn`.`worker` `w` on((`w`.`id` = `st`.`workerFk`))) join `vn`.`state` `e` on((`e`.`id` = `st`.`stateFk`))) join `vncontrol`.`accion` `a` on((`a`.`accion_id` = `st`.`actionFk`))) join `vn`.`workerDepartment` `wd` on((`wd`.`workerFk` = `st`.`workerFk`))) join `vn`.`department` `d` on((`d`.`id` = `wd`.`departmentFk`))) where ((`st`.`created` > (now() + interval -(1) hour)) and isnull(`prevPrepSales`.`saleFk`) and (not((`d`.`name` like 'EQUIPO%')))) */; +/*!50001 VIEW `salesPreparedLastHour` AS select `t`.`warehouseFk` AS `warehouseFk`,`st`.`saleFk` AS `saleFk`,`st`.`isChecked` AS `isChecked`,`st`.`originalQuantity` AS `originalQuantity`,`a`.`accion` AS `accion`,`st`.`created` AS `created`,`e`.`code` AS `code`,`w`.`firstName` AS `firstname`,`w`.`lastName` AS `lastName`,`w`.`code` AS `workerCode`,((`ic`.`cm3delivery` * `s`.`quantity`) / 1000) AS `litros`,`s`.`concept` AS `concept`,`d`.`name` AS `departmentName` from (((((((((`vn`.`saleTracking` `st` left join `vn`.`salesPreviousPreparated` `prevPrepSales` on((`prevPrepSales`.`saleFk` = `st`.`saleFk`))) join `vn`.`sale` `s` on((`s`.`id` = `st`.`saleFk`))) join `vn`.`ticket` `t` on((`t`.`id` = `s`.`ticketFk`))) join `vn`.`itemCost` `ic` on(((`ic`.`warehouseFk` = `t`.`warehouseFk`) and (`ic`.`itemFk` = `s`.`itemFk`)))) join `vn`.`worker` `w` on((`w`.`id` = `st`.`workerFk`))) join `vn`.`state` `e` on((`e`.`id` = `st`.`stateFk`))) join `vncontrol`.`accion` `a` on((`a`.`accion_id` = `st`.`actionFk`))) join `vn`.`workerDepartment` `wd` on((`wd`.`workerFk` = `st`.`workerFk`))) join `vn`.`department` `d` on((`d`.`id` = `wd`.`departmentFk`))) where ((`st`.`created` > (now() + interval -(1) hour)) and isnull(`prevPrepSales`.`saleFk`) and (not((`d`.`name` like 'EQUIPO%')))) */; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; @@ -63512,6 +64996,24 @@ USE `vn`; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; +-- +-- Final view structure for view `time__` +-- + +/*!50001 DROP VIEW IF EXISTS `time__`*/; +/*!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 `time__` AS select `t`.`date` AS `dated`,`t`.`period` AS `period`,`t`.`month` AS `month`,`t`.`year` AS `year`,`t`.`day` AS `day`,`t`.`week` AS `week`,`t`.`yearMonth` AS `yearMonth` from `vn2008`.`time` `t` */; +/*!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 `tr2` -- @@ -63797,4 +65299,4 @@ USE `vncontrol`; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-06-23 12:58:41 +-- Dump completed on 2020-07-16 10:43:28 diff --git a/db/export-structure.sh b/db/export-structure.sh index ec9578aad..891812824 100755 --- a/db/export-structure.sh +++ b/db/export-structure.sh @@ -80,7 +80,6 @@ IGNORETABLES=( --ignore-table=vn.ticketRequest__ --ignore-table=vn.ticketToPrepare --ignore-table=vn.till__ - --ignore-table=vn.time --ignore-table=vn.travelThermograph__ --ignore-table=vn.travel_cloneWeekly --ignore-table=vn.unary diff --git a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js index 8e9af247a..7eb8e7ed9 100644 --- a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js +++ b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js @@ -17,7 +17,7 @@ describe('Client activeWorkersWithRole', () => { let isBuyer = await app.models.Account.hasRole(result[0].id, 'buyer'); - expect(result.length).toEqual(13); + expect(result.length).toEqual(15); expect(isBuyer).toBeTruthy(); }); }); diff --git a/modules/ticket/back/methods/ticket/specs/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js index 56d351f2e..4aa1b3a77 100644 --- a/modules/ticket/back/methods/ticket/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js @@ -66,7 +66,7 @@ describe('ticket filter()', () => { const secondRow = result[1]; const thirdRow = result[2]; - expect(result.length).toEqual(13); + expect(result.length).toEqual(12); expect(firstRow.state).toEqual('Entregado'); expect(secondRow.state).toEqual('Entregado'); expect(thirdRow.state).toEqual('Entregado');