From e5b13267e2e1d1fb71d286210c1659be94ee4862 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 5 Jan 2021 15:03:35 +0100 Subject: [PATCH 1/8] 2605 - Ticket request send chat notification --- loopback/locale/en.json | 4 ++- loopback/locale/es.json | 4 ++- loopback/util/log.js | 6 ++-- modules/ticket/back/models/ticket-request.js | 34 ++++++++++++++++++-- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 1f85356dd..0ac49d5b5 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -86,5 +86,7 @@ "The social name cannot be empty": "The social name cannot be empty", "The nif cannot be empty": "The nif cannot be empty", "A travel with this data already exists": "A travel with this data already exists", - "The observation type can't be repeated": "The observation type can't be repeated" + "The observation type can't be repeated": "The observation type can't be repeated", + "New ticket request has been created with price": "New ticket request has been created '{{description}}' for day {{shipped}}, with a quantity of {{quantity}} and a price of {{price}} €", + "New ticket request has been created": "New ticket request has been created '{{description}}' for day {{shipped}}, with a quantity of {{quantity}}" } \ No newline at end of file diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 70c46c110..b54c0cc67 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -164,5 +164,7 @@ "You can not select this payment method without a registered bankery account": "No se puede utilizar este método de pago si no has registrado una cuenta bancaria", "You can't upload images on the test environment": "No puedes subir imágenes en el entorno de pruebas", "The selected ticket is not suitable for this route": "El ticket seleccionado no es apto para esta ruta", - "Sorts whole route": "Reordena ruta entera" + "Sorts whole route": "Reordena ruta entera", + "New ticket request has been created with price": "Se ha creado una nueva petición de compra '{{description}}' para el día {{shipped}}, con una cantidad de {{quantity}} y un precio de {{price}} €", + "New ticket request has been created": "Se ha creado una nueva petición de compra '{{description}}' para el día {{shipped}}, con una cantidad de {{quantity}}" } \ No newline at end of file diff --git a/loopback/util/log.js b/loopback/util/log.js index d81fc39a0..b491b97d0 100644 --- a/loopback/util/log.js +++ b/loopback/util/log.js @@ -24,9 +24,9 @@ exports.translateValues = async(instance, changes) => { function formatDate(date) { return new Intl.DateTimeFormat('es', { - year: '2-digit', - month: '2-digit', - day: '2-digit', + year: 'numeric', + month: 'numeric', + day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit' diff --git a/modules/ticket/back/models/ticket-request.js b/modules/ticket/back/models/ticket-request.js index f711ed23e..814f47bae 100644 --- a/modules/ticket/back/models/ticket-request.js +++ b/modules/ticket/back/models/ticket-request.js @@ -8,10 +8,38 @@ module.exports = function(Self) { Self.observe('before save', async function(ctx) { if (ctx.isNewInstance) { const loopBackContext = LoopBackContext.getCurrentContext(); - let filter = {where: {userFk: loopBackContext.active.accessToken.userId}}; - let worker = await Self.app.models.Worker.findOne(filter); + const filter = {where: {userFk: loopBackContext.active.accessToken.userId}}; + const models = Self.app.models; + const worker = await models.Worker.findOne(filter); - ctx.instance.requesterFk = worker.id; + const instance = ctx.instance; + instance.requesterFk = worker.id; + + const httpCtx = {req: loopBackContext.active}; + const httpRequest = httpCtx.req.http .req; + const $t = httpRequest.__; + + const attenderId = instance.attenderFk; + if (attenderId) { + const ticket = await models.Ticket.findById(instance.ticketFk); + let messageText = 'New ticket request has been created'; + if (instance.price) + messageText = 'New ticket request has been created with price'; + + const shipped = new Intl.DateTimeFormat('es', { + year: 'numeric', + month: 'numeric', + day: 'numeric' + }).format(ticket.shipped); + + const message = $t(messageText, { + description: instance.description, + shipped: shipped, + quantity: instance.quantity, + price: instance.price + }); + await models.Chat.sendCheckingPresence(httpCtx, attenderId, message); + } } }); }; From 779b229dfcb141c4460d19366b9a3c323a5c70c5 Mon Sep 17 00:00:00 2001 From: bernat Date: Thu, 7 Jan 2021 12:11:14 +0100 Subject: [PATCH 2/8] refactor tag fixtures --- db/dump/dumpedFixtures.sql | 26 ++++++++------------------ db/dump/fixtures.sql | 16 ++++++++++++++++ db/export-data.sh | 1 - 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql index 93a3c1c68..5ca9c9540 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 2021-01-05 9:40:22 +-- Dump completed on 2021-01-07 9:30:07 USE `account`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -124,7 +124,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:40:24 +-- Dump completed on 2021-01-07 9:30:09 USE `salix`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -172,7 +172,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:40:25 +-- Dump completed on 2021-01-07 9:30:10 USE `vn`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -251,16 +251,6 @@ INSERT INTO `pgc` VALUES ('4722000000',0.00,'Importación Exento ',1,0,0,1,0),(' /*!40000 ALTER TABLE `pgc` ENABLE KEYS */; UNLOCK TABLES; --- --- Dumping data for table `tag` --- - -LOCK TABLES `tag` WRITE; -/*!40000 ALTER TABLE `tag` DISABLE KEYS */; -INSERT INTO `tag` VALUES (1,'color','Color',0,0,'ink',NULL,NULL,'inkFk'),(2,NULL,'Forma',1,0,NULL,NULL,NULL,NULL),(3,NULL,'Material',1,0,NULL,NULL,NULL,NULL),(4,NULL,'Longitud',1,1,NULL,'mm',NULL,'size'),(5,NULL,'Diámetro',1,1,NULL,'mm',NULL,'diameter'),(6,NULL,'Perímetro',1,1,NULL,'mm',NULL,NULL),(7,NULL,'Ancho de la base',1,1,NULL,'mm',NULL,NULL),(8,NULL,'Altura',1,1,NULL,'mm',NULL,'size'),(9,NULL,'Volumen',1,1,NULL,'ml',NULL,NULL),(10,NULL,'Densidad',1,1,NULL,NULL,NULL,NULL),(11,NULL,'Calidad',1,0,NULL,NULL,NULL,NULL),(12,NULL,'Textura',1,0,NULL,NULL,NULL,NULL),(13,NULL,'Material del mango',1,0,NULL,NULL,NULL,NULL),(14,NULL,'Compra mínima',1,0,NULL,NULL,NULL,NULL),(15,NULL,'Nº pétalos',1,1,NULL,NULL,NULL,NULL),(16,NULL,'Ancho',1,1,NULL,'mm',NULL,NULL),(18,NULL,'Profundidad',1,1,NULL,'mm',NULL,NULL),(19,NULL,'Largo',1,1,NULL,'mm',NULL,'size'),(20,NULL,'Ancho superior',1,1,NULL,'mm',NULL,NULL),(21,NULL,'Ancho inferior',1,1,NULL,'mm',NULL,NULL),(22,NULL,'Gramaje',1,1,NULL,'g',NULL,NULL),(23,'stems','Tallos',1,1,NULL,NULL,NULL,'stems'),(24,NULL,'Estado',1,0,NULL,NULL,NULL,NULL),(25,NULL,'Color principal',0,0,'ink',NULL,NULL,NULL),(26,NULL,'Color secundario',0,0,'ink',NULL,NULL,NULL),(27,NULL,'Longitud(cm)',1,1,NULL,'cm',NULL,NULL),(28,NULL,'Diámetro base',1,1,NULL,'mm',NULL,'diameter'),(29,NULL,'Colección',1,0,NULL,NULL,NULL,NULL),(30,NULL,'Uds / caja',1,1,NULL,NULL,NULL,NULL),(31,NULL,'Contenido',1,0,NULL,NULL,NULL,NULL),(32,NULL,'Peso',1,1,NULL,'g',NULL,NULL),(33,NULL,'Grosor',1,1,NULL,'mm',NULL,NULL),(34,NULL,'Marca',1,0,NULL,NULL,NULL,NULL),(35,'origin','Origen',0,0,'origin',NULL,NULL,'originFk'),(36,NULL,'Proveedor',1,0,NULL,NULL,NULL,NULL),(37,'producer','Productor',0,0,'producer',NULL,NULL,'producerFk'),(38,NULL,'Duración',1,1,NULL,'s',NULL,NULL),(39,NULL,'Flor',1,0,NULL,NULL,NULL,NULL),(40,NULL,'Soporte',1,0,NULL,NULL,NULL,NULL),(41,NULL,'Tamaño flor',1,0,NULL,NULL,NULL,NULL),(42,NULL,'Apertura',1,0,NULL,NULL,NULL,NULL),(43,NULL,'Tallo',1,0,NULL,NULL,NULL,NULL),(44,NULL,'Nº hojas',1,1,NULL,NULL,NULL,NULL),(45,NULL,'Dimensiones',1,0,NULL,NULL,NULL,NULL),(46,NULL,'Diámetro boca',1,1,NULL,'mm',NULL,NULL),(47,NULL,'Nº flores',1,1,NULL,NULL,NULL,NULL),(48,NULL,'Uds / paquete',1,1,NULL,NULL,NULL,NULL),(49,NULL,'Maceta',1,1,NULL,'cm',NULL,'diameter'),(50,NULL,'Textura flor',1,0,NULL,NULL,NULL,NULL),(51,NULL,'Textura hoja',1,0,NULL,NULL,NULL,NULL),(52,NULL,'Tipo de IVA',1,0,NULL,NULL,NULL,NULL),(53,NULL,'Tronco',1,0,NULL,NULL,NULL,NULL),(54,NULL,'Hoja',1,0,NULL,NULL,NULL,NULL),(55,NULL,'Formato',1,0,NULL,NULL,NULL,NULL),(56,NULL,'Genero',1,0,NULL,NULL,NULL,NULL),(57,NULL,'Especie',1,0,NULL,NULL,NULL,NULL),(58,NULL,'Variedad',1,0,NULL,NULL,NULL,NULL),(59,NULL,'Medida grande',1,0,NULL,NULL,NULL,NULL),(60,NULL,'Medida mediano',1,0,NULL,NULL,NULL,NULL),(61,NULL,'Medida pequeño',1,0,NULL,NULL,NULL,NULL),(63,NULL,'Recipiente interior',1,0,NULL,NULL,NULL,NULL),(64,NULL,'Material secundario',1,0,NULL,NULL,NULL,NULL),(65,NULL,'Colores',1,0,NULL,NULL,NULL,NULL),(66,NULL,'Referencia',1,0,NULL,NULL,NULL,NULL),(67,'category','Categoria',1,0,NULL,NULL,NULL,NULL),(68,NULL,'Amb',1,0,NULL,NULL,NULL,NULL),(69,NULL,'Anchura',1,1,NULL,'cm',NULL,NULL),(70,NULL,'Hueco interior',1,0,NULL,NULL,NULL,NULL),(71,NULL,'Tamaño',1,0,NULL,NULL,NULL,NULL),(72,NULL,'Color botón',1,0,NULL,NULL,NULL,NULL),(73,NULL,'Tamaño minimo del botón',1,0,NULL,NULL,NULL,NULL),(74,NULL,'Obtentor',1,0,NULL,NULL,NULL,NULL),(75,NULL,'Longitud del brote',1,0,NULL,NULL,NULL,NULL),(76,NULL,'Tallos / u.v.',1,0,NULL,NULL,NULL,NULL),(77,NULL,'Madera de',1,0,NULL,NULL,NULL,NULL),(78,NULL,'Unidad de venta',1,0,NULL,NULL,NULL,NULL),(79,NULL,'Temporal',1,0,NULL,NULL,NULL,NULL),(80,NULL,'Gramaje/tallo',1,1,NULL,'g',NULL,NULL),(81,NULL,'Peso/paquete',1,1,NULL,'g',NULL,NULL),(82,NULL,'Flexibilidad del tallo',1,0,NULL,NULL,NULL,NULL),(83,NULL,'Nº planchas',1,1,NULL,NULL,NULL,NULL),(84,NULL,'Nº páginas',1,1,NULL,NULL,NULL,NULL),(85,NULL,'Editorial',1,0,NULL,NULL,NULL,NULL),(86,NULL,'Idioma',1,0,NULL,NULL,NULL,NULL),(87,NULL,'Fecha publicación',1,0,NULL,NULL,NULL,NULL),(88,NULL,'Cubierta',1,0,NULL,NULL,NULL,NULL),(89,NULL,'Encuadernación',1,0,NULL,NULL,NULL,NULL),(90,NULL,'Autor',1,0,NULL,NULL,NULL,NULL),(91,NULL,'Envoltorio',1,0,NULL,NULL,NULL,NULL),(92,NULL,'Nombre temporal',1,0,NULL,NULL,NULL,NULL),(93,NULL,'Modelo',1,0,NULL,NULL,NULL,NULL),(94,NULL,'Producto',1,0,NULL,NULL,NULL,NULL),(95,NULL,'Título',1,0,NULL,NULL,NULL,NULL),(96,NULL,'Tomo',1,0,NULL,NULL,NULL,NULL),(97,NULL,'Articulo',1,0,NULL,NULL,NULL,NULL),(98,NULL,'Metodo de cultivo',1,0,NULL,NULL,NULL,NULL),(99,NULL,'Edad',1,0,NULL,NULL,NULL,NULL),(100,NULL,'Agotado',1,0,NULL,NULL,NULL,NULL),(101,NULL,'Altura con asa',1,1,NULL,'cm',NULL,'size'),(102,NULL,'Nº tallos',1,1,NULL,NULL,NULL,NULL),(103,NULL,'Cultivo',1,0,NULL,NULL,NULL,NULL),(104,NULL,'Sabor',1,0,NULL,NULL,NULL,NULL),(105,NULL,'Talla',1,0,NULL,NULL,NULL,NULL),(106,NULL,'Calibre',1,1,NULL,NULL,NULL,NULL),(107,NULL,'Dulzura',1,1,NULL,'bx',NULL,NULL),(108,NULL,'Piezas',1,0,NULL,NULL,NULL,NULL),(109,NULL,'Altura con patas',1,0,NULL,'cm',NULL,'size'),(110,NULL,'Envase',1,0,NULL,NULL,NULL,NULL),(111,NULL,'Nº piezas',1,0,NULL,NULL,NULL,NULL),(112,NULL,'Uso',1,0,NULL,'cm',NULL,NULL),(113,NULL,'Color luz',1,0,NULL,NULL,NULL,NULL),(114,NULL,'Capacidad',1,0,NULL,NULL,NULL,NULL),(184,NULL,'Tallos por paquete',1,0,NULL,NULL,NULL,NULL),(205,NULL,'Apertura',1,0,NULL,NULL,NULL,NULL),(219,NULL,'Altura',1,0,NULL,'cm',NULL,'size'),(552,NULL,'fout kenmerk',1,0,NULL,NULL,NULL,NULL),(553,NULL,'Potinhoud',1,0,NULL,NULL,NULL,NULL),(554,NULL,'Marketingconcept',1,0,NULL,NULL,NULL,NULL),(555,NULL,'Leeftijd',1,0,NULL,NULL,NULL,NULL),(556,NULL,'Base',1,0,NULL,NULL,NULL,NULL),(557,NULL,'Kleurbehandeld',1,0,NULL,NULL,NULL,'inkFk'),(558,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,NULL,NULL),(559,NULL,'Verzorging: Water',1,0,NULL,NULL,NULL,NULL),(560,NULL,'Verzorging: Voeding',1,0,NULL,NULL,NULL,NULL),(561,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,NULL,NULL),(562,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,NULL,NULL),(563,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,NULL,NULL),(564,NULL,'Nabehandeling',1,0,NULL,NULL,NULL,NULL),(565,NULL,'Artikel beeld',1,0,NULL,NULL,NULL,NULL),(566,NULL,'Hoofdkleur 1',1,0,NULL,NULL,NULL,NULL),(567,NULL,'Hoofdkleur 2',1,0,NULL,NULL,NULL,NULL),(568,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,NULL,NULL),(569,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,NULL,NULL),(570,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,NULL,NULL),(571,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,NULL,NULL),(572,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,NULL,NULL),(573,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,NULL,NULL),(574,NULL,'Botanisch beeld',1,0,NULL,NULL,NULL,NULL),(575,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,NULL,NULL),(576,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,NULL,NULL),(577,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,NULL,NULL),(578,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,NULL,NULL),(579,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,NULL,NULL),(580,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,NULL,NULL),(581,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,NULL,NULL),(582,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,NULL,NULL),(583,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,NULL,NULL),(584,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,NULL,NULL),(585,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,NULL,NULL),(586,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,NULL,NULL),(587,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,NULL,NULL),(588,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,NULL,NULL),(589,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,NULL,NULL),(590,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,NULL,NULL),(591,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,NULL,NULL),(592,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,NULL,NULL),(593,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,NULL,NULL),(594,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,NULL,NULL),(595,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,NULL,NULL),(596,NULL,'Certificaten biologisch',1,0,NULL,NULL,NULL,NULL),(597,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,NULL,NULL),(598,NULL,'Certificaten Florimark',1,0,NULL,NULL,NULL,NULL),(599,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,NULL,NULL),(600,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,NULL,NULL),(601,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,NULL,NULL),(602,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,NULL,NULL),(603,NULL,'Certificaten ISO',1,0,NULL,NULL,NULL,NULL),(604,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,NULL,NULL),(605,NULL,'Certificaten Florverde',1,0,NULL,NULL,NULL,NULL),(606,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,NULL,NULL),(607,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,NULL,NULL),(608,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,NULL,NULL),(609,NULL,'Certificaten SAN',1,0,NULL,NULL,NULL,NULL),(610,NULL,'Certificaten GRASP',1,0,NULL,NULL,NULL,NULL),(611,NULL,'Label Fair Flora',1,0,NULL,NULL,NULL,NULL),(612,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,NULL,NULL),(613,NULL,'Fust',1,0,NULL,NULL,NULL,NULL),(614,NULL,'Stapelwagen',1,0,NULL,NULL,NULL,NULL),(615,NULL,'Aantal legborden veilings',1,0,NULL,NULL,NULL,NULL),(616,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,NULL,NULL),(617,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,NULL,NULL),(618,NULL,'Fustsoort',1,0,NULL,NULL,NULL,NULL),(619,NULL,'Envase',1,0,NULL,NULL,NULL,NULL),(620,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,NULL,NULL),(621,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,NULL,NULL),(622,NULL,'Tallos/bolsa',1,0,NULL,NULL,NULL,''),(623,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,NULL,NULL),(624,NULL,'Aantal stuks per fust',1,0,NULL,NULL,NULL,NULL),(625,NULL,'Aantal bossen per fust',1,0,NULL,NULL,NULL,NULL),(626,NULL,'Aantal bundels per fust',1,0,NULL,NULL,NULL,NULL),(627,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,NULL,NULL),(628,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,NULL,NULL),(629,NULL,'Fustlabel',1,0,NULL,NULL,NULL,NULL),(630,NULL,'Karlabel',1,0,NULL,NULL,NULL,NULL),(631,NULL,'Service productlabel',1,0,NULL,NULL,NULL,NULL),(632,NULL,'Service fustlabel',1,0,NULL,NULL,NULL,NULL),(633,NULL,'Service karlabel',1,0,NULL,NULL,NULL,NULL),(634,NULL,'Aantal fusten per laag',1,0,NULL,NULL,NULL,NULL),(635,NULL,'Presentatie per schapm2',1,0,NULL,NULL,NULL,NULL),(636,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,NULL,NULL),(637,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,NULL,NULL),(638,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,NULL,NULL),(639,NULL,'Maceta',1,1,NULL,'cm',NULL,'diameter'),(640,NULL,'Altura',1,0,NULL,'cm',NULL,'size'),(641,NULL,'nº plantas',1,0,NULL,NULL,NULL,NULL),(642,NULL,'Diámetro',1,0,NULL,NULL,NULL,NULL),(644,NULL,'Altura',1,1,NULL,'cm',NULL,'size'),(645,NULL,'Plantas/Maceta',1,0,NULL,NULL,NULL,NULL),(646,NULL,'Dikte',1,0,NULL,NULL,NULL,NULL),(647,NULL,'nº flores',1,0,NULL,NULL,NULL,NULL),(648,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,NULL,NULL),(649,NULL,'nº ramales',1,0,NULL,NULL,NULL,NULL),(650,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,NULL,NULL),(651,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,NULL,NULL),(652,NULL,'Altura tronco',1,1,NULL,'cm',NULL,'size'),(653,NULL,'Altura caja',1,0,NULL,'cm',NULL,'size'),(654,NULL,'Lengte scheuten',1,0,NULL,NULL,NULL,NULL),(655,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,NULL,NULL),(656,NULL,'Altura del capullo',1,0,NULL,NULL,NULL,NULL),(658,NULL,'Peso tallo',1,0,NULL,NULL,NULL,NULL),(659,NULL,'nº flores',1,0,NULL,NULL,NULL,NULL),(660,NULL,'Diámetro de la flor',1,0,NULL,NULL,NULL,NULL),(661,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,NULL,NULL),(662,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,NULL,NULL),(663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL,NULL),(664,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL,NULL),(665,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,NULL,NULL),(666,NULL,'Longitud inflorescencia',1,0,NULL,NULL,NULL,NULL),(667,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,NULL,NULL),(668,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,NULL,NULL),(669,NULL,'Longitud',1,0,NULL,NULL,NULL,'size'),(670,NULL,'Jaartal sortering hout',1,0,NULL,NULL,NULL,NULL),(671,NULL,'Diámetro de la hoja',1,0,NULL,NULL,NULL,NULL),(672,NULL,'Peso paquete',1,0,NULL,NULL,NULL,NULL),(673,NULL,'Maximum planthoogte',1,0,NULL,NULL,NULL,NULL),(674,NULL,'Maximum plantdiameter',1,0,NULL,NULL,NULL,NULL),(675,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,NULL,NULL),(676,NULL,'Maximum aantal takken per',1,0,NULL,NULL,NULL,NULL),(677,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,NULL,NULL),(678,NULL,'Maximum stamhoogte',1,0,NULL,NULL,NULL,NULL),(679,NULL,'Longitud mínima',1,0,NULL,NULL,NULL,'size'),(680,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,NULL,NULL),(681,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,NULL,NULL),(682,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,NULL,NULL),(683,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,NULL,NULL),(684,NULL,'Verpakkingswijze',1,0,NULL,NULL,NULL,NULL),(685,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,NULL,NULL),(686,NULL,'Medida',1,1,NULL,'cm',NULL,'size'),(687,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,NULL,NULL),(688,NULL,'Potvorm',1,0,NULL,NULL,NULL,NULL),(689,NULL,'Potkleur',1,0,NULL,NULL,NULL,NULL),(690,NULL,'Material maceta',1,0,NULL,NULL,NULL,NULL),(691,NULL,'Plantvorm',1,0,NULL,NULL,NULL,NULL),(692,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,NULL,NULL),(693,NULL,'Teeltwijze',1,0,NULL,NULL,NULL,NULL),(694,NULL,'Teeltmedium',1,0,NULL,NULL,NULL,NULL),(695,NULL,'Cubierta',1,0,NULL,NULL,NULL,NULL),(696,NULL,'Hoesvorm',1,0,NULL,NULL,NULL,NULL),(697,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,NULL,NULL),(698,NULL,'Extra toevoegingen',1,0,NULL,NULL,NULL,NULL),(699,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,NULL,NULL),(700,NULL,'Verpakte orchidee',1,0,NULL,NULL,NULL,NULL),(701,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,NULL,NULL),(702,NULL,'Voorbehandeling',1,0,NULL,NULL,NULL,NULL),(703,NULL,'Overige niet in pot',1,0,NULL,NULL,NULL,NULL),(704,NULL,'Forma de la flor',1,0,NULL,NULL,NULL,NULL),(705,NULL,'Flexibilidad',1,0,NULL,NULL,NULL,NULL),(706,NULL,'Hoeskleur',1,0,NULL,NULL,NULL,NULL),(707,NULL,'Extra deco',1,0,NULL,NULL,NULL,NULL),(710,NULL,'Altura',1,0,NULL,'cm',NULL,'size'),(711,NULL,'Diametro',1,0,NULL,NULL,NULL,NULL),(712,NULL,'Barcode',1,0,NULL,NULL,NULL,NULL),(713,NULL,'Productlabel',1,0,NULL,NULL,NULL,NULL),(714,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,NULL,NULL),(715,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,NULL,NULL),(716,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,NULL,NULL),(717,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,NULL,NULL),(718,NULL,'Maximum lengte verschil',1,0,NULL,NULL,NULL,NULL),(719,NULL,'Bladkleur',1,0,NULL,NULL,NULL,NULL),(720,NULL,'Plantgewicht',1,0,NULL,NULL,NULL,NULL),(721,NULL,'Diámetro',1,0,NULL,NULL,NULL,NULL),(722,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,NULL,NULL),(723,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,NULL,NULL),(724,NULL,'Kleurbehandeld',1,0,NULL,NULL,NULL,'inkFk'),(725,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,NULL,NULL),(726,NULL,'Diámetro del capullo',1,0,NULL,NULL,NULL,NULL),(727,NULL,'Volume inhoud',1,0,NULL,NULL,NULL,NULL),(728,NULL,'Vruchtbenaming',1,0,NULL,NULL,NULL,NULL),(729,NULL,'Vaaslevenindex',1,0,NULL,NULL,NULL,NULL),(730,NULL,'Overige informatie plante',1,0,NULL,NULL,NULL,NULL),(731,NULL,'Overige informatie snijbl',1,0,NULL,NULL,NULL,NULL),(732,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,NULL,NULL),(733,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,NULL,NULL),(734,NULL,'MPS certificering',1,0,NULL,NULL,NULL,NULL),(735,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,NULL,NULL),(736,NULL,'Artikelomschrijving',1,0,NULL,NULL,NULL,NULL),(737,NULL,'BTW-tarief',1,0,NULL,NULL,NULL,NULL),(738,NULL,'Prijseenheid',1,0,NULL,NULL,NULL,NULL),(739,NULL,'Transactievorm',1,0,NULL,NULL,NULL,NULL),(740,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,NULL,NULL),(741,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,NULL,NULL),(742,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,NULL,NULL),(743,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,NULL,NULL),(744,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,NULL,NULL),(745,NULL,'Algemene voorwaarden',1,0,NULL,NULL,NULL,NULL),(746,NULL,'Marktvorm',1,0,NULL,NULL,NULL,NULL),(747,NULL,'Themadagen',1,0,NULL,NULL,NULL,NULL),(748,NULL,'Handelscategorie',1,0,NULL,NULL,NULL,NULL),(749,NULL,'Producentengroepen',1,0,NULL,NULL,NULL,NULL),(750,NULL,'Favorieten Id',1,0,NULL,NULL,NULL,NULL),(751,NULL,'Verkoopeenheid',1,0,NULL,NULL,NULL,NULL),(752,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,NULL,NULL),(753,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(754,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,NULL,NULL),(755,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,NULL,NULL),(756,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,NULL,NULL),(757,NULL,'FloraHolland Financial',1,0,NULL,NULL,NULL,NULL),(758,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(759,NULL,'Benefiet veiling',1,0,NULL,NULL,NULL,NULL),(760,NULL,'Kloksoort',1,0,NULL,NULL,NULL,NULL),(761,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,NULL,NULL),(762,NULL,'Rest aantallen',1,0,NULL,NULL,NULL,NULL),(763,NULL,'Veilsoort',1,0,NULL,NULL,NULL,NULL),(764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(769,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(770,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,NULL,NULL),(771,NULL,'Gereserveerd',1,0,NULL,NULL,NULL,NULL),(772,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,NULL,NULL),(773,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,NULL,NULL),(774,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,NULL,NULL),(775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(789,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(790,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,NULL,NULL),(791,NULL,'Gereserveerd',1,0,NULL,NULL,NULL,NULL),(792,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,NULL,NULL),(793,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,NULL,NULL),(794,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,NULL,NULL),(795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(809,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(810,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(811,NULL,'Gereserveerd',1,0,NULL,NULL,NULL,NULL),(812,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,NULL,NULL),(813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(825,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(826,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,NULL,NULL),(827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(829,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(830,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,NULL,NULL),(831,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,NULL,NULL),(832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(839,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(840,NULL,'Gereserveerd VRM',1,0,NULL,NULL,NULL,NULL),(841,NULL,'Veiling',1,0,NULL,NULL,NULL,NULL),(842,NULL,'kopersaantallen',1,0,NULL,NULL,NULL,NULL),(843,NULL,'Caducidad',1,0,NULL,NULL,NULL,NULL),(844,NULL,'Lote',1,0,NULL,NULL,NULL,NULL),(845,NULL,'Uds palet',1,0,NULL,NULL,NULL,NULL),(4548,NULL,'fout kenmerk',1,0,NULL,NULL,'081',NULL),(4549,NULL,'Potinhoud',1,0,NULL,NULL,'A01',NULL),(4550,NULL,'Marketingconcept',1,0,NULL,NULL,'A02',NULL),(4551,NULL,'Leeftijd',1,0,NULL,NULL,'A03',NULL),(4552,NULL,'Uitgangsmateriaal',1,0,NULL,NULL,'A04',NULL),(4553,NULL,'Kleurbehandeld',1,0,NULL,NULL,'A05',NULL),(4554,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,'A06',NULL),(4555,NULL,'Verzorging: Water',1,0,NULL,NULL,'A07',NULL),(4556,NULL,'Verzorging: Voeding',1,0,NULL,NULL,'A08',NULL),(4557,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,'A09',NULL),(4558,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,'A10',NULL),(4559,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,'A11',NULL),(4560,NULL,'Nabehandeling',1,0,NULL,NULL,'A13',NULL),(4561,NULL,'Artikel beeld',1,0,NULL,NULL,'A23',NULL),(4562,NULL,'Hoofdkleur 1',1,0,NULL,NULL,'B01',NULL),(4563,NULL,'Hoofdkleur 2',1,0,NULL,NULL,'B02',NULL),(4564,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,'B03',NULL),(4565,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,'B04',NULL),(4566,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,'B05',NULL),(4567,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,'B06',NULL),(4568,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,'B07',NULL),(4569,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,'B08',NULL),(4570,NULL,'Botanisch beeld',1,0,NULL,NULL,'B09',NULL),(4571,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,'B10',NULL),(4572,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,'B11',NULL),(4573,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,'B12',NULL),(4574,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,'B13',NULL),(4575,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,'B14',NULL),(4576,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,'B15',NULL),(4577,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,'B16',NULL),(4578,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,'K01',NULL),(4579,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,'K02',NULL),(4580,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,'K03',NULL),(4581,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K04',NULL),(4582,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,'K05',NULL),(4583,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,'K07',NULL),(4584,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,'K08',NULL),(4585,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,'K11',NULL),(4586,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,'K12',NULL),(4587,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,'K13',NULL),(4588,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,'K14',NULL),(4589,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,'K15',NULL),(4590,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,'K16',NULL),(4591,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,'K17',NULL),(4592,NULL,'Certificaten biologisch',1,0,NULL,NULL,'K18',NULL),(4593,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,'K19',NULL),(4594,NULL,'Certificaten Florimark',1,0,NULL,NULL,'K20',NULL),(4595,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,'K21',NULL),(4596,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,'K22',NULL),(4597,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,'K23',NULL),(4598,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,'K24',NULL),(4599,NULL,'Certificaten ISO',1,0,NULL,NULL,'K25',NULL),(4600,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K26',NULL),(4601,NULL,'Certificaten Florverde',1,0,NULL,NULL,'K27',NULL),(4602,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,'K28',NULL),(4603,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,'K29',NULL),(4604,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,'K30',NULL),(4605,NULL,'Certificaten SAN',1,0,NULL,NULL,'K31',NULL),(4606,NULL,'Certificaten GRASP',1,0,NULL,NULL,'K32',NULL),(4607,NULL,'Label Fair Flora',1,0,NULL,NULL,'K33',NULL),(4608,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,'K34',NULL),(4609,NULL,'Certificaten Vegaplan',1,0,NULL,NULL,'K35',NULL),(4610,NULL,'Floriculture Sustainabili',1,0,NULL,NULL,'K99',NULL),(4611,NULL,'Fust',1,0,NULL,NULL,'L01',NULL),(4612,NULL,'Stapelwagen',1,0,NULL,NULL,'L02',NULL),(4613,NULL,'Aantal legborden veilings',1,0,NULL,NULL,'L03',NULL),(4614,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,'L04',NULL),(4615,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,'L05',NULL),(4616,NULL,'Fustsoort',1,0,NULL,NULL,'L06',NULL),(4617,NULL,'Fustmateriaal',1,0,NULL,NULL,'L07',NULL),(4618,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,'L08',NULL),(4619,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,'L09',NULL),(4620,NULL,'Aantal stelen per bos',1,0,NULL,NULL,'L11',NULL),(4621,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,'L12',NULL),(4622,NULL,'Aantal stuks per fust',1,0,NULL,NULL,'L13',NULL),(4623,NULL,'Aantal bossen per fust',1,0,NULL,NULL,'L14',NULL),(4624,NULL,'Aantal bundels per fust',1,0,NULL,NULL,'L15',NULL),(4625,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,'L16',NULL),(4626,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,'L17',NULL),(4627,NULL,'Fustlabel',1,0,NULL,NULL,'L18',NULL),(4628,NULL,'Karlabel',1,0,NULL,NULL,'L19',NULL),(4629,NULL,'Service productlabel',1,0,NULL,NULL,'L20',NULL),(4630,NULL,'Service fustlabel',1,0,NULL,NULL,'L21',NULL),(4631,NULL,'Service karlabel',1,0,NULL,NULL,'L22',NULL),(4632,NULL,'Aantal fusten per laag',1,0,NULL,NULL,'L23',NULL),(4633,NULL,'Presentatie per schapm2',1,0,NULL,NULL,'L24',NULL),(4634,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,'P01',NULL),(4635,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,'P02',NULL),(4636,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,'P03',NULL),(4637,NULL,'Maceta',1,0,NULL,NULL,'S01',NULL),(4638,NULL,'Altura mínima',1,1,NULL,'cm','S02','size'),(4639,NULL,'nº plantas',1,0,NULL,NULL,'S03',NULL),(4640,NULL,'Minimum plantdiameter',1,0,NULL,NULL,'S04',NULL),(4641,NULL,'Madurez',1,0,NULL,NULL,'S05',NULL),(4642,NULL,'Combinatiehoogte',1,0,NULL,NULL,'S06',NULL),(4643,NULL,'Min aantal koppen hoogste',1,0,NULL,NULL,'S07',NULL),(4644,NULL,'Dikte',1,0,NULL,NULL,'S08',NULL),(4645,NULL,'Min aantal bloemen/bloeiw',1,0,NULL,NULL,'S09',NULL),(4646,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,'S10',NULL),(4647,NULL,'Minimum aantal takken per',1,0,NULL,NULL,'S11',NULL),(4648,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,'S12',NULL),(4649,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,'S13',NULL),(4650,NULL,'Altura tronco',1,1,NULL,'cm','S14','size'),(4651,NULL,'Altura transporte',1,0,NULL,'cm','S15','size'),(4652,NULL,'Lengte scheuten',1,0,NULL,NULL,'S16',NULL),(4653,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,'S17',NULL),(4654,NULL,'Minimum bloemknophoogte',1,0,NULL,NULL,'S19',NULL),(4655,NULL,'Altura',1,1,NULL,'cm','S20','size'),(4656,NULL,'Gewicht (gemiddeld)',1,0,NULL,NULL,'S21',NULL),(4657,NULL,'Aantal bloemknoppen snijb',1,0,NULL,NULL,'S22',NULL),(4658,NULL,'Minimum bloemdiameter',1,0,NULL,NULL,'S23',NULL),(4659,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,'S24',NULL),(4660,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,'S25',NULL),(4661,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S26',NULL),(4662,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S27',NULL),(4663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S28',NULL),(4664,NULL,'Minimum bloeiwijzelengte',1,0,NULL,NULL,'S29',NULL),(4665,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,'S30',NULL),(4666,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,'S31',NULL),(4667,NULL,'Medida',1,0,NULL,'cm','S32',NULL),(4668,NULL,'Jaartal sortering hout',1,0,NULL,NULL,'S33',NULL),(4669,NULL,'Minimum bladdiameter',1,0,NULL,NULL,'S34',NULL),(4670,NULL,'Minimum bundelgewicht',1,0,NULL,NULL,'S35',NULL),(4671,NULL,'Altura máxima',1,0,NULL,NULL,'S36',NULL),(4672,NULL,'Maximum plantdiameter',1,0,NULL,NULL,'S37',NULL),(4673,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,'S38',NULL),(4674,NULL,'Maximum aantal takken per',1,0,NULL,NULL,'S39',NULL),(4675,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,'S40',NULL),(4676,NULL,'Altura máxima',1,0,NULL,NULL,'S41',NULL),(4677,NULL,'Maximum steellengte',1,0,NULL,NULL,'S42',NULL),(4678,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,'S43',NULL),(4679,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,'S44',NULL),(4680,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,'S45',NULL),(4681,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,'S46',NULL),(4682,NULL,'Verpakkingswijze',1,0,NULL,NULL,'S47',NULL),(4683,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,'S48',NULL),(4684,NULL,'Medida',1,1,NULL,'cm','S49','size'),(4685,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,'S50',NULL),(4686,NULL,'Potvorm',1,0,NULL,NULL,'S51',NULL),(4687,NULL,'Potkleur',1,0,NULL,NULL,'S52',NULL),(4688,NULL,'Potmateriaal',1,0,NULL,NULL,'S53',NULL),(4689,NULL,'Plantvorm',1,0,NULL,NULL,'S54',NULL),(4690,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S55',NULL),(4691,NULL,'Teeltwijze',1,0,NULL,NULL,'S56',NULL),(4692,NULL,'Teeltmedium',1,0,NULL,NULL,'S57',NULL),(4693,NULL,'Hoesmateriaal',1,0,NULL,NULL,'S58',NULL),(4694,NULL,'Hoesvorm',1,0,NULL,NULL,'S59',NULL),(4695,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,'S60',NULL),(4696,NULL,'Extra toevoegingen',1,0,NULL,NULL,'S61',NULL),(4697,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,'S62',NULL),(4698,NULL,'Verpakte orchidee',1,0,NULL,NULL,'S63',NULL),(4699,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,'S64',NULL),(4700,NULL,'Voorbehandeling',1,0,NULL,NULL,'S65',NULL),(4701,NULL,'Overige niet in pot',1,0,NULL,NULL,'S66',NULL),(4702,NULL,'Vorm snijbloemen',1,0,NULL,NULL,'S67',NULL),(4703,NULL,'Buigzaamheid bloemsteel',1,0,NULL,NULL,'S68',NULL),(4704,NULL,'Hoeskleur',1,0,NULL,NULL,'S69',NULL),(4705,NULL,'Extra deco materiaal',1,0,NULL,NULL,'S70',NULL),(4706,NULL,'Productkleur',1,0,NULL,NULL,'S71',NULL),(4707,NULL,'Productmateriaal',1,0,NULL,NULL,'S72',NULL),(4708,NULL,'Altura',1,1,NULL,'cm','S73','size'),(4709,NULL,'Materiaaldiameter',1,0,NULL,NULL,'S74',NULL),(4710,NULL,'Barcode',1,0,NULL,NULL,'S75',NULL),(4711,NULL,'Productlabel',1,0,NULL,NULL,'S76',NULL),(4712,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,'S77',NULL),(4713,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,'S78',NULL),(4714,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S79',NULL),(4715,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,'S80',NULL),(4716,NULL,'Maximum lengte verschil',1,0,NULL,NULL,'S81',NULL),(4717,NULL,'Bladkleur',1,0,NULL,NULL,'S82',NULL),(4718,NULL,'Plantgewicht',1,0,NULL,NULL,'S83',NULL),(4719,NULL,'Gemiddelde bloemdiameter',1,0,NULL,NULL,'S84',NULL),(4720,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,'S85',NULL),(4721,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,'S86',NULL),(4722,NULL,'Kleurbehandeld',1,0,NULL,NULL,'S87',NULL),(4723,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,'S88',NULL),(4724,NULL,'Minimum bloemknopdiameter',1,0,NULL,NULL,'S89',NULL),(4725,NULL,'Volume inhoud',1,0,NULL,NULL,'S90',NULL),(4726,NULL,'Vruchtbenaming',1,0,NULL,NULL,'S91',NULL),(4727,NULL,'Vaaslevenindex',1,0,NULL,NULL,'S92',NULL),(4728,NULL,'Overige informatie plante',1,0,NULL,NULL,'S93',NULL),(4729,NULL,'Overige informatie snijbl',1,0,NULL,NULL,'S94',NULL),(4730,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,'S95',NULL),(4731,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,'S96',NULL),(4732,NULL,'MPS certificering',1,0,NULL,NULL,'S97',NULL),(4733,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,'S98',NULL),(4734,NULL,'Artikelomschrijving',1,0,NULL,NULL,'S99',NULL),(4735,NULL,'BTW-tarief',1,0,NULL,NULL,'T01',NULL),(4736,NULL,'Prijseenheid',1,0,NULL,NULL,'T02',NULL),(4737,NULL,'Transactievorm',1,0,NULL,NULL,'T03',NULL),(4738,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,'T10',NULL),(4739,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,'T11',NULL),(4740,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,'T12',NULL),(4741,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,'T13',NULL),(4742,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,'T14',NULL),(4743,NULL,'Algemene voorwaarden',1,0,NULL,NULL,'T15',NULL),(4744,NULL,'Marktvorm',1,0,NULL,NULL,'T16',NULL),(4745,NULL,'Themadagen',1,0,NULL,NULL,'T17',NULL),(4746,NULL,'Handelscategorie',1,0,NULL,NULL,'T18',NULL),(4747,NULL,'Producentengroepen',1,0,NULL,NULL,'T19',NULL),(4748,NULL,'Favorieten Id',1,0,NULL,NULL,'T20',NULL),(4749,NULL,'Verkoopeenheid',1,0,NULL,NULL,'T21',NULL),(4750,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,'V01',NULL),(4751,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V02',NULL),(4752,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,'V03',NULL),(4753,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,'V04',NULL),(4754,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,'V05',NULL),(4755,NULL,'FloraHolland Financial',1,0,NULL,NULL,'V06',NULL),(4756,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V07',NULL),(4757,NULL,'Benefiet veiling',1,0,NULL,NULL,'V08',NULL),(4758,NULL,'Kloksoort',1,0,NULL,NULL,'V09',NULL),(4759,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,'V10',NULL),(4760,NULL,'Rest aantallen',1,0,NULL,NULL,'V11',NULL),(4761,NULL,'Veilsoort',1,0,NULL,NULL,'V12',NULL),(4762,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V13',NULL),(4763,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V14',NULL),(4764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V15',NULL),(4765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V16',NULL),(4766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V17',NULL),(4767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V18',NULL),(4768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V19',NULL),(4769,NULL,'Gereserveerd',1,0,NULL,NULL,'V20',NULL),(4770,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,'V21',NULL),(4771,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,'V22',NULL),(4772,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,'V23',NULL),(4773,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V24',NULL),(4774,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V25',NULL),(4775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V26',NULL),(4776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V27',NULL),(4777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V28',NULL),(4778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V29',NULL),(4779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V30',NULL),(4780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V31',NULL),(4781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V32',NULL),(4782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V33',NULL),(4783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V34',NULL),(4784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V35',NULL),(4785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V36',NULL),(4786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V37',NULL),(4787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V38',NULL),(4788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V39',NULL),(4789,NULL,'Gereserveerd',1,0,NULL,NULL,'V40',NULL),(4790,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,'V41',NULL),(4791,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,'V42',NULL),(4792,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,'V43',NULL),(4793,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V44',NULL),(4794,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V45',NULL),(4795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V46',NULL),(4796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V47',NULL),(4797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V48',NULL),(4798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V49',NULL),(4799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V50',NULL),(4800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V51',NULL),(4801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V52',NULL),(4802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V53',NULL),(4803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V54',NULL),(4804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V55',NULL),(4805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V56',NULL),(4806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V57',NULL),(4807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V58',NULL),(4808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V59',NULL),(4809,NULL,'Gereserveerd',1,0,NULL,NULL,'V60',NULL),(4810,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,'V61',NULL),(4811,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V62',NULL),(4812,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V63',NULL),(4813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V64',NULL),(4814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V65',NULL),(4815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V66',NULL),(4816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V67',NULL),(4817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V68',NULL),(4818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V69',NULL),(4819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V70',NULL),(4820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V71',NULL),(4821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V72',NULL),(4822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V73',NULL),(4823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V74',NULL),(4824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V75',NULL),(4825,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V76',NULL),(4826,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V77',NULL),(4827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V78',NULL),(4828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V79',NULL),(4829,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,'V80',NULL),(4830,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V81',NULL),(4831,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V82',NULL),(4832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V83',NULL),(4833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V84',NULL),(4834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V85',NULL),(4835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V86',NULL),(4836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V87',NULL),(4837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V88',NULL),(4838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V89',NULL),(4839,NULL,'Veiling',1,0,NULL,NULL,'V99',NULL),(4840,NULL,'kopersaantallen',1,0,NULL,NULL,'Z01',NULL),(6514,NULL,'Transporte',1,0,NULL,NULL,NULL,NULL); -/*!40000 ALTER TABLE `tag` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Dumping data for table `time` -- @@ -380,7 +370,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:40:31 +-- Dump completed on 2021-01-07 9:30:15 USE `cache`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -418,7 +408,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:40:32 +-- Dump completed on 2021-01-07 9:30:16 USE `hedera`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -486,7 +476,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:40:34 +-- Dump completed on 2021-01-07 9:30:17 USE `postgresql`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -574,7 +564,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:40:36 +-- Dump completed on 2021-01-07 9:30:19 USE `sage`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -632,4 +622,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:40:38 +-- Dump completed on 2021-01-07 9:30:21 diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index aa15b774f..4f9d2f1ac 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -1085,6 +1085,22 @@ INSERT INTO `vn`.`itemBotanical`(`itemFk`, `botanical`, `genusFk`, `specieFk`) (3, 'Cycas revoluta', 2, NULL), (4, 'Polygonum', NULL, NULL); +INSERT INTO `vn`.`tag`(`id`, `code`, `name`, `isFree`, `isQuantitatif`, `sourceTable`, `unit`, `ediTypeFk`, `overwrite`) + VALUES + (1, 'color', 'Color', 0, 0, 'ink', NULL, NULL, 'inkFk'), + (2, NULL, 'Forma', 1, 0, NULL, NULL,NULL, NULL), + (3, NULL, 'Material', 1, 0, NULL, NULL,NULL, NULL), + (4, NULL, 'Longitud', 1, 1, NULL, 'mm', NULL, 'size'), + (5, NULL, 'Diámetro', 1, 1, NULL, 'mm',NULL, 'diameter'), + (7, NULL, 'Ancho de la base', 1, 1, NULL, 'mm',NULL, NULL), + (23, 'stems', 'Tallos', 1, 1, NULL, NULL, NULL, 'stems'), + (27, NULL, 'Longitud(cm)', 1, 1, NULL, 'cm', NULL, NULL), + (36, NULL, 'Proveedor', 1, 0, NULL, NULL, NULL, NULL), + (56, NULL, 'Genero', 1, 0, NULL, NULL, NULL, NULL), + (58, NULL, 'Variedad', 1, 0, NULL, NULL, NULL, NULL), + (67, 'category', 'Categoria', 1, 0, NULL, NULL, NULL, NULL), + (92, NULL, 'Nombre temporal', 1, 0, NULL, NULL, NULL, NULL); + INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`) VALUES (1, 1, 56, 'Ranged weapon', 1), diff --git a/db/export-data.sh b/db/export-data.sh index b2ba97569..5980b5c29 100755 --- a/db/export-data.sh +++ b/db/export-data.sh @@ -43,7 +43,6 @@ TABLES=( cplusSubjectOp cplusTaxBreak pgc - tag time claimResponsible claimReason From a2550ce128b957fd81040965edba86b327bf9275 Mon Sep 17 00:00:00 2001 From: bernat Date: Fri, 8 Jan 2021 10:24:41 +0100 Subject: [PATCH 3/8] export table payment --- db/dump/structure.sql | 2527 ++++++++++++++++++++++------------------ db/export-structure.sh | 1 - 2 files changed, 1404 insertions(+), 1124 deletions(-) diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 05eceb370..99f500bb3 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -881,52 +881,52 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `passwordGenerate`() RETURNS text CHARSET utf8 COLLATE utf8_unicode_ci READS SQL DATA -BEGIN -/** - * Generates a random password that meets the minimum requirements. - * - * @return Generated password - */ - DECLARE vMinLength TINYINT; - DECLARE vMinAlpha TINYINT; - DECLARE vMinUpper TINYINT; - DECLARE vMinDigits TINYINT; - DECLARE vMinPunct TINYINT; - DECLARE vAlpha TINYINT DEFAULT 0; - DECLARE vUpper TINYINT DEFAULT 0; - DECLARE vDigits TINYINT DEFAULT 0; - DECLARE vPunct TINYINT DEFAULT 0; - DECLARE vRandIndex INT; - DECLARE vPwd TEXT DEFAULT ''; - - DECLARE vAlphaChars TEXT DEFAULT 'abcdefghijklmnopqrstuvwxyz'; - DECLARE vUpperChars TEXT DEFAULT 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - DECLARE vDigitChars TEXT DEFAULT '1234567890'; - DECLARE vPunctChars TEXT DEFAULT '!$%&()=.'; - - SELECT length, nAlpha, nUpper, nDigits, nPunct - INTO vMinLength, vMinAlpha, vMinUpper, vMinDigits, vMinPunct FROM userPassword; - - WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha - OR vUpper < vMinUpper OR vDigits < vMinDigits OR vPunct < vMinPunct DO - SET vRandIndex = FLOOR((RAND() * 4) + 1); - - CASE - WHEN vRandIndex = 1 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vAlphaChars, FLOOR((RAND() * 26) + 1), 1)); - SET vAlpha = vAlpha + 1; - WHEN vRandIndex = 2 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vUpperChars, FLOOR((RAND() * 26) + 1), 1)); - SET vUpper = vUpper + 1; - WHEN vRandIndex = 3 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vDigitChars, FLOOR((RAND() * 10) + 1), 1)); - SET vDigits = vDigits + 1; - WHEN vRandIndex = 4 THEN - SET vPwd = CONCAT(vPwd, SUBSTRING(vPunctChars, FLOOR((RAND() * LENGTH(vPunctChars)) + 1), 1)); - SET vPunct = vPunct + 1; - END CASE; - END WHILE; - RETURN vPwd; +BEGIN +/** + * Generates a random password that meets the minimum requirements. + * + * @return Generated password + */ + DECLARE vMinLength TINYINT; + DECLARE vMinAlpha TINYINT; + DECLARE vMinUpper TINYINT; + DECLARE vMinDigits TINYINT; + DECLARE vMinPunct TINYINT; + DECLARE vAlpha TINYINT DEFAULT 0; + DECLARE vUpper TINYINT DEFAULT 0; + DECLARE vDigits TINYINT DEFAULT 0; + DECLARE vPunct TINYINT DEFAULT 0; + DECLARE vRandIndex INT; + DECLARE vPwd TEXT DEFAULT ''; + + DECLARE vAlphaChars TEXT DEFAULT 'abcdefghijklmnopqrstuvwxyz'; + DECLARE vUpperChars TEXT DEFAULT 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + DECLARE vDigitChars TEXT DEFAULT '1234567890'; + DECLARE vPunctChars TEXT DEFAULT '!$%&()=.'; + + SELECT length, nAlpha, nUpper, nDigits, nPunct + INTO vMinLength, vMinAlpha, vMinUpper, vMinDigits, vMinPunct FROM userPassword; + + WHILE LENGTH(vPwd) < vMinLength OR vAlpha < vMinAlpha + OR vUpper < vMinUpper OR vDigits < vMinDigits OR vPunct < vMinPunct DO + SET vRandIndex = FLOOR((RAND() * 4) + 1); + + CASE + WHEN vRandIndex = 1 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vAlphaChars, FLOOR((RAND() * 26) + 1), 1)); + SET vAlpha = vAlpha + 1; + WHEN vRandIndex = 2 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vUpperChars, FLOOR((RAND() * 26) + 1), 1)); + SET vUpper = vUpper + 1; + WHEN vRandIndex = 3 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vDigitChars, FLOOR((RAND() * 10) + 1), 1)); + SET vDigits = vDigits + 1; + WHEN vRandIndex = 4 THEN + SET vPwd = CONCAT(vPwd, SUBSTRING(vPunctChars, FLOOR((RAND() * LENGTH(vPunctChars)) + 1), 1)); + SET vPunct = vPunct + 1; + END CASE; + END WHILE; + RETURN vPwd; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -1019,11 +1019,11 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `userGetNameFromId__`(vSelf INT) RETURNS varchar(30) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC -BEGIN -/** - * @deprecated Use user_getNameFromId(); - */ - RETURN user_getNameFromId(vSelf); +BEGIN +/** + * @deprecated Use user_getNameFromId(); + */ + RETURN user_getNameFromId(vSelf); END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -1088,22 +1088,22 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `user_getMysqlRole`(vUserName VARCHAR(255)) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC -BEGIN -/** - * From a username, it returns the associated MySQL wich should be used when - * using external authentication systems. - * - * @param vUserName The user name - * @return The associated MySQL role - */ - DECLARE vRole VARCHAR(255); - - SELECT CONCAT(IF(r.hasLogin, 'z-', ''), r.name) INTO vRole - FROM role r - JOIN user u ON u.role = r.id - WHERE u.name = vUserName; - - RETURN vRole; +BEGIN +/** + * From a username, it returns the associated MySQL wich should be used when + * using external authentication systems. + * + * @param vUserName The user name + * @return The associated MySQL role + */ + DECLARE vRole VARCHAR(255); + + SELECT CONCAT(IF(r.hasLogin, 'z-', ''), r.name) INTO vRole + FROM role r + JOIN user u ON u.role = r.id + WHERE u.name = vUserName; + + RETURN vRole; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -1122,20 +1122,20 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `user_getNameFromId`(vSelf INT) RETURNS varchar(30) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC -BEGIN -/** - * Gets user name from it's id. - * - * @param vSelf The user id - * @return The user name - */ - DECLARE vName VARCHAR(30); - - SELECT `name` INTO vName - FROM user - WHERE id = vSelf; - - RETURN vName; +BEGIN +/** + * Gets user name from it's id. + * + * @param vSelf The user id + * @return The user name + */ + DECLARE vName VARCHAR(30); + + SELECT `name` INTO vName + FROM user + WHERE id = vSelf; + + RETURN vName; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -4770,16 +4770,16 @@ BEGIN * La tabla mana_spellers es una caché * */ - - UPDATE mana_spellers me - JOIN - (SELECT Id_Trabajador, FLOOR(SUM(importe)/12) as pesoCarteraMensual - FROM bs.vendedores - WHERE año * 100 + mes >= (YEAR(CURDATE()) -1) * 100 + MONTH(CURDATE()) - GROUP BY Id_Trabajador - ) lastYearSales USING(Id_Trabajador) - SET me.prices_modifier_rate = GREATEST(me.minRate,LEAST(me.maxRate,ROUND(- me.used/lastYearSales.pesoCarteraMensual,3))) ; - + + UPDATE mana_spellers me + JOIN + (SELECT Id_Trabajador, FLOOR(SUM(importe)/12) as pesoCarteraMensual + FROM bs.vendedores + WHERE año * 100 + mes >= (YEAR(CURDATE()) -1) * 100 + MONTH(CURDATE()) + GROUP BY Id_Trabajador + ) lastYearSales USING(Id_Trabajador) + SET me.prices_modifier_rate = GREATEST(me.minRate,LEAST(me.maxRate,ROUND(- me.used/lastYearSales.pesoCarteraMensual,3))) ; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -5196,46 +5196,46 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`z-developer`@`%` PROCEDURE `saleGraphic`(vItemFk INT, - vTypeFk INT, - vCategoryFk INT, - vFromDate DATE, - vToDate DATE, +CREATE DEFINER=`z-developer`@`%` PROCEDURE `saleGraphic`(vItemFk INT, + vTypeFk INT, + vCategoryFk INT, + vFromDate DATE, + vToDate DATE, vProducerFk INT) -BEGIN - - DECLARE vFromDateLastYear DATE; - DECLARE vToDateLastYear DATE; - DECLARE vFromDateTwoYearsAgo DATE; - DECLARE vToDateTwoYearsAgo DATE; - - SET vItemFk = IFNULL(vItemFk,0); - SET vTypeFk = IFNULL(vTypeFk, 0); - SET vCategoryFk = IFNULL(vCategoryFk,0); - SET vFromDate = IFNULL(vFromDate,CURDATE()); - SET vToDate = IFNULL(vToDate,CURDATE()); - SET vProducerFk = IFNULL(vProducerFk,0); - - SET vFromDateLastYear = TIMESTAMPADD(YEAR,-1,vFromDate); - SET vToDateLastYear = TIMESTAMPADD(YEAR,-1,vToDate); - SET vFromDateTwoYearsAgo = TIMESTAMPADD(YEAR,-2,vFromDate); - SET vToDateTwoYearsAgo = TIMESTAMPADD(YEAR,-2,vToDate); - - SELECT s.quantity, CAST(v.importe AS DECIMAL(10,0)) importe, v.fecha - FROM bs.ventas v - JOIN vn.sale s ON s.id = v.Id_Movimiento - JOIN vn.item i ON i.id = s.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - WHERE vItemFk IN (i.id, 0) - AND vTypeFk IN (i.typeFk, 0) - AND vCategoryFk IN (it.categoryFk, 0) - AND vProducerFk IN (i.producerFk, 0) - AND (v.fecha BETWEEN vFromDate AND vToDate - OR v.fecha BETWEEN vFromDateLastYear AND vToDateLastYear - OR v.fecha BETWEEN vFromDateTwoYearsAgo AND vToDateTwoYearsAgo - ); - +BEGIN + + DECLARE vFromDateLastYear DATE; + DECLARE vToDateLastYear DATE; + DECLARE vFromDateTwoYearsAgo DATE; + DECLARE vToDateTwoYearsAgo DATE; + + SET vItemFk = IFNULL(vItemFk,0); + SET vTypeFk = IFNULL(vTypeFk, 0); + SET vCategoryFk = IFNULL(vCategoryFk,0); + SET vFromDate = IFNULL(vFromDate,CURDATE()); + SET vToDate = IFNULL(vToDate,CURDATE()); + SET vProducerFk = IFNULL(vProducerFk,0); + + SET vFromDateLastYear = TIMESTAMPADD(YEAR,-1,vFromDate); + SET vToDateLastYear = TIMESTAMPADD(YEAR,-1,vToDate); + SET vFromDateTwoYearsAgo = TIMESTAMPADD(YEAR,-2,vFromDate); + SET vToDateTwoYearsAgo = TIMESTAMPADD(YEAR,-2,vToDate); + + SELECT s.quantity, CAST(v.importe AS DECIMAL(10,0)) importe, v.fecha + FROM bs.ventas v + JOIN vn.sale s ON s.id = v.Id_Movimiento + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + WHERE vItemFk IN (i.id, 0) + AND vTypeFk IN (i.typeFk, 0) + AND vCategoryFk IN (it.categoryFk, 0) + AND vProducerFk IN (i.producerFk, 0) + AND (v.fecha BETWEEN vFromDate AND vToDate + OR v.fecha BETWEEN vFromDateLastYear AND vToDateLastYear + OR v.fecha BETWEEN vFromDateTwoYearsAgo AND vToDateTwoYearsAgo + ); + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7084,9 +7084,9 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cacheCalc_clean`() -BEGIN - DECLARE vCleanTime DATETIME DEFAULT TIMESTAMPADD(MINUTE, -5, NOW()); - DELETE FROM cache_calc WHERE expires < vCleanTime; +BEGIN + DECLARE vCleanTime DATETIME DEFAULT TIMESTAMPADD(MINUTE, -5, NOW()); + DELETE FROM cache_calc WHERE expires < vCleanTime; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7104,27 +7104,27 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_calc_end`(IN `v_calc` INT) -BEGIN - DECLARE v_cache_name VARCHAR(255); - DECLARE v_params VARCHAR(255); - - -- Libera el bloqueo y actualiza la fecha de ultimo refresco. - - UPDATE cache_calc cc JOIN cache c ON c.id = cc.cache_id - SET - cc.last_refresh = NOW(), - cc.expires = ADDTIME(NOW(), c.lifetime), - cc.connection_id = NULL - WHERE cc.id = v_calc; - - SELECT c.name, ca.params INTO v_cache_name, v_params - FROM cache c - JOIN cache_calc ca ON c.id = ca.cache_id - WHERE ca.id = v_calc; - - IF v_cache_name IS NOT NULL THEN - DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); - END IF; +BEGIN + DECLARE v_cache_name VARCHAR(255); + DECLARE v_params VARCHAR(255); + + -- Libera el bloqueo y actualiza la fecha de ultimo refresco. + + UPDATE cache_calc cc JOIN cache c ON c.id = cc.cache_id + SET + cc.last_refresh = NOW(), + cc.expires = ADDTIME(NOW(), c.lifetime), + cc.connection_id = NULL + WHERE cc.id = v_calc; + + SELECT c.name, ca.params INTO v_cache_name, v_params + FROM cache c + JOIN cache_calc ca ON c.id = ca.cache_id + WHERE ca.id = v_calc; + + IF v_cache_name IS NOT NULL THEN + DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); + END IF; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7142,88 +7142,88 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_calc_start`(OUT `v_calc` INT, INOUT `v_refresh` INT, IN `v_cache_name` VARCHAR(50), IN `v_params` VARCHAR(100)) -proc: BEGIN - DECLARE v_valid BOOL; - DECLARE v_lock_id VARCHAR(100); - DECLARE v_cache_id INT; - DECLARE v_expires DATETIME; - DECLARE v_clean_time DATETIME; - - DECLARE EXIT HANDLER FOR SQLEXCEPTION - BEGIN - IF v_lock_id IS NOT NULL THEN - DO RELEASE_LOCK(v_lock_id); - END IF; - - RESIGNAL; - END; - - SET v_params = IFNULL(v_params, ''); - - -- Si el servidor se ha reiniciado invalida todos los calculos. - - SELECT COUNT(*) > 0 INTO v_valid FROM cache_valid; - - IF !v_valid - THEN - DELETE FROM cache_calc; - INSERT INTO cache_valid (valid) VALUES (TRUE); - END IF; - - -- Obtiene un bloqueo exclusivo para que no haya problemas de concurrencia. - - SET v_lock_id = CONCAT_WS('/', v_cache_name, v_params); - - IF !GET_LOCK(v_lock_id, 30) - THEN - SET v_calc = NULL; - SET v_refresh = FALSE; - LEAVE proc; - END IF; - - -- Comprueba si el calculo solicitado existe y esta actualizado. - - SELECT c.id, ca.id, ca.expires - INTO v_cache_id, v_calc, v_expires - FROM cache c - LEFT JOIN cache_calc ca - ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci' - WHERE c.name = v_cache_name COLLATE 'utf8_general_ci'; - - -- Si existe una calculo valido libera el bloqueo y devuelve su identificador. - - IF !v_refresh AND NOW() < v_expires - THEN - DO RELEASE_LOCK(v_lock_id); - SET v_refresh = FALSE; - LEAVE proc; - END IF; - - -- Si el calculo no existe le crea una entrada en la tabla de calculos. - - IF v_calc IS NULL - THEN - INSERT INTO cache_calc SET - cache_id = v_cache_id, - cacheName = v_cache_name, - params = v_params, - last_refresh = NULL, - expires = NULL, - connection_id = CONNECTION_ID(); - - SET v_calc = LAST_INSERT_ID(); - ELSE - UPDATE cache_calc - SET - last_refresh = NULL, - expires = NULL, - connection_id = CONNECTION_ID() - WHERE id = v_calc; - END IF; - - -- Si se debe recalcular mantiene el bloqueo y devuelve su identificador. - - SET v_refresh = TRUE; +proc: BEGIN + DECLARE v_valid BOOL; + DECLARE v_lock_id VARCHAR(100); + DECLARE v_cache_id INT; + DECLARE v_expires DATETIME; + DECLARE v_clean_time DATETIME; + + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + IF v_lock_id IS NOT NULL THEN + DO RELEASE_LOCK(v_lock_id); + END IF; + + RESIGNAL; + END; + + SET v_params = IFNULL(v_params, ''); + + -- Si el servidor se ha reiniciado invalida todos los calculos. + + SELECT COUNT(*) > 0 INTO v_valid FROM cache_valid; + + IF !v_valid + THEN + DELETE FROM cache_calc; + INSERT INTO cache_valid (valid) VALUES (TRUE); + END IF; + + -- Obtiene un bloqueo exclusivo para que no haya problemas de concurrencia. + + SET v_lock_id = CONCAT_WS('/', v_cache_name, v_params); + + IF !GET_LOCK(v_lock_id, 30) + THEN + SET v_calc = NULL; + SET v_refresh = FALSE; + LEAVE proc; + END IF; + + -- Comprueba si el calculo solicitado existe y esta actualizado. + + SELECT c.id, ca.id, ca.expires + INTO v_cache_id, v_calc, v_expires + FROM cache c + LEFT JOIN cache_calc ca + ON ca.cache_id = c.id AND ca.params = v_params COLLATE 'utf8_general_ci' + WHERE c.name = v_cache_name COLLATE 'utf8_general_ci'; + + -- Si existe una calculo valido libera el bloqueo y devuelve su identificador. + + IF !v_refresh AND NOW() < v_expires + THEN + DO RELEASE_LOCK(v_lock_id); + SET v_refresh = FALSE; + LEAVE proc; + END IF; + + -- Si el calculo no existe le crea una entrada en la tabla de calculos. + + IF v_calc IS NULL + THEN + INSERT INTO cache_calc SET + cache_id = v_cache_id, + cacheName = v_cache_name, + params = v_params, + last_refresh = NULL, + expires = NULL, + connection_id = CONNECTION_ID(); + + SET v_calc = LAST_INSERT_ID(); + ELSE + UPDATE cache_calc + SET + last_refresh = NULL, + expires = NULL, + connection_id = CONNECTION_ID() + WHERE id = v_calc; + END IF; + + -- Si se debe recalcular mantiene el bloqueo y devuelve su identificador. + + SET v_refresh = TRUE; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7241,24 +7241,24 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_calc_unlock`(IN `v_calc` INT) -proc: BEGIN - DECLARE v_cache_name VARCHAR(50); - DECLARE v_params VARCHAR(100); - - IF v_calc IS NULL THEN - LEAVE proc; - END IF; - - SELECT c.name, ca.params INTO v_cache_name, v_params - FROM cache c - JOIN cache_calc ca ON c.id = ca.cache_id - WHERE ca.id = v_calc; - - DELETE FROM cache_calc WHERE id = v_calc; - - IF v_cache_name IS NOT NULL THEN - DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); - END IF; +proc: BEGIN + DECLARE v_cache_name VARCHAR(50); + DECLARE v_params VARCHAR(100); + + IF v_calc IS NULL THEN + LEAVE proc; + END IF; + + SELECT c.name, ca.params INTO v_cache_name, v_params + FROM cache c + JOIN cache_calc ca ON c.id = ca.cache_id + WHERE ca.id = v_calc; + + DELETE FROM cache_calc WHERE id = v_calc; + + IF v_cache_name IS NOT NULL THEN + DO RELEASE_LOCK(CONCAT_WS('/', v_cache_name, IFNULL(v_params, ''))); + END IF; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7277,9 +7277,9 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `cache_clean`() NO SQL -BEGIN - CALL available_clean; - CALL visible_clean; +BEGIN + CALL available_clean; + CALL visible_clean; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -7297,13 +7297,13 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `clean`() -BEGIN - - DECLARE vDateShort DATETIME; - - SET vDateShort = TIMESTAMPADD(MONTH, -1, CURDATE()); - - DELETE FROM cache.departure_limit WHERE Fecha < vDateShort; +BEGIN + + DECLARE vDateShort DATETIME; + + SET vDateShort = TIMESTAMPADD(MONTH, -1, CURDATE()); + + DELETE FROM cache.departure_limit WHERE Fecha < vDateShort; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -9202,154 +9202,154 @@ CREATE DEFINER=`root`@`%` PROCEDURE `exchange_new`( IN `vAuction` SMALLINT, IN `vPackage` INT, IN `vPutOrderFk` INT) -BEGIN +BEGIN /** * Adds a new exchange, generates it's barcode and * inserts/updates the transaction. When the referenced * transaction exists as provisional, updates it with - * the new values. - */ - DECLARE vEkt INT; - DECLARE vRewriteKop INT DEFAULT NULL; - DECLARE vBarcode CHAR(15) DEFAULT NULL; - DECLARE vIsDuplicated BOOL; + * the new values. + */ + DECLARE vEkt INT; + DECLARE vRewriteKop INT DEFAULT NULL; + DECLARE vBarcode CHAR(15) DEFAULT NULL; + DECLARE vIsDuplicated BOOL; DECLARE vUpdateExistent BOOL DEFAULT FALSE; - DECLARE duplicateKey CONDITION FOR 1062; + DECLARE duplicateKey CONDITION FOR 1062; + + DECLARE CONTINUE HANDLER FOR duplicateKey + SET vIsDuplicated = TRUE; + + -- Generates the barcode + + IF vAgj != 0 AND vAgj IS NOT NULL + THEN + SET vBarcode = CONCAT( + LPAD(vAuction, 2, 0), + LPAD(IFNULL(vClock, 99), 2, 0), + LPAD(DAYOFYEAR(vDate), 3, 0), + IF(vClock IS NULL OR vClock = 99, + LPAD(vAgj, 7, 0), + CONCAT(LPAD(vAgj, 5, 0), '01') + ), + '0' + ); + END IF; + + -- Rewrites the kop parameter + + IF vKop IS NULL THEN + SELECT defaultKop INTO vKop FROM exchangeConfig; + END IF; + + SELECT e.kop INTO vRewriteKop + FROM mailSender e + JOIN mail m ON m.senderFk = e.id + WHERE m.id = vMailFk; + + SET vKop = IFNULL(vRewriteKop, vKop); + + -- Inserts the new transaction - DECLARE CONTINUE HANDLER FOR duplicateKey - SET vIsDuplicated = TRUE; - - -- Generates the barcode - - IF vAgj != 0 AND vAgj IS NOT NULL - THEN - SET vBarcode = CONCAT( - LPAD(vAuction, 2, 0), - LPAD(IFNULL(vClock, 99), 2, 0), - LPAD(DAYOFYEAR(vDate), 3, 0), - IF(vClock IS NULL OR vClock = 99, - LPAD(vAgj, 7, 0), - CONCAT(LPAD(vAgj, 5, 0), '01') - ), - '0' - ); - END IF; - - -- Rewrites the kop parameter - - IF vKop IS NULL THEN - SELECT defaultKop INTO vKop FROM exchangeConfig; - END IF; - - SELECT e.kop INTO vRewriteKop - FROM mailSender e - JOIN mail m ON m.senderFk = e.id - WHERE m.id = vMailFk; - - SET vKop = IFNULL(vRewriteKop, vKop); - - -- Inserts the new transaction - - SET vIsDuplicated = FALSE; - INSERT INTO ekt SET - barcode = IFNULL(vBarcode, barcode) - ,deliveryNumber = vDeliveryNumber - ,entryYear = YEAR(vDate) - ,fec = vDate - ,hor = vHour - ,ref = vRef - ,item = vItem - ,agj = vAgj - ,cat = vCat - ,pac = vPac - ,sub = vSub - ,kop = vKop - ,ptd = vPtd - ,pro = vPro - ,ori = vOrigin - ,ptj = vPtj - ,qty = vQuantiy - ,pri = vPrice - ,klo = vClock - ,s1 = vS1 - ,s2 = vS2 - ,s3 = vS3 - ,s4 = vS4 - ,s5 = vS5 - ,s6 = vS6 - ,k1 = vK1 - ,k2 = vK2 - ,k3 = vP1 - ,k4 = vP2 - ,auction = vAuction - ,package = vPackage - ,putOrderFk = vPutOrderFk; - - -- If it exists duplicado updates it - - IF NOT vIsDuplicated - THEN - SET vEkt = LAST_INSERT_ID(); - CALL ekt_load (vEkt); - - ELSEIF vDeliveryNumber != 0 - AND vDeliveryNumber IS NOT NULL - THEN - SELECT id INTO vEkt - FROM ekt - WHERE deliveryNumber = vDeliveryNumber; - - SELECT COUNT(*) = 0 INTO vUpdateExistent - FROM ekt t - JOIN `exchange` b ON b.ektFk = t.id - JOIN exchangeConfig c - WHERE t.deliveryNumber = vDeliveryNumber - AND t.entryYear = YEAR(vDate) - AND b.typeFk != c.presaleFk; - END IF; - - IF vUpdateExistent - THEN - UPDATE ekt SET - barcode = IFNULL(vBarcode, barcode) - ,fec = vDate - ,hor = vHour - ,ref = vRef - ,item = vItem - ,agj = vAgj - ,cat = vCat - ,pac = vPac - ,sub = vSub - ,kop = vKop - ,ptd = vPtd - ,pro = vPro - ,ori = vOrigin - ,ptj = vPtj - ,qty = vQuantiy - ,pri = vPrice - ,klo = vClock - ,s1 = vS1 - ,s2 = vS2 - ,s3 = vS3 - ,s4 = vS4 - ,s5 = vS5 - ,s6 = vS6 - ,k1 = vK1 - ,k2 = vK2 - ,k3 = vP1 - ,k4 = vP2 - ,auction = vAuction - ,package = vPackage - ,putOrderFk = IFNULL(vPutOrderFk, putOrderFk) - WHERE id = vEkt; - END IF; - - -- Registers the exchange - - INSERT INTO `exchange` SET - mailFk = vMailFk - ,typeFk = vType - ,ektFk = vEkt; + SET vIsDuplicated = FALSE; + INSERT INTO ekt SET + barcode = IFNULL(vBarcode, barcode) + ,deliveryNumber = vDeliveryNumber + ,entryYear = YEAR(vDate) + ,fec = vDate + ,hor = vHour + ,ref = vRef + ,item = vItem + ,agj = vAgj + ,cat = vCat + ,pac = vPac + ,sub = vSub + ,kop = vKop + ,ptd = vPtd + ,pro = vPro + ,ori = vOrigin + ,ptj = vPtj + ,qty = vQuantiy + ,pri = vPrice + ,klo = vClock + ,s1 = vS1 + ,s2 = vS2 + ,s3 = vS3 + ,s4 = vS4 + ,s5 = vS5 + ,s6 = vS6 + ,k1 = vK1 + ,k2 = vK2 + ,k3 = vP1 + ,k4 = vP2 + ,auction = vAuction + ,package = vPackage + ,putOrderFk = vPutOrderFk; + + -- If it exists duplicado updates it + + IF NOT vIsDuplicated + THEN + SET vEkt = LAST_INSERT_ID(); + CALL ekt_load (vEkt); + + ELSEIF vDeliveryNumber != 0 + AND vDeliveryNumber IS NOT NULL + THEN + SELECT id INTO vEkt + FROM ekt + WHERE deliveryNumber = vDeliveryNumber; + + SELECT COUNT(*) = 0 INTO vUpdateExistent + FROM ekt t + JOIN `exchange` b ON b.ektFk = t.id + JOIN exchangeConfig c + WHERE t.deliveryNumber = vDeliveryNumber + AND t.entryYear = YEAR(vDate) + AND b.typeFk != c.presaleFk; + END IF; + + IF vUpdateExistent + THEN + UPDATE ekt SET + barcode = IFNULL(vBarcode, barcode) + ,fec = vDate + ,hor = vHour + ,ref = vRef + ,item = vItem + ,agj = vAgj + ,cat = vCat + ,pac = vPac + ,sub = vSub + ,kop = vKop + ,ptd = vPtd + ,pro = vPro + ,ori = vOrigin + ,ptj = vPtj + ,qty = vQuantiy + ,pri = vPrice + ,klo = vClock + ,s1 = vS1 + ,s2 = vS2 + ,s3 = vS3 + ,s4 = vS4 + ,s5 = vS5 + ,s6 = vS6 + ,k1 = vK1 + ,k2 = vK2 + ,k3 = vP1 + ,k4 = vP2 + ,auction = vAuction + ,package = vPackage + ,putOrderFk = IFNULL(vPutOrderFk, putOrderFk) + WHERE id = vEkt; + END IF; + + -- Registers the exchange + + INSERT INTO `exchange` SET + mailFk = vMailFk + ,typeFk = vType + ,ektFk = vEkt; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -11840,30 +11840,30 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `item_listAllocation`(IN `vWh` TINYINT, IN `vDate` DATE, IN `vType` INT, IN `vPrefix` VARCHAR(255), IN `vUseIds` BOOLEAN) -BEGIN -/** - * Lists visible items and it's box sizes of the specified - * type at specified date. - * - * @param vWh The warehouse id - * @param vDate The visible date - * @param vType The type id - * @param vPrefix The article prefix to filter or %NULL for all - * @param vUseIds Whether to order the result by item id - * @select List of visible items with it's box sizes - */ - CALL item_getVisible(vWh, vDate, vType, vPrefix); - - IF vUseIds - THEN - SELECT * FROM tmp.itemVisible - ORDER BY Id_Article; - ELSE - SELECT * FROM tmp.itemVisible - ORDER BY Article, packing; - END IF; - - DROP TEMPORARY TABLE tmp.itemVisible; +BEGIN +/** + * Lists visible items and it's box sizes of the specified + * type at specified date. + * + * @param vWh The warehouse id + * @param vDate The visible date + * @param vType The type id + * @param vPrefix The article prefix to filter or %NULL for all + * @param vUseIds Whether to order the result by item id + * @select List of visible items with it's box sizes + */ + CALL item_getVisible(vWh, vDate, vType, vPrefix); + + IF vUseIds + THEN + SELECT * FROM tmp.itemVisible + ORDER BY Id_Article; + ELSE + SELECT * FROM tmp.itemVisible + ORDER BY Article, packing; + END IF; + + DROP TEMPORARY TABLE tmp.itemVisible; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -13144,9 +13144,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 ;; @@ -13162,7 +13162,7 @@ BEGIN DECLARE vOk BOOL; DECLARE vDone BOOL DEFAULT FALSE; DECLARE vWarehouse INT; - DECLARE vShipment DATETIME; + DECLARE vShipment DATE; DECLARE vTicket INT; DECLARE vNotes VARCHAR(255); DECLARE vItem INT; @@ -16842,7 +16842,7 @@ CREATE TABLE `clientesProveedores` ( `IBAN` varchar(34) COLLATE utf8_unicode_ci NOT NULL, `CodigoCondiciones` smallint(6) NOT NULL, `StatusTraspasadoIME` tinyint(4) NOT NULL, - `TipoImportacionIME` tinyint(4) NOT NULL, + `TipoImportacionIME` tinyint(4) NOT NULL DEFAULT '2', `TipoPlanCuentaIME` smallint(6) NOT NULL DEFAULT '2', `Contrapartida` varchar(15) COLLATE utf8_unicode_ci NOT NULL, `CodigoCuentaImpagado` varchar(15) COLLATE utf8_unicode_ci NOT NULL, @@ -17481,8 +17481,7 @@ BEGIN */ TRUNCATE XDiario_movConta_IVA; - DELETE FROM movConta WHERE enlazadoSage = FALSE ; - + DELETE FROM movConta WHERE enlazadoSage = FALSE AND Asiento <> 1 ; CALL clientesProveedoresAdd; CALL planCuentasPgcAdd; CALL XDiario_movConta_IVA_InvoiceOutAdd_Manager; @@ -17588,7 +17587,7 @@ BEGIN IF(x.EURODEBE,x.EURODEBE,x.EUROHABER) AS ImporteAsiento, -- DOBLE(19) MONTH(x.FECHA) AS NumeroPeriodo, -- ENT(2) "-1" Al informar este valor se calcula automát. A partir de la fecha de asiento IF( sub2.FECREGCON IS NULL, sub2.FECHA_EX, sub2.FECREGCON) FechaGrabacion, -- FECHA(8) - IFNULL(xmi.CodigoDivisa, sub3.code) CodigoDivisa, -- VARCHAR(3) + IF(x.CAMBIO,IFNULL(xmi.CodigoDivisa, sub3.code),'') CodigoDivisa, -- VARCHAR(3) x.CAMBIO AS ImporteCambio, -- DOBLE(19) IFNULL(x.DEBEME,x.HABERME) AS ImporteDivisa, -- DOBLE(19) IF(x.CAMBIO,1,0) AS FactorCambio, -- DOBLE(19) @@ -17675,6 +17674,7 @@ BEGIN LEFT JOIN ( SELECT DISTINCT(account),cu.code FROM vn.bank b JOIN vn.currency cu ON cu.id = b.currencyFk + WHERE cu.code <> "EUR" -- no se informa cuando la divisa en EUR )sub3 ON sub3.account = x.SUBCTA WHERE x.enlazadoSage = 0 AND c.companyCode; @@ -20786,8 +20786,8 @@ DELIMITER ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `log_add_beta__`(IN `vTableName` VARCHAR(255), IN `vNewId` VARCHAR(255), IN `vOldId` VARCHAR(255)) -proc: BEGIN - -- XXX: Disabled while testing +proc: BEGIN + -- XXX: Disabled while testing DECLARE vLanded DATE; DECLARE vWarehouseFk INT; DECLARE vBuyerFk INT; @@ -20795,20 +20795,20 @@ proc: BEGIN DECLARE vItemFk INT; DECLARE vItemName VARCHAR(50); - -- LEAVE proc; + -- LEAVE proc; - IF vOldId IS NOT NULL AND !(vOldId <=> vNewId) THEN - INSERT IGNORE INTO `log` SET - tableName = vTableName, - tableId = vOldId, - operation = 'delete'; - END IF; - - IF vNewId IS NOT NULL THEN - INSERT IGNORE INTO `log` SET - tableName = vTableName, - tableId = vNewId, - operation = 'insert'; + IF vOldId IS NOT NULL AND !(vOldId <=> vNewId) THEN + INSERT IGNORE INTO `log` SET + tableName = vTableName, + tableId = vOldId, + operation = 'delete'; + END IF; + + IF vNewId IS NOT NULL THEN + INSERT IGNORE INTO `log` SET + tableName = vTableName, + tableId = vNewId, + operation = 'insert'; END IF; IF vTableName = 'buy' THEN @@ -20838,7 +20838,7 @@ proc: BEGIN END IF; END IF; - + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -21106,29 +21106,29 @@ CREATE DEFINER=`root`@`%` PROCEDURE `log_refreshSale`( BEGIN DROP TEMPORARY TABLE IF EXISTS tValues; CREATE TEMPORARY TABLE tValues - ENGINE = MEMORY - SELECT - m.id saleFk, - m.ticketFk, - m.itemFk, - t.warehouseFk, - t.shipped, + ENGINE = MEMORY + SELECT + m.id saleFk, + m.ticketFk, + m.itemFk, + t.warehouseFk, + t.shipped, ABS(m.quantity) quantity, m.created, TIMESTAMPADD(DAY, tp.life, t.shipped) expired, m.quantity < 0 isIn, - m.isPicked OR s.alertLevel > 1 isPicked - FROM vn.sale m - JOIN vn.ticket t ON t.id = m.ticketFk + m.isPicked OR s.alertLevel > 1 isPicked + FROM vn.sale m + JOIN vn.ticket t ON t.id = m.ticketFk JOIN vn.ticketState s ON s.ticketFk = t.id JOIN vn.item i ON i.id = m.itemFk - JOIN vn.itemType tp ON tp.id = i.typeFk + JOIN vn.itemType tp ON tp.id = i.typeFk WHERE ( - vTableId IS NULL - OR (vTableName = 'ticket' AND t.id = vTableId) - OR (vTableName = 'sale' AND m.id = vTableId) - ) - AND t.shipped >= vn.getInventoryDate() + vTableId IS NULL + OR (vTableName = 'ticket' AND t.id = vTableId) + OR (vTableName = 'sale' AND m.id = vTableId) + ) + AND t.shipped >= vn.getInventoryDate() AND m.quantity != 0; REPLACE INTO inbound ( @@ -21161,7 +21161,7 @@ BEGIN FROM tValues WHERE !isIn; - DROP TEMPORARY TABLE tValues; + DROP TEMPORARY TABLE tValues; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -28242,10 +28242,10 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_beforeUpdate` BEFORE UPDATE ON `vn`.`invoiceOut` FOR EACH ROW -BEGIN -CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount); -CALL clientRisk_update (NEW.clientFk, NEW.companyFk, NEW.amount); +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`invoiceOut_beforeUpdate` BEFORE UPDATE ON `vn`.`invoiceOut` FOR EACH ROW +BEGIN +CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount); +CALL clientRisk_update (NEW.clientFk, NEW.companyFk, NEW.amount); END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -30637,6 +30637,100 @@ CREATE TABLE `payMethod` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `payment` +-- + +DROP TABLE IF EXISTS `payment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `payment` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `received` date NOT NULL, + `supplierFk` int(11) NOT NULL, + `amount` decimal(10,2) NOT NULL DEFAULT '0.00', + `currencyFk` tinyint(3) unsigned NOT NULL DEFAULT '1', + `divisa` decimal(10,2) DEFAULT NULL, + `bankFk` int(11) NOT NULL DEFAULT '0', + `payMethodFk` tinyint(3) unsigned NOT NULL, + `bankingFees` double(6,2) unsigned NOT NULL DEFAULT '0.00', + `concept` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, + `companyFk` smallint(5) unsigned NOT NULL DEFAULT '442', + `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `isConciliated` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0', + `exchangeInsuranceFk` int(11) DEFAULT NULL, + `dueDated` date DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `empresa_id` (`companyFk`), + KEY `id_banco` (`bankFk`), + KEY `id_moneda` (`currencyFk`), + KEY `pay_met` (`payMethodFk`), + KEY `fk_pago_pago_sdc1_idx` (`exchangeInsuranceFk`), + KEY `pagoDueDatedIdx` (`dueDated`), + KEY `pago_ibfk_3` (`supplierFk`), + CONSTRAINT `pago_ibfk_3` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE, + CONSTRAINT `pago_moneda_1` FOREIGN KEY (`currencyFk`) REFERENCES `currency` (`id`) ON UPDATE CASCADE, + CONSTRAINT `pago_pay_met` FOREIGN KEY (`payMethodFk`) REFERENCES `payMethod` (`id`) ON UPDATE CASCADE, + CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE, + CONSTRAINT `payment_ibfk_2` FOREIGN KEY (`bankFk`) REFERENCES `bank` (`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 = 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 `payment_beforeInsert` BEFORE INSERT ON `payment` FOR EACH ROW +-- Edit trigger body code below this line. Do not edit lines above this one +BEGIN + DECLARE cuenta_banco,cuenta_proveedor DOUBLE; + DECLARE vNewBookEntry INT; + DECLARE bolCASH BOOLEAN; + + -- PAK 10/02/15 No se asientan los pagos directamente, salvo en el caso de las cajas de CASH + SELECT (cash = 1) INTO bolCASH FROM bank WHERE bank.id = NEW.bankFk ; + + IF bolCASH THEN + + SELECT account INTO cuenta_banco + FROM bank + WHERE id = NEW.bankFk; + + SELECT account INTO cuenta_proveedor + FROM supplier + WHERE id = NEW.supplierFk; + + CALL vn.ledger_next(vNewBookEntry); + + INSERT INTO XDiario (ASIEN,FECHA,SUBCTA,CONTRA,CONCEPTO,EURODEBE,EUROHABER,empresa_id) + SELECT vNewBookEntry,NEW.received,SUBCTA,CONTRA,NEW.concept,EURODEBE,EUROHABER,NEW.companyFk + FROM + ( SELECT cuenta_banco SUBCTA,cuenta_proveedor CONTRA,0 EURODEBE, NEW.amount + NEW.bankingFees EUROHABER + UNION ALL + SELECT cuenta_proveedor SUBCTA, cuenta_banco CONTRA,NEW.amount EURODEBE, 0 EUROHABER + ) gf; + + IF NEW.bankingFees <> 0 THEN + INSERT INTO XDiario (ASIEN,FECHA,SUBCTA,CONTRA,CONCEPTO,EURODEBE,EUROHABER,empresa_id) + SELECT vNewBookEntry,NEW.received,IF(c.id = 1,6260000002,IF(CEE = 1,6260000003,6260000004)),cuenta_banco,NEW.concept,NEW.bankingFees,0,NEW.companyFk + FROM supplier s + JOIN country c ON s.countryFk = c.id + WHERE s.id = NEW.supplierFk; + END IF; + END IF; + + SET NEW.dueDated = IFNULL(NEW.dueDated, NEW.received); + 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 */ ; + -- -- Temporary table structure for view `payment__` -- @@ -31635,14 +31729,14 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_afterUpdate` AFTER UPDATE ON `receipt` FOR EACH ROW -BEGIN - IF NEW.isConciliate = FALSE AND NEW.payed > OLD.payed THEN - INSERT INTO vn.mail(`sender`, subject, `body`) - SELECT 'finanzas@verdnatura.es', - CONCAT(' Cambios de recibos del cliente: ', NEW.clientFk), - CONCAT('Se ha cambiado el recibo: ', NEW.Id, ' de ', OLD.payed, ' a ', NEW.payed); - END IF; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`receipt_afterUpdate` AFTER UPDATE ON `receipt` FOR EACH ROW +BEGIN + IF NEW.isConciliate = FALSE AND NEW.payed > OLD.payed THEN + INSERT INTO vn.mail(`sender`, subject, `body`) + SELECT 'finanzas@verdnatura.es', + CONCAT(' Cambios de recibos del cliente: ', NEW.clientFk), + CONCAT('Se ha cambiado el recibo: ', NEW.Id, ' de ', OLD.payed, ' a ', NEW.payed); + END IF; END */;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -33333,7 +33427,26 @@ CREATE TABLE `tag` ( CONSTRAINT `fgnTag` FOREIGN KEY (`ediTypeFk`) REFERENCES `edi`.`type` (`type_id`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Categorias para etiquetar los productos'; /*!40101 SET character_set_client = @saved_cs_client */; - +/*!50003 SET @saved_cs_client = @@character_set_client */ ; +/*!50003 SET @saved_cs_results = @@character_set_results */ ; +/*!50003 SET @saved_col_connection = @@collation_connection */ ; +/*!50003 SET character_set_client = utf8 */ ; +/*!50003 SET character_set_results = utf8 */ ; +/*!50003 SET collation_connection = utf8_general_ci */ ; +/*!50003 SET @saved_sql_mode = @@sql_mode */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; +DELIMITER ;; +/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `vn`.`tag_BEFORE_INSERT` BEFORE INSERT ON `tag` FOR EACH ROW +BEGIN + IF NEW.ediTypeFk IS NULL AND (SELECT COUNT(*) FROM tag WHERE `name` = NEW.`name`) THEN + CALL util.throw('name duplicated'); + 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 `tagAbbreviation` @@ -33622,7 +33735,7 @@ DELIMITER ; /*!50003 SET character_set_results = utf8 */ ; /*!50003 SET collation_connection = utf8_general_ci */ ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; -/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; +/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`%`*/ /*!50003 TRIGGER `ticket_beforeUpdate` BEFORE UPDATE ON `ticket` @@ -33668,6 +33781,9 @@ BEGIN ' a ', TIME(NEW.shipped)); END IF; + INSERT IGNORE INTO zoneAgencyMode (agencyModeFk,zoneFk) + SELECT r.agencyModeFk, NEW.zoneFk FROM route r + WHERE r.id = NEW.routeFk; END IF; END */;; DELIMITER ; @@ -36110,6 +36226,25 @@ CREATE TABLE `zone` ( ) ENGINE=InnoDBDEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `zoneAgencyMode` +-- + +DROP TABLE IF EXISTS `zoneAgencyMode`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `zoneAgencyMode` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `agencyModeFk` int(11) NOT NULL, + `zoneFk` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `zoneAgencyMode_UN` (`agencyModeFk`,`zoneFk`), + KEY `zoneAgencyMode_FK_1` (`zoneFk`), + CONSTRAINT `zoneAgencyMode_FK` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `zoneAgencyMode_FK_1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDBDEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='junta agencias con zonas para que al enrutar se puedan proponer tickets.'; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `zoneClosure` -- @@ -36434,90 +36569,90 @@ DELIMITER ;; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`z-sysadmin`@`%`*/ /*!50106 EVENT `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2019-11-08 00:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Notifica en caso de que el servidor de impresión este parado' DO BEGIN - - DECLARE vCurrentCount INT; - DECLARE vCheckSum INT; - DECLARE vIsAlreadyNotified BOOLEAN; - DECLARE vTableQueue TEXT; - DECLARE vLineQueue TEXT; - DECLARE vDone BOOL DEFAULT FALSE; - DECLARE vCur CURSOR FOR - SELECT CONCAT(' - ', IFNULL(pq.id, ''), ' - ', IFNULL(p.path, ''),' - ', IFNULL(i.Informe, ''),' - ', IFNULL(e.Estado, ''),' - ', IFNULL(w.firstname, ''), " ", IFNULL(w.lastName, ''),' - ', IFNULL(pq.`error`, ''),' - ') - FROM vn.printingQueue pq - LEFT JOIN vn.worker w ON w.id = pq.worker - LEFT JOIN vn.printer p ON p.id = pq.printer - LEFT JOIN vn2008.Informes i ON i.Id_Informe = pq.report - JOIN vn2008.Estados e ON e.Id_Estado = pq.state - LIMIT 30; - - DECLARE CONTINUE HANDLER FOR NOT FOUND - SET vDone = TRUE; - - SELECT COUNT(*), IFNULL(SUM(id),0) INTO vCurrentCount, vCheckSum - FROM vn.printingQueue WHERE state = 1; - - SELECT isAlreadyNotified INTO vIsAlreadyNotified - FROM printingQueueCheck; - - IF (SELECT lastCount FROM printingQueueCheck) = vCurrentCount AND - (SELECT lastCheckSum FROM printingQueueCheck) = vCheckSum AND - vIsAlreadyNotified = FALSE AND vCurrentCount > 0 - THEN - - SELECT ' - - - - - - - - ' INTO vTableQueue; - - OPEN vCur; - - l: LOOP - - SET vDone = FALSE; - - FETCH vCur INTO vLineQueue; - - IF vDone THEN - LEAVE l; - END IF; - - SELECT CONCAT(vTableQueue, vLineQueue) INTO vTableQueue; - - END LOOP; - - CLOSE vCur; - - INSERT INTO vn2008.mail (`to`, subject, text) - VALUES ('cau@verdnatura.es, sysadmin@verdnatura.es', - 'servidor de impresion parado', - CONCAT('Hay ', vCurrentCount, ' lineas bloqueadas', vTableQueue, '
Id ColaRuta ImpresoraInformeEstadoTrabajadorError
')); - - UPDATE printingQueueCheck SET isAlreadyNotified = TRUE; - END IF; - - IF (SELECT lastCount FROM printingQueueCheck) > vCurrentCount AND - vIsAlreadyNotified = TRUE - THEN - UPDATE printingQueueCheck SET isAlreadyNotified = FALSE; - END IF; - - UPDATE printingQueueCheck - SET lastCount = vCurrentCount, - lastCheckSum = vCheckSum; - +/*!50106 CREATE*/ /*!50117 DEFINER=`z-sysadmin`@`%`*/ /*!50106 EVENT `printQueue_check` ON SCHEDULE EVERY 10 MINUTE STARTS '2019-11-08 00:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Notifica en caso de que el servidor de impresión este parado' DO BEGIN + + DECLARE vCurrentCount INT; + DECLARE vCheckSum INT; + DECLARE vIsAlreadyNotified BOOLEAN; + DECLARE vTableQueue TEXT; + DECLARE vLineQueue TEXT; + DECLARE vDone BOOL DEFAULT FALSE; + DECLARE vCur CURSOR FOR + SELECT CONCAT(' + ', IFNULL(pq.id, ''), ' + ', IFNULL(p.path, ''),' + ', IFNULL(i.Informe, ''),' + ', IFNULL(e.Estado, ''),' + ', IFNULL(w.firstname, ''), " ", IFNULL(w.lastName, ''),' + ', IFNULL(pq.`error`, ''),' + ') + FROM vn.printingQueue pq + LEFT JOIN vn.worker w ON w.id = pq.worker + LEFT JOIN vn.printer p ON p.id = pq.printer + LEFT JOIN vn2008.Informes i ON i.Id_Informe = pq.report + JOIN vn2008.Estados e ON e.Id_Estado = pq.state + LIMIT 30; + + DECLARE CONTINUE HANDLER FOR NOT FOUND + SET vDone = TRUE; + + SELECT COUNT(*), IFNULL(SUM(id),0) INTO vCurrentCount, vCheckSum + FROM vn.printingQueue WHERE state = 1; + + SELECT isAlreadyNotified INTO vIsAlreadyNotified + FROM printingQueueCheck; + + IF (SELECT lastCount FROM printingQueueCheck) = vCurrentCount AND + (SELECT lastCheckSum FROM printingQueueCheck) = vCheckSum AND + vIsAlreadyNotified = FALSE AND vCurrentCount > 0 + THEN + + SELECT ' + + + + + + + + ' INTO vTableQueue; + + OPEN vCur; + + l: LOOP + + SET vDone = FALSE; + + FETCH vCur INTO vLineQueue; + + IF vDone THEN + LEAVE l; + END IF; + + SELECT CONCAT(vTableQueue, vLineQueue) INTO vTableQueue; + + END LOOP; + + CLOSE vCur; + + INSERT INTO vn2008.mail (`to`, subject, text) + VALUES ('cau@verdnatura.es, sysadmin@verdnatura.es', + 'servidor de impresion parado', + CONCAT('Hay ', vCurrentCount, ' lineas bloqueadas', vTableQueue, '
Id ColaRuta ImpresoraInformeEstadoTrabajadorError
')); + + UPDATE printingQueueCheck SET isAlreadyNotified = TRUE; + END IF; + + IF (SELECT lastCount FROM printingQueueCheck) > vCurrentCount AND + vIsAlreadyNotified = TRUE + THEN + UPDATE printingQueueCheck SET isAlreadyNotified = FALSE; + END IF; + + UPDATE printingQueueCheck + SET lastCount = vCurrentCount, + lastCheckSum = vCheckSum; + END */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; @@ -36590,27 +36725,27 @@ DELIMITER ;; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;; /*!50003 SET @saved_time_zone = @@time_zone */ ;; /*!50003 SET time_zone = 'SYSTEM' */ ;; -/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`%`*/ /*!50106 EVENT `workerTimeControl_sendMail` ON SCHEDULE EVERY 1 WEEK STARTS '2020-11-25 08:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN - DECLARE vDone BOOL; - DECLARE vWeek,vYear INT; - DECLARE rs CURSOR FOR - SELECT week,year - FROM vn.time - WHERE dated IN (DATE_ADD(CURDATE(), INTERVAL -10 DAY), DATE_ADD(CURDATE(), INTERVAL -4 DAY)) - GROUP BY year,week; - DECLARE CONTINUE HANDLER FOR NOT FOUND - SET vDone = TRUE; - - OPEN rs; - myLoop: LOOP - SET vDone = FALSE; - FETCH rs INTO vWeek, vYear; - IF vDone THEN - LEAVE myLoop; - END IF; - CALL vn.workerTimeControl_sendMail(vWeek, vYear, NULL); - END LOOP; - CLOSE rs; +/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`%`*/ /*!50106 EVENT `workerTimeControl_sendMail` ON SCHEDULE EVERY 1 WEEK STARTS '2020-11-25 08:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN + DECLARE vDone BOOL; + DECLARE vWeek,vYear INT; + DECLARE rs CURSOR FOR + SELECT week,year + FROM vn.time + WHERE dated IN (DATE_ADD(CURDATE(), INTERVAL -10 DAY), DATE_ADD(CURDATE(), INTERVAL -4 DAY)) + GROUP BY year,week; + DECLARE CONTINUE HANDLER FOR NOT FOUND + SET vDone = TRUE; + + OPEN rs; + myLoop: LOOP + SET vDone = FALSE; + FETCH rs INTO vWeek, vYear; + IF vDone THEN + LEAVE myLoop; + END IF; + CALL vn.workerTimeControl_sendMail(vWeek, vYear, NULL); + END LOOP; + CLOSE rs; END */ ;; /*!50003 SET time_zone = @saved_time_zone */ ;; /*!50003 SET sql_mode = @saved_sql_mode */ ;; @@ -37780,69 +37915,69 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`z-developer`@`%` FUNCTION `ekt_getEntry`(vEktFk INT) RETURNS int(11) READS SQL DATA -BEGIN - DECLARE vTravelFk INT; - DECLARE vEntryFk INT DEFAULT 0; - DECLARE vEntryAssignFk INT; - - SET vTravelFk = vn.ekt_getTravel(vEktFk); - - IF vTravelFk THEN - - SELECT ea.id INTO vEntryAssignFk - FROM edi.ekt e - JOIN vn.travel tr ON tr.id = vTravelFk - JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk - AND ea.warehouseInFk = tr.warehouseInFk - AND ea.agencyModeFk = tr.agencyFk - AND IFNULL(ea.sub, e.sub) <=> e.sub - AND IFNULL(ea.kop, e.kop) <=> e.kop - AND IFNULL(ea.pro, e.pro) <=> e.pro - WHERE e.id = vEktFk - ORDER BY ea.sub <=> e.sub AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, - ea.sub <=> e.sub AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, - ea.sub <=> e.sub AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC, - ea.sub <=> e.sub AND ISNULL(ea.kop) AND ISNULL(ea.pro) DESC, - ISNULL(ea.sub) AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, - ISNULL(ea.sub) AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, - ISNULL(ea.sub) AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC - LIMIT 1; - - SELECT MAX(e.id) INTO vEntryFk - FROM vn.entry e - JOIN vn.ektEntryAssign ea ON ea.id = vEntryAssignFk - WHERE e.travelFk = vTravelFk - AND e.sub <=> ea.sub - AND e.kop <=> ea.kop - AND e.pro <=> ea.pro; - - - IF IFNULL(vEntryFk,0) = 0 THEN - - INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk, kop, sub, ref, pro) - SELECT vTravelFk, ea.supplierFk, c.id, cu.id, ea.kop, ea.sub, ea.ref, ea.pro - FROM vn.ektEntryAssign ea - JOIN vn.company c ON c.code = 'VNL' - JOIN vn.currency cu ON cu.code = 'EUR' - WHERE ea.id = vEntryAssignFk; - - SELECT MAX(id) INTO vEntryFk - FROM vn.entry - WHERE travelFk = vTravelFk; - - END IF; - - UPDATE vn.ektEntryAssign - SET entryFk = vEntryFk - WHERE id = vEntryAssignFk; - - ELSE - - SET vEntryFk = 9200; - - END IF; - - RETURN vEntryFk; +BEGIN + DECLARE vTravelFk INT; + DECLARE vEntryFk INT DEFAULT 0; + DECLARE vEntryAssignFk INT; + + SET vTravelFk = vn.ekt_getTravel(vEktFk); + + IF vTravelFk THEN + + SELECT ea.id INTO vEntryAssignFk + FROM edi.ekt e + JOIN vn.travel tr ON tr.id = vTravelFk + JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk + AND ea.warehouseInFk = tr.warehouseInFk + AND ea.agencyModeFk = tr.agencyFk + AND IFNULL(ea.sub, e.sub) <=> e.sub + AND IFNULL(ea.kop, e.kop) <=> e.kop + AND IFNULL(ea.pro, e.pro) <=> e.pro + WHERE e.id = vEktFk + ORDER BY ea.sub <=> e.sub AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, + ea.sub <=> e.sub AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, + ea.sub <=> e.sub AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC, + ea.sub <=> e.sub AND ISNULL(ea.kop) AND ISNULL(ea.pro) DESC, + ISNULL(ea.sub) AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, + ISNULL(ea.sub) AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, + ISNULL(ea.sub) AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC + LIMIT 1; + + SELECT MAX(e.id) INTO vEntryFk + FROM vn.entry e + JOIN vn.ektEntryAssign ea ON ea.id = vEntryAssignFk + WHERE e.travelFk = vTravelFk + AND e.sub <=> ea.sub + AND e.kop <=> ea.kop + AND e.pro <=> ea.pro; + + + IF IFNULL(vEntryFk,0) = 0 THEN + + INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk, kop, sub, ref, pro) + SELECT vTravelFk, ea.supplierFk, c.id, cu.id, ea.kop, ea.sub, ea.ref, ea.pro + FROM vn.ektEntryAssign ea + JOIN vn.company c ON c.code = 'VNL' + JOIN vn.currency cu ON cu.code = 'EUR' + WHERE ea.id = vEntryAssignFk; + + SELECT MAX(id) INTO vEntryFk + FROM vn.entry + WHERE travelFk = vTravelFk; + + END IF; + + UPDATE vn.ektEntryAssign + SET entryFk = vEntryFk + WHERE id = vEntryAssignFk; + + ELSE + + SET vEntryFk = 9200; + + END IF; + + RETURN vEntryFk; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -37861,69 +37996,69 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`z-developer`@`%` FUNCTION `ekt_getEntry_beta`(vEktFk INT) RETURNS int(11) READS SQL DATA -BEGIN - DECLARE vTravelFk INT; - DECLARE vEntryFk INT DEFAULT 0; - DECLARE vEntryAssignFk INT; - - SET vTravelFk = vn.ekt_getTravel(vEktFk); - - IF vTravelFk THEN - - SELECT ea.id INTO vEntryAssignFk - FROM edi.ekt e - JOIN vn.travel tr ON tr.id = vTravelFk - JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk - AND ea.warehouseInFk = tr.warehouseInFk - AND ea.agencyModeFk = tr.agencyFk - AND IFNULL(ea.sub, e.sub) <=> e.sub - AND IFNULL(ea.kop, e.kop) <=> e.kop - AND IFNULL(ea.pro, e.pro) <=> e.pro - WHERE e.id = vEktFk - ORDER BY ea.sub <=> e.sub AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, - ea.sub <=> e.sub AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, - ea.sub <=> e.sub AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC, - ea.sub <=> e.sub AND ISNULL(ea.kop) AND ISNULL(ea.pro) DESC, - ISNULL(ea.sub) AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, - ISNULL(ea.sub) AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, - ISNULL(ea.sub) AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC - LIMIT 1; - - SELECT MAX(e.id) INTO vEntryFk - FROM vn.entry e - JOIN vn.ektEntryAssign ea ON ea.id = vEntryAssignFk - WHERE e.travelFk = vTravelFk - AND e.sub <=> ea.sub - AND e.kop <=> ea.kop - AND e.pro <=> ea.pro; - - - IF IFNULL(vEntryFk,0) = 0 THEN - - INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk, kop, sub, ref, pro) - SELECT vTravelFk, ea.supplierFk, c.id, cu.id, ea.kop, ea.sub, ea.ref, ea.pro - FROM vn.ektEntryAssign ea - JOIN vn.company c ON c.code = 'VNL' - JOIN vn.currency cu ON cu.code = 'EUR' - WHERE ea.id = vEntryAssignFk; - - SELECT MAX(id) INTO vEntryFk - FROM vn.entry - WHERE travelFk = vTravelFk; - - END IF; - - UPDATE vn.ektEntryAssign - SET entryFk = vEntryFk - WHERE id = vEntryAssignFk; - - ELSE - - SET vEntryFk = 9200; - - END IF; - - RETURN vEntryFk; +BEGIN + DECLARE vTravelFk INT; + DECLARE vEntryFk INT DEFAULT 0; + DECLARE vEntryAssignFk INT; + + SET vTravelFk = vn.ekt_getTravel(vEktFk); + + IF vTravelFk THEN + + SELECT ea.id INTO vEntryAssignFk + FROM edi.ekt e + JOIN vn.travel tr ON tr.id = vTravelFk + JOIN vn.ektEntryAssign ea ON ea.warehouseOutFk = tr.warehouseOutFk + AND ea.warehouseInFk = tr.warehouseInFk + AND ea.agencyModeFk = tr.agencyFk + AND IFNULL(ea.sub, e.sub) <=> e.sub + AND IFNULL(ea.kop, e.kop) <=> e.kop + AND IFNULL(ea.pro, e.pro) <=> e.pro + WHERE e.id = vEktFk + ORDER BY ea.sub <=> e.sub AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, + ea.sub <=> e.sub AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, + ea.sub <=> e.sub AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC, + ea.sub <=> e.sub AND ISNULL(ea.kop) AND ISNULL(ea.pro) DESC, + ISNULL(ea.sub) AND ea.kop <=> e.kop AND ea.pro <=> e.pro DESC, + ISNULL(ea.sub) AND ea.kop <=> e.kop AND ISNULL(ea.pro) DESC, + ISNULL(ea.sub) AND ISNULL(ea.kop) AND ea.pro <=> e.pro DESC + LIMIT 1; + + SELECT MAX(e.id) INTO vEntryFk + FROM vn.entry e + JOIN vn.ektEntryAssign ea ON ea.id = vEntryAssignFk + WHERE e.travelFk = vTravelFk + AND e.sub <=> ea.sub + AND e.kop <=> ea.kop + AND e.pro <=> ea.pro; + + + IF IFNULL(vEntryFk,0) = 0 THEN + + INSERT INTO vn.entry(travelFk, supplierFk, companyFk, currencyFk, kop, sub, ref, pro) + SELECT vTravelFk, ea.supplierFk, c.id, cu.id, ea.kop, ea.sub, ea.ref, ea.pro + FROM vn.ektEntryAssign ea + JOIN vn.company c ON c.code = 'VNL' + JOIN vn.currency cu ON cu.code = 'EUR' + WHERE ea.id = vEntryAssignFk; + + SELECT MAX(id) INTO vEntryFk + FROM vn.entry + WHERE travelFk = vTravelFk; + + END IF; + + UPDATE vn.ektEntryAssign + SET entryFk = vEntryFk + WHERE id = vEntryAssignFk; + + ELSE + + SET vEntryFk = 9200; + + END IF; + + RETURN vEntryFk; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -39700,17 +39835,17 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`root`@`%` FUNCTION `item_getFhImage`(itemFk INT) RETURNS varchar(255) CHARSET utf8 COLLATE utf8_unicode_ci DETERMINISTIC -BEGIN - DECLARE vImageUrl VARCHAR(255); - SELECT sr.PictureReference INTO vImageUrl - FROM vn.buy b - JOIN edi.ekt e ON b.ektFk = e.id - JOIN edi.supplyResponse sr ON sr.Item_ArticleCode =e.`ref` - JOIN vn.item i ON i.id = b.itemFk - WHERE b.itemFk = itemFk - ORDER BY (sr.EmbalageCode = e.package) DESC - LIMIT 1; - RETURN vImageUrl; +BEGIN + DECLARE vImageUrl VARCHAR(255); + SELECT sr.PictureReference INTO vImageUrl + FROM vn.buy b + JOIN edi.ekt e ON b.ektFk = e.id + JOIN edi.supplyResponse sr ON sr.Item_ArticleCode =e.`ref` + JOIN vn.item i ON i.id = b.itemFk + WHERE b.itemFk = itemFk + ORDER BY (sr.EmbalageCode = e.package) DESC + LIMIT 1; + RETURN vImageUrl; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -40362,7 +40497,7 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`%` FUNCTION `ticketSplitCounter`(vTicketFk INT) RETURNS varchar(15) CHARSET utf8 COLLATE utf8_unicode_ci +CREATE DEFINER=`root`@`%` FUNCTION `ticketSplitCounter`(vTicketFk INT) RETURNS varchar(15) CHARSET utf8 READS SQL DATA BEGIN DECLARE vSplitCounter VARCHAR(15); @@ -40375,7 +40510,9 @@ BEGIN LEFT JOIN vn2008.movement_label l ON l.Id_Movimiento = s.id WHERE ticketFk = vTicketFk ) sub; - RETURN vSplitCounter; + + RETURN IFNULL(vSplitCounter,'--'); + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -40761,13 +40898,13 @@ DELIMITER ; DELIMITER ;; CREATE DEFINER=`z-sysadmin`@`%` FUNCTION `time_getSalesYear`(vMonth INT, vYear INT) RETURNS int(11) DETERMINISTIC -BEGIN -DECLARE vSalesYear INT; -SELECT salesYear INTO vSalesYear -FROM `time` -WHERE `month` = vMonth AND `year` = vYear -LIMIT 1; -RETURN vSalesYear; +BEGIN +DECLARE vSalesYear INT; +SELECT salesYear INTO vSalesYear +FROM `time` +WHERE `month` = vMonth AND `year` = vYear +LIMIT 1; +RETURN vSalesYear; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -42906,10 +43043,10 @@ proc: BEGIN FROM edi.warehouseFloramondo WHERE warehouseFk = vWarehouseFk; - CALL cache.visible_refresh(vVisibleCache, FALSE, vWarehouseFk); - + CALL cache.visible_refresh(vVisibleCache, TRUE, vWarehouseFk); + IF (NOT vIsLogifloraAllowed AND vVNHWarehouseFk != vWarehouseFk) - OR (vShipped > TIMESTAMPADD(DAY, vMaxLogifloraDays + vRangeLogifloraDays, CURDATE()) ) + OR (vShipped > TIMESTAMPADD(DAY, vMaxLogifloraDays + vRangeLogifloraDays, CURDATE()) ) THEN DELETE tl FROM tmp.ticketLot tl JOIN item i ON i.id = tl.itemFk @@ -48255,216 +48392,216 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `entryConverter`(IN `vEntry` INT) -BEGIN - - DECLARE vWarehouseIn INT; - DECLARE vWarehouseOut INT; - DECLARE vTravel INT; - - DECLARE done BOOL DEFAULT FALSE; - - DECLARE vId_Entrada INT; - DECLARE vId_Article INT; - DECLARE vEtiquetas INT; - DECLARE vId_Cubo VARCHAR(10); - DECLARE vPacking INT; - DECLARE vGrouping INT; - DECLARE vCantidad INT; - DECLARE vCostefijo DECIMAL(10,3); - DECLARE vPortefijo DECIMAL(10,3); - DECLARE vEmbalajefijo DECIMAL(10); - DECLARE vComisionfija DECIMAL(10,3); - DECLARE vCaja INT; - DECLARE vNicho VARCHAR(5); - DECLARE vTarifa1 DECIMAL(10,2); - DECLARE vTarifa2 DECIMAL(10,2); - DECLARE vTarifa3 DECIMAL(10,2); - DECLARE vPVP DECIMAL(10,2); - DECLARE vCompra INT; - - DECLARE rs CURSOR FOR - SELECT - b.Id_Entrada, - b.Id_Article, - b.Etiquetas, - b.Id_Cubo, - b.Packing, - b.`grouping`, - b.Cantidad, - b.Costefijo, - b.Portefijo, - b.Embalajefijo, - b.Comisionfija, - b.caja, - b.Nicho, - b.Tarifa1, - b.Tarifa2, - b.Tarifa3, - b.PVP - FROM vn2008.Compres b - JOIN vn.itemConversor ic ON ic.espItemFk = b.Id_Article - WHERE Id_Entrada = vEntry; - - DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; - - SELECT warehouseInFk, warehouseOutFk, tr.id - INTO vWarehouseIn, vWarehouseOut, vTravel - FROM travel tr - JOIN entry e ON e.travelFk = tr.id - WHERE e.id = vEntry; - - UPDATE travel - SET warehouseInFk = vWarehouseOut, - warehouseOutFk = vWarehouseIn - WHERE id = vTravel; - - UPDATE vn2008.Compres c - LEFT JOIN vn.itemConversor ic ON ic.espItemFk = c.Id_Article - SET Etiquetas = 0, Cantidad = 0 - WHERE c.Id_Entrada = vEntry - AND ic.espItemFk IS NULL; - - OPEN rs; - - DELETE FROM vn2008.Compres WHERE Id_Entrada = vEntry; - - FETCH rs INTO - vId_Entrada, - vId_Article, - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP; - - WHILE NOT done DO - - -- Primero la linea original con las cantidades invertidas - INSERT INTO vn2008.Compres - ( - Id_Entrada, - Id_Article, - Etiquetas, - Id_Cubo, - Packing, - `grouping`, - Cantidad, - Costefijo, - Portefijo, - Embalajefijo, - Comisionfija, - caja, - Nicho, - Tarifa1, - Tarifa2, - Tarifa3, - PVP - ) - VALUES - ( - vId_Entrada, - vId_Article, - - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP); - - -- Ahora la linea nueva, con el item genérico - INSERT INTO vn2008.Compres - ( - Id_Entrada, - Id_Article, - Etiquetas, - Id_Cubo, - Packing, - `grouping`, - Cantidad, - Costefijo, - Portefijo, - Embalajefijo, - Comisionfija, - caja, - Nicho, - Tarifa1, - Tarifa2, - Tarifa3, - PVP - ) - SELECT - vId_Entrada, - genItemFk as Id_Article, - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP - FROM itemConversor - WHERE espItemFk = vId_Article; - - SELECT LAST_INSERT_ID() - INTO vCompra; - - REPLACE vn2008.Compres_mark(Id_Compra,`comment`) - SELECT vCompra, vId_Article; - - - FETCH rs INTO - vId_Entrada, - vId_Article, - vEtiquetas, - vId_Cubo, - vPacking, - vGrouping, - vCantidad, - vCostefijo, - vPortefijo, - vEmbalajefijo, - vComisionfija, - vCaja, - vNicho, - vTarifa1, - vTarifa2, - vTarifa3, - vPVP; - - END WHILE; - - - CLOSE rs; - - - +BEGIN + + DECLARE vWarehouseIn INT; + DECLARE vWarehouseOut INT; + DECLARE vTravel INT; + + DECLARE done BOOL DEFAULT FALSE; + + DECLARE vId_Entrada INT; + DECLARE vId_Article INT; + DECLARE vEtiquetas INT; + DECLARE vId_Cubo VARCHAR(10); + DECLARE vPacking INT; + DECLARE vGrouping INT; + DECLARE vCantidad INT; + DECLARE vCostefijo DECIMAL(10,3); + DECLARE vPortefijo DECIMAL(10,3); + DECLARE vEmbalajefijo DECIMAL(10); + DECLARE vComisionfija DECIMAL(10,3); + DECLARE vCaja INT; + DECLARE vNicho VARCHAR(5); + DECLARE vTarifa1 DECIMAL(10,2); + DECLARE vTarifa2 DECIMAL(10,2); + DECLARE vTarifa3 DECIMAL(10,2); + DECLARE vPVP DECIMAL(10,2); + DECLARE vCompra INT; + + DECLARE rs CURSOR FOR + SELECT + b.Id_Entrada, + b.Id_Article, + b.Etiquetas, + b.Id_Cubo, + b.Packing, + b.`grouping`, + b.Cantidad, + b.Costefijo, + b.Portefijo, + b.Embalajefijo, + b.Comisionfija, + b.caja, + b.Nicho, + b.Tarifa1, + b.Tarifa2, + b.Tarifa3, + b.PVP + FROM vn2008.Compres b + JOIN vn.itemConversor ic ON ic.espItemFk = b.Id_Article + WHERE Id_Entrada = vEntry; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + SELECT warehouseInFk, warehouseOutFk, tr.id + INTO vWarehouseIn, vWarehouseOut, vTravel + FROM travel tr + JOIN entry e ON e.travelFk = tr.id + WHERE e.id = vEntry; + + UPDATE travel + SET warehouseInFk = vWarehouseOut, + warehouseOutFk = vWarehouseIn + WHERE id = vTravel; + + UPDATE vn2008.Compres c + LEFT JOIN vn.itemConversor ic ON ic.espItemFk = c.Id_Article + SET Etiquetas = 0, Cantidad = 0 + WHERE c.Id_Entrada = vEntry + AND ic.espItemFk IS NULL; + + OPEN rs; + + DELETE FROM vn2008.Compres WHERE Id_Entrada = vEntry; + + FETCH rs INTO + vId_Entrada, + vId_Article, + vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP; + + WHILE NOT done DO + + -- Primero la linea original con las cantidades invertidas + INSERT INTO vn2008.Compres + ( + Id_Entrada, + Id_Article, + Etiquetas, + Id_Cubo, + Packing, + `grouping`, + Cantidad, + Costefijo, + Portefijo, + Embalajefijo, + Comisionfija, + caja, + Nicho, + Tarifa1, + Tarifa2, + Tarifa3, + PVP + ) + VALUES + ( + vId_Entrada, + vId_Article, + - vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + - vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP); + + -- Ahora la linea nueva, con el item genérico + INSERT INTO vn2008.Compres + ( + Id_Entrada, + Id_Article, + Etiquetas, + Id_Cubo, + Packing, + `grouping`, + Cantidad, + Costefijo, + Portefijo, + Embalajefijo, + Comisionfija, + caja, + Nicho, + Tarifa1, + Tarifa2, + Tarifa3, + PVP + ) + SELECT + vId_Entrada, + genItemFk as Id_Article, + vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP + FROM itemConversor + WHERE espItemFk = vId_Article; + + SELECT LAST_INSERT_ID() + INTO vCompra; + + REPLACE vn2008.Compres_mark(Id_Compra,`comment`) + SELECT vCompra, vId_Article; + + + FETCH rs INTO + vId_Entrada, + vId_Article, + vEtiquetas, + vId_Cubo, + vPacking, + vGrouping, + vCantidad, + vCostefijo, + vPortefijo, + vEmbalajefijo, + vComisionfija, + vCaja, + vNicho, + vTarifa1, + vTarifa2, + vTarifa3, + vPVP; + + END WHILE; + + + CLOSE rs; + + + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -48526,62 +48663,62 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `entryPrepare`(IN `idE` BIGINT) -BEGIN - SELECT - b.quantity / b.packing AS Paquetes, - b.packing AS `Grouping`, - barcode, - 'ASEGURADO' AS asegurado, - ic.name, - ic.order, - s.name AS Consignatario, - e.supplierFk AS Id_Cliente, - e.isOrdered, - e.isConfirmed, - 10 AS Calidad, - LPAD(IFNULL(cpd.id, ip.code), - 5, - '0') AS path, - b.entryFk AS Id_Ticket, - t.landed AS Fecha, - b.itemFk, - b.quantity, - i.name AS Concepte, - i.size, - i.inkFk, - i.category, - o.code AS Origen, - 0 AS Bultos, - wIn.`name` AS Tipo, - 0 AS OK, - 0 AS Reservado, - i.stems, - b.id AS Id_Movimiento, - ip.code, - 'PEDIDO ASEGURADO' AS MSG, - 0 AS Seguro, - i.image, - pr.name AS producer - FROM vn.buy b - JOIN vn.entry e ON b.entryFk = e.id - JOIN vn.travel t ON t.id = e.travelFk - JOIN vn.warehouse wIn ON wIn.id = t.warehouseInFk - JOIN vn.warehouse wOut ON wOut.id = t.warehouseOutFk - JOIN vn.item i ON i.id = b.itemFk - JOIN vn.itemType it ON it.id =i.typeFk - JOIN vn.itemCategory ic ON ic.id = it.categoryFk - JOIN vn.packaging pkg ON pkg.id = b.packageFk - LEFT JOIN vn.itemPlacement ip ON i.id = ip.itemFk AND ip.warehouseFk = wIn.id AND ip.warehouseFk = t.warehouseOutFk - LEFT JOIN (SELECT itemFk, code AS barcode FROM vn.itemBarcode GROUP BY itemFk) ib ON ib.itemFk = b.itemFk - LEFT JOIN vn.origin o ON o.id = i.originFk - LEFT JOIN vn.supplier s ON s.id = e.supplierFk - LEFT JOIN vn.producer pr on pr.id = i.producerFk - LEFT JOIN vn.coolerPathDetail cpd ON LEFT(ip.code, 3) = cpd.hallway - WHERE - NOT wIn.isFeedStock AND NOT e.isInventory AND NOT e.isRaid - AND e.id = 158772 - AND i.typeFk IS NOT NULL - AND ic.merchandise IS NOT FALSE; +BEGIN + SELECT + b.quantity / b.packing AS Paquetes, + b.packing AS `Grouping`, + barcode, + 'ASEGURADO' AS asegurado, + ic.name, + ic.order, + s.name AS Consignatario, + e.supplierFk AS Id_Cliente, + e.isOrdered, + e.isConfirmed, + 10 AS Calidad, + LPAD(IFNULL(cpd.id, ip.code), + 5, + '0') AS path, + b.entryFk AS Id_Ticket, + t.landed AS Fecha, + b.itemFk, + b.quantity, + i.name AS Concepte, + i.size, + i.inkFk, + i.category, + o.code AS Origen, + 0 AS Bultos, + wIn.`name` AS Tipo, + 0 AS OK, + 0 AS Reservado, + i.stems, + b.id AS Id_Movimiento, + ip.code, + 'PEDIDO ASEGURADO' AS MSG, + 0 AS Seguro, + i.image, + pr.name AS producer + FROM vn.buy b + JOIN vn.entry e ON b.entryFk = e.id + JOIN vn.travel t ON t.id = e.travelFk + JOIN vn.warehouse wIn ON wIn.id = t.warehouseInFk + JOIN vn.warehouse wOut ON wOut.id = t.warehouseOutFk + JOIN vn.item i ON i.id = b.itemFk + JOIN vn.itemType it ON it.id =i.typeFk + JOIN vn.itemCategory ic ON ic.id = it.categoryFk + JOIN vn.packaging pkg ON pkg.id = b.packageFk + LEFT JOIN vn.itemPlacement ip ON i.id = ip.itemFk AND ip.warehouseFk = wIn.id AND ip.warehouseFk = t.warehouseOutFk + LEFT JOIN (SELECT itemFk, code AS barcode FROM vn.itemBarcode GROUP BY itemFk) ib ON ib.itemFk = b.itemFk + LEFT JOIN vn.origin o ON o.id = i.originFk + LEFT JOIN vn.supplier s ON s.id = e.supplierFk + LEFT JOIN vn.producer pr on pr.id = i.producerFk + LEFT JOIN vn.coolerPathDetail cpd ON LEFT(ip.code, 3) = cpd.hallway + WHERE + NOT wIn.isFeedStock AND NOT e.isInventory AND NOT e.isRaid + AND e.id = 158772 + AND i.typeFk IS NOT NULL + AND ic.merchandise IS NOT FALSE; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -59338,77 +59475,77 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `saleItemShelvingMake`(IN `vTicketFk` INT, IN `vSectorFk` INT) -BEGIN - - SET @rest:= CAST(0 AS DECIMAL(10,0)); - SET @saleFk := CAST(0 AS DECIMAL(10,0)); - SET @reserved := CAST(0 AS DECIMAL(10,0)); - - UPDATE vn.itemShelving ish - JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id - JOIN sale s ON s.id = sis.saleFk - SET ish.visible = sis.quantity + ish.visible, - ish.available = sis.quantity + ish.visible - WHERE s.ticketFk = vTicketFk; - - DELETE sis.* - FROM saleItemShelving sis - JOIN sale s ON s.id = sis.saleFk - WHERE s.ticketFk = vTicketFk; - - INSERT INTO saleItemShelving( saleFk, - itemShelvingFk, - quantity, - ubication) - SELECT saleFk, - itemShelvingFk, - CAST(Reserved as DECIMAL(10,0)) as Reserved, - ubication - FROM - (SELECT saleFk, - itemShelvingFk, - ubication, - @rest := IF(@saleFk = saleFk, @rest, quantity) as Falta, - @reserved := IF(available < @rest, available, IF(@rest < packing,0,@rest)) as Reserved, - @rest := @rest - @reserved, - @saleFk := saleFk - FROM - ( SELECT s.id as saleFk, - ish.created, - ish.id as itemShelvingFk, - ish.available, - s.quantity, - ish.packing, - CONCAT(p.`column`, '-',p.`row`,': ', sh.code ) as ubication - FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.sector sc ON sc.warehouseFk = t.warehouseFk - JOIN vn.parking p ON p.sectorFk = sc.id - JOIN vn.shelving sh ON sh.parkingFk = p.id - JOIN vn.itemShelving ish ON ish.shelvingFk = sh.code AND ish.itemFk = s.itemFk - WHERE t.id = vTicketFk - AND sc.id = vSectorFk - AND s.quantity MOD ish.packing = 0 - AND s.quantity >= ish.packing - ORDER BY s.id, - sh.priority DESC, - ish.packing DESC, - ish.created - ) sub - ) sub2 - WHERE Reserved > 0; - - UPDATE vn.itemShelving ish - JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id - JOIN vn.sale s ON s.id = sis.saleFk - SET ish.available = ish.visible - sis.quantity, - ish.visible = ish.visible - sis.quantity - WHERE s.ticketFk = vTicketFk - AND s.isPicked = FALSE; - - CALL vn.saleItemShelvingIsPicked(vTicketFk, TRUE); - - +BEGIN + + SET @rest:= CAST(0 AS DECIMAL(10,0)); + SET @saleFk := CAST(0 AS DECIMAL(10,0)); + SET @reserved := CAST(0 AS DECIMAL(10,0)); + + UPDATE vn.itemShelving ish + JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id + JOIN sale s ON s.id = sis.saleFk + SET ish.visible = sis.quantity + ish.visible, + ish.available = sis.quantity + ish.visible + WHERE s.ticketFk = vTicketFk; + + DELETE sis.* + FROM saleItemShelving sis + JOIN sale s ON s.id = sis.saleFk + WHERE s.ticketFk = vTicketFk; + + INSERT INTO saleItemShelving( saleFk, + itemShelvingFk, + quantity, + ubication) + SELECT saleFk, + itemShelvingFk, + CAST(Reserved as DECIMAL(10,0)) as Reserved, + ubication + FROM + (SELECT saleFk, + itemShelvingFk, + ubication, + @rest := IF(@saleFk = saleFk, @rest, quantity) as Falta, + @reserved := IF(available < @rest, available, IF(@rest < packing,0,@rest)) as Reserved, + @rest := @rest - @reserved, + @saleFk := saleFk + FROM + ( SELECT s.id as saleFk, + ish.created, + ish.id as itemShelvingFk, + ish.available, + s.quantity, + ish.packing, + CONCAT(p.`column`, '-',p.`row`,': ', sh.code ) as ubication + FROM vn.sale s + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.sector sc ON sc.warehouseFk = t.warehouseFk + JOIN vn.parking p ON p.sectorFk = sc.id + JOIN vn.shelving sh ON sh.parkingFk = p.id + JOIN vn.itemShelving ish ON ish.shelvingFk = sh.code AND ish.itemFk = s.itemFk + WHERE t.id = vTicketFk + AND sc.id = vSectorFk + AND s.quantity MOD ish.packing = 0 + AND s.quantity >= ish.packing + ORDER BY s.id, + sh.priority DESC, + ish.packing DESC, + ish.created + ) sub + ) sub2 + WHERE Reserved > 0; + + UPDATE vn.itemShelving ish + JOIN vn.saleItemShelving sis ON sis.itemShelvingFk = ish.id + JOIN vn.sale s ON s.id = sis.saleFk + SET ish.available = ish.visible - sis.quantity, + ish.visible = ish.visible - sis.quantity + WHERE s.ticketFk = vTicketFk + AND s.isPicked = FALSE; + + CALL vn.saleItemShelvingIsPicked(vTicketFk, TRUE); + + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -60149,33 +60286,33 @@ DELIMITER ; /*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`root`@`%` PROCEDURE `scanTreeCreate__`() -BEGIN - CALL nestTree( - 'vn2008', - 'scan', - 'vn2008', - 'scanTree' - ); - - UPDATE vn2008.scanTree st - JOIN ( - SELECT sl.scan_id, - MAX(sl.odbc_date) lastScanned, - COUNT(DISTINCT t.routeFk) routeCount, - MIN(t.routeFk) mod 1000 as minRoute, - MAX(t.routeFk) mod 1000 as maxRoute, - COUNT(sl.scan_line_id) as scanned - FROM vn2008.scan_line sl - JOIN expedition e ON e.id = sl.`code` - JOIN ticket t ON t.id = e.ticketFk - WHERE t.routeFk - GROUP BY sl.scan_id - ) rs ON rs.scan_id = st.id - SET st.lastScanned = rs.lastScanned, - st.routeCount = rs.routeCount, - st.minRoute = rs.minRoute, - st.maxRoute = IF(rs.minRoute != rs.maxRoute, rs.maxRoute,NULL), - st.scanned = rs.scanned; +BEGIN + CALL nestTree( + 'vn2008', + 'scan', + 'vn2008', + 'scanTree' + ); + + UPDATE vn2008.scanTree st + JOIN ( + SELECT sl.scan_id, + MAX(sl.odbc_date) lastScanned, + COUNT(DISTINCT t.routeFk) routeCount, + MIN(t.routeFk) mod 1000 as minRoute, + MAX(t.routeFk) mod 1000 as maxRoute, + COUNT(sl.scan_line_id) as scanned + FROM vn2008.scan_line sl + JOIN expedition e ON e.id = sl.`code` + JOIN ticket t ON t.id = e.ticketFk + WHERE t.routeFk + GROUP BY sl.scan_id + ) rs ON rs.scan_id = st.id + SET st.lastScanned = rs.lastScanned, + st.routeCount = rs.routeCount, + st.minRoute = rs.minRoute, + st.maxRoute = IF(rs.minRoute != rs.maxRoute, rs.maxRoute,NULL), + st.scanned = rs.scanned; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -64051,25 +64188,25 @@ DELIMITER ; /*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; CREATE DEFINER=`z-developer`@`%` PROCEDURE `ticketManaToPromo`(vTicketFk INT) -BEGIN - - DECLARE vManaComponent INT; - - DECLARE vPromoComponent INT; - - SELECT id INTO vManaComponent - FROM vn.component c - WHERE c.code = 'mana'; - - SELECT id INTO vPromoComponent - FROM vn.component c - WHERE c.code = 'floramondoPromo'; - - UPDATE vn.saleComponent sc - JOIN vn.sale s ON s.id = sc.saleFk - SET componentFk = vPromoComponent - WHERE componentFk = vManaComponent - AND s.ticketFk = vTicketFk; +BEGIN + + DECLARE vManaComponent INT; + + DECLARE vPromoComponent INT; + + SELECT id INTO vManaComponent + FROM vn.component c + WHERE c.code = 'mana'; + + SELECT id INTO vPromoComponent + FROM vn.component c + WHERE c.code = 'floramondoPromo'; + + UPDATE vn.saleComponent sc + JOIN vn.sale s ON s.id = sc.saleFk + SET componentFk = vPromoComponent + WHERE componentFk = vManaComponent + AND s.ticketFk = vTicketFk; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -65147,6 +65284,150 @@ BEGIN CLOSE rsTicket; +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_cloneWeekly__3` */; +/*!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_cloneWeekly__3`(IN vWeek INT) +BEGIN +DECLARE vIsDone BOOL; + DECLARE vLanding DATE; + DECLARE vShipment DATE; + DECLARE vWarehouse INT; + DECLARE vTicket INT; + DECLARE vWeekDay INT; + DECLARE vClient INT; + DECLARE vEmpresa INT; + DECLARE vConsignatario INT; + DECLARE vAgencia INT; + DECLARE vNewTicket INT; + DECLARE vYear INT; + + DECLARE rsTicket CURSOR FOR + SELECT tt.Id_Ticket, weekDay, Id_Cliente, warehouse_id, empresa_id, Id_Consigna, Id_Agencia + FROM Tickets_turno tt + JOIN Tickets t ON tt.Id_Ticket = t.Id_Ticket; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE; + + SET vYear = YEAR(CURDATE()) + IF(vWeek < WEEK(CURDATE()),1, 0); + + OPEN rsTicket; + myLoop: LOOP + BEGIN + DECLARE vSalesPersonEmail VARCHAR(150); + DECLARE vMailSent BOOL; + DECLARE vSubject VARCHAR(150); + DECLARE vMessage TEXT; + /*DECLARE vError TEXT; + DECLARE CONTINUE HANDLER FOR SQLEXCEPTION + BEGIN + GET DIAGNOSTICS CONDITION 1 + vError = MESSAGE_TEXT; + + END;*/ + + SET vIsDone = FALSE; + FETCH rsTicket INTO vTicket, vWeekDay, vClient, vWarehouse, vEmpresa, vConsignatario, vAgencia; + + IF vIsDone THEN + + LEAVE myLoop; + END IF; + SELECT date INTO vShipment + FROM `time` + WHERE `year` = vYear AND `week` = vWeek + AND WEEKDAY(date) = vWeekDay; + + -- busca si el ticket ya ha sido clonado + IF (SELECT COUNT(*) FROM vn.ticket tOrig + JOIN vn.sale saleOrig ON tOrig.id = saleOrig.ticketFk + JOIN vn.saleCloned sc ON sc.saleOriginalFk = saleOrig.id + JOIN vn.sale saleClon ON saleClon.id = sc.saleClonedFk + JOIN vn.ticket tClon ON tClon.id = saleClon.ticketFk + WHERE tOrig.id = vTicket AND tClon.isDeleted = FALSE AND DATE(tClon.shipped) = vShipment) > 0 + THEN + ITERATE myLoop; + END IF; + CALL vn.zone_getLanded(vShipment, vConsignatario, vAgencia, vWarehouse,FALSE); + + SELECT landed INTO vLanding from tmp.zoneGetLanded LIMIT 1; + IF (SELECT COUNT(*) FROM Agencias WHERE Id_Agencia = vAgencia AND Agencia LIKE '%turno%') THEN + SET vAgencia = NULL; + END IF; + + CALL vn.ticketCreateWithoutZone(vClient, vShipment, vWarehouse, vEmpresa, vConsignatario, vAgencia, NULL, vLanding,account.userGetId(), vNewTicket); + + IF (vLanding IS NULL) THEN + + SELECT e.email INTO vSalesPersonEmail + FROM vn.client c + JOIN vn.worker sp ON sp.id = c.salesPersonFk + JOIN account.emailUser e ON e.userFk = sp.userFk + WHERE c.id = vClient; + + SET vSubject = CONCAT('Turnos - No se ha podido clonar correctamente el ticket ', vTicket, + ' para el dia: ', vShipment); + SET vMessage = CONCAT('No se ha podido clonar el ticket ', vTicket, + ' para el dia: ', vShipment, + ' porque no hay una zona de envío disponible. Se ha creado el ticket: ', vNewTicket, + ' pero ha que revisar las fechas y la agencia'); + + SELECT COUNT(*) INTO vMailSent + FROM vn.mail + WHERE sender = vSalesPersonEmail + AND subject = vSubject; + + IF NOT vMailSent THEN + INSERT INTO vn2008.mail (`to`,`subject`,`text`) + VALUES (vSalesPersonEmail, vSubject, vMessage); + END IF; + CALL vn.ticketStateUpdate (vNewTicket, 'FIXING'); + END IF; + + INSERT INTO vn.sale (ticketFk, itemFk, concept, quantity, price, discount, priceFixed, isPriceFixed) + SELECT vNewTicket, saleOrig.itemFk , saleOrig.concept , saleOrig.quantity, saleOrig.price , saleOrig.discount, saleOrig.priceFixed, saleOrig.isPriceFixed + FROM vn.sale saleOrig + WHERE saleOrig.ticketFk = vTicket; + + INSERT IGNORE INTO vn.saleCloned(saleOriginalFk, saleClonedFk) + SELECT saleOriginal.id, saleClon.id + FROM vn.sale saleOriginal + JOIN vn.sale saleClon ON saleOriginal.itemFk = saleClon.itemFk AND saleOriginal.quantity = saleClon.quantity + WHERE saleOriginal.ticketFk = vTicket AND saleClon.ticketFk = vNewTicket; + + INSERT INTO Ordenes (orden,datorden,datticket,codvendedor,codcomprador,cantidad,preciomax,preu,id_article,id_cliente,comentario, + ok, total,datcompra,ko,id_movimiento) + SELECT o.orden,o.datorden,vShipment,o.codvendedor,o.codcomprador,o.cantidad,o.preciomax,o.preu,o.id_article,o.id_cliente,o.comentario, + o.ok, o.total,o.datcompra,o.ko,m2.Id_Movimiento + FROM Movimientos m JOIN Ordenes o ON o.Id_Movimiento = m.Id_Movimiento + JOIN Movimientos m2 ON m.Concepte = m2.Concepte AND m.Cantidad = m2.Cantidad AND m.Id_Article = m2.Id_Article + WHERE m.Id_Ticket = vTicket AND m2.Id_Ticket = vNewTicket; + + INSERT INTO ticket_observation(Id_Ticket,observation_type_id,text) VALUES(vNewTicket,4,CONCAT('turno desde ticket: ',vTicket)) + ON DUPLICATE KEY UPDATE text = CONCAT(ticket_observation.text,VALUES(text),' '); + + INSERT INTO ticket_observation(Id_Ticket,observation_type_id,text) VALUES(vNewTicket,1,'ATENCION: Contiene lineas de TURNO') + ON DUPLICATE KEY UPDATE text = CONCAT(ticket_observation.text,VALUES(text),' '); + + CALL vn.ticketCalculateClon(vNewTicket, vTicket); + END; + END LOOP; + + CLOSE rsTicket; + END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -76215,4 +76496,4 @@ USE `vncontrol`; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-01-05 9:34:47 +-- Dump completed on 2021-01-08 10:00:22 diff --git a/db/export-structure.sh b/db/export-structure.sh index 1fef22a31..36d41ea18 100755 --- a/db/export-structure.sh +++ b/db/export-structure.sh @@ -59,7 +59,6 @@ IGNORETABLES=( --ignore-table=vn.mail__ --ignore-table=vn.manaSpellers --ignore-table=vn.outgoingInvoiceKk - --ignore-table=vn.payment --ignore-table=vn.paymentExchangeInsurance --ignore-table=vn.payrollCenter --ignore-table=vn.plantpassport__ From f8ba2534cc39f5042e3fafeb6e9e3032693fdd8e Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 8 Jan 2021 14:32:48 +0100 Subject: [PATCH 4/8] 2691 - Scope days changes --- modules/ticket/front/search-panel/index.html | 62 +++++++++++--------- modules/ticket/front/search-panel/index.js | 35 +++++++++++ modules/ticket/front/search-panel/style.scss | 22 +++++++ 3 files changed, 91 insertions(+), 28 deletions(-) create mode 100644 modules/ticket/front/search-panel/style.scss diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 8570036c0..6928e10c6 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -1,6 +1,6 @@
-
- + + - + - - - - - - - - - +
+ + + + + + O + + + +
+ - + - + - + - + diff --git a/modules/ticket/front/search-panel/index.js b/modules/ticket/front/search-panel/index.js index 08b0fb244..3efeb576c 100644 --- a/modules/ticket/front/search-panel/index.js +++ b/modules/ticket/front/search-panel/index.js @@ -1,8 +1,12 @@ import ngModule from '../module'; import SearchPanel from 'core/components/searchbar/search-panel'; +import './style.scss'; + class Controller extends SearchPanel { constructor($, $element) { super($, $element); + this.filter = this.$.filter; + this.getGroupedStates(); } @@ -19,6 +23,37 @@ class Controller extends SearchPanel { this.groupedStates = groupedStates; }); } + + get from() { + return this._from; + } + + set from(value) { + this._from = value; + + this.filter.scopeDays = null; + } + + get to() { + return this._to; + } + + set to(value) { + this._to = value; + + this.filter.scopeDays = null; + } + + get scopeDays() { + return this._scopeDays; + } + + set scopeDays(value) { + this._scopeDays = value; + + this.filter.from = null; + this.filter.to = null; + } } ngModule.vnComponent('vnTicketSearchPanel', { diff --git a/modules/ticket/front/search-panel/style.scss b/modules/ticket/front/search-panel/style.scss new file mode 100644 index 000000000..374db22d7 --- /dev/null +++ b/modules/ticket/front/search-panel/style.scss @@ -0,0 +1,22 @@ +@import "./effects"; +@import "./variables"; + + +form#ticket-form { + padding: 0 +} + +.scope-days { + border: $border-thin-light; + text-align: right; + + & > p { + font-size: 1.2rem; + margin: 3px; + } + + .or { + font-weight: bold; + font-size: 26px + } +} \ No newline at end of file From ffdc753ad4b6b0fade2ad18a47a9248faf2b14a7 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 11 Jan 2021 08:48:53 +0100 Subject: [PATCH 5/8] 2691 - Added "or" between date ranges and scope days --- front/core/components/field/index.js | 5 ++++- modules/ticket/front/search-panel/index.html | 8 ++++++-- modules/ticket/front/search-panel/index.js | 20 ------------------- .../ticket/front/search-panel/index.spec.js | 13 ++++++++++++ .../ticket/front/search-panel/locale/es.yml | 3 ++- modules/ticket/front/search-panel/style.scss | 10 +++++++++- modules/ticket/front/weekly/locale/es.yml | 2 +- 7 files changed, 35 insertions(+), 26 deletions(-) diff --git a/front/core/components/field/index.js b/front/core/components/field/index.js index 8d619e4a3..d18973bbe 100644 --- a/front/core/components/field/index.js +++ b/front/core/components/field/index.js @@ -187,7 +187,10 @@ export default class Field extends FormInput { } onChange() { - this.emit('change', {value: this.field}); + // Changes doesn't reflect until appling async + this.$.$applyAsync(() => { + this.emit('change', {value: this.field}); + }); } } Field.$inject = ['$element', '$scope']; diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 6928e10c6..934b1fc1f 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -27,13 +27,13 @@ vn-one label="From" ng-model="filter.from" - on-change="$ctrl.from = value"> + on-change="filter.scopeDays = null"> + on-change="filter.scopeDays = null"> O + + diff --git a/modules/ticket/front/search-panel/index.js b/modules/ticket/front/search-panel/index.js index 3efeb576c..71a339482 100644 --- a/modules/ticket/front/search-panel/index.js +++ b/modules/ticket/front/search-panel/index.js @@ -24,26 +24,6 @@ class Controller extends SearchPanel { }); } - get from() { - return this._from; - } - - set from(value) { - this._from = value; - - this.filter.scopeDays = null; - } - - get to() { - return this._to; - } - - set to(value) { - this._to = value; - - this.filter.scopeDays = null; - } - get scopeDays() { return this._scopeDays; } diff --git a/modules/ticket/front/search-panel/index.spec.js b/modules/ticket/front/search-panel/index.spec.js index 55d341d2a..99c9d8da0 100644 --- a/modules/ticket/front/search-panel/index.spec.js +++ b/modules/ticket/front/search-panel/index.spec.js @@ -10,6 +10,7 @@ describe('Ticket Component vnTicketSearchPanel', () => { $httpBackend = _$httpBackend_; controller = $componentController('vnTicketSearchPanel', {$element: null}); controller.$t = () => {}; + controller.filter = {}; })); describe('getGroupedStates()', () => { @@ -32,4 +33,16 @@ describe('Ticket Component vnTicketSearchPanel', () => { }]); }); }); + + describe('scopeDays() setter', () => { + it('should clear the date range', () => { + controller.filter.from = new Date(); + controller.filter.to = new Date(); + + controller.scopeDays = 1; + + expect(controller.filter.from).toBeNull(); + expect(controller.filter.to).toBeNull(); + }); + }); }); diff --git a/modules/ticket/front/search-panel/locale/es.yml b/modules/ticket/front/search-panel/locale/es.yml index 5fa75ac09..54a01c82f 100644 --- a/modules/ticket/front/search-panel/locale/es.yml +++ b/modules/ticket/front/search-panel/locale/es.yml @@ -16,4 +16,5 @@ Pending: Pendiente FREE: Libre DELIVERED: Servido ON_PREPARATION: En preparacion -PACKED: Encajado \ No newline at end of file +PACKED: Encajado +Cannot choose a range of dates and days onward at the same time: No se puede selecionar un rango de fechas y días en adelante a la vez \ No newline at end of file diff --git a/modules/ticket/front/search-panel/style.scss b/modules/ticket/front/search-panel/style.scss index 374db22d7..56c36fabd 100644 --- a/modules/ticket/front/search-panel/style.scss +++ b/modules/ticket/front/search-panel/style.scss @@ -8,6 +8,7 @@ form#ticket-form { .scope-days { border: $border-thin-light; + position: relative; text-align: right; & > p { @@ -17,6 +18,13 @@ form#ticket-form { .or { font-weight: bold; - font-size: 26px + font-size: 26px; + color: $color-font-secondary + } + + vn-icon[icon="info"] { + position: absolute; + top: 2px; + right: 2px } } \ No newline at end of file diff --git a/modules/ticket/front/weekly/locale/es.yml b/modules/ticket/front/weekly/locale/es.yml index 804467dae..62f0f5b53 100644 --- a/modules/ticket/front/weekly/locale/es.yml +++ b/modules/ticket/front/weekly/locale/es.yml @@ -4,4 +4,4 @@ You are going to delete this weekly ticket: Vas a eliminar este ticket programad This ticket will be removed from weekly tickets! Continue anyway?: Este ticket se eliminará de tickets programados! ¿Continuar de todas formas? Search weekly ticket by id or client id: Busca tickets programados por el identificador o el identificador del cliente Search by weekly ticket: Buscar por tickets programados -weekDay: Dia \ No newline at end of file +Weekday: Llegada \ No newline at end of file From 035bdfb1adf5032b1dd6e98dc28f16968f96cad4 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 11 Jan 2021 10:08:33 +0100 Subject: [PATCH 6/8] Rounded box --- modules/ticket/front/search-panel/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ticket/front/search-panel/style.scss b/modules/ticket/front/search-panel/style.scss index 56c36fabd..d90c66251 100644 --- a/modules/ticket/front/search-panel/style.scss +++ b/modules/ticket/front/search-panel/style.scss @@ -8,6 +8,7 @@ form#ticket-form { .scope-days { border: $border-thin-light; + border-radius: 5px; position: relative; text-align: right; From 7568a1c06663f58e9626f5b70d623db2348304b9 Mon Sep 17 00:00:00 2001 From: joan Date: Mon, 11 Jan 2021 14:54:24 +0100 Subject: [PATCH 7/8] Updated unit tests --- .../core/components/searchbar/search-panel.js | 1 + front/core/components/searchbar/style.scss | 25 ++++++++++++++- modules/ticket/front/search-panel/index.html | 8 ++--- modules/ticket/front/search-panel/index.js | 19 +++++++++++- .../ticket/front/search-panel/index.spec.js | 27 ++++++++++++++-- modules/ticket/front/search-panel/style.scss | 31 ------------------- 6 files changed, 72 insertions(+), 39 deletions(-) delete mode 100644 modules/ticket/front/search-panel/style.scss diff --git a/front/core/components/searchbar/search-panel.js b/front/core/components/searchbar/search-panel.js index f473c2b04..67fd3fae2 100644 --- a/front/core/components/searchbar/search-panel.js +++ b/front/core/components/searchbar/search-panel.js @@ -1,4 +1,5 @@ import Component from '../../lib/component'; +import './style.scss'; export default class SearchPanel extends Component { set filter(value) { diff --git a/front/core/components/searchbar/style.scss b/front/core/components/searchbar/style.scss index c1d4be21c..eab9c126b 100644 --- a/front/core/components/searchbar/style.scss +++ b/front/core/components/searchbar/style.scss @@ -1,4 +1,4 @@ -@import "variables"; +@import "./variables"; vn-searchbar { display: block; @@ -44,4 +44,27 @@ vn-searchbar { & > form { padding: $spacing-lg; } + + & > form#manifold-form { + padding: 0; + + .manifold-panel { + border: $border-thin-light; + border-radius: 5px; + position: relative; + text-align: right; + + .or { + font-weight: bold; + font-size: 26px; + color: $color-font-secondary + } + + vn-icon[icon="info"] { + position: absolute; + top: 2px; + right: 2px + } + } + } } \ No newline at end of file diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 934b1fc1f..d9ab2ee91 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -1,5 +1,5 @@
-
+
- + + on-change="$ctrl.from = value"> + on-change="$ctrl.to = value"> O { })); describe('getGroupedStates()', () => { - it('should set an array of groupedStates with the aditionof a name translation', () => { + it('should set an array of groupedStates with the adition of a name translation', () => { jest.spyOn(controller, '$t').mockReturnValue('miCodigo'); const data = [ { @@ -34,8 +34,30 @@ describe('Ticket Component vnTicketSearchPanel', () => { }); }); + describe('from() setter', () => { + it('should clear the scope days when setting the from property', () => { + controller.filter.scopeDays = 1; + + controller.from = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.from).toBeDefined(); + }); + }); + + describe('to() setter', () => { + it('should clear the scope days when setting the to property', () => { + controller.filter.scopeDays = 1; + + controller.to = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.to).toBeDefined(); + }); + }); + describe('scopeDays() setter', () => { - it('should clear the date range', () => { + it('should clear the date range when setting the scopeDays property', () => { controller.filter.from = new Date(); controller.filter.to = new Date(); @@ -43,6 +65,7 @@ describe('Ticket Component vnTicketSearchPanel', () => { expect(controller.filter.from).toBeNull(); expect(controller.filter.to).toBeNull(); + expect(controller.scopeDays).toBeDefined(); }); }); }); diff --git a/modules/ticket/front/search-panel/style.scss b/modules/ticket/front/search-panel/style.scss deleted file mode 100644 index d90c66251..000000000 --- a/modules/ticket/front/search-panel/style.scss +++ /dev/null @@ -1,31 +0,0 @@ -@import "./effects"; -@import "./variables"; - - -form#ticket-form { - padding: 0 -} - -.scope-days { - border: $border-thin-light; - border-radius: 5px; - position: relative; - text-align: right; - - & > p { - font-size: 1.2rem; - margin: 3px; - } - - .or { - font-weight: bold; - font-size: 26px; - color: $color-font-secondary - } - - vn-icon[icon="info"] { - position: absolute; - top: 2px; - right: 2px - } -} \ No newline at end of file From 4435f5e1b0fc21fe58eeae1b5f3756753779aafd Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 12 Jan 2021 07:45:13 +0100 Subject: [PATCH 8/8] Vn-th sortable icon hotfix --- front/core/components/th/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/front/core/components/th/index.js b/front/core/components/th/index.js index f815056f6..b9ea8fde8 100644 --- a/front/core/components/th/index.js +++ b/front/core/components/th/index.js @@ -1,4 +1,5 @@ import ngModule from '../../module'; +import './style.scss'; export default class Th { constructor($element) {