From 9a4e20bb31b25e6169a04660572637081e5d9ca6 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 11 Aug 2020 11:03:43 +0200 Subject: [PATCH 01/25] new models and fixtures --- back/model-config.json | 9 +++++ back/models/mail.json | 36 +++++++++++++++++ back/models/worker-time-control-mail.json | 39 +++++++++++++++++++ back/models/worker-time-control-params.js | 3 ++ back/models/worker-time-control-params.json | 35 +++++++++++++++++ .../00-workerTimeControlParams.sql | 6 +++ db/dump/fixtures.sql | 4 +- 7 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 back/models/mail.json create mode 100644 back/models/worker-time-control-mail.json create mode 100644 back/models/worker-time-control-params.js create mode 100644 back/models/worker-time-control-params.json create mode 100644 db/changes/12300-Summer/00-workerTimeControlParams.sql diff --git a/back/model-config.json b/back/model-config.json index 323e5f233..3d0085fc2 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -67,6 +67,15 @@ }, "UserLog": { "dataSource": "vn" + }, + "WorkerTimeControlParams": { + "dataSource": "vn" + }, + "WorkerTimeControlMail": { + "dataSource": "vn" + }, + "Mail": { + "dataSource": "vn" } } diff --git a/back/models/mail.json b/back/models/mail.json new file mode 100644 index 000000000..cf5c11993 --- /dev/null +++ b/back/models/mail.json @@ -0,0 +1,36 @@ +{ + "name": "Mail", + "base": "VnModel", + "options": { + "mysql": { + "table": "mail" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "required": true + }, + "sender": { + "type": "String" + }, + "replyTo": { + "type": "String" + }, + "subject": { + "type": "String" + }, + "body": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/worker-time-control-mail.json b/back/models/worker-time-control-mail.json new file mode 100644 index 000000000..4a0fd31f1 --- /dev/null +++ b/back/models/worker-time-control-mail.json @@ -0,0 +1,39 @@ +{ + "name": "WorkerTimeControlMail", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerTimeControlMail" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "required": true + }, + "workerFk": { + "type": "Number" + }, + "year": { + "type": "Number" + }, + "week": { + "type": "Number" + }, + "state": { + "type": "String" + }, + "updated": { + "type": "Date" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/worker-time-control-params.js b/back/models/worker-time-control-params.js new file mode 100644 index 000000000..c71d4c237 --- /dev/null +++ b/back/models/worker-time-control-params.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/imap-time-control/checkInbox')(Self); +}; diff --git a/back/models/worker-time-control-params.json b/back/models/worker-time-control-params.json new file mode 100644 index 000000000..cc904cf40 --- /dev/null +++ b/back/models/worker-time-control-params.json @@ -0,0 +1,35 @@ +{ + "name": "WorkerTimeControlParams", + "description": "imap config", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerTimeControlParams" + } + }, + "properties": { + "mailHost": { + "type": "String" + }, + "mailUser": { + "type": "String" + }, + "mailPass": { + "type": "String" + }, + "mailSuccessFolder": { + "type": "String" + }, + "mailErrorFolder": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/db/changes/12300-Summer/00-workerTimeControlParams.sql b/db/changes/12300-Summer/00-workerTimeControlParams.sql new file mode 100644 index 000000000..47ef2e3ea --- /dev/null +++ b/db/changes/12300-Summer/00-workerTimeControlParams.sql @@ -0,0 +1,6 @@ +ALTER TABLE `vn`.`workerTimeControlParams` +ADD COLUMN `mailUser` VARCHAR(45) NOT NULL AFTER `askInOut`, +ADD COLUMN `mailPass` VARCHAR(45) NOT NULL AFTER `mailUser`, +ADD COLUMN `mailHost` VARCHAR(45) NOT NULL AFTER `mailPass`, +ADD COLUMN `mailSuccessFolder` VARCHAR(45) NOT NULL AFTER `mailHost`, +ADD COLUMN `mailErrorFolder` VARCHAR(45) NOT NULL AFTER `mailSuccessFolder`; diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index a1018ab5a..80f21297f 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2034,9 +2034,9 @@ INSERT INTO `vn`.`queuePriority`(`id`, `priority`) (2, 'Normal'), (3, 'Baja'); -INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`) +INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`, `mailSuccessFolder`, `mailErrorFolder`) VALUES - (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000); + (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000, 'Leidos.exito', 'Leidos.error'); INSERT IGNORE INTO `vn`.`greugeConfig` (`id`, `freightPickUpPrice`) VALUES ('1', '11'); From 860f9f4e874288ca05cf55668ff79b289a443136 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 11 Aug 2020 11:12:40 +0200 Subject: [PATCH 02/25] new method for imap --- back/methods/imap-time-control/checkInbox.js | 129 +++++++++++ package-lock.json | 215 +++++++++++++++++-- package.json | 2 + 3 files changed, 325 insertions(+), 21 deletions(-) create mode 100644 back/methods/imap-time-control/checkInbox.js diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js new file mode 100644 index 000000000..ff0b0a46e --- /dev/null +++ b/back/methods/imap-time-control/checkInbox.js @@ -0,0 +1,129 @@ +const Imap = require('imap'); + +module.exports = Self => { + Self.remoteMethod('checkInbox', { + description: 'Check an email inbox and process it', + accessType: 'READ', + returns: + { + arg: 'body', + type: 'file', + root: true + }, + http: { + path: `/checkInbox`, + verb: 'GET' + } + }); + + Self.checkInbox = async() => { + let imapConfig = await Self.app.models.WorkerTimeControlParams.findOne(); + let imap = new Imap({ + user: imapConfig.mailUser, + password: imapConfig.mailPass, + host: imapConfig.mailHost, + port: 993, + tls: true + }); + let isEmailOk; + let emailText = ''; + + function openInbox(cb) { + imap.openBox('INBOX', true, cb); + } + + imap.once('ready', function() { + openInbox(function(err, box) { + if (err) throw err; + let f = imap.seq.fetch('1:3', { + bodies: ['HEADER.FIELDS (FROM SUBJECT)', '1'], + struct: true + }); + f.on('message', function(msg, seqno) { + isEmailOk = false; + msg.on('body', function(stream, info) { + let buffer = ''; + stream.on('data', function(chunk) { + buffer = chunk.toString('utf8'); + if (info.which === '1') { + emailText = buffer.split('\n')[0]; + emailText = emailText.toUpperCase(); + emailText = emailText.replace(/\s/g, ''); + if (emailText === 'OK') + isEmailOk = true; // isEmailOk + } + }); + stream.once('end', function() { + if (info.which === 'HEADER.FIELDS (FROM SUBJECT)') { + console.log('isEmailOk', isEmailOk); + if (isEmailOk) { + emailConfirm(buffer); + imap.seq.move(seqno, 'exito', function(err) { + console.log('Move correcte: ' + err); + console.log('Move error: ' + seqno); + }); + } else { + emailReply(buffer); + imap.seq.move(seqno, 'error', function(err) { + console.log('Move error: ' + err); + console.log('Move error: ' + seqno); + }); + } + } + }); + }); + }); + // msg.on('attributes', function(attrs) { + // console.log('ATRIBUTO', attrs.struct[0]); + // console.log('ATRIBUTO', attrs.struct[0].params); + // }); + }); + }); + + imap.connect(); + return 'pepinillos'; + }; + async function getUser(workerEmail) { + let firstPosition = workerEmail.search('<') + 1; + let lastPosition = workerEmail.search('@') - firstPosition; + let userName = workerEmail.substr(firstPosition, lastPosition); + let user = await Self.app.models.Account.findOne({where: {name: userName}}); + return user; + } + + async function getEmailDate(subject) { + let date = subject.match(/\d+/g); + return date; + } + + async function emailConfirm(buffer) { + let now = new Date(); + let from = JSON.stringify(Imap.parseHeader(buffer).from); + let subject = JSON.stringify(Imap.parseHeader(buffer).subject); + + let timeControlDate = await getEmailDate(subject); + let week = timeControlDate[0]; + let year = timeControlDate[1]; + let user = await getUser(from); + + let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + worker: user.id + } + }); + await workerMail.updateAttributes({ + updated: now, + state: 'CONFIRMED' + }); + // MOVER A CARPETA EXITO + } + async function emailReply(subject, workerEmail) { + console.log('bbbbb'); + + // INSERT EN VN.MAIL + // UPDATE EN WORKERTIMECONTROLMAIL + // MOVER A CARPETA ERROR + } +}; diff --git a/package-lock.json b/package-lock.json index 92030199a..28cfafa08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4955,7 +4955,7 @@ }, "util": { "version": "0.10.3", - "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -5917,7 +5917,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -6423,7 +6423,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -6637,7 +6637,7 @@ "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -7762,7 +7762,7 @@ "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "integrity": "sha1-HxngwuGqDjJ5fEl5nyg3rGr2nFc=", "requires": { "is-obj": "^1.0.0" } @@ -7925,6 +7925,11 @@ "iconv-lite": "~0.4.13" } }, + "encoding-japanese": { + "version": "1.0.30", + "resolved": "https://registry.npmjs.org/encoding-japanese/-/encoding-japanese-1.0.30.tgz", + "integrity": "sha512-bd/DFLAoJetvv7ar/KIpE3CNO8wEuyrt9Xuw6nSMiZ+Vrz/Q21BPsMHvARL2Wz6IKHKXgb+DWZqtRg1vql9cBg==" + }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -8889,7 +8894,7 @@ }, "file-loader": { "version": "1.1.11", - "resolved": "http://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", "dev": true, "requires": { @@ -10075,7 +10080,7 @@ "global-modules": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=", "dev": true, "requires": { "global-prefix": "^1.0.1", @@ -11412,8 +11417,7 @@ "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "helmet": { "version": "3.21.2", @@ -11613,6 +11617,17 @@ } } }, + "html-to-text": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-5.1.1.tgz", + "integrity": "sha512-Bci6bD/JIfZSvG4s0gW/9mMKwBRoe/1RWLxUME/d6WUSZCdY7T60bssf/jFf7EYXRyqU4P5xdClVqiYU0/ypdA==", + "requires": { + "he": "^1.2.0", + "htmlparser2": "^3.10.1", + "lodash": "^4.17.11", + "minimist": "^1.2.0" + } + }, "html-webpack-plugin": { "version": "4.0.0-beta.11", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.11.tgz", @@ -11848,6 +11863,38 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "imap": { + "version": "0.8.19", + "resolved": "https://registry.npmjs.org/imap/-/imap-0.8.19.tgz", + "integrity": "sha1-NniHOTSrCc6mukh0HyhNoq9Z2NU=", + "requires": { + "readable-stream": "1.1.x", + "utf7": ">=1.0.2" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, "import-fresh": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", @@ -12258,7 +12305,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -12612,7 +12659,7 @@ "jasmine-spec-reporter": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", - "integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", + "integrity": "sha1-HWMq7ANBZwrTJPkrqEtLMrNeniI=", "dev": true, "requires": { "colors": "1.1.2" @@ -17602,6 +17649,32 @@ "type-check": "~0.3.2" } }, + "libbase64": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/libbase64/-/libbase64-1.2.1.tgz", + "integrity": "sha512-l+nePcPbIG1fNlqMzrh68MLkX/gTxk/+vdvAb388Ssi7UuUN31MI44w4Yf33mM3Cm4xDfw48mdf3rkdHszLNew==" + }, + "libmime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/libmime/-/libmime-5.0.0.tgz", + "integrity": "sha512-2Bm96d5ktnE217Ib1FldvUaPAaOst6GtZrsxJCwnJgi9lnsoAKIHyU0sae8rNx6DNYbjdqqh8lv5/b9poD8qOg==", + "requires": { + "encoding-japanese": "1.0.30", + "iconv-lite": "0.6.2", + "libbase64": "1.2.1", + "libqp": "1.1.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, "liboneandone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/liboneandone/-/liboneandone-1.2.0.tgz", @@ -17611,6 +17684,11 @@ "request": "^2.74.0" } }, + "libqp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz", + "integrity": "sha1-9ebgatdLeU+1tbZpiL9yjvHe2+g=" + }, "liftoff": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", @@ -17633,6 +17711,14 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-gDBO4aHNZS6coiZCKVhSNh43F9ioIL4JwRjLZPkoLIY4yZFwg264Y5lu2x6rb1Js42Gh6Yqm2f6L2AJcnkzinQ==", + "requires": { + "uc.micro": "^1.0.1" + } + }, "load-json-file": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -18379,6 +18465,68 @@ "yallist": "^3.0.2" } }, + "mailparser": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/mailparser/-/mailparser-2.8.0.tgz", + "integrity": "sha512-Ja5H6/I1NKIFdFJF5HdZkaMGCN8F+1lu3870ZmrabkHQshhrPk4OWeEMiF0OVo82+6XJqemJPCg6pqgXaj3B6Q==", + "requires": { + "encoding-japanese": "1.0.30", + "he": "1.2.0", + "html-to-text": "5.1.1", + "iconv-lite": "0.6.2", + "libmime": "5.0.0", + "linkify-it": "3.0.2", + "mailsplit": "5.0.0", + "nodemailer": "6.4.10", + "tlds": "1.207.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "nodemailer": { + "version": "6.4.10", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.10.tgz", + "integrity": "sha512-j+pS9CURhPgk6r0ENr7dji+As2xZiHSvZeVnzKniLOw1eRAyM/7flP0u65tCnsapV8JFu+t0l/5VeHsCZEeh9g==" + } + } + }, + "mailsplit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mailsplit/-/mailsplit-5.0.0.tgz", + "integrity": "sha512-HeXA0eyCKBtZqbr7uoeb3Nn2L7VV8Vm27x6/YBb0ZiNzRzLoNS2PqRgGYADwh0cBzLYtqddq40bSSirqLO2LGw==", + "requires": { + "libbase64": "1.2.1", + "libmime": "4.2.1", + "libqp": "1.1.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.0.tgz", + "integrity": "sha512-NnEhI9hIEKHOzJ4f697DMz9IQEXr/MMJ5w64vN2/4Ai+wRnvV7SBrL0KLoRlwaKVghOc7LQ5YkPLuX146b6Ydw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "libmime": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/libmime/-/libmime-4.2.1.tgz", + "integrity": "sha512-09y7zjSc5im1aNsq815zgo4/G3DnIzym3aDOHsGq4Ee5vrX4PdgQRybAsztz9Rv0NhO+J5C0llEUloa3sUmjmA==", + "requires": { + "encoding-japanese": "1.0.30", + "iconv-lite": "0.5.0", + "libbase64": "1.2.1", + "libqp": "1.1.0" + } + } + } + }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -21087,7 +21235,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -21474,7 +21622,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -21675,7 +21823,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { @@ -22123,7 +22271,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", "dev": true, "requires": { "define-property": "^1.0.0", @@ -22174,7 +22322,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -22458,7 +22606,7 @@ "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -23596,6 +23744,11 @@ "setimmediate": "^1.0.4" } }, + "tlds": { + "version": "1.207.0", + "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.207.0.tgz", + "integrity": "sha512-k7d7Q1LqjtAvhtEOs3yN14EabsNO8ZCoY6RESSJDB9lst3bTx3as/m1UuAeCKzYxiyhR1qq72ZPhpSf+qlqiwg==" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -23731,7 +23884,7 @@ "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "integrity": "sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=", "dev": true, "requires": { "nopt": "~1.0.10" @@ -23880,6 +24033,11 @@ "is-typedarray": "^1.0.0" } }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "uglify-js": { "version": "3.4.10", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", @@ -24220,6 +24378,21 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, + "utf7": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utf7/-/utf7-1.0.2.tgz", + "integrity": "sha1-lV9JCq5lO6IguUVqCod2wZk2CZE=", + "requires": { + "semver": "~5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" + } + } + }, "utf8-bytes": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/utf8-bytes/-/utf8-bytes-0.0.1.tgz", @@ -25009,7 +25182,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -25022,7 +25195,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -25495,7 +25668,7 @@ }, "xmlbuilder": { "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" }, "xmlchars": { diff --git a/package.json b/package.json index b7cca0364..837eab8b3 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "fs-extra": "^5.0.0", "helmet": "^3.21.2", "i18n": "^0.8.4", + "imap": "^0.8.19", "loopback": "^3.26.0", "loopback-boot": "^2.27.1", "loopback-component-explorer": "^6.5.0", @@ -23,6 +24,7 @@ "loopback-connector-mysql": "^5.4.3", "loopback-connector-remote": "^3.4.1", "loopback-context": "^3.4.0", + "mailparser": "^2.8.0", "md5": "^2.2.1", "object-diff": "0.0.4", "object.pick": "^1.3.0", From fa344f4ff68e3fc00e192f56352138bb7cbcdb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20S=C3=A1nchez?= Date: Sat, 19 Sep 2020 13:02:00 +0200 Subject: [PATCH 03/25] 2449 - Autocompletion --- front/core/components/autocomplete/index.js | 4 +- front/core/components/drop-down/index.js | 3 ++ .../front/basic-data/step-one/index.html | 11 ++++-- .../ticket/front/basic-data/step-one/index.js | 12 +++++- .../back/methods/agency-mode/byWarehouse.js | 38 +++++++++++++++++++ modules/zone/back/models/agency-mode.js | 3 ++ 6 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 modules/zone/back/methods/agency-mode/byWarehouse.js create mode 100644 modules/zone/back/models/agency-mode.js diff --git a/front/core/components/autocomplete/index.js b/front/core/components/autocomplete/index.js index 30e984fc6..b335d266f 100755 --- a/front/core/components/autocomplete/index.js +++ b/front/core/components/autocomplete/index.js @@ -248,7 +248,8 @@ export default class Autocomplete extends Field { 'where', 'order', 'limit', - 'searchFunction' + 'searchFunction', + 'whereFunction' ]); } @@ -290,6 +291,7 @@ ngModule.vnComponent('vnAutocomplete', { limit: ' + ng-model="$ctrl.agencyModeId" + where="{warehouseFk: $ctrl.warehouseId}"> + vn-acl="productionBoss" + where-function="$ctrl.zoneWhere()"> {{::name}} - Max. {{::hour | date: 'HH:mm'}} h. diff --git a/modules/ticket/front/basic-data/step-one/index.js b/modules/ticket/front/basic-data/step-one/index.js index 45fd397dd..0e18326ae 100644 --- a/modules/ticket/front/basic-data/step-one/index.js +++ b/modules/ticket/front/basic-data/step-one/index.js @@ -56,12 +56,14 @@ class Controller extends Component { set warehouseId(value) { if (value != this.ticket.warehouseFk) { this.ticket.warehouseFk = value; - this.getShipped({ + this.ticket.agencyModeFk = null; + this.ticket.zoneFk = null; + /* this.getShipped({ landed: this.ticket.landed, addressFk: this.ticket.addressFk, agencyModeFk: this.ticket.agencyModeFk, warehouseFk: value - }); + }); */ } } @@ -241,6 +243,12 @@ class Controller extends Component { || !this.ticket.companyFk || !this.ticket.shipped || !this.ticket.landed || !this.ticket.zoneFk; } + + zoneWhere() { + if (this.agencyModeId) + return {agencyModeFk: this.agencyModeId}; + return {}; + } } ngModule.vnComponent('vnTicketBasicDataStepOne', { diff --git a/modules/zone/back/methods/agency-mode/byWarehouse.js b/modules/zone/back/methods/agency-mode/byWarehouse.js new file mode 100644 index 000000000..c89217eef --- /dev/null +++ b/modules/zone/back/methods/agency-mode/byWarehouse.js @@ -0,0 +1,38 @@ +const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; +const mergeFilters = require('vn-loopback/util/filter').mergeFilters; + +module.exports = Self => { + Self.remoteMethod('byWarehouse', { + description: 'Returns a list of agencies from a warehouse', + accepts: [{ + arg: 'filter', + type: 'Object', + description: `Filter defining where, order, offset, and limit - must be a JSON-encoded string` + }], + returns: { + type: ['object'], + root: true + }, + http: { + path: `/byWarehouse`, + verb: 'GET' + } + }); + + Self.byWarehouse = async filter => { + const conn = Self.dataSource.connector; + const where = {isActive: true}; + filter = mergeFilters(filter, {where}); + + let stmt = new ParameterizedSQL( + `SELECT id, name + FROM ( + SELECT DISTINCT am.id, am.name, am.isActive, zw.warehouseFk + FROM zoneWarehouse zw + JOIN zone z ON z.id = zw.zoneFk + JOIN agencyMode am ON am.id = z.agencyModeFk) am`); + stmt.merge(conn.makeSuffix(filter)); + + return conn.executeStmt(stmt); + }; +}; diff --git a/modules/zone/back/models/agency-mode.js b/modules/zone/back/models/agency-mode.js new file mode 100644 index 000000000..93658f471 --- /dev/null +++ b/modules/zone/back/models/agency-mode.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/agency-mode/byWarehouse')(Self); +}; From ae3d00bad198a9449c74fcbbb81905ed8d26c626 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 22 Sep 2020 07:38:20 +0200 Subject: [PATCH 04/25] Added new method --- .../front/basic-data/step-one/index.html | 2 +- .../ticket/front/basic-data/step-one/index.js | 10 +++- .../back/methods/zone/includingExpired.js | 60 +++++++++++++++++++ modules/zone/back/models/zone.js | 1 + 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 modules/zone/back/methods/zone/includingExpired.js diff --git a/modules/ticket/front/basic-data/step-one/index.html b/modules/ticket/front/basic-data/step-one/index.html index eb2fe9560..59435635e 100644 --- a/modules/ticket/front/basic-data/step-one/index.html +++ b/modules/ticket/front/basic-data/step-one/index.html @@ -70,7 +70,7 @@ { + Self.remoteMethod('includingExpired', { + description: 'Returns a list of agencies from a warehouse', + accepts: [{ + arg: 'filter', + type: 'Object', + description: `Filter defining where, order, offset, and limit - must be a JSON-encoded string` + }], + returns: { + type: ['object'], + root: true + }, + http: { + path: `/includingExpired`, + verb: 'GET' + } + }); + + Self.includingExpired = async filter => { + const conn = Self.dataSource.connector; + const where = filter.where; + // filter = mergeFilters(filter, {where}); + const stmts = []; + let stmt; + + console.log(where); + + if (where.agencyModeFk) { + stmt = new ParameterizedSQL(`CALL vn.zone_getLanded(?, ?, ?, ?, ?)`, [ + where.shipped, + where.addressFk, + where.agencyModeFk, + where.warehouseFk, + true]); + stmts.push(stmt); + } + + stmt = new ParameterizedSQL( + `SELECT id, name, agencyModeFk + FROM vn.zone z`); + + if (where.agencyModeFk) + stmt.merge(`JOIN tmp.zoneGetLanded zgl ON zgl.zoneFk = z.id`); + + stmt.merge(conn.makePagination(filter)); + + let index; + if (stmts.length) + index = stmts.push(stmt) - 1; + else stmts.push(stmt); + + const sql = ParameterizedSQL.join(stmts, ';'); + const result = await conn.executeStmt(sql); + + return index ? result[index] : result; + }; +}; diff --git a/modules/zone/back/models/zone.js b/modules/zone/back/models/zone.js index b0f21c998..0b1b9d106 100644 --- a/modules/zone/back/models/zone.js +++ b/modules/zone/back/models/zone.js @@ -5,6 +5,7 @@ module.exports = Self => { require('../methods/zone/toggleIsIncluded')(Self); require('../methods/zone/getUpcomingDeliveries')(Self); require('../methods/zone/deleteZone')(Self); + require('../methods/zone/includingExpired')(Self); Self.validatesPresenceOf('agencyModeFk', { message: `Agency cannot be blank` From 89667a18c90155eb7427adfd6932ea6a42c089c5 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 22 Sep 2020 07:50:30 +0200 Subject: [PATCH 05/25] Handle ticket without old state --- .../ticket/back/methods/ticket-tracking/changeState.js | 8 +++++--- package-lock.json | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ticket/back/methods/ticket-tracking/changeState.js b/modules/ticket/back/methods/ticket-tracking/changeState.js index e28413b24..f7baeecfd 100644 --- a/modules/ticket/back/methods/ticket-tracking/changeState.js +++ b/modules/ticket/back/methods/ticket-tracking/changeState.js @@ -40,15 +40,17 @@ module.exports = Self => { params.workerFk = worker.id; } - let ticket = await models.TicketState.findById( + let ticketState = await models.TicketState.findById( params.ticketFk, {fields: ['stateFk']} ); - let oldStateAllowed = await models.State.isEditable(ctx, ticket.stateFk); + let oldStateAllowed; + if (ticketState) + oldStateAllowed = await models.State.isEditable(ctx, ticketState.stateFk); let newStateAllowed = await models.State.isEditable(ctx, params.stateFk); - let isAllowed = oldStateAllowed && newStateAllowed; + let isAllowed = (!ticketState || oldStateAllowed == true) && newStateAllowed == true; if (!isAllowed) throw new UserError(`You don't have enough privileges`, 'ACCESS_DENIED'); diff --git a/package-lock.json b/package-lock.json index 601f6681b..b5a27cb21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22928,7 +22928,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { From 06f03c6b849c7d50afd49d8011aa2c1c0c93c13d Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 22 Sep 2020 13:59:00 +0200 Subject: [PATCH 06/25] mail models and fix checkInbox --- back/methods/imap-time-control/checkInbox.js | 165 +++++++++++++------ back/model-config.json | 3 + back/models/mail-forward.json | 26 +++ back/models/mail.json | 3 +- db/tests/vn/workerTimeControlCheck.spec.js | 2 +- modules/worker/back/models/worker.json | 3 + 6 files changed, 145 insertions(+), 57 deletions(-) create mode 100644 back/models/mail-forward.json diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index ff0b0a46e..4f3cb06b0 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -1,5 +1,5 @@ const Imap = require('imap'); - +const {NULL} = require('node-sass'); module.exports = Self => { Self.remoteMethod('checkInbox', { description: 'Check an email inbox and process it', @@ -26,7 +26,8 @@ module.exports = Self => { tls: true }); let isEmailOk; - let emailText = ''; + let uid; + let emailBody; function openInbox(cb) { imap.openBox('INBOX', true, cb); @@ -35,7 +36,7 @@ module.exports = Self => { imap.once('ready', function() { openInbox(function(err, box) { if (err) throw err; - let f = imap.seq.fetch('1:3', { + let f = imap.seq.fetch('1:*', { bodies: ['HEADER.FIELDS (FROM SUBJECT)', '1'], struct: true }); @@ -43,87 +44,143 @@ module.exports = Self => { isEmailOk = false; msg.on('body', function(stream, info) { let buffer = ''; + let bufferCopy = ''; stream.on('data', function(chunk) { + // console.log('chunk', chunk); buffer = chunk.toString('utf8'); - if (info.which === '1') { - emailText = buffer.split('\n')[0]; - emailText = emailText.toUpperCase(); - emailText = emailText.replace(/\s/g, ''); - if (emailText === 'OK') - isEmailOk = true; // isEmailOk + // console.log('buffer', buffer); + if (info.which === '1' && bufferCopy.length == 0) + bufferCopy = buffer.replace(/\s/g, ' '); + }); + stream.on('end', function() { + if (bufferCopy.length > 0) { + emailBody = bufferCopy.toUpperCase().trim(); + + const bodyPositionOK = emailBody.match(/\bOK\b/i); + + if (bodyPositionOK != null && (bodyPositionOK.index == 0 || bodyPositionOK.index == 122)) + isEmailOk = true; + else + isEmailOk = false; } }); - stream.once('end', function() { + msg.once('attributes', function(attrs) { + uid = attrs.uid; + // let structure = attrs.struct[2][0]; + // console.log('attrs.struct', structure); + // console.log('attrs', structure.params); + // console.log('attrs.struct', structure.find(item => item.subtype === 'html')); + }); + msg.once('end', function() { if (info.which === 'HEADER.FIELDS (FROM SUBJECT)') { - console.log('isEmailOk', isEmailOk); if (isEmailOk) { + imap.move(uid, 'exito', function(err) { + }); emailConfirm(buffer); - imap.seq.move(seqno, 'exito', function(err) { - console.log('Move correcte: ' + err); - console.log('Move error: ' + seqno); - }); } else { - emailReply(buffer); - imap.seq.move(seqno, 'error', function(err) { - console.log('Move error: ' + err); - console.log('Move error: ' + seqno); + imap.move(uid, 'error', function(err) { }); + emailReply(buffer, emailBody); } } }); }); }); - // msg.on('attributes', function(attrs) { - // console.log('ATRIBUTO', attrs.struct[0]); - // console.log('ATRIBUTO', attrs.struct[0].params); - // }); + f.once('end', function() { + imap.end(); + }); }); }); imap.connect(); - return 'pepinillos'; + return 'Leer emails de gestion horaria'; }; - async function getUser(workerEmail) { - let firstPosition = workerEmail.search('<') + 1; - let lastPosition = workerEmail.search('@') - firstPosition; - let userName = workerEmail.substr(firstPosition, lastPosition); - let user = await Self.app.models.Account.findOne({where: {name: userName}}); - return user; - } - - async function getEmailDate(subject) { - let date = subject.match(/\d+/g); - return date; - } async function emailConfirm(buffer) { - let now = new Date(); - let from = JSON.stringify(Imap.parseHeader(buffer).from); - let subject = JSON.stringify(Imap.parseHeader(buffer).subject); + // try { + const now = new Date(); + const from = JSON.stringify(Imap.parseHeader(buffer).from); + const subject = JSON.stringify(Imap.parseHeader(buffer).subject); - let timeControlDate = await getEmailDate(subject); - let week = timeControlDate[0]; - let year = timeControlDate[1]; - let user = await getUser(from); + const timeControlDate = await getEmailDate(subject); + const week = timeControlDate[0]; + const year = timeControlDate[1]; + const user = await getUser(from); let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ where: { week: week, year: year, - worker: user.id + workerFk: user.id } }); - await workerMail.updateAttributes({ - updated: now, - state: 'CONFIRMED' - }); - // MOVER A CARPETA EXITO + if (workerMail != NULL) { + await workerMail.updateAttributes({ + updated: now, + state: 'CONFIRMED' + }); + } + // } catch (err) { + // throw err; + // } } - async function emailReply(subject, workerEmail) { - console.log('bbbbb'); - // INSERT EN VN.MAIL - // UPDATE EN WORKERTIMECONTROLMAIL - // MOVER A CARPETA ERROR + async function emailReply(buffer, emailBody) { + // try { + const now = new Date(); + const from = JSON.stringify(Imap.parseHeader(buffer).from); + const subject = JSON.stringify(Imap.parseHeader(buffer).subject); + + const timeControlDate = await getEmailDate(subject); + const week = timeControlDate[0]; + const year = timeControlDate[1]; + const user = await getUser(from); + + let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } + }); + if (workerMail != NULL) { + await workerMail.updateAttributes({ + updated: now, + state: 'REVISE' + }); + } + + await sendMail(user, subject, emailBody); + // } catch (err) { + // throw err; + // } + } + + async function getUser(workerEmail) { + const userEmail = workerEmail.match(/(?<=<)(.*?)(?=>)/); + + let [user] = await Self.rawSql(`SELECT u.id,u.name FROM account.user u + LEFT JOIN account.mailForward m on m.account = u.id + WHERE forwardTo =? OR + CONCAT(u.name,'@verdnatura.es') = ?`, + [userEmail[0], userEmail[0]]); + + return user; + } + + async function getEmailDate(subject) { + const date = subject.match(/\d+/g); + return date; + } + + async function sendMail(user, subject, emailBody) { + const sendTo = 'rrhh@verdnatura.es'; + const emailSubject = subject + ' ' + user.name; + + await Self.app.models.Mail.create({ + sender: sendTo, + subject: emailSubject, + body: emailBody + }); } }; diff --git a/back/model-config.json b/back/model-config.json index 46733696f..07900448c 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -79,6 +79,9 @@ }, "Mail": { "dataSource": "vn" + }, + "MailForward": { + "dataSource": "vn" } } diff --git a/back/models/mail-forward.json b/back/models/mail-forward.json new file mode 100644 index 000000000..40b695a7a --- /dev/null +++ b/back/models/mail-forward.json @@ -0,0 +1,26 @@ +{ + "name": "MailForward", + "base": "VnModel", + "options": { + "mysql": { + "table": "account.mailForward" + } + }, + "properties": { + "account": { + "id": true, + "type": "Number" + }, + "forwardTo": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/mail.json b/back/models/mail.json index cf5c11993..3861460f3 100644 --- a/back/models/mail.json +++ b/back/models/mail.json @@ -9,8 +9,7 @@ "properties": { "id": { "id": true, - "type": "Number", - "required": true + "type": "Number" }, "sender": { "type": "String" diff --git a/db/tests/vn/workerTimeControlCheck.spec.js b/db/tests/vn/workerTimeControlCheck.spec.js index 4869e38a6..f70a0b1c3 100644 --- a/db/tests/vn/workerTimeControlCheck.spec.js +++ b/db/tests/vn/workerTimeControlCheck.spec.js @@ -1,7 +1,7 @@ const app = require('vn-loopback/server/server'); const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; -// #2257 xdescribe dbtest workerTimeControl_check() +// #2261 xdescribe dbtest workerTimeControl_check() xdescribe('worker workerTimeControl_check()', () => { it(`should throw an error if the worker can't sign on that tablet`, async() => { let stmts = []; diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 6af7e8608..45eee23bf 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -31,6 +31,9 @@ "userFk": { "type" : "Number", "required": true + }, + "bossFk": { + "type" : "Number" } }, "relations": { From 2b2970bfcd1af3c6db22f8a941eef213bc585c4a Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 23 Sep 2020 07:35:45 +0200 Subject: [PATCH 07/25] fix checkInbox --- back/methods/imap-time-control/checkInbox.js | 64 +++++++++----------- back/models/worker-time-control-mail.json | 3 + 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index 4f3cb06b0..a79fe4418 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -46,9 +46,7 @@ module.exports = Self => { let buffer = ''; let bufferCopy = ''; stream.on('data', function(chunk) { - // console.log('chunk', chunk); buffer = chunk.toString('utf8'); - // console.log('buffer', buffer); if (info.which === '1' && bufferCopy.length == 0) bufferCopy = buffer.replace(/\s/g, ' '); }); @@ -66,10 +64,6 @@ module.exports = Self => { }); msg.once('attributes', function(attrs) { uid = attrs.uid; - // let structure = attrs.struct[2][0]; - // console.log('attrs.struct', structure); - // console.log('attrs', structure.params); - // console.log('attrs.struct', structure.find(item => item.subtype === 'html')); }); msg.once('end', function() { if (info.which === 'HEADER.FIELDS (FROM SUBJECT)') { @@ -97,7 +91,7 @@ module.exports = Self => { }; async function emailConfirm(buffer) { - // try { + console.log('buffer', buffer); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); @@ -106,27 +100,28 @@ module.exports = Self => { const week = timeControlDate[0]; const year = timeControlDate[1]; const user = await getUser(from); + let workerMail; - let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ - where: { - week: week, - year: year, - workerFk: user.id - } - }); + if (user.id != NULL) { + workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } + }); + } if (workerMail != NULL) { await workerMail.updateAttributes({ updated: now, state: 'CONFIRMED' }); } - // } catch (err) { - // throw err; - // } } async function emailReply(buffer, emailBody) { - // try { + console.log('buffer', buffer); + console.log('emailBody', emailBody); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); @@ -135,25 +130,26 @@ module.exports = Self => { const week = timeControlDate[0]; const year = timeControlDate[1]; const user = await getUser(from); + let workerMail; - let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ - where: { - week: week, - year: year, - workerFk: user.id - } - }); - if (workerMail != NULL) { - await workerMail.updateAttributes({ - updated: now, - state: 'REVISE' + if (user.id != NULL) { + workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } }); - } - await sendMail(user, subject, emailBody); - // } catch (err) { - // throw err; - // } + if (workerMail != NULL) { + await workerMail.updateAttributes({ + updated: now, + state: 'REVISE', + emailResponse: emailBody + }); + } else + await sendMail(user, subject, emailBody); + } } async function getUser(workerEmail) { diff --git a/back/models/worker-time-control-mail.json b/back/models/worker-time-control-mail.json index 4a0fd31f1..81ca235d7 100644 --- a/back/models/worker-time-control-mail.json +++ b/back/models/worker-time-control-mail.json @@ -26,6 +26,9 @@ }, "updated": { "type": "Date" + }, + "emailResponse": { + "type": "String" } }, "acls": [ From d4c819ebf722e7c8cd185cd26f4f00ac711aa271 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 11 Aug 2020 11:03:43 +0200 Subject: [PATCH 08/25] new models and fixtures --- back/model-config.json | 9 +++++ back/models/mail.json | 36 +++++++++++++++++ back/models/worker-time-control-mail.json | 39 +++++++++++++++++++ back/models/worker-time-control-params.js | 3 ++ back/models/worker-time-control-params.json | 35 +++++++++++++++++ .../00-workerTimeControlParams.sql | 6 +++ db/dump/fixtures.sql | 4 +- 7 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 back/models/mail.json create mode 100644 back/models/worker-time-control-mail.json create mode 100644 back/models/worker-time-control-params.js create mode 100644 back/models/worker-time-control-params.json create mode 100644 db/changes/12300-Summer/00-workerTimeControlParams.sql diff --git a/back/model-config.json b/back/model-config.json index dc5cde217..46733696f 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -70,6 +70,15 @@ }, "UserLog": { "dataSource": "vn" + }, + "WorkerTimeControlParams": { + "dataSource": "vn" + }, + "WorkerTimeControlMail": { + "dataSource": "vn" + }, + "Mail": { + "dataSource": "vn" } } diff --git a/back/models/mail.json b/back/models/mail.json new file mode 100644 index 000000000..cf5c11993 --- /dev/null +++ b/back/models/mail.json @@ -0,0 +1,36 @@ +{ + "name": "Mail", + "base": "VnModel", + "options": { + "mysql": { + "table": "mail" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "required": true + }, + "sender": { + "type": "String" + }, + "replyTo": { + "type": "String" + }, + "subject": { + "type": "String" + }, + "body": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/worker-time-control-mail.json b/back/models/worker-time-control-mail.json new file mode 100644 index 000000000..4a0fd31f1 --- /dev/null +++ b/back/models/worker-time-control-mail.json @@ -0,0 +1,39 @@ +{ + "name": "WorkerTimeControlMail", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerTimeControlMail" + } + }, + "properties": { + "id": { + "id": true, + "type": "Number", + "required": true + }, + "workerFk": { + "type": "Number" + }, + "year": { + "type": "Number" + }, + "week": { + "type": "Number" + }, + "state": { + "type": "String" + }, + "updated": { + "type": "Date" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/worker-time-control-params.js b/back/models/worker-time-control-params.js new file mode 100644 index 000000000..c71d4c237 --- /dev/null +++ b/back/models/worker-time-control-params.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/imap-time-control/checkInbox')(Self); +}; diff --git a/back/models/worker-time-control-params.json b/back/models/worker-time-control-params.json new file mode 100644 index 000000000..cc904cf40 --- /dev/null +++ b/back/models/worker-time-control-params.json @@ -0,0 +1,35 @@ +{ + "name": "WorkerTimeControlParams", + "description": "imap config", + "base": "VnModel", + "options": { + "mysql": { + "table": "workerTimeControlParams" + } + }, + "properties": { + "mailHost": { + "type": "String" + }, + "mailUser": { + "type": "String" + }, + "mailPass": { + "type": "String" + }, + "mailSuccessFolder": { + "type": "String" + }, + "mailErrorFolder": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/db/changes/12300-Summer/00-workerTimeControlParams.sql b/db/changes/12300-Summer/00-workerTimeControlParams.sql new file mode 100644 index 000000000..47ef2e3ea --- /dev/null +++ b/db/changes/12300-Summer/00-workerTimeControlParams.sql @@ -0,0 +1,6 @@ +ALTER TABLE `vn`.`workerTimeControlParams` +ADD COLUMN `mailUser` VARCHAR(45) NOT NULL AFTER `askInOut`, +ADD COLUMN `mailPass` VARCHAR(45) NOT NULL AFTER `mailUser`, +ADD COLUMN `mailHost` VARCHAR(45) NOT NULL AFTER `mailPass`, +ADD COLUMN `mailSuccessFolder` VARCHAR(45) NOT NULL AFTER `mailHost`, +ADD COLUMN `mailErrorFolder` VARCHAR(45) NOT NULL AFTER `mailSuccessFolder`; diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 22fa2076a..5d886c9d8 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2067,9 +2067,9 @@ INSERT INTO `vn`.`queuePriority`(`id`, `priority`) (2, 'Normal'), (3, 'Baja'); -INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`) +INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`, `mailSuccessFolder`, `mailErrorFolder`) VALUES - (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000); + (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000, 'Leidos.exito', 'Leidos.error'); INSERT IGNORE INTO `vn`.`greugeConfig` (`id`, `freightPickUpPrice`) VALUES ('1', '11'); From 01574b8967ff0332373c411a992eded5360c2ac0 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 11 Aug 2020 11:12:40 +0200 Subject: [PATCH 09/25] new method for imap --- back/methods/imap-time-control/checkInbox.js | 129 +++++++++++++ package-lock.json | 183 ++++++++++++++++++- package.json | 2 + 3 files changed, 309 insertions(+), 5 deletions(-) create mode 100644 back/methods/imap-time-control/checkInbox.js diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js new file mode 100644 index 000000000..ff0b0a46e --- /dev/null +++ b/back/methods/imap-time-control/checkInbox.js @@ -0,0 +1,129 @@ +const Imap = require('imap'); + +module.exports = Self => { + Self.remoteMethod('checkInbox', { + description: 'Check an email inbox and process it', + accessType: 'READ', + returns: + { + arg: 'body', + type: 'file', + root: true + }, + http: { + path: `/checkInbox`, + verb: 'GET' + } + }); + + Self.checkInbox = async() => { + let imapConfig = await Self.app.models.WorkerTimeControlParams.findOne(); + let imap = new Imap({ + user: imapConfig.mailUser, + password: imapConfig.mailPass, + host: imapConfig.mailHost, + port: 993, + tls: true + }); + let isEmailOk; + let emailText = ''; + + function openInbox(cb) { + imap.openBox('INBOX', true, cb); + } + + imap.once('ready', function() { + openInbox(function(err, box) { + if (err) throw err; + let f = imap.seq.fetch('1:3', { + bodies: ['HEADER.FIELDS (FROM SUBJECT)', '1'], + struct: true + }); + f.on('message', function(msg, seqno) { + isEmailOk = false; + msg.on('body', function(stream, info) { + let buffer = ''; + stream.on('data', function(chunk) { + buffer = chunk.toString('utf8'); + if (info.which === '1') { + emailText = buffer.split('\n')[0]; + emailText = emailText.toUpperCase(); + emailText = emailText.replace(/\s/g, ''); + if (emailText === 'OK') + isEmailOk = true; // isEmailOk + } + }); + stream.once('end', function() { + if (info.which === 'HEADER.FIELDS (FROM SUBJECT)') { + console.log('isEmailOk', isEmailOk); + if (isEmailOk) { + emailConfirm(buffer); + imap.seq.move(seqno, 'exito', function(err) { + console.log('Move correcte: ' + err); + console.log('Move error: ' + seqno); + }); + } else { + emailReply(buffer); + imap.seq.move(seqno, 'error', function(err) { + console.log('Move error: ' + err); + console.log('Move error: ' + seqno); + }); + } + } + }); + }); + }); + // msg.on('attributes', function(attrs) { + // console.log('ATRIBUTO', attrs.struct[0]); + // console.log('ATRIBUTO', attrs.struct[0].params); + // }); + }); + }); + + imap.connect(); + return 'pepinillos'; + }; + async function getUser(workerEmail) { + let firstPosition = workerEmail.search('<') + 1; + let lastPosition = workerEmail.search('@') - firstPosition; + let userName = workerEmail.substr(firstPosition, lastPosition); + let user = await Self.app.models.Account.findOne({where: {name: userName}}); + return user; + } + + async function getEmailDate(subject) { + let date = subject.match(/\d+/g); + return date; + } + + async function emailConfirm(buffer) { + let now = new Date(); + let from = JSON.stringify(Imap.parseHeader(buffer).from); + let subject = JSON.stringify(Imap.parseHeader(buffer).subject); + + let timeControlDate = await getEmailDate(subject); + let week = timeControlDate[0]; + let year = timeControlDate[1]; + let user = await getUser(from); + + let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + worker: user.id + } + }); + await workerMail.updateAttributes({ + updated: now, + state: 'CONFIRMED' + }); + // MOVER A CARPETA EXITO + } + async function emailReply(subject, workerEmail) { + console.log('bbbbb'); + + // INSERT EN VN.MAIL + // UPDATE EN WORKERTIMECONTROLMAIL + // MOVER A CARPETA ERROR + } +}; diff --git a/package-lock.json b/package-lock.json index 37af78e3a..8bd4ddb07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8795,6 +8795,11 @@ "iconv-lite": "~0.4.13" } }, + "encoding-japanese": { + "version": "1.0.30", + "resolved": "https://registry.npmjs.org/encoding-japanese/-/encoding-japanese-1.0.30.tgz", + "integrity": "sha512-bd/DFLAoJetvv7ar/KIpE3CNO8wEuyrt9Xuw6nSMiZ+Vrz/Q21BPsMHvARL2Wz6IKHKXgb+DWZqtRg1vql9cBg==" + }, "end-of-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", @@ -12288,8 +12293,7 @@ "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "helmet": { "version": "3.21.2", @@ -12489,6 +12493,17 @@ } } }, + "html-to-text": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-5.1.1.tgz", + "integrity": "sha512-Bci6bD/JIfZSvG4s0gW/9mMKwBRoe/1RWLxUME/d6WUSZCdY7T60bssf/jFf7EYXRyqU4P5xdClVqiYU0/ypdA==", + "requires": { + "he": "^1.2.0", + "htmlparser2": "^3.10.1", + "lodash": "^4.17.11", + "minimist": "^1.2.0" + } + }, "html-webpack-plugin": { "version": "4.0.0-beta.11", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.11.tgz", @@ -12724,6 +12739,38 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "imap": { + "version": "0.8.19", + "resolved": "https://registry.npmjs.org/imap/-/imap-0.8.19.tgz", + "integrity": "sha1-NniHOTSrCc6mukh0HyhNoq9Z2NU=", + "requires": { + "readable-stream": "1.1.x", + "utf7": ">=1.0.2" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, "import-fresh": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", @@ -13488,7 +13535,7 @@ "jasmine-spec-reporter": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", - "integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", + "integrity": "sha1-HWMq7ANBZwrTJPkrqEtLMrNeniI=", "dev": true, "requires": { "colors": "1.1.2" @@ -18481,6 +18528,32 @@ "type-check": "~0.3.2" } }, + "libbase64": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/libbase64/-/libbase64-1.2.1.tgz", + "integrity": "sha512-l+nePcPbIG1fNlqMzrh68MLkX/gTxk/+vdvAb388Ssi7UuUN31MI44w4Yf33mM3Cm4xDfw48mdf3rkdHszLNew==" + }, + "libmime": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/libmime/-/libmime-5.0.0.tgz", + "integrity": "sha512-2Bm96d5ktnE217Ib1FldvUaPAaOst6GtZrsxJCwnJgi9lnsoAKIHyU0sae8rNx6DNYbjdqqh8lv5/b9poD8qOg==", + "requires": { + "encoding-japanese": "1.0.30", + "iconv-lite": "0.6.2", + "libbase64": "1.2.1", + "libqp": "1.1.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, "liboneandone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/liboneandone/-/liboneandone-1.2.0.tgz", @@ -18490,6 +18563,11 @@ "request": "^2.74.0" } }, + "libqp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz", + "integrity": "sha1-9ebgatdLeU+1tbZpiL9yjvHe2+g=" + }, "liftoff": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-3.1.0.tgz", @@ -18512,6 +18590,14 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-gDBO4aHNZS6coiZCKVhSNh43F9ioIL4JwRjLZPkoLIY4yZFwg264Y5lu2x6rb1Js42Gh6Yqm2f6L2AJcnkzinQ==", + "requires": { + "uc.micro": "^1.0.1" + } + }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -19258,6 +19344,68 @@ "yallist": "^3.0.2" } }, + "mailparser": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/mailparser/-/mailparser-2.8.0.tgz", + "integrity": "sha512-Ja5H6/I1NKIFdFJF5HdZkaMGCN8F+1lu3870ZmrabkHQshhrPk4OWeEMiF0OVo82+6XJqemJPCg6pqgXaj3B6Q==", + "requires": { + "encoding-japanese": "1.0.30", + "he": "1.2.0", + "html-to-text": "5.1.1", + "iconv-lite": "0.6.2", + "libmime": "5.0.0", + "linkify-it": "3.0.2", + "mailsplit": "5.0.0", + "nodemailer": "6.4.10", + "tlds": "1.207.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz", + "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "nodemailer": { + "version": "6.4.10", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.4.10.tgz", + "integrity": "sha512-j+pS9CURhPgk6r0ENr7dji+As2xZiHSvZeVnzKniLOw1eRAyM/7flP0u65tCnsapV8JFu+t0l/5VeHsCZEeh9g==" + } + } + }, + "mailsplit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mailsplit/-/mailsplit-5.0.0.tgz", + "integrity": "sha512-HeXA0eyCKBtZqbr7uoeb3Nn2L7VV8Vm27x6/YBb0ZiNzRzLoNS2PqRgGYADwh0cBzLYtqddq40bSSirqLO2LGw==", + "requires": { + "libbase64": "1.2.1", + "libmime": "4.2.1", + "libqp": "1.1.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.0.tgz", + "integrity": "sha512-NnEhI9hIEKHOzJ4f697DMz9IQEXr/MMJ5w64vN2/4Ai+wRnvV7SBrL0KLoRlwaKVghOc7LQ5YkPLuX146b6Ydw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "libmime": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/libmime/-/libmime-4.2.1.tgz", + "integrity": "sha512-09y7zjSc5im1aNsq815zgo4/G3DnIzym3aDOHsGq4Ee5vrX4PdgQRybAsztz9Rv0NhO+J5C0llEUloa3sUmjmA==", + "requires": { + "encoding-japanese": "1.0.30", + "iconv-lite": "0.5.0", + "libbase64": "1.2.1", + "libqp": "1.1.0" + } + } + } + }, "make-dir": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", @@ -24464,6 +24612,11 @@ "setimmediate": "^1.0.4" } }, + "tlds": { + "version": "1.207.0", + "resolved": "https://registry.npmjs.org/tlds/-/tlds-1.207.0.tgz", + "integrity": "sha512-k7d7Q1LqjtAvhtEOs3yN14EabsNO8ZCoY6RESSJDB9lst3bTx3as/m1UuAeCKzYxiyhR1qq72ZPhpSf+qlqiwg==" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -24748,6 +24901,11 @@ "is-typedarray": "^1.0.0" } }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, "uglify-js": { "version": "3.4.10", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", @@ -25088,6 +25246,21 @@ "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, + "utf7": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utf7/-/utf7-1.0.2.tgz", + "integrity": "sha1-lV9JCq5lO6IguUVqCod2wZk2CZE=", + "requires": { + "semver": "~5.3.0" + }, + "dependencies": { + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" + } + } + }, "utf8-bytes": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/utf8-bytes/-/utf8-bytes-0.0.1.tgz", @@ -25877,7 +26050,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -25890,7 +26063,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } diff --git a/package.json b/package.json index f9d291467..b407bdfef 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "fs-extra": "^5.0.0", "helmet": "^3.21.2", "i18n": "^0.8.4", + "imap": "^0.8.19", "loopback": "^3.26.0", "loopback-boot": "^2.27.1", "loopback-component-explorer": "^6.5.0", @@ -23,6 +24,7 @@ "loopback-connector-mysql": "^5.4.3", "loopback-connector-remote": "^3.4.1", "loopback-context": "^3.4.0", + "mailparser": "^2.8.0", "md5": "^2.2.1", "object-diff": "0.0.4", "object.pick": "^1.3.0", From ca41b93995fc9d563482aaca7011bd96a0238bbc Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 22 Sep 2020 13:59:00 +0200 Subject: [PATCH 10/25] mail models and fix checkInbox --- back/methods/imap-time-control/checkInbox.js | 165 +++++++++++++------ back/model-config.json | 3 + back/models/mail-forward.json | 26 +++ back/models/mail.json | 3 +- db/tests/vn/workerTimeControlCheck.spec.js | 2 +- modules/worker/back/models/worker.json | 3 + 6 files changed, 145 insertions(+), 57 deletions(-) create mode 100644 back/models/mail-forward.json diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index ff0b0a46e..4f3cb06b0 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -1,5 +1,5 @@ const Imap = require('imap'); - +const {NULL} = require('node-sass'); module.exports = Self => { Self.remoteMethod('checkInbox', { description: 'Check an email inbox and process it', @@ -26,7 +26,8 @@ module.exports = Self => { tls: true }); let isEmailOk; - let emailText = ''; + let uid; + let emailBody; function openInbox(cb) { imap.openBox('INBOX', true, cb); @@ -35,7 +36,7 @@ module.exports = Self => { imap.once('ready', function() { openInbox(function(err, box) { if (err) throw err; - let f = imap.seq.fetch('1:3', { + let f = imap.seq.fetch('1:*', { bodies: ['HEADER.FIELDS (FROM SUBJECT)', '1'], struct: true }); @@ -43,87 +44,143 @@ module.exports = Self => { isEmailOk = false; msg.on('body', function(stream, info) { let buffer = ''; + let bufferCopy = ''; stream.on('data', function(chunk) { + // console.log('chunk', chunk); buffer = chunk.toString('utf8'); - if (info.which === '1') { - emailText = buffer.split('\n')[0]; - emailText = emailText.toUpperCase(); - emailText = emailText.replace(/\s/g, ''); - if (emailText === 'OK') - isEmailOk = true; // isEmailOk + // console.log('buffer', buffer); + if (info.which === '1' && bufferCopy.length == 0) + bufferCopy = buffer.replace(/\s/g, ' '); + }); + stream.on('end', function() { + if (bufferCopy.length > 0) { + emailBody = bufferCopy.toUpperCase().trim(); + + const bodyPositionOK = emailBody.match(/\bOK\b/i); + + if (bodyPositionOK != null && (bodyPositionOK.index == 0 || bodyPositionOK.index == 122)) + isEmailOk = true; + else + isEmailOk = false; } }); - stream.once('end', function() { + msg.once('attributes', function(attrs) { + uid = attrs.uid; + // let structure = attrs.struct[2][0]; + // console.log('attrs.struct', structure); + // console.log('attrs', structure.params); + // console.log('attrs.struct', structure.find(item => item.subtype === 'html')); + }); + msg.once('end', function() { if (info.which === 'HEADER.FIELDS (FROM SUBJECT)') { - console.log('isEmailOk', isEmailOk); if (isEmailOk) { + imap.move(uid, 'exito', function(err) { + }); emailConfirm(buffer); - imap.seq.move(seqno, 'exito', function(err) { - console.log('Move correcte: ' + err); - console.log('Move error: ' + seqno); - }); } else { - emailReply(buffer); - imap.seq.move(seqno, 'error', function(err) { - console.log('Move error: ' + err); - console.log('Move error: ' + seqno); + imap.move(uid, 'error', function(err) { }); + emailReply(buffer, emailBody); } } }); }); }); - // msg.on('attributes', function(attrs) { - // console.log('ATRIBUTO', attrs.struct[0]); - // console.log('ATRIBUTO', attrs.struct[0].params); - // }); + f.once('end', function() { + imap.end(); + }); }); }); imap.connect(); - return 'pepinillos'; + return 'Leer emails de gestion horaria'; }; - async function getUser(workerEmail) { - let firstPosition = workerEmail.search('<') + 1; - let lastPosition = workerEmail.search('@') - firstPosition; - let userName = workerEmail.substr(firstPosition, lastPosition); - let user = await Self.app.models.Account.findOne({where: {name: userName}}); - return user; - } - - async function getEmailDate(subject) { - let date = subject.match(/\d+/g); - return date; - } async function emailConfirm(buffer) { - let now = new Date(); - let from = JSON.stringify(Imap.parseHeader(buffer).from); - let subject = JSON.stringify(Imap.parseHeader(buffer).subject); + // try { + const now = new Date(); + const from = JSON.stringify(Imap.parseHeader(buffer).from); + const subject = JSON.stringify(Imap.parseHeader(buffer).subject); - let timeControlDate = await getEmailDate(subject); - let week = timeControlDate[0]; - let year = timeControlDate[1]; - let user = await getUser(from); + const timeControlDate = await getEmailDate(subject); + const week = timeControlDate[0]; + const year = timeControlDate[1]; + const user = await getUser(from); let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ where: { week: week, year: year, - worker: user.id + workerFk: user.id } }); - await workerMail.updateAttributes({ - updated: now, - state: 'CONFIRMED' - }); - // MOVER A CARPETA EXITO + if (workerMail != NULL) { + await workerMail.updateAttributes({ + updated: now, + state: 'CONFIRMED' + }); + } + // } catch (err) { + // throw err; + // } } - async function emailReply(subject, workerEmail) { - console.log('bbbbb'); - // INSERT EN VN.MAIL - // UPDATE EN WORKERTIMECONTROLMAIL - // MOVER A CARPETA ERROR + async function emailReply(buffer, emailBody) { + // try { + const now = new Date(); + const from = JSON.stringify(Imap.parseHeader(buffer).from); + const subject = JSON.stringify(Imap.parseHeader(buffer).subject); + + const timeControlDate = await getEmailDate(subject); + const week = timeControlDate[0]; + const year = timeControlDate[1]; + const user = await getUser(from); + + let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } + }); + if (workerMail != NULL) { + await workerMail.updateAttributes({ + updated: now, + state: 'REVISE' + }); + } + + await sendMail(user, subject, emailBody); + // } catch (err) { + // throw err; + // } + } + + async function getUser(workerEmail) { + const userEmail = workerEmail.match(/(?<=<)(.*?)(?=>)/); + + let [user] = await Self.rawSql(`SELECT u.id,u.name FROM account.user u + LEFT JOIN account.mailForward m on m.account = u.id + WHERE forwardTo =? OR + CONCAT(u.name,'@verdnatura.es') = ?`, + [userEmail[0], userEmail[0]]); + + return user; + } + + async function getEmailDate(subject) { + const date = subject.match(/\d+/g); + return date; + } + + async function sendMail(user, subject, emailBody) { + const sendTo = 'rrhh@verdnatura.es'; + const emailSubject = subject + ' ' + user.name; + + await Self.app.models.Mail.create({ + sender: sendTo, + subject: emailSubject, + body: emailBody + }); } }; diff --git a/back/model-config.json b/back/model-config.json index 46733696f..07900448c 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -79,6 +79,9 @@ }, "Mail": { "dataSource": "vn" + }, + "MailForward": { + "dataSource": "vn" } } diff --git a/back/models/mail-forward.json b/back/models/mail-forward.json new file mode 100644 index 000000000..40b695a7a --- /dev/null +++ b/back/models/mail-forward.json @@ -0,0 +1,26 @@ +{ + "name": "MailForward", + "base": "VnModel", + "options": { + "mysql": { + "table": "account.mailForward" + } + }, + "properties": { + "account": { + "id": true, + "type": "Number" + }, + "forwardTo": { + "type": "String" + } + }, + "acls": [ + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW" + } + ] +} diff --git a/back/models/mail.json b/back/models/mail.json index cf5c11993..3861460f3 100644 --- a/back/models/mail.json +++ b/back/models/mail.json @@ -9,8 +9,7 @@ "properties": { "id": { "id": true, - "type": "Number", - "required": true + "type": "Number" }, "sender": { "type": "String" diff --git a/db/tests/vn/workerTimeControlCheck.spec.js b/db/tests/vn/workerTimeControlCheck.spec.js index 4869e38a6..f70a0b1c3 100644 --- a/db/tests/vn/workerTimeControlCheck.spec.js +++ b/db/tests/vn/workerTimeControlCheck.spec.js @@ -1,7 +1,7 @@ const app = require('vn-loopback/server/server'); const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; -// #2257 xdescribe dbtest workerTimeControl_check() +// #2261 xdescribe dbtest workerTimeControl_check() xdescribe('worker workerTimeControl_check()', () => { it(`should throw an error if the worker can't sign on that tablet`, async() => { let stmts = []; diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 6af7e8608..45eee23bf 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -31,6 +31,9 @@ "userFk": { "type" : "Number", "required": true + }, + "bossFk": { + "type" : "Number" } }, "relations": { From 28dc557e2fe14da7f57af59c3d70b2c069b708cb Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 23 Sep 2020 07:35:45 +0200 Subject: [PATCH 11/25] fix checkInbox --- back/methods/imap-time-control/checkInbox.js | 64 +++++++++----------- back/models/worker-time-control-mail.json | 3 + 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index 4f3cb06b0..a79fe4418 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -46,9 +46,7 @@ module.exports = Self => { let buffer = ''; let bufferCopy = ''; stream.on('data', function(chunk) { - // console.log('chunk', chunk); buffer = chunk.toString('utf8'); - // console.log('buffer', buffer); if (info.which === '1' && bufferCopy.length == 0) bufferCopy = buffer.replace(/\s/g, ' '); }); @@ -66,10 +64,6 @@ module.exports = Self => { }); msg.once('attributes', function(attrs) { uid = attrs.uid; - // let structure = attrs.struct[2][0]; - // console.log('attrs.struct', structure); - // console.log('attrs', structure.params); - // console.log('attrs.struct', structure.find(item => item.subtype === 'html')); }); msg.once('end', function() { if (info.which === 'HEADER.FIELDS (FROM SUBJECT)') { @@ -97,7 +91,7 @@ module.exports = Self => { }; async function emailConfirm(buffer) { - // try { + console.log('buffer', buffer); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); @@ -106,27 +100,28 @@ module.exports = Self => { const week = timeControlDate[0]; const year = timeControlDate[1]; const user = await getUser(from); + let workerMail; - let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ - where: { - week: week, - year: year, - workerFk: user.id - } - }); + if (user.id != NULL) { + workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } + }); + } if (workerMail != NULL) { await workerMail.updateAttributes({ updated: now, state: 'CONFIRMED' }); } - // } catch (err) { - // throw err; - // } } async function emailReply(buffer, emailBody) { - // try { + console.log('buffer', buffer); + console.log('emailBody', emailBody); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); @@ -135,25 +130,26 @@ module.exports = Self => { const week = timeControlDate[0]; const year = timeControlDate[1]; const user = await getUser(from); + let workerMail; - let workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ - where: { - week: week, - year: year, - workerFk: user.id - } - }); - if (workerMail != NULL) { - await workerMail.updateAttributes({ - updated: now, - state: 'REVISE' + if (user.id != NULL) { + workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ + where: { + week: week, + year: year, + workerFk: user.id + } }); - } - await sendMail(user, subject, emailBody); - // } catch (err) { - // throw err; - // } + if (workerMail != NULL) { + await workerMail.updateAttributes({ + updated: now, + state: 'REVISE', + emailResponse: emailBody + }); + } else + await sendMail(user, subject, emailBody); + } } async function getUser(workerEmail) { diff --git a/back/models/worker-time-control-mail.json b/back/models/worker-time-control-mail.json index 4a0fd31f1..81ca235d7 100644 --- a/back/models/worker-time-control-mail.json +++ b/back/models/worker-time-control-mail.json @@ -26,6 +26,9 @@ }, "updated": { "type": "Date" + }, + "emailResponse": { + "type": "String" } }, "acls": [ From eff0641769bb4158200cf015bb990b9fe44435e3 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 23 Sep 2020 08:13:36 +0200 Subject: [PATCH 12/25] delete console.log --- back/methods/imap-time-control/checkInbox.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index a79fe4418..82e3396e3 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -91,7 +91,6 @@ module.exports = Self => { }; async function emailConfirm(buffer) { - console.log('buffer', buffer); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); @@ -120,8 +119,6 @@ module.exports = Self => { } async function emailReply(buffer, emailBody) { - console.log('buffer', buffer); - console.log('emailBody', emailBody); const now = new Date(); const from = JSON.stringify(Imap.parseHeader(buffer).from); const subject = JSON.stringify(Imap.parseHeader(buffer).subject); From 1f23f6c53c57622041b8e8baa4b27cfc8da10ef8 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 23 Sep 2020 09:11:00 +0200 Subject: [PATCH 13/25] delete import --- back/methods/imap-time-control/checkInbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index 82e3396e3..8cb893c76 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -1,5 +1,5 @@ const Imap = require('imap'); -const {NULL} = require('node-sass'); + module.exports = Self => { Self.remoteMethod('checkInbox', { description: 'Check an email inbox and process it', From 3f4e5a6c0cf821fda0f4d1c9a8477f255612d558 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 23 Sep 2020 09:31:21 +0200 Subject: [PATCH 14/25] fix checkinbox --- back/methods/imap-time-control/checkInbox.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/back/methods/imap-time-control/checkInbox.js b/back/methods/imap-time-control/checkInbox.js index 8cb893c76..6a6b697a7 100644 --- a/back/methods/imap-time-control/checkInbox.js +++ b/back/methods/imap-time-control/checkInbox.js @@ -101,7 +101,7 @@ module.exports = Self => { const user = await getUser(from); let workerMail; - if (user.id != NULL) { + if (user.id != null) { workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ where: { week: week, @@ -110,7 +110,7 @@ module.exports = Self => { } }); } - if (workerMail != NULL) { + if (workerMail != null) { await workerMail.updateAttributes({ updated: now, state: 'CONFIRMED' @@ -129,7 +129,7 @@ module.exports = Self => { const user = await getUser(from); let workerMail; - if (user.id != NULL) { + if (user.id != null) { workerMail = await Self.app.models.WorkerTimeControlMail.findOne({ where: { week: week, @@ -138,7 +138,7 @@ module.exports = Self => { } }); - if (workerMail != NULL) { + if (workerMail != null) { await workerMail.updateAttributes({ updated: now, state: 'REVISE', From 5ec5979a3e1763002555477d439598e1deaea2b1 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 23 Sep 2020 11:21:25 +0200 Subject: [PATCH 15/25] Updated tests --- .../05-ticket/06_basic_data_steps.spec.js | 3 +- .../front/basic-data/step-one/index.html | 2 +- .../ticket/front/basic-data/step-one/index.js | 24 ++++++----- .../front/basic-data/step-one/index.spec.js | 39 ++++++++++++------ .../agency-mode/specs/byWarehouse.spec.js | 21 ++++++++++ modules/zone/back/methods/agency/getLanded.js | 17 ++++---- .../methods/agency/specs/getLanded.spec.js | 4 +- .../back/methods/zone/includingExpired.js | 27 +++++++++---- .../zone/specs/includingExpired.spec.js | 40 +++++++++++++++++++ 9 files changed, 135 insertions(+), 42 deletions(-) create mode 100644 modules/zone/back/methods/agency-mode/specs/byWarehouse.spec.js create mode 100644 modules/zone/back/methods/zone/specs/includingExpired.spec.js diff --git a/e2e/paths/05-ticket/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js index 3191673a5..f9ad65a29 100644 --- a/e2e/paths/05-ticket/06_basic_data_steps.spec.js +++ b/e2e/paths/05-ticket/06_basic_data_steps.spec.js @@ -50,7 +50,7 @@ describe('Ticket Edit basic data path', () => { }); it(`should edit the ticket agency then check there are no zones for it`, async() => { - await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Entanglement'); + await page.autocompleteSearch(selectors.ticketBasicData.agency, 'inhouse pickup'); await page.waitFor(1000); let emptyZone = await page .expectPropertyValue(selectors.ticketBasicData.zone, 'value', ''); @@ -59,6 +59,7 @@ describe('Ticket Edit basic data path', () => { }); it(`should edit the ticket zone then check the agency is for the new zone`, async() => { + await page.clearInput(selectors.ticketBasicData.agency); await page.autocompleteSearch(selectors.ticketBasicData.zone, 'Zone expensive A'); let zone = await page .waitToGetProperty(selectors.ticketBasicData.agency, 'value'); diff --git a/modules/ticket/front/basic-data/step-one/index.html b/modules/ticket/front/basic-data/step-one/index.html index 59435635e..0e8d25b7c 100644 --- a/modules/ticket/front/basic-data/step-one/index.html +++ b/modules/ticket/front/basic-data/step-one/index.html @@ -66,7 +66,7 @@ show-field="name" value-field="id" ng-model="$ctrl.agencyModeId" - where="{warehouseFk: $ctrl.warehouseId}"> + where-function="$ctrl.agencyModeWhere()"> { jest.spyOn(controller, 'getShipped'); controller.ticket.warehouseId = 1; controller.warehouseId = 2; - const landed = new Date(); - const expectedResult = { - landed: landed, - addressFk: 121, - agencyModeFk: 7, - warehouseFk: 2 - }; - controller.landed = landed; - expect(controller.getShipped).toHaveBeenCalledWith(expectedResult); expect(controller.ticket.warehouseFk).toEqual(2); }); }); @@ -125,7 +116,6 @@ describe('Ticket', () => { shipped: shipped, addressFk: 121, agencyModeFk: 7, - showExpiredZones: false, warehouseFk: 1 }; controller.shipped = shipped; @@ -176,8 +166,7 @@ describe('Ticket', () => { shipped: shipped, addressFk: 121, agencyModeFk: agencyModeId, - warehouseFk: 1, - showExpiredZones: false, + warehouseFk: 1 }; controller.ticket.shipped = shipped; controller.agencyModeId = 8; @@ -363,5 +352,31 @@ describe('Ticket', () => { expect(controller.landed).toEqual(landed); }); }); + + describe('zoneWhere() getter', () => { + it('should return an object containing filter properties', async() => { + const shipped = new Date(); + controller.ticket.shipped = shipped; + + const expectedResult = { + addressFk: 121, + agencyModeFk: 7, + shipped: shipped, + warehouseFk: 1 + }; + const result = controller.zoneWhere(); + + expect(result).toEqual(expect.objectContaining(expectedResult)); + }); + }); + + describe('agencyModeWhere() getter', () => { + it('should return an object containing the warehouseFk property', async() => { + const expectedResult = {warehouseFk: 1}; + const result = controller.agencyModeWhere(); + + expect(result).toEqual(expect.objectContaining(expectedResult)); + }); + }); }); }); diff --git a/modules/zone/back/methods/agency-mode/specs/byWarehouse.spec.js b/modules/zone/back/methods/agency-mode/specs/byWarehouse.spec.js new file mode 100644 index 000000000..a2c2ca592 --- /dev/null +++ b/modules/zone/back/methods/agency-mode/specs/byWarehouse.spec.js @@ -0,0 +1,21 @@ +const app = require('vn-loopback/server/server'); + +describe('AgencyMode byWarehhouse()', () => { + const warehouseId = 1; + it('should return all the agencies', async() => { + const where = {}; + const agencies = await app.models.AgencyMode.byWarehouse({where}); + + expect(agencies.length).toBeGreaterThan(10); + }); + + it('should return only the agencies for a warehouse', async() => { + const where = {warehouseFk: warehouseId}; + const agencies = await app.models.AgencyMode.byWarehouse({where}); + + const validWarehouse = agencies.every(agency => agency.warehouseFk = warehouseId); + + expect(agencies.length).toEqual(6); + expect(validWarehouse).toBeTruthy(); + }); +}); diff --git a/modules/zone/back/methods/agency/getLanded.js b/modules/zone/back/methods/agency/getLanded.js index ef68331e6..27ac88327 100644 --- a/modules/zone/back/methods/agency/getLanded.js +++ b/modules/zone/back/methods/agency/getLanded.js @@ -1,7 +1,7 @@ const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; module.exports = Self => { - Self.remoteMethod('getLanded', { + Self.remoteMethodCtx('getLanded', { description: 'Returns the first shipped and landed possible for params', accessType: 'READ', accepts: [{ @@ -23,11 +23,6 @@ module.exports = Self => { arg: 'warehouseFk', type: 'number', required: true - }, - { - arg: 'showExpiredZones', - type: 'boolean', - required: true }], returns: { type: 'object', @@ -39,7 +34,13 @@ module.exports = Self => { } }); - Self.getLanded = async(shipped, addressFk, agencyModeFk, warehouseFk, showExpiredZones) => { + Self.getLanded = async(ctx, shipped, addressFk, agencyModeFk, warehouseFk) => { + const userId = ctx.req.accessToken.userId; + const models = Self.app.models; + const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss'); + let showExpired = false; + if (isProductionBoss) showExpired = true; + let stmts = []; stmts.push(new ParameterizedSQL( `CALL vn.zone_getLanded(?, ?, ?, ?, ?)`, [ @@ -47,7 +48,7 @@ module.exports = Self => { addressFk, agencyModeFk, warehouseFk, - showExpiredZones + showExpired ] )); diff --git a/modules/zone/back/methods/agency/specs/getLanded.spec.js b/modules/zone/back/methods/agency/specs/getLanded.spec.js index c24379530..fee3bd608 100644 --- a/modules/zone/back/methods/agency/specs/getLanded.spec.js +++ b/modules/zone/back/methods/agency/specs/getLanded.spec.js @@ -2,13 +2,13 @@ const app = require('vn-loopback/server/server'); describe('agency getLanded()', () => { it('should return a landing date', async() => { + const ctx = {req: {accessToken: {userId: 1}}}; const shipped = new Date(); shipped.setDate(shipped.getDate() + 1); const addressFk = 121; const agencyModeFk = 7; const warehouseFk = 1; - const showExpiredZones = true; - let result = await app.models.Agency.getLanded(shipped, addressFk, agencyModeFk, warehouseFk, showExpiredZones); + let result = await app.models.Agency.getLanded(ctx, shipped, addressFk, agencyModeFk, warehouseFk); expect(result.landed).toBeDefined(); }); diff --git a/modules/zone/back/methods/zone/includingExpired.js b/modules/zone/back/methods/zone/includingExpired.js index 14af42c26..6428d5b88 100644 --- a/modules/zone/back/methods/zone/includingExpired.js +++ b/modules/zone/back/methods/zone/includingExpired.js @@ -2,7 +2,7 @@ const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; const mergeFilters = require('vn-loopback/util/filter').mergeFilters; module.exports = Self => { - Self.remoteMethod('includingExpired', { + Self.remoteMethodCtx('includingExpired', { description: 'Returns a list of agencies from a warehouse', accepts: [{ arg: 'filter', @@ -19,33 +19,44 @@ module.exports = Self => { } }); - Self.includingExpired = async filter => { + Self.includingExpired = async(ctx, filter) => { + const userId = ctx.req.accessToken.userId; const conn = Self.dataSource.connector; + const models = Self.app.models; const where = filter.where; - // filter = mergeFilters(filter, {where}); + const stmts = []; let stmt; - console.log(where); + const filterByAvailability = where.shipped && where.addressFk + && where.agencyModeFk && where.warehouseFk; + + if (filterByAvailability) { + const isProductionBoss = await models.Account.hasRole(userId, 'productionBoss'); + let showExpired = false; + if (isProductionBoss) showExpired = true; - if (where.agencyModeFk) { stmt = new ParameterizedSQL(`CALL vn.zone_getLanded(?, ?, ?, ?, ?)`, [ where.shipped, where.addressFk, where.agencyModeFk, where.warehouseFk, - true]); + showExpired]); stmts.push(stmt); } + delete where.shipped; + delete where.addressFk; + delete where.warehouseFk; + stmt = new ParameterizedSQL( `SELECT id, name, agencyModeFk FROM vn.zone z`); - if (where.agencyModeFk) + if (filterByAvailability) stmt.merge(`JOIN tmp.zoneGetLanded zgl ON zgl.zoneFk = z.id`); - stmt.merge(conn.makePagination(filter)); + stmt.merge(conn.makeWhere(filter.where)); let index; if (stmts.length) diff --git a/modules/zone/back/methods/zone/specs/includingExpired.spec.js b/modules/zone/back/methods/zone/specs/includingExpired.spec.js new file mode 100644 index 000000000..ebda57868 --- /dev/null +++ b/modules/zone/back/methods/zone/specs/includingExpired.spec.js @@ -0,0 +1,40 @@ +const app = require('vn-loopback/server/server'); + +describe('zone includingExpired()', () => { + const inhousePickupId = 1; + const addressId = 101; + const warehouseId = 1; + + it('should return an array containing all zones', async() => { + const ctx = {req: {accessToken: {userId: 1}}}; + const where = {}; + const result = await app.models.Zone.includingExpired(ctx, {where}); + + expect(result.length).toBeGreaterThan(2); + }); + + it('should return an array containing zones from the agencyMode "Inhouse pickup"', async() => { + const ctx = {req: {accessToken: {userId: 1}}}; + const where = {agencyModeFk: inhousePickupId}; + const result = await app.models.Zone.includingExpired(ctx, {where}); + + const validAgency = result.every(zone => zone.agencyModeFk = inhousePickupId); + + expect(result.length).toEqual(3); + expect(validAgency).toBeTruthy(); + }); + + it('should return an array containing available zones', async() => { + const ctx = {req: {accessToken: {userId: 1}}}; + const where = { + shipped: new Date(), + addressFk: addressId, + agencyModeFk: inhousePickupId, + warehouseFk: warehouseId + }; + const result = await app.models.Zone.includingExpired(ctx, {where}); + const firstZone = result[0]; + + expect(firstZone.name).toEqual('Zone pickup A'); + }); +}); From a8589d694554632fa5621ef867092ac6d440395e Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 23 Sep 2020 14:13:44 +0200 Subject: [PATCH 16/25] Autocomplete warehouse on agency selection --- .../front/basic-data/step-one/index.html | 18 ++++++++++++++---- .../ticket/front/basic-data/step-one/index.js | 3 +++ .../back/methods/agency-mode/byWarehouse.js | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/ticket/front/basic-data/step-one/index.html b/modules/ticket/front/basic-data/step-one/index.html index 0e8d25b7c..98d92e7e2 100644 --- a/modules/ticket/front/basic-data/step-one/index.html +++ b/modules/ticket/front/basic-data/step-one/index.html @@ -7,8 +7,10 @@
- - - diff --git a/modules/ticket/front/basic-data/step-one/index.js b/modules/ticket/front/basic-data/step-one/index.js index d7dbb8cd1..e7eb30583 100644 --- a/modules/ticket/front/basic-data/step-one/index.js +++ b/modules/ticket/front/basic-data/step-one/index.js @@ -99,6 +99,9 @@ class Controller extends Component { if (!value) return; + const agencyMode = this.$.agencyMode.selection; + this.ticket.warehouseFk = agencyMode.warehouseFk; + this.getLanded({ shipped: this.ticket.shipped, addressFk: this.ticket.addressFk, diff --git a/modules/zone/back/methods/agency-mode/byWarehouse.js b/modules/zone/back/methods/agency-mode/byWarehouse.js index c89217eef..f336f5ed2 100644 --- a/modules/zone/back/methods/agency-mode/byWarehouse.js +++ b/modules/zone/back/methods/agency-mode/byWarehouse.js @@ -25,7 +25,7 @@ module.exports = Self => { filter = mergeFilters(filter, {where}); let stmt = new ParameterizedSQL( - `SELECT id, name + `SELECT id, name, warehouseFk FROM ( SELECT DISTINCT am.id, am.name, am.isActive, zw.warehouseFk FROM zoneWarehouse zw From 75ac6ad8d3de1140b02a83e42688dac2cc76994d Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 23 Sep 2020 14:20:41 +0200 Subject: [PATCH 17/25] Updated unit test --- modules/ticket/front/basic-data/step-one/index.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/ticket/front/basic-data/step-one/index.spec.js b/modules/ticket/front/basic-data/step-one/index.spec.js index eea22b73b..bd88b88ac 100644 --- a/modules/ticket/front/basic-data/step-one/index.spec.js +++ b/modules/ticket/front/basic-data/step-one/index.spec.js @@ -160,6 +160,7 @@ describe('Ticket', () => { describe('agencyModeId() setter', () => { it('should set agencyModeId property and call getLanded() method', () => { jest.spyOn(controller, 'getLanded'); + controller.$.agencyMode = {selection: {warehouseFk: 1}}; const shipped = new Date(); const agencyModeId = 8; const expectedResult = { From 44e23ca560a3f9a7cf97efb62fb1c701219cfe50 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 24 Sep 2020 09:00:42 +0200 Subject: [PATCH 18/25] Removed sql version --- db/changes/12300-Summer/00-workerTimeControlParams.sql | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 db/changes/12300-Summer/00-workerTimeControlParams.sql diff --git a/db/changes/12300-Summer/00-workerTimeControlParams.sql b/db/changes/12300-Summer/00-workerTimeControlParams.sql deleted file mode 100644 index 47ef2e3ea..000000000 --- a/db/changes/12300-Summer/00-workerTimeControlParams.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE `vn`.`workerTimeControlParams` -ADD COLUMN `mailUser` VARCHAR(45) NOT NULL AFTER `askInOut`, -ADD COLUMN `mailPass` VARCHAR(45) NOT NULL AFTER `mailUser`, -ADD COLUMN `mailHost` VARCHAR(45) NOT NULL AFTER `mailPass`, -ADD COLUMN `mailSuccessFolder` VARCHAR(45) NOT NULL AFTER `mailHost`, -ADD COLUMN `mailErrorFolder` VARCHAR(45) NOT NULL AFTER `mailSuccessFolder`; From 53e729edddded0e2c9abf3f34248db6f0dff6b41 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 24 Sep 2020 10:14:53 +0200 Subject: [PATCH 19/25] 2366 - Merge event colors --- modules/worker/front/calendar/index.html | 9 +- modules/worker/front/calendar/index.js | 17 +- modules/worker/front/calendar/index.spec.js | 2 +- modules/worker/front/calendar/locale/es.yml | 1 + modules/worker/front/calendar/style.scss | 5 + package-lock.json | 217 +++++++++----------- 6 files changed, 122 insertions(+), 129 deletions(-) diff --git a/modules/worker/front/calendar/index.html b/modules/worker/front/calendar/index.html index 621d6c23f..6636f5c62 100644 --- a/modules/worker/front/calendar/index.html +++ b/modules/worker/front/calendar/index.html @@ -38,7 +38,7 @@ order="DESC"> -
+
+
+ + + + Festive + +
{ - this.events[new Date(day).getTime()] = event; + let addEvent = (day, newEvent) => { + const timestamp = new Date(day).getTime(); + const event = this.events[timestamp]; + + if (event) { + const oldName = event.name; + Object.assign(event, newEvent); + event.name = `${oldName}, ${event.name}`; + } else + this.events[timestamp] = newEvent; }; if (data.holidays) { @@ -97,7 +105,7 @@ class Controller extends Section { addEvent(holiday.dated, { name: holidayName, - color: '#ff0' + border: '2px solid #FF4444' }); }); } @@ -128,6 +136,9 @@ class Controller extends Section { dayNumber.title = event.name; dayNumber.style.backgroundColor = event.color; dayNumber.style.color = 'rgba(0, 0, 0, 0.7)'; + + if (event.border) + dayNumber.style.border = event.border; } pick(absenceType) { diff --git a/modules/worker/front/calendar/index.spec.js b/modules/worker/front/calendar/index.spec.js index cb42fb316..14a5e2e0d 100644 --- a/modules/worker/front/calendar/index.spec.js +++ b/modules/worker/front/calendar/index.spec.js @@ -95,7 +95,7 @@ describe('Worker', () => { let events = controller.events; - expect(events[today.getTime()].name).toEqual('Holiday'); + expect(events[today.getTime()].name).toEqual('New year, Holiday'); expect(events[tomorrow.getTime()].name).toEqual('Easter'); expect(events[yesterday.getTime()].name).toEqual('Leave'); expect(events[yesterday.getTime()].color).toEqual('#bbb'); diff --git a/modules/worker/front/calendar/locale/es.yml b/modules/worker/front/calendar/locale/es.yml index 68a9cf54d..0626b7550 100644 --- a/modules/worker/front/calendar/locale/es.yml +++ b/modules/worker/front/calendar/locale/es.yml @@ -1,5 +1,6 @@ Calendar: Calendario Holidays: Vacaciones +Festive: Festivo Used: Utilizados Year: Año of: de diff --git a/modules/worker/front/calendar/style.scss b/modules/worker/front/calendar/style.scss index 1934a6ca0..917798ddb 100644 --- a/modules/worker/front/calendar/style.scss +++ b/modules/worker/front/calendar/style.scss @@ -36,4 +36,9 @@ vn-worker-calendar { top: 16px; right: 16px } + + vn-side-menu div > .input { + border-color: rgba(0, 0, 0, 0.3); + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + } } diff --git a/package-lock.json b/package-lock.json index 6bc1b14a6..f0ae74065 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2954,6 +2954,22 @@ } } }, + "@babel/runtime-corejs3": { + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.11.2.tgz", + "integrity": "sha512-qh5IR+8VgFz83VBa6OkaET6uN/mJOhHONuy3m1sgF0CV6mXdPSEBdA7e1eUbVvyNtANjMbg22JUv71BaDXLY6A==", + "requires": { + "core-js-pure": "^3.0.0", + "regenerator-runtime": "^0.13.4" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" + } + } + }, "@babel/template": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", @@ -4935,11 +4951,6 @@ "@types/yargs": "^13.0.0" } }, - "@kyleshockey/object-assign-deep": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@kyleshockey/object-assign-deep/-/object-assign-deep-0.4.2.tgz", - "integrity": "sha1-hJAPDu/DcnmPR1G1JigwuCCJIuw=" - }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -6692,6 +6703,7 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" @@ -7169,9 +7181,9 @@ } }, "btoa": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.1.2.tgz", - "integrity": "sha1-PkC4FmP4HS3WWWpMtxSo3BbPq+A=" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==" }, "buffer": { "version": "4.9.1", @@ -8014,7 +8026,8 @@ "core-js": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==" + "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", + "dev": true }, "core-js-compat": { "version": "3.6.5", @@ -8034,6 +8047,11 @@ } } }, + "core-js-pure": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.6.5.tgz", + "integrity": "sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA==" + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -8086,23 +8104,11 @@ } }, "cross-fetch": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-0.0.8.tgz", - "integrity": "sha1-Ae2U3EB98sAPGAf95wCnz6SKIFw=", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz", + "integrity": "sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==", "requires": { - "node-fetch": "1.7.3", - "whatwg-fetch": "2.0.3" - }, - "dependencies": { - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - } + "node-fetch": "2.6.1" } }, "cross-spawn": { @@ -8331,9 +8337,9 @@ "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" }, "deep-extend": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", - "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, "deep-is": { "version": "0.1.3", @@ -8810,24 +8816,11 @@ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, - "encode-3986": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/encode-3986/-/encode-3986-1.0.0.tgz", - "integrity": "sha1-lA1RSY+HQa3hhLda0UObMXwMemA=" - }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "~0.4.13" - } - }, "encoding-japanese": { "version": "1.0.30", "resolved": "https://registry.npmjs.org/encoding-japanese/-/encoding-japanese-1.0.30.tgz", @@ -13351,31 +13344,11 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" }, "isomorphic-form-data": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isomorphic-form-data/-/isomorphic-form-data-0.0.1.tgz", - "integrity": "sha1-Am9ifgMrDNhBPsyHVZKLlKRosGI=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-form-data/-/isomorphic-form-data-2.0.0.tgz", + "integrity": "sha512-TYgVnXWeESVmQSg4GLVbalmQ+B4NPi/H4eWxqALKj63KsUrcu301YDjBqaOw3h+cbak7Na4Xyps3BiptHtxTfg==", "requires": { - "form-data": "^1.0.0-rc3" - }, - "dependencies": { - "async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", - "requires": { - "lodash": "^4.17.11" - } - }, - "form-data": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz", - "integrity": "sha1-rjFduaSQf6BlUCMEpm13M0de43w=", - "requires": { - "async": "^2.0.1", - "combined-stream": "^1.0.5", - "mime-types": "^2.1.11" - } - } + "form-data": "^2.3.2" } }, "isstream": { @@ -13568,7 +13541,7 @@ "jasmine-spec-reporter": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", - "integrity": "sha1-HWMq7ANBZwrTJPkrqEtLMrNeniI=", + "integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", "dev": true, "requires": { "colors": "1.1.2" @@ -20350,9 +20323,9 @@ "integrity": "sha512-sSHCgWfJ+Lui/u+0msF3oyCgvdkhxDbkCS6Q8uiJquzOimkJBvX6hl5aSSA7DR1XbMpdM8r7phjcF63sF4rkKg==" }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, "node-forge": { "version": "0.8.5", @@ -22176,7 +22149,8 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true }, "regenerator-transform": { "version": "0.14.5", @@ -24393,57 +24367,67 @@ } }, "swagger-client": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/swagger-client/-/swagger-client-3.9.0.tgz", - "integrity": "sha512-uyCq2xoaAtmE0oIQ0fCfnsDoy/v97ANnAZywtyk4yumBP74xXp4NFlpZaqZJHN9K9dbPzgs3MH98VocZeM0ExQ==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/swagger-client/-/swagger-client-3.11.0.tgz", + "integrity": "sha512-5cM2S8qDmA0fwpGW71384Bik7MXI5D8XJz6uVHeH3X3gy9hZo8SDc7MeNShnxSLKAGIUHs9gIqjSeCrUftMNPw==", "requires": { - "@kyleshockey/js-yaml": "^1.0.1", - "@kyleshockey/object-assign-deep": "^0.4.0", - "babel-runtime": "^6.26.0", - "btoa": "1.1.2", - "buffer": "^5.1.0", - "cookie": "^0.3.1", - "cross-fetch": "0.0.8", - "deep-extend": "^0.5.1", - "encode-3986": "^1.0.0", - "fast-json-patch": "^2.0.6", - "isomorphic-form-data": "0.0.1", - "lodash": "^4.16.2", - "qs": "^6.3.0", + "@babel/runtime-corejs3": "^7.11.2", + "btoa": "^1.2.1", + "buffer": "^5.6.0", + "cookie": "~0.4.1", + "cross-fetch": "^3.0.6", + "deep-extend": "~0.6.0", + "fast-json-patch": "^2.2.1", + "isomorphic-form-data": "~2.0.0", + "js-yaml": "^3.14.0", + "lodash": "^4.17.19", + "qs": "^6.9.4", "querystring-browser": "^1.0.4", - "traverse": "^0.6.6", - "url": "^0.11.0", - "utf8-bytes": "0.0.1", - "utfstring": "^2.0.0" + "traverse": "~0.6.6", + "url": "~0.11.0" }, "dependencies": { - "@kyleshockey/js-yaml": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@kyleshockey/js-yaml/-/js-yaml-1.0.1.tgz", - "integrity": "sha512-coFyIk1LvTscq1cUU4nCCfYwv+cmG4fCP+wgDKgYZjhM4f++YwZy+g0k+1tUqa4GuUpBTEOGH2KUqKFFWdT73g==", - "requires": { - "argparse": "^1.0.7" - } - }, "buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", - "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", "requires": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" } }, "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" + }, + "fast-json-patch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz", + "integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==", + "requires": { + "fast-deep-equal": "^2.0.1" + } + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } }, "punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" + }, "url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -24547,9 +24531,9 @@ }, "dependencies": { "bl": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", - "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -25466,16 +25450,6 @@ } } }, - "utf8-bytes": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/utf8-bytes/-/utf8-bytes-0.0.1.tgz", - "integrity": "sha1-EWsCVEjJtQAIHN+/H01sbDfYg30=" - }, - "utfstring": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/utfstring/-/utfstring-2.0.0.tgz", - "integrity": "sha512-/ugBfyvIoLe9xqkFHio3CxXnpUKQ1p2LfTxPr6QTRj6GiwpHo73YGdh03UmAzDQNOWpNIE0J5nLss00L4xlWgg==" - }, "util": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", @@ -26278,7 +26252,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -26291,7 +26265,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -26549,11 +26523,6 @@ "iconv-lite": "0.4.24" } }, - "whatwg-fetch": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", - "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=" - }, "whatwg-mimetype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", From d18d7670ec21d00503862bcecb3a42e7f33208e9 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 24 Sep 2020 10:44:12 +0200 Subject: [PATCH 20/25] Updated unit tests --- modules/worker/front/calendar/index.html | 2 +- modules/worker/front/calendar/style.scss | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/worker/front/calendar/index.html b/modules/worker/front/calendar/index.html index 6636f5c62..fe61e828e 100644 --- a/modules/worker/front/calendar/index.html +++ b/modules/worker/front/calendar/index.html @@ -50,7 +50,7 @@
- + Festive diff --git a/modules/worker/front/calendar/style.scss b/modules/worker/front/calendar/style.scss index 917798ddb..65f27e43e 100644 --- a/modules/worker/front/calendar/style.scss +++ b/modules/worker/front/calendar/style.scss @@ -41,4 +41,12 @@ vn-worker-calendar { border-color: rgba(0, 0, 0, 0.3); border-bottom: 1px solid rgba(0, 0, 0, 0.3); } + + .festive { + background-color:white; + border: 2px solid #FF4444; + width: 24px; + min-width: 24px; + height: 24px + } } From d2dbf417f4560033cb11a4b42f0c47edcbc96038 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 24 Sep 2020 11:15:35 +0200 Subject: [PATCH 21/25] Updated to standard color --- front/core/components/calendar/style.scss | 2 +- modules/worker/front/calendar/index.js | 6 ++++-- modules/worker/front/calendar/style.scss | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/front/core/components/calendar/style.scss b/front/core/components/calendar/style.scss index 28c87793b..76cb7f6f2 100644 --- a/front/core/components/calendar/style.scss +++ b/front/core/components/calendar/style.scss @@ -55,7 +55,7 @@ } &.event .day-number { background-color: $color-main; - color: $color-font-dark; + color: $color-font-bg; } & > .day-number { display: flex; diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index 3ab7ebc9b..897430665 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -105,7 +105,7 @@ class Controller extends Section { addEvent(holiday.dated, { name: holidayName, - border: '2px solid #FF4444' + className: 'festive' }); }); } @@ -135,10 +135,12 @@ class Controller extends Section { let dayNumber = element.firstElementChild; dayNumber.title = event.name; dayNumber.style.backgroundColor = event.color; - dayNumber.style.color = 'rgba(0, 0, 0, 0.7)'; if (event.border) dayNumber.style.border = event.border; + + if (event.className) + dayNumber.classList.add(event.className); } pick(absenceType) { diff --git a/modules/worker/front/calendar/style.scss b/modules/worker/front/calendar/style.scss index 65f27e43e..b778a68b5 100644 --- a/modules/worker/front/calendar/style.scss +++ b/modules/worker/front/calendar/style.scss @@ -44,7 +44,7 @@ vn-worker-calendar { .festive { background-color:white; - border: 2px solid #FF4444; + border: 2px solid $color-alert; width: 24px; min-width: 24px; height: 24px From 69e2597b91f907d8b53f2620c6cf5e15c31c0f13 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 24 Sep 2020 14:01:56 +0200 Subject: [PATCH 22/25] Updated e2e --- e2e/paths/05-ticket/06_basic_data_steps.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/paths/05-ticket/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js index f9ad65a29..f6660ae39 100644 --- a/e2e/paths/05-ticket/06_basic_data_steps.spec.js +++ b/e2e/paths/05-ticket/06_basic_data_steps.spec.js @@ -50,7 +50,7 @@ describe('Ticket Edit basic data path', () => { }); it(`should edit the ticket agency then check there are no zones for it`, async() => { - await page.autocompleteSearch(selectors.ticketBasicData.agency, 'inhouse pickup'); + await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Super-Man delivery'); await page.waitFor(1000); let emptyZone = await page .expectPropertyValue(selectors.ticketBasicData.zone, 'value', ''); From f1d36df558efc3aebc4f946861ed52a4a5a40f56 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 24 Sep 2020 15:00:00 +0200 Subject: [PATCH 23/25] #2458 - Removed states from pending tickets --- modules/ticket/back/methods/ticket/filter.js | 9 +++++++-- modules/ticket/front/index/index.html | 3 ++- modules/ticket/front/summary/index.js | 9 +++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index 62ca149f0..6dbe52524 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -161,8 +161,13 @@ module.exports = Self => { if (value) { return {and: [ {'st.alertLevel': 0}, - {'st.code': {neq: 'OK'}}, - {'st.code': {neq: 'BOARDING'}} + {'st.code': {nin: [ + 'OK', + 'BOARDING', + 'PRINTED', + 'PRINTED_AUTO', + 'PICKER_DESIGNED' + ]}} ]}; } else { return {and: [ diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 3e9809952..e9066a41b 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -161,7 +161,8 @@
+ ticket="$ctrl.selectedTicket" + model="model"> Date: Thu, 24 Sep 2020 15:00:43 +0200 Subject: [PATCH 24/25] Removed jenkins success notifications --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c810dc474..d07b47809 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -134,7 +134,7 @@ pipeline { } } - if (!env.COMMITTER_EMAIL) return + if (!env.COMMITTER_EMAIL || currentBuild.currentResult == 'SUCCESS') return; try { mail( to: env.COMMITTER_EMAIL, From 790c9bfe6f607ae6f46a0dbd8bdc5671d54052fe Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Fri, 25 Sep 2020 14:50:04 +0200 Subject: [PATCH 25/25] update models and fixtures --- back/model-config.json | 6 - back/models/mail-forward.json | 26 --- db/dump/dumpedFixtures.sql | 24 +- db/dump/fixtures.sql | 214 +++++++++--------- modules/account/back/model-config.json | 3 + .../account/back}/models/mail.json | 0 .../methods/state/specs/editableState.spec.js | 2 +- .../methods/state/specs/isEditable.spec.js | 2 +- 8 files changed, 128 insertions(+), 149 deletions(-) delete mode 100644 back/models/mail-forward.json rename {back => modules/account/back}/models/mail.json (100%) diff --git a/back/model-config.json b/back/model-config.json index 3a89d2b23..b8a8f04ac 100644 --- a/back/model-config.json +++ b/back/model-config.json @@ -79,12 +79,6 @@ }, "WorkerTimeControlMail": { "dataSource": "vn" - }, - "Mail": { - "dataSource": "vn" - }, - "MailForward": { - "dataSource": "vn" } } diff --git a/back/models/mail-forward.json b/back/models/mail-forward.json deleted file mode 100644 index 40b695a7a..000000000 --- a/back/models/mail-forward.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "MailForward", - "base": "VnModel", - "options": { - "mysql": { - "table": "account.mailForward" - } - }, - "properties": { - "account": { - "id": true, - "type": "Number" - }, - "forwardTo": { - "type": "String" - } - }, - "acls": [ - { - "accessType": "READ", - "principalType": "ROLE", - "principalId": "$everyone", - "permission": "ALLOW" - } - ] -} diff --git a/db/dump/dumpedFixtures.sql b/db/dump/dumpedFixtures.sql index 374c1ed50..02b5b6ec2 100644 --- a/db/dump/dumpedFixtures.sql +++ b/db/dump/dumpedFixtures.sql @@ -36,7 +36,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-09 11:46:28 +-- Dump completed on 2020-09-24 12:39:30 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 2020-09-09 11:46:30 +-- Dump completed on 2020-09-24 12:39:32 USE `salix`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -149,7 +149,7 @@ USE `salix`; LOCK TABLES `ACL` WRITE; /*!40000 ALTER TABLE `ACL` DISABLE KEYS */; -INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','salesAssistant'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','salesAssistant'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','salesAssistant'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(164,'InvoiceOut','regenerate','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','READ','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(188,'TicketDms','removeFile','WRITE','ALLOW','ROLE','employee'),(189,'TicketDms','*','READ','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','employee'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','salesAssistant'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(219,'Account','acl','READ','ALLOW','ROLE','account'),(220,'Account','getCurrentUserData','READ','ALLOW','ROLE','account'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'); +INSERT INTO `ACL` VALUES (1,'Account','*','*','ALLOW','ROLE','employee'),(3,'Address','*','*','ALLOW','ROLE','employee'),(5,'AgencyService','*','READ','ALLOW','ROLE','employee'),(7,'Client','*','*','ALLOW','ROLE','employee'),(9,'ClientObservation','*','*','ALLOW','ROLE','employee'),(11,'ContactChannel','*','READ','ALLOW','ROLE','trainee'),(13,'Employee','*','READ','ALLOW','ROLE','employee'),(14,'PayMethod','*','READ','ALLOW','ROLE','trainee'),(16,'FakeProduction','*','READ','ALLOW','ROLE','employee'),(17,'Warehouse','* ','READ','ALLOW','ROLE','trainee'),(18,'State','*','READ','ALLOW','ROLE','employee'),(20,'TicketState','*','*','ALLOW','ROLE','employee'),(24,'Delivery','*','READ','ALLOW','ROLE','employee'),(25,'Zone','*','READ','ALLOW','ROLE','employee'),(26,'ClientCredit','*','*','ALLOW','ROLE','employee'),(27,'ClientCreditLimit','*','READ','ALLOW','ROLE','trainee'),(30,'GreugeType','*','READ','ALLOW','ROLE','trainee'),(31,'Mandate','*','READ','ALLOW','ROLE','trainee'),(32,'MandateType','*','READ','ALLOW','ROLE','trainee'),(33,'Company','*','READ','ALLOW','ROLE','trainee'),(34,'Greuge','*','READ','ALLOW','ROLE','trainee'),(35,'AddressObservation','*','*','ALLOW','ROLE','employee'),(36,'ObservationType','*','*','ALLOW','ROLE','employee'),(37,'Greuge','*','WRITE','ALLOW','ROLE','employee'),(38,'AgencyMode','*','READ','ALLOW','ROLE','employee'),(39,'ItemTag','*','WRITE','ALLOW','ROLE','buyer'),(40,'ItemBotanical','*','WRITE','ALLOW','ROLE','buyer'),(41,'ItemBotanical','*','READ','ALLOW','ROLE','employee'),(42,'ItemPlacement','*','WRITE','ALLOW','ROLE','buyer'),(43,'ItemPlacement','*','WRITE','ALLOW','ROLE','replenisher'),(44,'ItemPlacement','*','READ','ALLOW','ROLE','employee'),(45,'ItemBarcode','*','READ','ALLOW','ROLE','employee'),(46,'ItemBarcode','*','WRITE','ALLOW','ROLE','buyer'),(47,'ItemBarcode','*','WRITE','ALLOW','ROLE','replenisher'),(48,'ItemNiche','*','READ','ALLOW','ROLE','employee'),(49,'ItemNiche','*','WRITE','ALLOW','ROLE','buyer'),(50,'ItemNiche','*','WRITE','ALLOW','ROLE','replenisher'),(51,'ItemTag','*','READ','ALLOW','ROLE','employee'),(53,'Item','*','READ','ALLOW','ROLE','employee'),(54,'Item','*','WRITE','ALLOW','ROLE','buyer'),(55,'Recovery','*','READ','ALLOW','ROLE','trainee'),(56,'Recovery','*','WRITE','ALLOW','ROLE','administrative'),(58,'CreditClassification','*','*','ALLOW','ROLE','insurance'),(60,'CreditInsurance','*','*','ALLOW','ROLE','insurance'),(61,'InvoiceOut','*','READ','ALLOW','ROLE','employee'),(62,'Ticket','*','*','ALLOW','ROLE','employee'),(63,'TicketObservation','*','*','ALLOW','ROLE','employee'),(64,'Route','*','READ','ALLOW','ROLE','employee'),(65,'Sale','*','READ','ALLOW','ROLE','employee'),(66,'TicketTracking','*','READ','ALLOW','ROLE','employee'),(68,'TicketPackaging','*','*','ALLOW','ROLE','employee'),(69,'Packaging','*','READ','ALLOW','ROLE','employee'),(70,'Packaging','*','WRITE','ALLOW','ROLE','logistic'),(71,'SaleChecked','*','READ','ALLOW','ROLE','employee'),(72,'SaleComponent','*','READ','ALLOW','ROLE','employee'),(73,'Expedition','*','READ','ALLOW','ROLE','employee'),(74,'Expedition','*','WRITE','ALLOW','ROLE','deliveryBoss'),(75,'Expedition','*','WRITE','ALLOW','ROLE','production'),(76,'AnnualAverageInvoiced','*','READ','ALLOW','ROLE','employee'),(77,'WorkerMana','*','READ','ALLOW','ROLE','employee'),(78,'TicketTracking','*','WRITE','ALLOW','ROLE','production'),(79,'TicketTracking','changeState','*','ALLOW','ROLE','employee'),(80,'Sale','deleteSales','*','ALLOW','ROLE','employee'),(81,'Sale','moveToTicket','*','ALLOW','ROLE','employee'),(82,'Sale','updateQuantity','*','ALLOW','ROLE','employee'),(83,'Sale','updatePrice','*','ALLOW','ROLE','employee'),(84,'Sale','updateDiscount','*','ALLOW','ROLE','employee'),(85,'SaleTracking','*','READ','ALLOW','ROLE','employee'),(86,'Order','*','*','ALLOW','ROLE','employee'),(87,'OrderRow','*','*','ALLOW','ROLE','employee'),(88,'ClientContact','*','*','ALLOW','ROLE','employee'),(89,'Sale','moveToNewTicket','*','ALLOW','ROLE','employee'),(90,'Sale','reserve','*','ALLOW','ROLE','employee'),(91,'TicketWeekly','*','READ','ALLOW','ROLE','employee'),(94,'Agency','landsThatDay','*','ALLOW','ROLE','employee'),(96,'ClaimEnd','*','READ','ALLOW','ROLE','employee'),(97,'ClaimEnd','*','WRITE','ALLOW','ROLE','salesAssistant'),(98,'ClaimBeginning','*','*','ALLOW','ROLE','employee'),(99,'ClaimDevelopment','*','READ','ALLOW','ROLE','employee'),(100,'ClaimDevelopment','*','WRITE','ALLOW','ROLE','salesAssistant'),(101,'Claim','*','*','ALLOW','ROLE','employee'),(102,'Claim','createFromSales','*','ALLOW','ROLE','employee'),(103,'ClaimEnd','importTicketSales','WRITE','ALLOW','ROLE','salesAssistant'),(104,'Item','*','WRITE','ALLOW','ROLE','marketingBoss'),(105,'ItemBarcode','*','WRITE','ALLOW','ROLE','marketingBoss'),(106,'ItemBotanical','*','WRITE','ALLOW','ROLE','marketingBoss'),(107,'ItemNiche','*','WRITE','ALLOW','ROLE','marketingBoss'),(108,'ItemPlacement','*','WRITE','ALLOW','ROLE','marketingBoss'),(109,'UserConfig','*','*','ALLOW','ROLE','employee'),(110,'Bank','*','READ','ALLOW','ROLE','trainee'),(111,'ClientLog','*','READ','ALLOW','ROLE','trainee'),(112,'Defaulter','*','READ','ALLOW','ROLE','employee'),(113,'ClientRisk','*','READ','ALLOW','ROLE','trainee'),(114,'Receipt','*','READ','ALLOW','ROLE','trainee'),(115,'Receipt','*','WRITE','ALLOW','ROLE','administrative'),(116,'BankEntity','*','*','ALLOW','ROLE','employee'),(117,'ClientSample','*','*','ALLOW','ROLE','employee'),(118,'WorkerTeam','*','*','ALLOW','ROLE','salesPerson'),(119,'Travel','*','READ','ALLOW','ROLE','employee'),(120,'Travel','*','WRITE','ALLOW','ROLE','buyer'),(121,'Item','regularize','*','ALLOW','ROLE','employee'),(122,'TicketRequest','*','*','ALLOW','ROLE','employee'),(123,'Worker','*','*','ALLOW','ROLE','employee'),(124,'Client','confirmTransaction','WRITE','ALLOW','ROLE','administrative'),(125,'Agency','getAgenciesWithWarehouse','*','ALLOW','ROLE','employee'),(126,'Client','activeWorkersWithRole','*','ALLOW','ROLE','employee'),(127,'TicketLog','*','READ','ALLOW','ROLE','employee'),(129,'TicketService','*','*','ALLOW','ROLE','employee'),(130,'Expedition','*','WRITE','ALLOW','ROLE','packager'),(131,'CreditInsurance','*','READ','ALLOW','ROLE','trainee'),(132,'CreditClassification','*','READ','ALLOW','ROLE','trainee'),(133,'ItemTag','*','WRITE','ALLOW','ROLE','marketingBoss'),(135,'ZoneGeo','*','READ','ALLOW','ROLE','employee'),(136,'ZoneCalendar','*','READ','ALLOW','ROLE','employee'),(137,'ZoneIncluded','*','READ','ALLOW','ROLE','employee'),(138,'LabourHoliday','*','READ','ALLOW','ROLE','employee'),(139,'LabourHolidayLegend','*','READ','ALLOW','ROLE','employee'),(140,'LabourHolidayType','*','READ','ALLOW','ROLE','employee'),(141,'Zone','*','*','ALLOW','ROLE','deliveryBoss'),(142,'ZoneCalendar','*','WRITE','ALLOW','ROLE','deliveryBoss'),(143,'ZoneIncluded','*','*','ALLOW','ROLE','deliveryBoss'),(144,'Stowaway','*','*','ALLOW','ROLE','employee'),(145,'Ticket','getPossibleStowaways','READ','ALLOW','ROLE','employee'),(147,'UserConfigView','*','*','ALLOW','ROLE','employee'),(148,'UserConfigView','*','*','ALLOW','ROLE','employee'),(149,'Sip','*','READ','ALLOW','ROLE','employee'),(150,'Sip','*','WRITE','ALLOW','ROLE','hr'),(151,'Department','*','READ','ALLOW','ROLE','employee'),(152,'Department','*','WRITE','ALLOW','ROLE','hr'),(153,'Route','*','READ','ALLOW','ROLE','employee'),(154,'Route','*','WRITE','ALLOW','ROLE','delivery'),(155,'Calendar','*','READ','ALLOW','ROLE','hr'),(156,'WorkerLabour','*','READ','ALLOW','ROLE','hr'),(157,'Calendar','absences','READ','ALLOW','ROLE','employee'),(158,'ItemTag','*','WRITE','ALLOW','ROLE','accessory'),(160,'TicketServiceType','*','READ','ALLOW','ROLE','employee'),(161,'TicketConfig','*','READ','ALLOW','ROLE','employee'),(162,'InvoiceOut','delete','WRITE','ALLOW','ROLE','invoicing'),(163,'InvoiceOut','book','WRITE','ALLOW','ROLE','invoicing'),(164,'InvoiceOut','regenerate','WRITE','ALLOW','ROLE','invoicing'),(165,'TicketDms','*','READ','ALLOW','ROLE','employee'),(167,'Worker','isSubordinate','READ','ALLOW','ROLE','employee'),(168,'Worker','mySubordinates','READ','ALLOW','ROLE','employee'),(169,'WorkerTimeControl','filter','READ','ALLOW','ROLE','employee'),(170,'WorkerTimeControl','addTime','WRITE','ALLOW','ROLE','employee'),(171,'TicketServiceType','*','WRITE','ALLOW','ROLE','administrative'),(172,'Sms','*','READ','ALLOW','ROLE','employee'),(173,'Sms','send','WRITE','ALLOW','ROLE','employee'),(174,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(175,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(176,'Device','*','*','ALLOW','ROLE','employee'),(177,'Device','*','*','ALLOW','ROLE','employee'),(178,'WorkerTimeControl','*','*','ALLOW','ROLE','employee'),(179,'ItemLog','*','READ','ALLOW','ROLE','employee'),(180,'RouteLog','*','READ','ALLOW','ROLE','employee'),(181,'Dms','removeFile','WRITE','ALLOW','ROLE','employee'),(182,'Dms','uploadFile','WRITE','ALLOW','ROLE','employee'),(183,'Dms','downloadFile','READ','ALLOW','ROLE','employee'),(184,'Client','uploadFile','WRITE','ALLOW','ROLE','employee'),(185,'ClientDms','removeFile','WRITE','ALLOW','ROLE','employee'),(186,'ClientDms','*','READ','ALLOW','ROLE','trainee'),(187,'Ticket','uploadFile','WRITE','ALLOW','ROLE','employee'),(188,'TicketDms','removeFile','WRITE','ALLOW','ROLE','employee'),(189,'TicketDms','*','READ','ALLOW','ROLE','employee'),(190,'Route','updateVolume','WRITE','ALLOW','ROLE','deliveryBoss'),(191,'Agency','getLanded','READ','ALLOW','ROLE','employee'),(192,'Agency','getShipped','READ','ALLOW','ROLE','employee'),(194,'Postcode','*','WRITE','ALLOW','ROLE','employee'),(195,'Ticket','addSale','WRITE','ALLOW','ROLE','employee'),(196,'Dms','updateFile','WRITE','ALLOW','ROLE','employee'),(197,'Dms','*','READ','ALLOW','ROLE','trainee'),(198,'ClaimDms','removeFile','WRITE','ALLOW','ROLE','employee'),(199,'ClaimDms','*','READ','ALLOW','ROLE','employee'),(200,'Claim','uploadFile','WRITE','ALLOW','ROLE','employee'),(201,'Sale','updateConcept','WRITE','ALLOW','ROLE','employee'),(202,'Claim','updateClaimAction','WRITE','ALLOW','ROLE','salesAssistant'),(203,'UserPhone','*','*','ALLOW','ROLE','employee'),(204,'WorkerDms','removeFile','WRITE','ALLOW','ROLE','hr'),(205,'WorkerDms','*','READ','ALLOW','ROLE','hr'),(206,'Chat','*','*','ALLOW','ROLE','employee'),(207,'Chat','sendMessage','*','ALLOW','ROLE','employee'),(208,'Sale','recalculatePrice','WRITE','ALLOW','ROLE','employee'),(209,'Ticket','recalculateComponents','WRITE','ALLOW','ROLE','employee'),(211,'TravelLog','*','READ','ALLOW','ROLE','buyer'),(212,'Thermograph','*','*','ALLOW','ROLE','buyer'),(213,'TravelThermograph','*','WRITE','ALLOW','ROLE','buyer'),(214,'Entry','*','*','ALLOW','ROLE','buyer'),(215,'TicketWeekly','*','WRITE','ALLOW','ROLE','buyer'),(216,'TravelThermograph','*','READ','ALLOW','ROLE','employee'),(218,'Intrastat','*','*','ALLOW','ROLE','buyer'),(219,'Account','acl','READ','ALLOW','ROLE','account'),(220,'Account','getCurrentUserData','READ','ALLOW','ROLE','account'),(221,'UserConfig','getUserConfig','READ','ALLOW','ROLE','account'),(222,'Client','*','READ','ALLOW','ROLE','trainee'),(226,'ClientObservation','*','READ','ALLOW','ROLE','trainee'),(227,'Address','*','READ','ALLOW','ROLE','trainee'),(228,'AddressObservation','*','READ','ALLOW','ROLE','trainee'),(230,'ClientCredit','*','READ','ALLOW','ROLE','trainee'),(231,'ClientContact','*','READ','ALLOW','ROLE','trainee'),(232,'ClientSample','*','READ','ALLOW','ROLE','trainee'),(233,'EntryLog','*','READ','ALLOW','ROLE','buyer'),(234,'WorkerLog','*','READ','ALLOW','ROLE','hr'),(235,'CustomsAgent','*','*','ALLOW','ROLE','employee'),(236,'Buy','*','*','ALLOW','ROLE','buyer'),(237,'WorkerDms','filter','*','ALLOW','ROLE','employee'); /*!40000 ALTER TABLE `ACL` ENABLE KEYS */; UNLOCK TABLES; @@ -172,7 +172,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-09 11:46:30 +-- Dump completed on 2020-09-24 12:39:33 USE `vn`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -257,7 +257,7 @@ UNLOCK TABLES; LOCK TABLES `tag` WRITE; /*!40000 ALTER TABLE `tag` DISABLE KEYS */; -INSERT INTO `tag` VALUES (1,'color','Color',0,0,'ink',NULL,NULL,'inkFk'),(2,NULL,'Forma',1,0,NULL,NULL,NULL,NULL),(3,NULL,'Material',1,0,NULL,NULL,NULL,NULL),(4,NULL,'Longitud',1,1,NULL,'mm',NULL,'size'),(5,NULL,'Diámetro',1,1,NULL,'mm',NULL,'diameter'),(6,NULL,'Perímetro',1,1,NULL,'mm',NULL,NULL),(7,NULL,'Ancho de la base',1,1,NULL,'mm',NULL,NULL),(8,NULL,'Altura',1,1,NULL,'mm',NULL,'size'),(9,NULL,'Volumen',1,1,NULL,'ml',NULL,NULL),(10,NULL,'Densidad',1,1,NULL,NULL,NULL,NULL),(11,NULL,'Calidad',1,0,NULL,NULL,NULL,NULL),(12,NULL,'Textura',1,0,NULL,NULL,NULL,NULL),(13,NULL,'Material del mango',1,0,NULL,NULL,NULL,NULL),(14,NULL,'Compra mínima',1,0,NULL,NULL,NULL,NULL),(15,NULL,'Nº pétalos',1,1,NULL,NULL,NULL,NULL),(16,NULL,'Ancho',1,1,NULL,'mm',NULL,NULL),(18,NULL,'Profundidad',1,1,NULL,'mm',NULL,NULL),(19,NULL,'Largo',1,1,NULL,'mm',NULL,'size'),(20,NULL,'Ancho superior',1,1,NULL,'mm',NULL,NULL),(21,NULL,'Ancho inferior',1,1,NULL,'mm',NULL,NULL),(22,NULL,'Gramaje',1,1,NULL,'g',NULL,NULL),(23,'stems','Tallos',1,1,NULL,NULL,NULL,'stems'),(24,NULL,'Estado',1,0,NULL,NULL,NULL,NULL),(25,NULL,'Color principal',0,0,'ink',NULL,NULL,NULL),(26,NULL,'Color secundario',0,0,'ink',NULL,NULL,NULL),(27,NULL,'Longitud(cm)',1,1,NULL,'cm',NULL,NULL),(28,NULL,'Diámetro base',1,1,'','mm',NULL,'diameter'),(29,NULL,'Colección',1,0,NULL,NULL,NULL,NULL),(30,NULL,'Uds / caja',1,1,NULL,NULL,NULL,NULL),(31,NULL,'Contenido',1,0,NULL,NULL,NULL,NULL),(32,NULL,'Peso',1,1,NULL,'g',NULL,NULL),(33,NULL,'Grosor',1,1,NULL,'mm',NULL,NULL),(34,NULL,'Marca',1,0,NULL,NULL,NULL,NULL),(35,'origin','Origen',0,0,'origin',NULL,NULL,'originFk'),(36,NULL,'Proveedor',1,0,NULL,NULL,NULL,NULL),(37,'producer','Productor',0,0,'producer',NULL,NULL,'producerFk'),(38,NULL,'Duración',1,1,NULL,'s',NULL,NULL),(39,NULL,'Flor',1,0,NULL,NULL,NULL,NULL),(40,NULL,'Soporte',1,0,NULL,NULL,NULL,NULL),(41,NULL,'Tamaño flor',1,0,NULL,NULL,NULL,NULL),(42,NULL,'Apertura',1,0,NULL,NULL,NULL,NULL),(43,NULL,'Tallo',1,0,NULL,NULL,NULL,NULL),(44,NULL,'Nº hojas',1,1,NULL,NULL,NULL,NULL),(45,NULL,'Dimensiones',1,0,NULL,NULL,NULL,NULL),(46,NULL,'Diámetro boca',1,1,NULL,'mm',NULL,NULL),(47,NULL,'Nº flores',1,1,NULL,NULL,NULL,NULL),(48,NULL,'Uds / paquete',1,1,NULL,NULL,NULL,NULL),(49,NULL,'Maceta',1,1,NULL,'cm',NULL,'diameter'),(50,NULL,'Textura flor',1,0,NULL,NULL,NULL,NULL),(51,NULL,'Textura hoja',1,0,NULL,NULL,NULL,NULL),(52,NULL,'Tipo de IVA',1,0,NULL,NULL,NULL,NULL),(53,NULL,'Tronco',1,0,NULL,NULL,NULL,NULL),(54,NULL,'Hoja',1,0,NULL,NULL,NULL,NULL),(55,NULL,'Formato',1,0,NULL,NULL,NULL,NULL),(56,NULL,'Genero',1,0,NULL,NULL,NULL,NULL),(57,NULL,'Especie',1,0,NULL,NULL,NULL,NULL),(58,NULL,'Variedad',1,0,NULL,NULL,NULL,NULL),(59,NULL,'Medida grande',1,0,NULL,NULL,NULL,NULL),(60,NULL,'Medida mediano',1,0,NULL,NULL,NULL,NULL),(61,NULL,'Medida pequeño',1,0,NULL,NULL,NULL,NULL),(63,NULL,'Recipiente interior',1,0,NULL,NULL,NULL,NULL),(64,NULL,'Material secundario',1,0,NULL,NULL,NULL,NULL),(65,NULL,'Colores',1,0,NULL,NULL,NULL,NULL),(66,NULL,'Referencia',1,0,NULL,NULL,NULL,NULL),(67,'category','Categoria',1,0,NULL,NULL,NULL,NULL),(68,NULL,'Amb',1,0,NULL,NULL,NULL,NULL),(69,NULL,'Anchura',1,1,NULL,'cm',NULL,NULL),(70,NULL,'Hueco interior',1,0,NULL,NULL,NULL,NULL),(71,NULL,'Tamaño',1,0,NULL,NULL,NULL,NULL),(72,NULL,'Color botón',1,0,NULL,NULL,NULL,NULL),(73,NULL,'Tamaño minimo del botón',1,0,NULL,NULL,NULL,NULL),(74,NULL,'Obtentor',1,0,NULL,NULL,NULL,NULL),(75,NULL,'Longitud del brote',1,0,NULL,NULL,NULL,NULL),(76,NULL,'Tallos / u.v.',1,0,NULL,NULL,NULL,NULL),(77,NULL,'Madera de',1,0,NULL,NULL,NULL,NULL),(78,NULL,'Unidad de venta',1,0,NULL,NULL,NULL,NULL),(79,NULL,'Temporal',1,0,NULL,NULL,NULL,NULL),(80,NULL,'Gramaje/tallo',1,1,NULL,'g',NULL,NULL),(81,NULL,'Peso/paquete',1,1,NULL,'g',NULL,NULL),(82,NULL,'Flexibilidad del tallo',1,0,NULL,NULL,NULL,NULL),(83,NULL,'Nº planchas',1,1,NULL,NULL,NULL,NULL),(84,NULL,'Nº páginas',1,1,NULL,NULL,NULL,NULL),(85,NULL,'Editorial',1,0,NULL,NULL,NULL,NULL),(86,NULL,'Idioma',1,0,NULL,NULL,NULL,NULL),(87,NULL,'Fecha publicación',1,0,NULL,NULL,NULL,NULL),(88,NULL,'Cubierta',1,0,NULL,NULL,NULL,NULL),(89,NULL,'Encuadernación',1,0,NULL,NULL,NULL,NULL),(90,NULL,'Autor',1,0,NULL,NULL,NULL,NULL),(91,NULL,'Envoltorio',1,0,NULL,NULL,NULL,NULL),(92,NULL,'Nombre temporal',1,0,NULL,NULL,NULL,NULL),(93,NULL,'Modelo',1,0,NULL,NULL,NULL,NULL),(94,NULL,'Producto',1,0,NULL,NULL,NULL,NULL),(95,NULL,'Título',1,0,NULL,NULL,NULL,NULL),(96,NULL,'Tomo',1,0,NULL,NULL,NULL,NULL),(97,NULL,'Articulo',1,0,NULL,NULL,NULL,NULL),(98,NULL,'Metodo de cultivo',1,0,NULL,NULL,NULL,NULL),(99,NULL,'Edad',1,0,NULL,NULL,NULL,NULL),(100,NULL,'Agotado',1,0,NULL,NULL,NULL,NULL),(101,NULL,'Altura con asa',1,1,NULL,'cm',NULL,NULL),(102,NULL,'Nº tallos',1,1,NULL,NULL,NULL,NULL),(103,NULL,'Cultivo',1,0,NULL,NULL,NULL,NULL),(104,NULL,'Sabor',1,0,NULL,NULL,NULL,NULL),(105,NULL,'Talla',1,0,NULL,NULL,NULL,NULL),(106,NULL,'Calibre',1,1,NULL,NULL,NULL,NULL),(107,NULL,'Dulzura',1,1,NULL,'bx',NULL,NULL),(108,NULL,'Piezas',1,0,NULL,NULL,NULL,NULL),(109,NULL,'Altura con patas',1,0,NULL,NULL,NULL,NULL),(110,NULL,'Envase',1,0,NULL,NULL,NULL,NULL),(111,NULL,'Nº piezas',1,0,NULL,NULL,NULL,NULL),(112,NULL,'Uso',1,0,NULL,'cm',NULL,NULL),(113,NULL,'Color luz',1,0,NULL,NULL,NULL,NULL),(114,NULL,'Capacidad',1,0,NULL,NULL,NULL,NULL),(184,NULL,'Tallos por paquete',1,0,NULL,NULL,NULL,NULL),(205,NULL,'Apertura',1,0,NULL,NULL,'S05',NULL),(219,NULL,'Altura',1,0,NULL,NULL,'S20','size'),(552,NULL,'fout kenmerk',1,0,NULL,NULL,'081',NULL),(553,NULL,'Potinhoud',1,0,NULL,NULL,'A01',NULL),(554,NULL,'Marketingconcept',1,0,NULL,NULL,'A02',NULL),(555,NULL,'Leeftijd',1,0,NULL,NULL,'A03',NULL),(556,NULL,'Uitgangsmateriaal',1,0,NULL,NULL,'A04',NULL),(557,NULL,'Kleurbehandeld',1,0,NULL,NULL,'A05','inkFk'),(558,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,'A06',NULL),(559,NULL,'Verzorging: Water',1,0,NULL,NULL,'A07',NULL),(560,NULL,'Verzorging: Voeding',1,0,NULL,NULL,'A08',NULL),(561,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,'A09',NULL),(562,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,'A10',NULL),(563,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,'A11',NULL),(564,NULL,'Nabehandeling',1,0,NULL,NULL,'A13',NULL),(565,NULL,'Artikel beeld',1,0,NULL,NULL,'A23',NULL),(566,NULL,'Hoofdkleur 1',1,0,NULL,NULL,'B01',NULL),(567,NULL,'Hoofdkleur 2',1,0,NULL,NULL,'B02',NULL),(568,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,'B03',NULL),(569,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,'B04',NULL),(570,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,'B05',NULL),(571,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,'B06',NULL),(572,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,'B07',NULL),(573,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,'B08',NULL),(574,NULL,'Botanisch beeld',1,0,NULL,NULL,'B09',NULL),(575,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,'B10',NULL),(576,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,'B11',NULL),(577,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,'B12',NULL),(578,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,'B13',NULL),(579,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,'B14',NULL),(580,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,'B15',NULL),(581,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,'B16',NULL),(582,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,'K01',NULL),(583,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,'K02',NULL),(584,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,'K03',NULL),(585,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K04',NULL),(586,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,'K05',NULL),(587,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,'K07',NULL),(588,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,'K08',NULL),(589,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,'K11',NULL),(590,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,'K12',NULL),(591,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,'K13',NULL),(592,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,'K14',NULL),(593,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,'K15',NULL),(594,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,'K16',NULL),(595,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,'K17',NULL),(596,NULL,'Certificaten biologisch',1,0,NULL,NULL,'K18',NULL),(597,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,'K19',NULL),(598,NULL,'Certificaten Florimark',1,0,NULL,NULL,'K20',NULL),(599,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,'K21',NULL),(600,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,'K22',NULL),(601,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,'K23',NULL),(602,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,'K24',NULL),(603,NULL,'Certificaten ISO',1,0,NULL,NULL,'K25',NULL),(604,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K26',NULL),(605,NULL,'Certificaten Florverde',1,0,NULL,NULL,'K27',NULL),(606,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,'K28',NULL),(607,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,'K29',NULL),(608,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,'K30',NULL),(609,NULL,'Certificaten SAN',1,0,NULL,NULL,'K31',NULL),(610,NULL,'Certificaten GRASP',1,0,NULL,NULL,'K32',NULL),(611,NULL,'Label Fair Flora',1,0,NULL,NULL,'K33',NULL),(612,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,'K34',NULL),(613,NULL,'Fust',1,0,NULL,NULL,'L01',NULL),(614,NULL,'Stapelwagen',1,0,NULL,NULL,'L02',NULL),(615,NULL,'Aantal legborden veilings',1,0,NULL,NULL,'L03',NULL),(616,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,'L04',NULL),(617,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,'L05',NULL),(618,NULL,'Fustsoort',1,0,NULL,NULL,'L06',NULL),(619,NULL,'Fustmateriaal',1,0,NULL,NULL,'L07',NULL),(620,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,'L08',NULL),(621,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,'L09',NULL),(622,NULL,'Tallos/bolsa',1,0,NULL,NULL,'L11',''),(623,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,'L12',NULL),(624,NULL,'Aantal stuks per fust',1,0,NULL,NULL,'L13',NULL),(625,NULL,'Aantal bossen per fust',1,0,NULL,NULL,'L14',NULL),(626,NULL,'Aantal bundels per fust',1,0,NULL,NULL,'L15',NULL),(627,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,'L16',NULL),(628,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,'L17',NULL),(629,NULL,'Fustlabel',1,0,NULL,NULL,'L18',NULL),(630,NULL,'Karlabel',1,0,NULL,NULL,'L19',NULL),(631,NULL,'Service productlabel',1,0,NULL,NULL,'L20',NULL),(632,NULL,'Service fustlabel',1,0,NULL,NULL,'L21',NULL),(633,NULL,'Service karlabel',1,0,NULL,NULL,'L22',NULL),(634,NULL,'Aantal fusten per laag',1,0,NULL,NULL,'L23',NULL),(635,NULL,'Presentatie per schapm2',1,0,NULL,NULL,'L24',NULL),(636,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,'P01',NULL),(637,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,'P02',NULL),(638,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,'P03',NULL),(639,NULL,'Maceta',1,1,NULL,'cm','S01','diameter'),(640,NULL,'Altura',1,0,NULL,NULL,'S02','size'),(641,NULL,'nº plantas',1,0,NULL,NULL,'S03',NULL),(642,NULL,'Diámetro',1,0,NULL,NULL,'S04',NULL),(644,NULL,'Combinatiehoogte',1,0,NULL,NULL,'S06',NULL),(645,NULL,'Plantas/Maceta',1,0,NULL,NULL,'S07',NULL),(646,NULL,'Dikte',1,0,NULL,NULL,'S08',NULL),(647,NULL,'nº flores',1,0,NULL,NULL,'S09',NULL),(648,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,'S10',NULL),(649,NULL,'nº ramales',1,0,NULL,NULL,'S11',NULL),(650,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,'S12',NULL),(651,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,'S13',NULL),(652,NULL,'Minimum stamhoogte',1,0,NULL,NULL,'S14',NULL),(653,NULL,'Altura caja',1,0,NULL,NULL,'S15',NULL),(654,NULL,'Lengte scheuten',1,0,NULL,NULL,'S16',NULL),(655,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,'S17',NULL),(656,NULL,'Altura del capullo',1,0,NULL,NULL,'S19',NULL),(658,NULL,'Peso tallo',1,0,NULL,NULL,'S21',NULL),(659,NULL,'nº flores',1,0,NULL,NULL,'S22',NULL),(660,NULL,'Diámetro de la flor',1,0,NULL,NULL,'S23',NULL),(661,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,'S24',NULL),(662,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,'S25',NULL),(663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S26',NULL),(664,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S27',NULL),(665,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S28',NULL),(666,NULL,'Longitud inflorescencia',1,0,NULL,NULL,'S29',NULL),(667,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,'S30',NULL),(668,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,'S31',NULL),(669,NULL,'Longitud',1,0,NULL,NULL,'S32',NULL),(670,NULL,'Jaartal sortering hout',1,0,NULL,NULL,'S33',NULL),(671,NULL,'Diámetro de la hoja',1,0,NULL,NULL,'S34',NULL),(672,NULL,'Peso paquete',1,0,NULL,NULL,'S35',NULL),(673,NULL,'Maximum planthoogte',1,0,NULL,NULL,'S36',NULL),(674,NULL,'Maximum plantdiameter',1,0,NULL,NULL,'S37',NULL),(675,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,'S38',NULL),(676,NULL,'Maximum aantal takken per',1,0,NULL,NULL,'S39',NULL),(677,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,'S40',NULL),(678,NULL,'Maximum stamhoogte',1,0,NULL,NULL,'S41',NULL),(679,NULL,'Longitud mínima',1,0,NULL,NULL,'S42','size'),(680,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,'S43',NULL),(681,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,'S44',NULL),(682,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,'S45',NULL),(683,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,'S46',NULL),(684,NULL,'Verpakkingswijze',1,0,NULL,NULL,'S47',NULL),(685,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,'S48',NULL),(686,NULL,'Bolomvang',1,0,NULL,NULL,'S49',NULL),(687,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,'S50',NULL),(688,NULL,'Potvorm',1,0,NULL,NULL,'S51',NULL),(689,NULL,'Potkleur',1,0,NULL,NULL,'S52',NULL),(690,NULL,'Material maceta',1,0,NULL,NULL,'S53',NULL),(691,NULL,'Plantvorm',1,0,NULL,NULL,'S54',NULL),(692,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S55',NULL),(693,NULL,'Teeltwijze',1,0,NULL,NULL,'S56',NULL),(694,NULL,'Teeltmedium',1,0,NULL,NULL,'S57',NULL),(695,NULL,'Hoesmateriaal',1,0,NULL,NULL,'S58',NULL),(696,NULL,'Hoesvorm',1,0,NULL,NULL,'S59',NULL),(697,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,'S60',NULL),(698,NULL,'Extra toevoegingen',1,0,NULL,NULL,'S61',NULL),(699,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,'S62',NULL),(700,NULL,'Verpakte orchidee',1,0,NULL,NULL,'S63',NULL),(701,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,'S64',NULL),(702,NULL,'Voorbehandeling',1,0,NULL,NULL,'S65',NULL),(703,NULL,'Overige niet in pot',1,0,NULL,NULL,'S66',NULL),(704,NULL,'Vorm snijbloemen',1,0,NULL,NULL,'S67',NULL),(705,NULL,'Buigzaamheid bloemsteel',1,0,NULL,NULL,'S68',NULL),(706,NULL,'Hoeskleur',1,0,NULL,NULL,'S69',NULL),(707,NULL,'Extra deco materiaal',1,0,NULL,NULL,'S70',NULL),(708,NULL,'Productkleur',1,0,NULL,NULL,'S71','inkFk'),(709,NULL,'Productmateriaal',1,0,NULL,NULL,'S72',NULL),(710,NULL,'Materiaalhoogte',1,0,NULL,NULL,'S73',NULL),(711,NULL,'Materiaaldiameter',1,0,NULL,NULL,'S74',NULL),(712,NULL,'Barcode',1,0,NULL,NULL,'S75',NULL),(713,NULL,'Productlabel',1,0,NULL,NULL,'S76',NULL),(714,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,'S77',NULL),(715,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,'S78',NULL),(716,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S79',NULL),(717,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,'S80',NULL),(718,NULL,'Maximum lengte verschil',1,0,NULL,NULL,'S81',NULL),(719,NULL,'Bladkleur',1,0,NULL,NULL,'S82',NULL),(720,NULL,'Plantgewicht',1,0,NULL,NULL,'S83',NULL),(721,NULL,'Diámetro',1,0,NULL,NULL,'S84',NULL),(722,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,'S85',NULL),(723,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,'S86',NULL),(724,NULL,'Kleurbehandeld',1,0,NULL,NULL,'S87','inkFk'),(725,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,'S88',NULL),(726,NULL,'Diámetro del capullo',1,0,NULL,NULL,'S89',NULL),(727,NULL,'Volume inhoud',1,0,NULL,NULL,'S90',NULL),(728,NULL,'Vruchtbenaming',1,0,NULL,NULL,'S91',NULL),(729,NULL,'Vaaslevenindex',1,0,NULL,NULL,'S92',NULL),(730,NULL,'Overige informatie plante',1,0,NULL,NULL,'S93',NULL),(731,NULL,'Overige informatie snijbl',1,0,NULL,NULL,'S94',NULL),(732,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,'S95',NULL),(733,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,'S96',NULL),(734,NULL,'MPS certificering',1,0,NULL,NULL,'S97',NULL),(735,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,'S98',NULL),(736,NULL,'Artikelomschrijving',1,0,NULL,NULL,'S99',NULL),(737,NULL,'BTW-tarief',1,0,NULL,NULL,'T01',NULL),(738,NULL,'Prijseenheid',1,0,NULL,NULL,'T02',NULL),(739,NULL,'Transactievorm',1,0,NULL,NULL,'T03',NULL),(740,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,'T10',NULL),(741,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,'T11',NULL),(742,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,'T12',NULL),(743,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,'T13',NULL),(744,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,'T14',NULL),(745,NULL,'Algemene voorwaarden',1,0,NULL,NULL,'T15',NULL),(746,NULL,'Marktvorm',1,0,NULL,NULL,'T16',NULL),(747,NULL,'Themadagen',1,0,NULL,NULL,'T17',NULL),(748,NULL,'Handelscategorie',1,0,NULL,NULL,'T18',NULL),(749,NULL,'Producentengroepen',1,0,NULL,NULL,'T19',NULL),(750,NULL,'Favorieten Id',1,0,NULL,NULL,'T20',NULL),(751,NULL,'Verkoopeenheid',1,0,NULL,NULL,'T21',NULL),(752,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,'V01',NULL),(753,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V02',NULL),(754,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,'V03',NULL),(755,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,'V04',NULL),(756,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,'V05',NULL),(757,NULL,'FloraHolland Financial',1,0,NULL,NULL,'V06',NULL),(758,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V07',NULL),(759,NULL,'Benefiet veiling',1,0,NULL,NULL,'V08',NULL),(760,NULL,'Kloksoort',1,0,NULL,NULL,'V09',NULL),(761,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,'V10',NULL),(762,NULL,'Rest aantallen',1,0,NULL,NULL,'V11',NULL),(763,NULL,'Veilsoort',1,0,NULL,NULL,'V12',NULL),(764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V13',NULL),(765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V14',NULL),(766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V15',NULL),(767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V16',NULL),(768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V17',NULL),(769,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V18',NULL),(770,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V19',NULL),(771,NULL,'Gereserveerd',1,0,NULL,NULL,'V20',NULL),(772,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,'V21',NULL),(773,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,'V22',NULL),(774,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,'V23',NULL),(775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V24',NULL),(776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V25',NULL),(777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V26',NULL),(778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V27',NULL),(779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V28',NULL),(780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V29',NULL),(781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V30',NULL),(782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V31',NULL),(783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V32',NULL),(784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V33',NULL),(785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V34',NULL),(786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V35',NULL),(787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V36',NULL),(788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V37',NULL),(789,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V38',NULL),(790,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V39',NULL),(791,NULL,'Gereserveerd',1,0,NULL,NULL,'V40',NULL),(792,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,'V41',NULL),(793,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,'V42',NULL),(794,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,'V43',NULL),(795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V44',NULL),(796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V45',NULL),(797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V46',NULL),(798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V47',NULL),(799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V48',NULL),(800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V49',NULL),(801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V50',NULL),(802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V51',NULL),(803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V52',NULL),(804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V53',NULL),(805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V54',NULL),(806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V55',NULL),(807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V56',NULL),(808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V57',NULL),(809,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V58',NULL),(810,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V59',NULL),(811,NULL,'Gereserveerd',1,0,NULL,NULL,'V60',NULL),(812,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,'V61',NULL),(813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V62',NULL),(814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V63',NULL),(815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V64',NULL),(816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V65',NULL),(817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V66',NULL),(818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V67',NULL),(819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V68',NULL),(820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V69',NULL),(821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V70',NULL),(822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V71',NULL),(823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V72',NULL),(824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V73',NULL),(825,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V74',NULL),(826,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V75',NULL),(827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V76',NULL),(828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V77',NULL),(829,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V78',NULL),(830,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V79',NULL),(831,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,'V80',NULL),(832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V81',NULL),(833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V82',NULL),(834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V83',NULL),(835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V84',NULL),(836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V85',NULL),(837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V86',NULL),(838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V87',NULL),(839,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V88',NULL),(840,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V89',NULL),(841,NULL,'Veiling',1,0,NULL,NULL,'V99',NULL),(842,NULL,'kopersaantallen',1,0,NULL,NULL,'Z01',NULL),(843,NULL,'Caducidad',1,0,NULL,NULL,NULL,NULL); +INSERT INTO `tag` VALUES (1,'color','Color',0,0,'ink',NULL,NULL,'inkFk'),(2,NULL,'Forma',1,0,NULL,NULL,NULL,NULL),(3,NULL,'Material',1,0,NULL,NULL,NULL,NULL),(4,NULL,'Longitud',1,1,NULL,'mm',NULL,'size'),(5,NULL,'Diámetro',1,1,NULL,'mm',NULL,'diameter'),(6,NULL,'Perímetro',1,1,NULL,'mm',NULL,NULL),(7,NULL,'Ancho de la base',1,1,NULL,'mm',NULL,NULL),(8,NULL,'Altura',1,1,NULL,'mm',NULL,'size'),(9,NULL,'Volumen',1,1,NULL,'ml',NULL,NULL),(10,NULL,'Densidad',1,1,NULL,NULL,NULL,NULL),(11,NULL,'Calidad',1,0,NULL,NULL,NULL,NULL),(12,NULL,'Textura',1,0,NULL,NULL,NULL,NULL),(13,NULL,'Material del mango',1,0,NULL,NULL,NULL,NULL),(14,NULL,'Compra mínima',1,0,NULL,NULL,NULL,NULL),(15,NULL,'Nº pétalos',1,1,NULL,NULL,NULL,NULL),(16,NULL,'Ancho',1,1,NULL,'mm',NULL,NULL),(18,NULL,'Profundidad',1,1,NULL,'mm',NULL,NULL),(19,NULL,'Largo',1,1,NULL,'mm',NULL,'size'),(20,NULL,'Ancho superior',1,1,NULL,'mm',NULL,NULL),(21,NULL,'Ancho inferior',1,1,NULL,'mm',NULL,NULL),(22,NULL,'Gramaje',1,1,NULL,'g',NULL,NULL),(23,'stems','Tallos',1,1,NULL,NULL,NULL,'stems'),(24,NULL,'Estado',1,0,NULL,NULL,NULL,NULL),(25,NULL,'Color principal',0,0,'ink',NULL,NULL,NULL),(26,NULL,'Color secundario',0,0,'ink',NULL,NULL,NULL),(27,NULL,'Longitud(cm)',1,1,NULL,'cm',NULL,NULL),(28,NULL,'Diámetro base',1,1,'','mm',NULL,'diameter'),(29,NULL,'Colección',1,0,NULL,NULL,NULL,NULL),(30,NULL,'Uds / caja',1,1,NULL,NULL,NULL,NULL),(31,NULL,'Contenido',1,0,NULL,NULL,NULL,NULL),(32,NULL,'Peso',1,1,NULL,'g',NULL,NULL),(33,NULL,'Grosor',1,1,NULL,'mm',NULL,NULL),(34,NULL,'Marca',1,0,NULL,NULL,NULL,NULL),(35,'origin','Origen',0,0,'origin',NULL,NULL,'originFk'),(36,NULL,'Proveedor',1,0,NULL,NULL,NULL,NULL),(37,'producer','Productor',0,0,'producer',NULL,NULL,'producerFk'),(38,NULL,'Duración',1,1,NULL,'s',NULL,NULL),(39,NULL,'Flor',1,0,NULL,NULL,NULL,NULL),(40,NULL,'Soporte',1,0,NULL,NULL,NULL,NULL),(41,NULL,'Tamaño flor',1,0,NULL,NULL,NULL,NULL),(42,NULL,'Apertura',1,0,NULL,NULL,NULL,NULL),(43,NULL,'Tallo',1,0,NULL,NULL,NULL,NULL),(44,NULL,'Nº hojas',1,1,NULL,NULL,NULL,NULL),(45,NULL,'Dimensiones',1,0,NULL,NULL,NULL,NULL),(46,NULL,'Diámetro boca',1,1,NULL,'mm',NULL,NULL),(47,NULL,'Nº flores',1,1,NULL,NULL,NULL,NULL),(48,NULL,'Uds / paquete',1,1,NULL,NULL,NULL,NULL),(49,NULL,'Maceta',1,1,NULL,'cm',NULL,'diameter'),(50,NULL,'Textura flor',1,0,NULL,NULL,NULL,NULL),(51,NULL,'Textura hoja',1,0,NULL,NULL,NULL,NULL),(52,NULL,'Tipo de IVA',1,0,NULL,NULL,NULL,NULL),(53,NULL,'Tronco',1,0,NULL,NULL,NULL,NULL),(54,NULL,'Hoja',1,0,NULL,NULL,NULL,NULL),(55,NULL,'Formato',1,0,NULL,NULL,NULL,NULL),(56,NULL,'Genero',1,0,NULL,NULL,NULL,NULL),(57,NULL,'Especie',1,0,NULL,NULL,NULL,NULL),(58,NULL,'Variedad',1,0,NULL,NULL,NULL,NULL),(59,NULL,'Medida grande',1,0,NULL,NULL,NULL,NULL),(60,NULL,'Medida mediano',1,0,NULL,NULL,NULL,NULL),(61,NULL,'Medida pequeño',1,0,NULL,NULL,NULL,NULL),(63,NULL,'Recipiente interior',1,0,NULL,NULL,NULL,NULL),(64,NULL,'Material secundario',1,0,NULL,NULL,NULL,NULL),(65,NULL,'Colores',1,0,NULL,NULL,NULL,NULL),(66,NULL,'Referencia',1,0,NULL,NULL,NULL,NULL),(67,'category','Categoria',1,0,NULL,NULL,NULL,NULL),(68,NULL,'Amb',1,0,NULL,NULL,NULL,NULL),(69,NULL,'Anchura',1,1,NULL,'cm',NULL,NULL),(70,NULL,'Hueco interior',1,0,NULL,NULL,NULL,NULL),(71,NULL,'Tamaño',1,0,NULL,NULL,NULL,NULL),(72,NULL,'Color botón',1,0,NULL,NULL,NULL,NULL),(73,NULL,'Tamaño minimo del botón',1,0,NULL,NULL,NULL,NULL),(74,NULL,'Obtentor',1,0,NULL,NULL,NULL,NULL),(75,NULL,'Longitud del brote',1,0,NULL,NULL,NULL,NULL),(76,NULL,'Tallos / u.v.',1,0,NULL,NULL,NULL,NULL),(77,NULL,'Madera de',1,0,NULL,NULL,NULL,NULL),(78,NULL,'Unidad de venta',1,0,NULL,NULL,NULL,NULL),(79,NULL,'Temporal',1,0,NULL,NULL,NULL,NULL),(80,NULL,'Gramaje/tallo',1,1,NULL,'g',NULL,NULL),(81,NULL,'Peso/paquete',1,1,NULL,'g',NULL,NULL),(82,NULL,'Flexibilidad del tallo',1,0,NULL,NULL,NULL,NULL),(83,NULL,'Nº planchas',1,1,NULL,NULL,NULL,NULL),(84,NULL,'Nº páginas',1,1,NULL,NULL,NULL,NULL),(85,NULL,'Editorial',1,0,NULL,NULL,NULL,NULL),(86,NULL,'Idioma',1,0,NULL,NULL,NULL,NULL),(87,NULL,'Fecha publicación',1,0,NULL,NULL,NULL,NULL),(88,NULL,'Cubierta',1,0,NULL,NULL,NULL,NULL),(89,NULL,'Encuadernación',1,0,NULL,NULL,NULL,NULL),(90,NULL,'Autor',1,0,NULL,NULL,NULL,NULL),(91,NULL,'Envoltorio',1,0,NULL,NULL,NULL,NULL),(92,NULL,'Nombre temporal',1,0,NULL,NULL,NULL,NULL),(93,NULL,'Modelo',1,0,NULL,NULL,NULL,NULL),(94,NULL,'Producto',1,0,NULL,NULL,NULL,NULL),(95,NULL,'Título',1,0,NULL,NULL,NULL,NULL),(96,NULL,'Tomo',1,0,NULL,NULL,NULL,NULL),(97,NULL,'Articulo',1,0,NULL,NULL,NULL,NULL),(98,NULL,'Metodo de cultivo',1,0,NULL,NULL,NULL,NULL),(99,NULL,'Edad',1,0,NULL,NULL,NULL,NULL),(100,NULL,'Agotado',1,0,NULL,NULL,NULL,NULL),(101,NULL,'Altura con asa',1,1,NULL,'cm',NULL,NULL),(102,NULL,'Nº tallos',1,1,NULL,NULL,NULL,NULL),(103,NULL,'Cultivo',1,0,NULL,NULL,NULL,NULL),(104,NULL,'Sabor',1,0,NULL,NULL,NULL,NULL),(105,NULL,'Talla',1,0,NULL,NULL,NULL,NULL),(106,NULL,'Calibre',1,1,NULL,NULL,NULL,NULL),(107,NULL,'Dulzura',1,1,NULL,'bx',NULL,NULL),(108,NULL,'Piezas',1,0,NULL,NULL,NULL,NULL),(109,NULL,'Altura con patas',1,0,NULL,NULL,NULL,NULL),(110,NULL,'Envase',1,0,NULL,NULL,NULL,NULL),(111,NULL,'Nº piezas',1,0,NULL,NULL,NULL,NULL),(112,NULL,'Uso',1,0,NULL,'cm',NULL,NULL),(113,NULL,'Color luz',1,0,NULL,NULL,NULL,NULL),(114,NULL,'Capacidad',1,0,NULL,NULL,NULL,NULL),(184,NULL,'Tallos por paquete',1,0,NULL,NULL,NULL,NULL),(205,NULL,'Apertura',1,0,NULL,NULL,'S05',NULL),(219,NULL,'Altura',1,0,NULL,NULL,'S20','size'),(552,NULL,'fout kenmerk',1,0,NULL,NULL,'081',NULL),(553,NULL,'Potinhoud',1,0,NULL,NULL,'A01',NULL),(554,NULL,'Marketingconcept',1,0,NULL,NULL,'A02',NULL),(555,NULL,'Leeftijd',1,0,NULL,NULL,'A03',NULL),(556,NULL,'Base',1,0,NULL,NULL,'A04',NULL),(557,NULL,'Kleurbehandeld',1,0,NULL,NULL,'A05','inkFk'),(558,NULL,'Verzorging: Standplaats',1,0,NULL,NULL,'A06',NULL),(559,NULL,'Verzorging: Water',1,0,NULL,NULL,'A07',NULL),(560,NULL,'Verzorging: Voeding',1,0,NULL,NULL,'A08',NULL),(561,NULL,'Verzorging: Temperatuur',1,0,NULL,NULL,'A09',NULL),(562,NULL,'Verzorging: Specifieke in',1,0,NULL,NULL,'A10',NULL),(563,NULL,'Verzorging: Consumptie',1,0,NULL,NULL,'A11',NULL),(564,NULL,'Nabehandeling',1,0,NULL,NULL,'A13',NULL),(565,NULL,'Artikel beeld',1,0,NULL,NULL,'A23',NULL),(566,NULL,'Hoofdkleur 1',1,0,NULL,NULL,'B01',NULL),(567,NULL,'Hoofdkleur 2',1,0,NULL,NULL,'B02',NULL),(568,NULL,'RHS hoofdkleur 1',1,0,NULL,NULL,'B03',NULL),(569,NULL,'RHS hoofdkleur 2',1,0,NULL,NULL,'B04',NULL),(570,NULL,'Hoofdkleur 1 blad',1,0,NULL,NULL,'B05',NULL),(571,NULL,'Hoofdkleur 2 blad',1,0,NULL,NULL,'B06',NULL),(572,NULL,'RHS hoofdkleur 1 blad',1,0,NULL,NULL,'B07',NULL),(573,NULL,'RHS hoofdkleur 2 blad',1,0,NULL,NULL,'B08',NULL),(574,NULL,'Botanisch beeld',1,0,NULL,NULL,'B09',NULL),(575,NULL,'Hoofdkleur bes/vrucht',1,0,NULL,NULL,'B10',NULL),(576,NULL,'RHS hoofdkleur bes/vrucht',1,0,NULL,NULL,'B11',NULL),(577,NULL,'UPOV hoofdkleur 1 bloem',1,0,NULL,NULL,'B12',NULL),(578,NULL,'UPOV hoofdkleur 2 bloem',1,0,NULL,NULL,'B13',NULL),(579,NULL,'UPOV hoofdkleur 1 blad',1,0,NULL,NULL,'B14',NULL),(580,NULL,'UPOV hoofdkleur 2 blad',1,0,NULL,NULL,'B15',NULL),(581,NULL,'UPOV hoofdkleur bes/vruch',1,0,NULL,NULL,'B16',NULL),(582,NULL,'Negatieve keurcode 1',1,0,NULL,NULL,'K01',NULL),(583,NULL,'Negatieve keurcode 2',1,0,NULL,NULL,'K02',NULL),(584,NULL,'Bedrijfskenmerk fytosanit',1,0,NULL,NULL,'K03',NULL),(585,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K04',NULL),(586,NULL,'Certificaten MPS-TraceCer',1,0,NULL,NULL,'K05',NULL),(587,NULL,'Overige leveranciersinfor',1,0,NULL,NULL,'K07',NULL),(588,NULL,'Certificaten MPS-GAP',1,0,NULL,NULL,'K08',NULL),(589,NULL,'Betrouwbaarheidsindex kla',1,0,NULL,NULL,'K11',NULL),(590,NULL,'Betrouwbaarheidsindex waa',1,0,NULL,NULL,'K12',NULL),(591,NULL,'Productkwaliteitslabel',1,0,NULL,NULL,'K13',NULL),(592,NULL,'Label Fair Flowers Fair P',1,0,NULL,NULL,'K14',NULL),(593,NULL,'Certificaten Socialy Qual',1,0,NULL,NULL,'K15',NULL),(594,NULL,'Certificaten GlobalGAP',1,0,NULL,NULL,'K16',NULL),(595,NULL,'Certificaten MPS Quality',1,0,NULL,NULL,'K17',NULL),(596,NULL,'Certificaten biologisch',1,0,NULL,NULL,'K18',NULL),(597,NULL,'Certificaten eetbare prod',1,0,NULL,NULL,'K19',NULL),(598,NULL,'Certificaten Florimark',1,0,NULL,NULL,'K20',NULL),(599,NULL,'Certificaten Milieukeur',1,0,NULL,NULL,'K21',NULL),(600,NULL,'Certificaten Kenya Flower',1,0,NULL,NULL,'K22',NULL),(601,NULL,'Certificaten Fairtrade',1,0,NULL,NULL,'K23',NULL),(602,NULL,'Keurmerk MPS-ProductProof',1,0,NULL,NULL,'K24',NULL),(603,NULL,'Certificaten ISO',1,0,NULL,NULL,'K25',NULL),(604,NULL,'Certificaten aardwarmte',1,0,NULL,NULL,'K26',NULL),(605,NULL,'Certificaten Florverde',1,0,NULL,NULL,'K27',NULL),(606,NULL,'Certificaten Ethical Trad',1,0,NULL,NULL,'K28',NULL),(607,NULL,'Certificaten Ethiopian EH',1,0,NULL,NULL,'K29',NULL),(608,NULL,'Certificaten gewasbescher',1,0,NULL,NULL,'K30',NULL),(609,NULL,'Certificaten SAN',1,0,NULL,NULL,'K31',NULL),(610,NULL,'Certificaten GRASP',1,0,NULL,NULL,'K32',NULL),(611,NULL,'Label Fair Flora',1,0,NULL,NULL,'K33',NULL),(612,NULL,'GLobalG.A.P. Chain of Cus',1,0,NULL,NULL,'K34',NULL),(613,NULL,'Fust',1,0,NULL,NULL,'L01',NULL),(614,NULL,'Stapelwagen',1,0,NULL,NULL,'L02',NULL),(615,NULL,'Aantal legborden veilings',1,0,NULL,NULL,'L03',NULL),(616,NULL,'Aantal legborden Deense s',1,0,NULL,NULL,'L04',NULL),(617,NULL,'Aantal onderstellen Deens',1,0,NULL,NULL,'L05',NULL),(618,NULL,'Fustsoort',1,0,NULL,NULL,'L06',NULL),(619,NULL,'Envase',1,0,NULL,NULL,'L07',NULL),(620,NULL,'Aantal legborden Eurostap',1,0,NULL,NULL,'L08',NULL),(621,NULL,'Aantal onderstellen Euros',1,0,NULL,NULL,'L09',NULL),(622,NULL,'Tallos/bolsa',1,0,NULL,NULL,'L11',''),(623,NULL,'Aantal bossen per bundel',1,0,NULL,NULL,'L12',NULL),(624,NULL,'Aantal stuks per fust',1,0,NULL,NULL,'L13',NULL),(625,NULL,'Aantal bossen per fust',1,0,NULL,NULL,'L14',NULL),(626,NULL,'Aantal bundels per fust',1,0,NULL,NULL,'L15',NULL),(627,NULL,'Aantal bossen per hoes',1,0,NULL,NULL,'L16',NULL),(628,NULL,'Aantal bundels per hoes',1,0,NULL,NULL,'L17',NULL),(629,NULL,'Fustlabel',1,0,NULL,NULL,'L18',NULL),(630,NULL,'Karlabel',1,0,NULL,NULL,'L19',NULL),(631,NULL,'Service productlabel',1,0,NULL,NULL,'L20',NULL),(632,NULL,'Service fustlabel',1,0,NULL,NULL,'L21',NULL),(633,NULL,'Service karlabel',1,0,NULL,NULL,'L22',NULL),(634,NULL,'Aantal fusten per laag',1,0,NULL,NULL,'L23',NULL),(635,NULL,'Presentatie per schapm2',1,0,NULL,NULL,'L24',NULL),(636,NULL,'Positieve keurcode fytosa',1,0,NULL,NULL,'P01',NULL),(637,NULL,'Positieve keurcode kwalit',1,0,NULL,NULL,'P02',NULL),(638,NULL,'Positieve keurcode veilin',1,0,NULL,NULL,'P03',NULL),(639,NULL,'Maceta',1,1,NULL,'cm','S01','diameter'),(640,NULL,'Altura',1,0,NULL,NULL,'S02','size'),(641,NULL,'nº plantas',1,0,NULL,NULL,'S03',NULL),(642,NULL,'Diámetro',1,0,NULL,NULL,'S04',NULL),(644,NULL,'Combinatiehoogte',1,0,NULL,NULL,'S06',NULL),(645,NULL,'Plantas/Maceta',1,0,NULL,NULL,'S07',NULL),(646,NULL,'Dikte',1,0,NULL,NULL,'S08',NULL),(647,NULL,'nº flores',1,0,NULL,NULL,'S09',NULL),(648,NULL,'Min aantal bloemtrossen p',1,0,NULL,NULL,'S10',NULL),(649,NULL,'nº ramales',1,0,NULL,NULL,'S11',NULL),(650,NULL,'Minimum aantal bollen per',1,0,NULL,NULL,'S12',NULL),(651,NULL,'Minimum aantal bladeren p',1,0,NULL,NULL,'S13',NULL),(652,NULL,'Minimum stamhoogte',1,0,NULL,NULL,'S14',NULL),(653,NULL,'Altura caja',1,0,NULL,NULL,'S15',NULL),(654,NULL,'Lengte scheuten',1,0,NULL,NULL,'S16',NULL),(655,NULL,'Min aant vertakkingen pr ',1,0,NULL,NULL,'S17',NULL),(656,NULL,'Altura del capullo',1,0,NULL,NULL,'S19',NULL),(658,NULL,'Peso tallo',1,0,NULL,NULL,'S21',NULL),(659,NULL,'nº flores',1,0,NULL,NULL,'S22',NULL),(660,NULL,'Diámetro de la flor',1,0,NULL,NULL,'S23',NULL),(661,NULL,'Minimum bloemschedelengte',1,0,NULL,NULL,'S24',NULL),(662,NULL,'Aantal bloemkoppen per tr',1,0,NULL,NULL,'S25',NULL),(663,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S26',NULL),(664,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S27',NULL),(665,NULL,'Aant.kleuren/cultiv/vorme',1,0,NULL,NULL,'S28',NULL),(666,NULL,'Longitud inflorescencia',1,0,NULL,NULL,'S29',NULL),(667,NULL,'Verpakkingswijze snijbloe',1,0,NULL,NULL,'S30',NULL),(668,NULL,'Minimum aant bloemen per ',1,0,NULL,NULL,'S31',NULL),(669,NULL,'Longitud',1,0,NULL,NULL,'S32',NULL),(670,NULL,'Jaartal sortering hout',1,0,NULL,NULL,'S33',NULL),(671,NULL,'Diámetro de la hoja',1,0,NULL,NULL,'S34',NULL),(672,NULL,'Peso paquete',1,0,NULL,NULL,'S35',NULL),(673,NULL,'Maximum planthoogte',1,0,NULL,NULL,'S36',NULL),(674,NULL,'Maximum plantdiameter',1,0,NULL,NULL,'S37',NULL),(675,NULL,'Max aantal bloemen/bloeiw',1,0,NULL,NULL,'S38',NULL),(676,NULL,'Maximum aantal takken per',1,0,NULL,NULL,'S39',NULL),(677,NULL,'Maximum aantal bollen per',1,0,NULL,NULL,'S40',NULL),(678,NULL,'Maximum stamhoogte',1,0,NULL,NULL,'S41',NULL),(679,NULL,'Longitud mínima',1,0,NULL,NULL,'S42','size'),(680,NULL,'Maximum aantal knoppen sn',1,0,NULL,NULL,'S43',NULL),(681,NULL,'Maximum bloemdiameter',1,0,NULL,NULL,'S44',NULL),(682,NULL,'Maximum bloeiwijzelengte',1,0,NULL,NULL,'S45',NULL),(683,NULL,'Aantal vruchten / trossen',1,0,NULL,NULL,'S46',NULL),(684,NULL,'Verpakkingswijze',1,0,NULL,NULL,'S47',NULL),(685,NULL,'Minimum vruchtdiameter',1,0,NULL,NULL,'S48',NULL),(686,NULL,'Bolomvang',1,0,NULL,NULL,'S49',NULL),(687,NULL,'Bloem/bes/vruchtkleur 1',1,0,NULL,NULL,'S50',NULL),(688,NULL,'Potvorm',1,0,NULL,NULL,'S51',NULL),(689,NULL,'Potkleur',1,0,NULL,NULL,'S52',NULL),(690,NULL,'Material maceta',1,0,NULL,NULL,'S53',NULL),(691,NULL,'Plantvorm',1,0,NULL,NULL,'S54',NULL),(692,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S55',NULL),(693,NULL,'Teeltwijze',1,0,NULL,NULL,'S56',NULL),(694,NULL,'Teeltmedium',1,0,NULL,NULL,'S57',NULL),(695,NULL,'Cubierta',1,0,NULL,NULL,'S58',NULL),(696,NULL,'Hoesvorm',1,0,NULL,NULL,'S59',NULL),(697,NULL,'Hoesbedrukking algemeen',1,0,NULL,NULL,'S60',NULL),(698,NULL,'Extra toevoegingen',1,0,NULL,NULL,'S61',NULL),(699,NULL,'Land van herkomst (bedrij',1,0,NULL,NULL,'S62',NULL),(700,NULL,'Verpakte orchidee',1,0,NULL,NULL,'S63',NULL),(701,NULL,'Hoesbedrukking extra',1,0,NULL,NULL,'S64',NULL),(702,NULL,'Voorbehandeling',1,0,NULL,NULL,'S65',NULL),(703,NULL,'Overige niet in pot',1,0,NULL,NULL,'S66',NULL),(704,NULL,'Forma de la flor',1,0,NULL,NULL,'S67',NULL),(705,NULL,'Flexibilidad',1,0,NULL,NULL,'S68',NULL),(706,NULL,'Hoeskleur',1,0,NULL,NULL,'S69',NULL),(707,NULL,'Extra deco',1,0,NULL,NULL,'S70',NULL),(708,NULL,'Color',1,0,NULL,NULL,'S71','inkFk'),(709,NULL,'Producto',1,0,NULL,NULL,'S72',NULL),(710,NULL,'Altura',1,0,NULL,NULL,'S73',NULL),(711,NULL,'Diametro',1,0,NULL,NULL,'S74',NULL),(712,NULL,'Barcode',1,0,NULL,NULL,'S75',NULL),(713,NULL,'Productlabel',1,0,NULL,NULL,'S76',NULL),(714,NULL,'Eetbaar/ niet eetbaar',1,0,NULL,NULL,'S77',NULL),(715,NULL,'Plantmaat zonder pot',1,0,NULL,NULL,'S78',NULL),(716,NULL,'Aantal kleuren/cultiv per',1,0,NULL,NULL,'S79',NULL),(717,NULL,'Maximum percentage oud ho',1,0,NULL,NULL,'S80',NULL),(718,NULL,'Maximum lengte verschil',1,0,NULL,NULL,'S81',NULL),(719,NULL,'Bladkleur',1,0,NULL,NULL,'S82',NULL),(720,NULL,'Plantgewicht',1,0,NULL,NULL,'S83',NULL),(721,NULL,'Diámetro',1,0,NULL,NULL,'S84',NULL),(722,NULL,'Bloem/bes/vruchtkleur 2',1,0,NULL,NULL,'S85',NULL),(723,NULL,'Winterhardheid (USDA zone',1,0,NULL,NULL,'S86',NULL),(724,NULL,'Kleurbehandeld',1,0,NULL,NULL,'S87','inkFk'),(725,NULL,'Bloem-/bladkleurverdeling',1,0,NULL,NULL,'S88',NULL),(726,NULL,'Diámetro del capullo',1,0,NULL,NULL,'S89',NULL),(727,NULL,'Volume inhoud',1,0,NULL,NULL,'S90',NULL),(728,NULL,'Vruchtbenaming',1,0,NULL,NULL,'S91',NULL),(729,NULL,'Vaaslevenindex',1,0,NULL,NULL,'S92',NULL),(730,NULL,'Overige informatie plante',1,0,NULL,NULL,'S93',NULL),(731,NULL,'Overige informatie snijbl',1,0,NULL,NULL,'S94',NULL),(732,NULL,'Toepassingsmogelijkheid',1,0,NULL,NULL,'S95',NULL),(733,NULL,'Productbeeld aanvoerder',1,0,NULL,NULL,'S96',NULL),(734,NULL,'MPS certificering',1,0,NULL,NULL,'S97',NULL),(735,NULL,'Kwaliteitsgroep',1,0,NULL,NULL,'S98',NULL),(736,NULL,'Artikelomschrijving',1,0,NULL,NULL,'S99',NULL),(737,NULL,'BTW-tarief',1,0,NULL,NULL,'T01',NULL),(738,NULL,'Prijseenheid',1,0,NULL,NULL,'T02',NULL),(739,NULL,'Transactievorm',1,0,NULL,NULL,'T03',NULL),(740,NULL,'Handelsverpakking voorwaa',1,0,NULL,NULL,'T10',NULL),(741,NULL,'Consumentenverpakking voo',1,0,NULL,NULL,'T11',NULL),(742,NULL,'Leveringsvoorwaarden',1,0,NULL,NULL,'T12',NULL),(743,NULL,'PT heffing voorwaarden',1,0,NULL,NULL,'T13',NULL),(744,NULL,'Serviceheffing voorwaarde',1,0,NULL,NULL,'T14',NULL),(745,NULL,'Algemene voorwaarden',1,0,NULL,NULL,'T15',NULL),(746,NULL,'Marktvorm',1,0,NULL,NULL,'T16',NULL),(747,NULL,'Themadagen',1,0,NULL,NULL,'T17',NULL),(748,NULL,'Handelscategorie',1,0,NULL,NULL,'T18',NULL),(749,NULL,'Producentengroepen',1,0,NULL,NULL,'T19',NULL),(750,NULL,'Favorieten Id',1,0,NULL,NULL,'T20',NULL),(751,NULL,'Verkoopeenheid',1,0,NULL,NULL,'T21',NULL),(752,NULL,'Veilgroep voorkeur',1,0,NULL,NULL,'V01',NULL),(753,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V02',NULL),(754,NULL,'Keurmeesternummer FloraHo',1,0,NULL,NULL,'V03',NULL),(755,NULL,'Rijnummer Rijnsburg',1,0,NULL,NULL,'V04',NULL),(756,NULL,'Verwerkingslocatie FloraH',1,0,NULL,NULL,'V05',NULL),(757,NULL,'FloraHolland Financial',1,0,NULL,NULL,'V06',NULL),(758,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V07',NULL),(759,NULL,'Benefiet veiling',1,0,NULL,NULL,'V08',NULL),(760,NULL,'Kloksoort',1,0,NULL,NULL,'V09',NULL),(761,NULL,'Minimumprijs aanvoerder',1,0,NULL,NULL,'V10',NULL),(762,NULL,'Rest aantallen',1,0,NULL,NULL,'V11',NULL),(763,NULL,'Veilsoort',1,0,NULL,NULL,'V12',NULL),(764,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V13',NULL),(765,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V14',NULL),(766,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V15',NULL),(767,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V16',NULL),(768,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V17',NULL),(769,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V18',NULL),(770,NULL,'Gereserveerd FloraHolland',1,0,NULL,NULL,'V19',NULL),(771,NULL,'Gereserveerd',1,0,NULL,NULL,'V20',NULL),(772,NULL,'Veilgroep Aalsmeer',1,0,NULL,NULL,'V21',NULL),(773,NULL,'Promotie kenmerk FloraHol',1,0,NULL,NULL,'V22',NULL),(774,NULL,'Verrekening snijbloemenvo',1,0,NULL,NULL,'V23',NULL),(775,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V24',NULL),(776,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V25',NULL),(777,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V26',NULL),(778,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V27',NULL),(779,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V28',NULL),(780,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V29',NULL),(781,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V30',NULL),(782,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V31',NULL),(783,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V32',NULL),(784,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V33',NULL),(785,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V34',NULL),(786,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V35',NULL),(787,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V36',NULL),(788,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V37',NULL),(789,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V38',NULL),(790,NULL,'Gereserveerd Aalsmeer',1,0,NULL,NULL,'V39',NULL),(791,NULL,'Gereserveerd',1,0,NULL,NULL,'V40',NULL),(792,NULL,'Tussenopslag klok Plantio',1,0,NULL,NULL,'V41',NULL),(793,NULL,'Soort ladingsdrager Plant',1,0,NULL,NULL,'V42',NULL),(794,NULL,'Logistiek middel Plantion',1,0,NULL,NULL,'V43',NULL),(795,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V44',NULL),(796,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V45',NULL),(797,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V46',NULL),(798,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V47',NULL),(799,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V48',NULL),(800,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V49',NULL),(801,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V50',NULL),(802,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V51',NULL),(803,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V52',NULL),(804,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V53',NULL),(805,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V54',NULL),(806,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V55',NULL),(807,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V56',NULL),(808,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V57',NULL),(809,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V58',NULL),(810,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V59',NULL),(811,NULL,'Gereserveerd',1,0,NULL,NULL,'V60',NULL),(812,NULL,'Veilgroep Plantion Ede',1,0,NULL,NULL,'V61',NULL),(813,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V62',NULL),(814,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V63',NULL),(815,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V64',NULL),(816,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V65',NULL),(817,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V66',NULL),(818,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V67',NULL),(819,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V68',NULL),(820,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V69',NULL),(821,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V70',NULL),(822,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V71',NULL),(823,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V72',NULL),(824,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V73',NULL),(825,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V74',NULL),(826,NULL,'Gereserveerd Plantion Ede',1,0,NULL,NULL,'V75',NULL),(827,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V76',NULL),(828,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V77',NULL),(829,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V78',NULL),(830,NULL,'Gereserveerd Holambra',1,0,NULL,NULL,'V79',NULL),(831,NULL,'Toegevoegde waardes VRM',1,0,NULL,NULL,'V80',NULL),(832,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V81',NULL),(833,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V82',NULL),(834,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V83',NULL),(835,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V84',NULL),(836,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V85',NULL),(837,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V86',NULL),(838,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V87',NULL),(839,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V88',NULL),(840,NULL,'Gereserveerd VRM',1,0,NULL,NULL,'V89',NULL),(841,NULL,'Veiling',1,0,NULL,NULL,'V99',NULL),(842,NULL,'kopersaantallen',1,0,NULL,NULL,'Z01',NULL),(843,NULL,'Caducidad',1,0,NULL,NULL,NULL,NULL),(844,NULL,'Lote',1,0,NULL,NULL,NULL,NULL),(845,NULL,'Uds palet',1,0,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `tag` ENABLE KEYS */; UNLOCK TABLES; @@ -317,7 +317,7 @@ UNLOCK TABLES; LOCK TABLES `state` WRITE; /*!40000 ALTER TABLE `state` DISABLE KEYS */; -INSERT INTO `state` VALUES (1,'Arreglar',2,0,'FIXING',NULL,1,0,0,0,0,0,0,4),(2,'Libre',2,0,'FREE',NULL,2,1,0,0,0,1,0,4),(3,'OK',3,0,'OK',3,28,1,0,0,0,1,1,3),(4,'Impreso',4,1,'PRINTED',2,29,1,0,1,0,0,0,2),(5,'Preparación',5,1,'ON_PREPARATION',7,5,0,0,0,2,0,0,2),(6,'En Revisión',7,1,'ON_CHECKING',NULL,6,0,1,0,3,0,0,1),(7,'Sin Acabar',1,0,'NOT_READY',NULL,7,0,0,0,0,1,0,4),(8,'Revisado',8,1,'CHECKED',NULL,8,0,1,0,3,0,0,1),(9,'Encajando',9,2,'PACKING',NULL,9,0,1,0,0,0,0,0),(10,'Encajado',10,2,'PACKED',NULL,10,0,1,0,0,0,0,0),(11,'Facturado',0,0,'INVOICED',NULL,11,0,1,0,0,0,0,0),(12,'Bloqueado',0,0,'BLOCKED',NULL,12,0,0,0,0,0,0,4),(13,'En Reparto',11,3,'ON_DELIVERY',NULL,13,0,1,0,0,0,0,0),(14,'Preparado',6,1,'PREPARED',NULL,14,0,1,0,2,0,0,1),(15,'Pte Recogida',12,3,'WAITING_FOR_PICKUP',NULL,15,0,1,0,0,0,0,0),(16,'Entregado',13,3,'DELIVERED',NULL,16,0,1,0,0,0,0,0),(20,'Asignado',4,1,'PICKER_DESIGNED',NULL,20,1,0,0,0,0,0,2),(21,'Retornado',4,1,'PRINTED_BACK',6,21,0,0,0,0,0,0,2),(22,'¿Fecha?',2,0,'WRONG_DATE',NULL,22,0,0,0,0,0,0,4),(23,'URGENTE',2,0,'LAST_CALL',NULL,23,1,0,0,0,0,0,4),(24,'Encadenado',4,0,'CHAINED',4,24,0,0,0,0,0,0,3),(25,'Embarcando',3,0,'BOARDING',5,25,1,0,0,0,1,0,3),(26,'Prep Previa',5,1,'PREVIOUS_PREPARATION',1,26,0,0,0,1,0,0,2),(27,'Prep Asistida',5,1,'ASSISTED_PREPARATION',7,27,0,0,0,0,0,0,2),(28,'Previa OK',3,1,'OK PREVIOUS',3,28,1,0,0,1,1,1,3),(29,'Previa Impreso',4,1,'PRINTED PREVIOUS',2,29,1,0,1,1,0,0,3),(30,'Embarcado',4,0,'BOARD',5,30,0,0,0,2,0,0,3),(31,'Polizon Impreso',4,1,'PRINTED STOWAWAY',2,29,1,0,1,0,0,0,3),(32,'Polizon OK',3,1,'OK STOWAWAY',3,31,1,0,0,1,1,1,3),(33,'Auto_Impreso',4,1,'PRINTED_AUTO',2,29,1,0,1,0,0,0,2); +INSERT INTO `state` VALUES (1,'Arreglar',2,0,'FIXING',NULL,1,0,0,0,0,0,0,4),(2,'Libre',2,0,'FREE',NULL,2,1,0,0,0,1,0,4),(3,'OK',3,0,'OK',3,28,1,0,0,0,1,1,3),(4,'Impreso',4,0,'PRINTED',2,29,1,0,1,0,0,0,2),(5,'Preparación',5,1,'ON_PREPARATION',7,5,0,0,0,2,0,0,2),(6,'En Revisión',7,1,'ON_CHECKING',NULL,6,0,1,0,3,0,0,1),(7,'Sin Acabar',1,0,'NOT_READY',NULL,7,0,0,0,0,1,0,4),(8,'Revisado',8,1,'CHECKED',NULL,8,0,1,0,3,0,0,1),(9,'Encajando',9,2,'PACKING',NULL,9,0,1,0,0,0,0,0),(10,'Encajado',10,2,'PACKED',NULL,10,0,1,0,0,0,0,0),(11,'Facturado',0,3,'INVOICED',NULL,11,0,1,0,0,0,0,0),(12,'Bloqueado',0,0,'BLOCKED',NULL,12,0,0,0,0,0,0,4),(13,'En Reparto',11,3,'ON_DELIVERY',NULL,13,0,1,0,0,0,0,0),(14,'Preparado',6,1,'PREPARED',NULL,14,0,1,0,2,0,0,1),(15,'Pte Recogida',12,3,'WAITING_FOR_PICKUP',NULL,15,0,1,0,0,0,0,0),(16,'Entregado',13,3,'DELIVERED',NULL,16,0,1,0,0,0,0,0),(20,'Asignado',4,0,'PICKER_DESIGNED',NULL,20,1,0,0,0,0,0,2),(21,'Retornado',4,1,'PRINTED_BACK',6,21,0,0,0,0,0,0,2),(22,'¿Fecha?',2,0,'WRONG_DATE',NULL,22,0,0,0,0,0,0,4),(23,'URGENTE',2,0,'LAST_CALL',NULL,23,1,0,0,0,0,0,4),(24,'Encadenado',4,0,'CHAINED',4,24,0,0,0,0,0,0,3),(25,'Embarcando',3,0,'BOARDING',5,25,1,0,0,0,1,0,3),(26,'Prep Previa',5,1,'PREVIOUS_PREPARATION',1,26,0,0,0,1,0,0,2),(27,'Prep Asistida',5,1,'ASSISTED_PREPARATION',7,27,0,0,0,0,0,0,2),(28,'Previa OK',3,1,'OK PREVIOUS',3,28,1,0,0,1,1,1,3),(29,'Previa Impreso',4,1,'PRINTED PREVIOUS',2,29,1,0,1,1,0,0,3),(30,'Embarcado',4,1,'BOARD',5,30,0,0,0,2,0,0,3),(31,'Polizon Impreso',4,1,'PRINTED STOWAWAY',2,29,1,0,1,0,0,0,3),(32,'Polizon OK',3,1,'OK STOWAWAY',3,31,1,0,0,1,1,1,3),(33,'Auto_Impreso',4,0,'PRINTED_AUTO',2,29,1,0,1,0,0,0,2); /*!40000 ALTER TABLE `state` ENABLE KEYS */; UNLOCK TABLES; @@ -337,7 +337,7 @@ UNLOCK TABLES; LOCK TABLES `department` WRITE; /*!40000 ALTER TABLE `department` DISABLE KEYS */; -INSERT INTO `department` VALUES (1,'VERDNATURA',1,2,763,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/',NULL,1),(23,'CAMARA',14,19,NULL,72,604,2,6,1,0,1,2,37,'/37/',NULL,0),(31,'INFORMATICA',5,6,NULL,72,127,3,9,0,0,0,0,NULL,'/','informatica',1),(34,'CONTABILIDAD',7,8,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(35,'FINANZAS',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(36,'LABORAL',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(37,'PRODUCCION',13,52,NULL,72,230,3,11,1,0,0,17,NULL,'/',NULL,0),(38,'SACADO',20,21,NULL,72,230,4,14,1,0,1,0,37,'/37/',NULL,0),(39,'ENCAJADO',22,23,NULL,72,230,4,12,1,0,1,0,37,'/37/',NULL,0),(41,'ADMINISTRACION',53,54,NULL,72,599,3,8,0,0,0,0,NULL,'/',NULL,1),(43,'VENTAS',55,80,NULL,0,NULL,NULL,NULL,0,0,0,12,NULL,'/',NULL,1),(44,'GERENCIA',81,82,NULL,72,300,2,7,0,0,0,0,NULL,'/',NULL,0),(45,'LOGISTICA',83,84,NULL,72,596,3,19,0,0,0,0,NULL,'/',NULL,1),(46,'REPARTO',85,88,NULL,72,659,3,10,0,0,0,1,NULL,'/',NULL,0),(48,'ALMACENAJE',89,90,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0),(49,'PROPIEDAD',91,92,NULL,72,1008,1,1,0,0,0,0,NULL,'/',NULL,0),(52,'CARGA AEREA',93,94,NULL,72,163,4,28,0,0,0,0,NULL,'/',NULL,0),(53,'MARKETING Y COMUNICACIÓN',95,96,NULL,72,1238,0,0,0,0,0,0,NULL,'/',NULL,1),(54,'ORNAMENTALES',97,98,NULL,72,433,3,21,0,0,0,0,NULL,'/',NULL,0),(55,'TALLER NATURAL',99,100,NULL,72,695,2,23,0,0,0,0,NULL,'/',NULL,0),(56,'TALLER ARTIFICIAL',101,102,NULL,72,1780,2,24,0,0,0,0,NULL,'/',NULL,0),(58,'CAMPOS',103,104,NULL,72,225,2,2,0,0,0,0,NULL,'/',NULL,0),(59,'MANTENIMIENTO',105,106,NULL,72,1907,4,16,0,0,0,0,NULL,'/',NULL,0),(60,'RECLAMACIONES',107,108,NULL,72,563,3,20,0,0,0,0,NULL,'/',NULL,1),(61,'VNH',109,110,NULL,73,1297,3,17,0,0,0,0,NULL,'/',NULL,0),(63,'VENTAS FRANCIA',56,57,NULL,72,277,2,27,0,0,1,0,43,'/43/',NULL,0),(66,'VERDNAMADRID',111,112,NULL,72,163,3,18,0,0,0,0,NULL,'/',NULL,0),(68,'COMPLEMENTOS',24,25,NULL,72,617,3,26,1,0,1,0,37,'/37/',NULL,0),(69,'VERDNABARNA',113,114,NULL,74,432,3,22,0,0,0,0,NULL,'/',NULL,0),(77,'PALETIZADO',86,87,NULL,72,230,4,15,1,0,1,0,46,'/46/',NULL,0),(80,'EQUIPO J VALLES',58,59,NULL,72,693,3,4,0,0,1,0,43,'/43/','jvp_equipo',1),(86,'LIMPIEZA',115,116,NULL,72,599,0,0,0,0,0,0,NULL,'/',NULL,0),(89,'COORDINACION',117,118,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0),(90,'TRAILER',119,120,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(91,'ARTIFICIAL',26,27,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(92,'EQUIPO SILVERIO',60,61,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','sdc_equipo',1),(93,'CONFECCION',121,122,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(94,'EQUIPO J BROCAL',62,63,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jes_equipo',1),(95,'EQUIPO C ZAMBRANO',64,65,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','czg_equipo',1),(96,'EQUIPO C LOPEZ',66,67,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','cla_equipo',1),(97,'EQUIPO D SARRION',68,69,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/',NULL,1),(98,'EQUIPO RODRIGO',70,71,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','rhr_equipo',1),(99,'EQUIPO MANOLI',72,73,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/',NULL,1),(101,'EQUIPO J IBAÑEZ',74,75,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jmi_equipo',1),(102,'EQ ROJO FV RUBEN C',28,29,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(103,'EQ AZUL FV A FOLQUES',30,31,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(104,'EQ AMARILLO FV NORMAN G',32,33,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(105,'EQ MORADO FV MATOU',34,35,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(106,'EQ VERDE PCA KEVIN GIMENEZ',36,37,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(107,'EQ NARANJA PCA RUBEN ZANON',38,39,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(110,'EQ ROSA PCA J BONDIA',40,41,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(111,'EQ REPONEDOR CAJAS',42,43,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(112,'CAMARA EQ EDGAR LLEO',15,16,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0),(113,'CAMARA EQ MARC ROCA',17,18,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0),(114,'EQ MARRON PCA JL NUEVO',44,45,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(115,'EQUIPO CLAUDI',76,77,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','csr_equipo',1),(120,'PCA PRODUCCION',46,47,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(121,'FV PRODUCCION',48,49,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(122,'PCA ALMACEN',50,51,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(123,'EQUIPO ELENA BASCUÑANA',78,79,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','ebt_equipo',0); +INSERT INTO `department` VALUES (1,'VERDNATURA',1,2,763,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(22,'COMPRAS',3,4,NULL,72,596,2,5,0,0,0,0,NULL,'/',NULL,1),(23,'CAMARA',14,19,NULL,72,604,2,6,1,0,1,2,37,'/37/',NULL,0),(31,'INFORMATICA',5,6,NULL,72,127,3,9,0,0,0,0,NULL,'/','informatica',1),(34,'CONTABILIDAD',7,8,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(35,'FINANZAS',9,10,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(36,'LABORAL',11,12,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,1),(37,'PRODUCCION',13,52,NULL,72,230,3,11,1,0,0,17,NULL,'/',NULL,0),(38,'SACADO',20,21,NULL,72,230,4,14,1,0,1,0,37,'/37/',NULL,0),(39,'ENCAJADO',22,23,NULL,72,230,4,12,1,0,1,0,37,'/37/',NULL,0),(41,'ADMINISTRACION',53,54,NULL,72,599,3,8,0,0,0,0,NULL,'/',NULL,1),(43,'VENTAS',55,76,NULL,0,NULL,NULL,NULL,0,0,0,10,NULL,'/',NULL,1),(44,'GERENCIA',77,78,NULL,72,300,2,7,0,0,0,0,NULL,'/',NULL,0),(45,'LOGISTICA',79,80,NULL,72,596,3,19,0,0,0,0,NULL,'/',NULL,1),(46,'REPARTO',81,84,NULL,72,659,3,10,0,0,0,1,NULL,'/',NULL,0),(48,'ALMACENAJE',85,86,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0),(49,'PROPIEDAD',87,88,NULL,72,1008,1,1,0,0,0,0,NULL,'/',NULL,0),(52,'CARGA AEREA',89,90,NULL,72,163,4,28,0,0,0,0,NULL,'/',NULL,0),(53,'MARKETING Y COMUNICACIÓN',91,92,NULL,72,1238,0,0,0,0,0,0,NULL,'/',NULL,1),(54,'ORNAMENTALES',93,94,NULL,72,433,3,21,0,0,0,0,NULL,'/',NULL,0),(55,'TALLER NATURAL',95,96,NULL,72,695,2,23,0,0,0,0,NULL,'/',NULL,0),(56,'TALLER ARTIFICIAL',97,98,NULL,72,1780,2,24,0,0,0,0,NULL,'/',NULL,0),(58,'CAMPOS',99,100,NULL,72,225,2,2,0,0,0,0,NULL,'/',NULL,0),(59,'MANTENIMIENTO',101,102,NULL,72,1907,4,16,0,0,0,0,NULL,'/',NULL,0),(60,'RECLAMACIONES',103,104,NULL,72,563,3,20,0,0,0,0,NULL,'/',NULL,1),(61,'VNH',105,106,NULL,73,1297,3,17,0,0,0,0,NULL,'/',NULL,0),(63,'VENTAS FRANCIA',56,57,NULL,72,277,2,27,0,0,1,0,43,'/43/',NULL,0),(66,'VERDNAMADRID',107,108,NULL,72,163,3,18,0,0,0,0,NULL,'/',NULL,0),(68,'COMPLEMENTOS',24,25,NULL,72,617,3,26,1,0,1,0,37,'/37/',NULL,0),(69,'VERDNABARNA',109,110,NULL,74,432,3,22,0,0,0,0,NULL,'/',NULL,0),(77,'PALETIZADO',82,83,NULL,72,230,4,15,1,0,1,0,46,'/46/',NULL,0),(80,'EQUIPO J VALLES',58,59,NULL,72,693,3,4,0,0,1,0,43,'/43/','jvp_equipo',1),(86,'LIMPIEZA',111,112,NULL,72,599,0,0,0,0,0,0,NULL,'/',NULL,0),(89,'COORDINACION',113,114,NULL,0,NULL,NULL,NULL,1,0,0,0,NULL,'/',NULL,0),(90,'TRAILER',115,116,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(91,'ARTIFICIAL',26,27,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(92,'EQUIPO SILVERIO',60,61,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','sdc_equipo',1),(93,'CONFECCION',117,118,NULL,0,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0),(94,'EQUIPO J BROCAL',62,63,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jes_equipo',1),(95,'EQUIPO C ZAMBRANO',64,65,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','czg_equipo',1),(96,'EQUIPO C LOPEZ',66,67,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','cla_equipo',1),(98,'EQUIPO RODRIGO',68,69,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','rhr_equipo',1),(101,'EQUIPO J IBAÑEZ',70,71,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','jmi_equipo',1),(102,'EQ ROJO FV RUBEN C',28,29,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(103,'EQ AZUL FV A FOLQUES',30,31,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(104,'EQ AMARILLO FV NORMAN G',32,33,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(105,'EQ MORADO FV MATOU',34,35,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(106,'EQ VERDE PCA KEVIN GIMENEZ',36,37,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(107,'EQ NARANJA PCA RUBEN ZANON',38,39,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(110,'EQ ROSA PCA J BONDIA',40,41,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(111,'EQ REPONEDOR CAJAS',42,43,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(112,'CAMARA EQ EDGAR LLEO',15,16,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0),(113,'CAMARA EQ MARC ROCA',17,18,NULL,0,NULL,NULL,NULL,1,0,2,0,23,'/37/23/',NULL,0),(114,'EQ MARRON PCA JL NUEVO',44,45,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(115,'EQUIPO CLAUDI',72,73,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','csr_equipo',1),(120,'PCA PRODUCCION',46,47,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(121,'FV PRODUCCION',48,49,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(122,'PCA ALMACEN',50,51,NULL,0,NULL,NULL,NULL,1,0,1,0,37,'/37/',NULL,0),(123,'EQUIPO ELENA BASCUÑANA',74,75,NULL,0,NULL,NULL,NULL,0,0,1,0,43,'/43/','ebt_equipo',0),(124,'CONTROL INTERNO',119,120,NULL,72,NULL,NULL,NULL,0,0,0,0,NULL,'/',NULL,0); /*!40000 ALTER TABLE `department` ENABLE KEYS */; UNLOCK TABLES; @@ -370,7 +370,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-09 11:46:35 +-- Dump completed on 2020-09-24 12:39:37 USE `cache`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -408,7 +408,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-09 11:46:35 +-- Dump completed on 2020-09-24 12:39:37 USE `hedera`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -466,7 +466,7 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-09 11:46:36 +-- Dump completed on 2020-09-24 12:39:38 USE `postgresql`; -- MySQL dump 10.13 Distrib 5.7.28, for osx10.15 (x86_64) -- @@ -541,7 +541,7 @@ UNLOCK TABLES; LOCK TABLES `workcenter` WRITE; /*!40000 ALTER TABLE `workcenter` DISABLE KEYS */; -INSERT INTO `workcenter` VALUES (1,'Silla',20,1056,1,'Av espioca 100',552703),(2,'Mercaflor',19,NULL,NULL,NULL,NULL),(3,'Marjales',26,20008,NULL,NULL,NULL),(4,'VNH',NULL,NULL,3,NULL,NULL),(5,'Madrid',28,2852,5,'Av constitución 3',554145),(6,'Vilassar',88,88031,2,'Cami del Crist, 33',556412),(7,'Tenerife',NULL,NULL,10,NULL,NULL); +INSERT INTO `workcenter` VALUES (1,'Silla',20,1073,1,'Av espioca 100',552703),(2,'Mercaflor',19,NULL,NULL,NULL,NULL),(3,'Marjales',26,20008,NULL,NULL,NULL),(4,'VNH',NULL,NULL,3,NULL,NULL),(5,'Madrid',28,2852,5,'Av constitución 3',554145),(6,'Vilassar',88,88031,2,'Cami del Crist, 33',556412),(7,'Tenerife',NULL,NULL,10,NULL,NULL); /*!40000 ALTER TABLE `workcenter` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -554,4 +554,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-09-09 11:46:38 +-- Dump completed on 2020-09-24 12:39:40 diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 7a2fde69a..b4022e913 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -776,10 +776,16 @@ INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `d (12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 1, 4751000000, 0, NULL, 0, 82, 2, NULL, 0), (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 83, 2, NULL, 0), (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 84, 2, NULL, 0), - (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL, 0), - (16, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 67350, 2, NULL, 0), + (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 88, 2, NULL, 0), + (16, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 0, 4751000000, 0, NULL, 0, 88, 2, NULL, 0), (71, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 1, 4751000000, 0, NULL, 0, 88, 2, NULL, 0); +INSERT INTO `vn`.`priceFixed`(`id`, `itemFk`, `rate0`, `rate1`, `rate2`, `rate3`, `started`, `ended`, `bonus`, `warehouseFk`, `created`) + VALUES + (1, 1, 0, 0, 2.5, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 0, 1, CURDATE()), + (3, 3, 10, 10, 10, 10, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 0, 1, CURDATE()), + (4, 5, 8.5, 10, 7.5, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 1, 2, CURDATE()); + INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`) VALUES (1, 1, 1, 71, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 1, 1, 18), @@ -1071,105 +1077,107 @@ INSERT INTO `vn`.`itemBotanical`(`itemFk`, `botanical`, `genusFk`, `specieFk`) INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`) VALUES - (1 , 1, 56, 'Ranged weapon', 1), - (2 , 1, 58, 'longbow', 2), - (3 , 1, 27, '2m', 3), - (4 , 1, 36, 'Stark Industries', 4), - (5 , 1, 1, 'Brown', 5), - (6 , 1, 67, '+1 precission', 6), - (7 , 1, 23, '1', 7), - (8 , 2, 56, 'Melee weapon', 1), - (9 , 2, 58, 'combat fist', 2), - (10, 2, 27, '15cm', 3), - (11, 2, 36, 'Stark Industries', 4), - (12, 2, 1, 'Silver', 5), - (13, 2, 67, 'Concussion', 6), - (14, 2, 23, '2', 7), - (15, 3, 56, 'Ranged weapon', 1), - (16, 3, 58, 'sniper rifle', 2), - (17, 3, 4, '300mm', 3), - (18, 3, 36, 'Stark Industries', 4), - (19, 3, 1, 'Green', 5), - (20, 3, 67, 'precission', 6), - (21, 3, 23, '3', 7), - (22, 4, 56, 'Melee weapon', 1), - (23, 4, 58, 'heavy shield', 2), - (24, 4, 4, '1x0.5m', 3), - (25, 4, 36, 'Stark Industries', 4), - (26, 4, 1, 'Black', 5), - (27, 4, 67, 'containtment', 6), - (28, 4, 23, '4', 7), - (29, 5, 56, 'Ranged weapon', 1), - (30, 5, 58, 'pistol', 2), - (31, 5, 27, '9mm', 3), - (32, 5, 36, 'Stark Industries', 4), - (33, 5, 1, 'Silver', 5), - (34, 5, 67, 'rapid fire', 6), - (35, 5, 23, '5', 7), - (36, 6, 56, 'Container', 1), - (37, 6, 58, 'ammo box', 2), - (38, 6, 27, '1m', 3), - (39, 6, 36, 'Stark Industries', 4), - (40, 6, 1, 'Green', 5), - (41, 6, 67, 'supply', 6), - (42, 6, 23, '6', 7), - (43, 7, 56, 'Container', 1), - (44, 7, 58, 'medical box', 2), - (45, 7, 27, '1m', 3), - (46, 7, 36, 'Stark Industries', 4), - (47, 7, 1, 'White', 5), - (48, 7, 67, 'supply', 6), - (49, 7, 23, '7', 7), - (50, 8, 56, 'Ranged Reinforced weapon', 1), - (51, 8, 58, '+1 longbow', 2), - (52, 8, 27, '2m', 3), - (53, 8, 36, 'Stark Industries', 4), - (54, 8, 1, 'Brown', 5), - (55, 8, 67, 'precission', 6), - (56, 8, 23, '8', 7), - (57, 9, 56, 'Melee Reinforced weapon', 1), - (58, 9, 58, 'combat fist', 2), - (59, 9, 27, '15cm', 3), - (60, 9, 36, 'Stark Industries', 4), - (61, 9, 1, 'Silver', 5), - (62, 9, 67, 'Concussion', 6), - (63, 9, 23, '9', 7), - (64, 10, 56, 'Ranged Reinforced weapon', 1), - (65, 10, 58, 'sniper rifle', 2), - (66, 10, 4, '300mm', 3), - (67, 10, 36, 'Stark Industries', 4), - (68, 10, 1, 'Green', 5), - (69, 10, 67, 'precission', 6), - (70, 10, 23, '10', 7), - (71, 11, 56, 'Melee Reinforced weapon', 1), - (72, 11, 58, 'heavy shield', 2), - (73, 11, 4, '1x0.5m', 3), - (74, 11, 36, 'Stark Industries', 4), - (75, 11, 1, 'Black', 5), - (76, 11, 67, 'containtment', 6), - (77, 11, 23, '11', 7), - (78, 12, 56, 'Ranged Reinforced weapon', 1), - (79, 12, 58, 'pistol', 2), - (80, 12, 27, '9mm', 3), - (81, 12, 36, 'Stark Industries', 4), - (82, 12, 1, 'Silver', 5), - (83, 12, 67, 'rapid fire', 6), - (84, 12, 23, '12', 7), - (85, 13, 56, 'Chest', 1), - (86, 13, 58, 'ammo box', 2), - (87, 13, 27, '1m', 3), - (88, 13, 36, 'Stark Industries', 4), - (89, 13, 1, 'Green', 5), - (90, 13, 67, 'supply', 6), - (91, 13, 23, '13', 7), - (92, 14, 56, 'Chest', 1), - (93, 14, 58, 'medical box', 2), - (94, 14, 27, '1m', 3), - (95, 14, 36, 'Stark Industries', 4), - (96, 14, 1, 'White', 5), - (97, 14, 67, 'supply', 6), - (98, 14, 23, '1', 7), - (99, 71, 92, 'Shipping cost', 2); + (1, 1, 56, 'Ranged weapon', 1), + (2, 1, 58, 'longbow', 2), + (3, 1, 27, '2m', 3), + (4, 1, 36, 'Stark Industries', 4), + (5, 1, 1, 'Brown', 5), + (6, 1, 67, '+1 precission', 6), + (7, 1, 23, '1', 7), + (8, 2, 56, 'Melee weapon', 1), + (9, 2, 58, 'combat fist', 2), + (10, 2, 27, '15cm', 3), + (11, 2, 36, 'Stark Industries', 4), + (12, 2, 1, 'Silver', 5), + (13, 2, 67, 'Concussion', 6), + (14, 2, 23, '2', 7), + (15, 3, 56, 'Ranged weapon', 1), + (16, 3, 58, 'sniper rifle', 2), + (17, 3, 4, '300mm', 3), + (18, 3, 36, 'Stark Industries', 4), + (19, 3, 1, 'Green', 5), + (20, 3, 67, 'precission', 6), + (21, 3, 23, '3', 7), + (22, 4, 56, 'Melee weapon', 1), + (23, 4, 58, 'heavy shield', 2), + (24, 4, 4, '1x0.5m', 3), + (25, 4, 36, 'Stark Industries', 4), + (26, 4, 1, 'Black', 5), + (27, 4, 67, 'containtment', 6), + (28, 4, 23, '4', 7), + (29, 5, 56, 'Ranged weapon', 1), + (30, 5, 58, 'pistol', 2), + (31, 5, 27, '9mm', 3), + (32, 5, 36, 'Stark Industries', 4), + (33, 5, 1, 'Silver', 5), + (34, 5, 67, 'rapid fire', 6), + (35, 5, 23, '5', 7), + (36, 6, 56, 'Container', 1), + (37, 6, 58, 'ammo box', 2), + (38, 6, 27, '1m', 3), + (39, 6, 36, 'Stark Industries', 4), + (40, 6, 1, 'Green', 5), + (41, 6, 67, 'supply', 6), + (42, 6, 23, '6', 7), + (43, 7, 56, 'Container', 1), + (44, 7, 58, 'medical box', 2), + (45, 7, 27, '1m', 3), + (46, 7, 36, 'Stark Industries', 4), + (47, 7, 1, 'White', 5), + (48, 7, 67, 'supply', 6), + (49, 7, 23, '7', 7), + (50, 8, 56, 'Ranged Reinforced weapon', 1), + (51, 8, 58, '+1 longbow', 2), + (52, 8, 27, '2m', 3), + (53, 8, 36, 'Stark Industries', 4), + (54, 8, 1, 'Brown', 5), + (55, 8, 67, 'precission', 6), + (56, 8, 23, '8', 7), + (57, 9, 56, 'Melee Reinforced weapon', 1), + (58, 9, 58, 'combat fist', 2), + (59, 9, 27, '15cm', 3), + (60, 9, 36, 'Stark Industries', 4), + (61, 9, 1, 'Silver', 5), + (62, 9, 67, 'Concussion', 6), + (63, 9, 23, '9', 7), + (64, 10, 56, 'Ranged Reinforced weapon', 1), + (65, 10, 58, 'sniper rifle', 2), + (66, 10, 4, '300mm', 3), + (67, 10, 36, 'Stark Industries', 4), + (68, 10, 1, 'Green', 5), + (69, 10, 67, 'precission', 6), + (70, 10, 23, '10', 7), + (71, 11, 56, 'Melee Reinforced weapon', 1), + (72, 11, 58, 'heavy shield', 2), + (73, 11, 4, '1x0.5m', 3), + (74, 11, 36, 'Stark Industries', 4), + (75, 11, 1, 'Black', 5), + (76, 11, 67, 'containtment', 6), + (77, 11, 23, '11', 7), + (78, 12, 56, 'Ranged Reinforced weapon', 1), + (79, 12, 58, 'pistol', 2), + (80, 12, 27, '9mm', 3), + (81, 12, 36, 'Stark Industries', 4), + (82, 12, 1, 'Silver', 5), + (83, 12, 67, 'rapid fire', 6), + (84, 12, 23, '12', 7), + (85, 13, 56, 'Chest', 1), + (86, 13, 58, 'ammo box', 2), + (87, 13, 27, '1m', 3), + (88, 13, 36, 'Stark Industries', 4), + (89, 13, 1, 'Green', 5), + (90, 13, 67, 'supply', 6), + (91, 13, 23, '13', 7), + (92, 14, 56, 'Chest', 1), + (93, 14, 58, 'medical box', 2), + (94, 14, 27, '1m', 3), + (95, 14, 36, 'Stark Industries', 4), + (96, 14, 1, 'White', 5), + (97, 14, 67, 'supply', 6), + (98, 14, 23, '1', 7), + (99, 15, 92, 'Shipping cost', 2), + (100, 16, 92, 'Shipping cost', 2), + (101, 71, 92, 'Shipping cost', 2); INSERT INTO `vn`.`itemTypeTag`(`id`, `itemTypeFk`, `tagFk`, `priority`) VALUES @@ -2063,9 +2071,9 @@ INSERT INTO `vn`.`queuePriority`(`id`, `priority`) (2, 'Normal'), (3, 'Baja'); -INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`, `mailSuccessFolder`, `mailErrorFolder`) +INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`) VALUES - (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000, 'Leidos.exito', 'Leidos.error'); + (1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000); INSERT IGNORE INTO `vn`.`greugeConfig` (`id`, `freightPickUpPrice`) VALUES ('1', '11'); diff --git a/modules/account/back/model-config.json b/modules/account/back/model-config.json index d243a2cca..6e3d96025 100644 --- a/modules/account/back/model-config.json +++ b/modules/account/back/model-config.json @@ -34,5 +34,8 @@ }, "UserSync": { "dataSource": "vn" + }, + "Mail": { + "dataSource": "vn" } } \ No newline at end of file diff --git a/back/models/mail.json b/modules/account/back/models/mail.json similarity index 100% rename from back/models/mail.json rename to modules/account/back/models/mail.json diff --git a/modules/ticket/back/methods/state/specs/editableState.spec.js b/modules/ticket/back/methods/state/specs/editableState.spec.js index 03cb7616c..55e60beb8 100644 --- a/modules/ticket/back/methods/state/specs/editableState.spec.js +++ b/modules/ticket/back/methods/state/specs/editableState.spec.js @@ -29,6 +29,6 @@ describe('ticket editableStates()', () => { let result = await app.models.State.editableStates(ctx, filter); let pickerDesignedState = result.some(state => state.code == 'PICKER_DESIGNED'); - expect(pickerDesignedState).toBeFalsy(); + expect(pickerDesignedState).toBeTruthy(); }); }); diff --git a/modules/ticket/back/methods/state/specs/isEditable.spec.js b/modules/ticket/back/methods/state/specs/isEditable.spec.js index 158a010dc..518a543bf 100644 --- a/modules/ticket/back/methods/state/specs/isEditable.spec.js +++ b/modules/ticket/back/methods/state/specs/isEditable.spec.js @@ -30,7 +30,7 @@ describe('state isEditable()', () => { it('should return false if the state is not editable for the given role', async() => { const employeeRole = 1; - const asignedState = 20; + const asignedState = 13; let ctx = {req: {accessToken: {userId: employeeRole}}}; let result = await app.models.State.isEditable(ctx, asignedState);