From 00dd05ba6d1bfdfceb1b16c42138d85955eb32d9 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Wed, 7 Jun 2017 08:43:25 +0200 Subject: [PATCH 01/98] Docker --- Jenkinsfile | 5 +++-- services/mailer/Dockerfile | 11 +++++++++++ services/nginx/conf-dev.conf | 7 +++++-- services/nginx/conf-prod.conf | 9 ++++++--- services/production/Dockerfile | 11 +++++++++++ 5 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 services/mailer/Dockerfile create mode 100644 services/production/Dockerfile diff --git a/Jenkinsfile b/Jenkinsfile index 3d33de37b..aaced7ee8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,14 +7,15 @@ def branchName = "${env.BRANCH_NAME}"; def branchNameTest = "preprod"; def branchNameProd = "master"; def prefixDocker = "test"; -def dockerNginxName = ["nginx", "-p 80:80 --privileged --link test-auth:auth --link test-salix:salix --link test-client:client"] +def dockerNginxName = ["nginx", "-p 80:80 --privileged --link test-auth:auth --link test-salix:salix --link test-client:client --link test-mailer:mailer"] def dockerAuthName = ["auth", "-p 3000:3000"] def dockerSalixName = ["salix", "-p 3001:3001"] def dockerClientName = ["client", "-p 3002:3002"] +def dockerMailerName = ["mailer", "-p 3003:3003"] def buildNumber = "${env.BUILD_NUMBER}"; -def dockers = [dockerAuthName, dockerSalixName, dockerClientName, dockerNginxName] +def dockers = [dockerAuthName, dockerSalixName, dockerClientName, dockerMailerName, dockerNginxName] node { diff --git a/services/mailer/Dockerfile b/services/mailer/Dockerfile new file mode 100644 index 000000000..1f9574a64 --- /dev/null +++ b/services/mailer/Dockerfile @@ -0,0 +1,11 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +CMD ["npm", "start"] + +EXPOSE 3003 diff --git a/services/nginx/conf-dev.conf b/services/nginx/conf-dev.conf index 3bec6e463..51d72c315 100644 --- a/services/nginx/conf-dev.conf +++ b/services/nginx/conf-dev.conf @@ -31,14 +31,17 @@ http { location ~ ^/auth(?:/(.*))?$ { proxy_pass http://127.0.0.1:3000/$1$is_args$args; } + location ~ ^(?:/(.*))?$ { + proxy_pass http://127.0.0.1:3001/$1$is_args$args; + } location ~ ^/client(?:/(.*))?$ { proxy_pass http://127.0.0.1:3002/$1$is_args$args; } location ~ ^/mailer(?:/(.*))?$ { proxy_pass http://127.0.0.1:3003/$1$is_args$args; } - location ~ ^(?:/(.*))?$ { - proxy_pass http://127.0.0.1:3001/$1$is_args$args; + location ~ ^/production(?:/(.*))?$ { + proxy_pass http://127.0.0.1:3004/$1$is_args$args; } } diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index ac814c46f..9ba46e97e 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -19,21 +19,24 @@ http { root /usr/share/nginx/html; - location /static { + location ~ ^/static(?:/(.*))?$ { alias /usr/share/nginx/html; autoindex on; } location ~ ^/auth(?:/(.*))?$ { proxy_pass http://auth:3000/$1$is_args$args; } + location ~ ^(?:/(.*))?$ { + proxy_pass http://salix:3001/$1$is_args$args; + } location ~ ^/client(?:/(.*))?$ { proxy_pass http://client:3002/$1$is_args$args; } location ~ ^/mailer(?:/(.*))?$ { proxy_pass http://mailer:3003/$1$is_args$args; } - location ~ ^(?:/(.*))?$ { - proxy_pass http://salix:3001/$1$is_args$args; + location ~ ^/production(?:/(.*))?$ { + proxy_pass http://production:3004/$1$is_args$args; } } } diff --git a/services/production/Dockerfile b/services/production/Dockerfile new file mode 100644 index 000000000..7c672f9a6 --- /dev/null +++ b/services/production/Dockerfile @@ -0,0 +1,11 @@ +FROM node:6.9.1 + +COPY . /app + +WORKDIR /app + +RUN npm install + +CMD ["npm", "start"] + +EXPOSE 3004 From 7ec66e862c8a9c39877215da368825c312390ea3 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Wed, 7 Jun 2017 09:07:58 +0200 Subject: [PATCH 02/98] nginx --- services/nginx/conf-dev.conf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/nginx/conf-dev.conf b/services/nginx/conf-dev.conf index 51d72c315..8eb6bc2ec 100644 --- a/services/nginx/conf-dev.conf +++ b/services/nginx/conf-dev.conf @@ -31,9 +31,7 @@ http { location ~ ^/auth(?:/(.*))?$ { proxy_pass http://127.0.0.1:3000/$1$is_args$args; } - location ~ ^(?:/(.*))?$ { - proxy_pass http://127.0.0.1:3001/$1$is_args$args; - } + location ~ ^/client(?:/(.*))?$ { proxy_pass http://127.0.0.1:3002/$1$is_args$args; } @@ -43,6 +41,10 @@ http { location ~ ^/production(?:/(.*))?$ { proxy_pass http://127.0.0.1:3004/$1$is_args$args; } + # Este tiene que ser el último + location ~ ^(?:/(.*))?$ { + proxy_pass http://127.0.0.1:3001/$1$is_args$args; + } } types { From 3ffa0205647bcf11c93e1c19d82b1d0a8c1d8353 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Wed, 7 Jun 2017 09:09:35 +0200 Subject: [PATCH 03/98] nginx docker --- services/nginx/conf-dev.conf | 1 - services/nginx/conf-prod.conf | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/nginx/conf-dev.conf b/services/nginx/conf-dev.conf index 8eb6bc2ec..f5af8b9f6 100644 --- a/services/nginx/conf-dev.conf +++ b/services/nginx/conf-dev.conf @@ -31,7 +31,6 @@ http { location ~ ^/auth(?:/(.*))?$ { proxy_pass http://127.0.0.1:3000/$1$is_args$args; } - location ~ ^/client(?:/(.*))?$ { proxy_pass http://127.0.0.1:3002/$1$is_args$args; } diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index 9ba46e97e..3e9f9f7c0 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -26,9 +26,6 @@ http { location ~ ^/auth(?:/(.*))?$ { proxy_pass http://auth:3000/$1$is_args$args; } - location ~ ^(?:/(.*))?$ { - proxy_pass http://salix:3001/$1$is_args$args; - } location ~ ^/client(?:/(.*))?$ { proxy_pass http://client:3002/$1$is_args$args; } @@ -38,5 +35,9 @@ http { location ~ ^/production(?:/(.*))?$ { proxy_pass http://production:3004/$1$is_args$args; } + # Este tiene que ser el último + location ~ ^(?:/(.*))?$ { + proxy_pass http://salix:3001/$1$is_args$args; + } } } From 51a700b6ce111ac02945412c32ebbbd1d2f2326b Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Wed, 7 Jun 2017 13:27:57 +0200 Subject: [PATCH 04/98] date-picker v1 --- client/core/src/date-picker/date-picker.js | 28 ++++++++++++++----- .../src/filter-panel/filter-panel.html | 4 +-- client/production/src/index/index.html | 2 +- client/vendor/src/flatpickr.js | 6 ++++ package.json | 1 + 5 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 client/vendor/src/flatpickr.js diff --git a/client/core/src/date-picker/date-picker.js b/client/core/src/date-picker/date-picker.js index 8b02d1236..9f4a1647b 100644 --- a/client/core/src/date-picker/date-picker.js +++ b/client/core/src/date-picker/date-picker.js @@ -2,12 +2,13 @@ import {module as _module} from '../module'; import * as resolveFactory from '../lib/resolveDefaultComponents'; import * as normalizerFactory from '../lib/inputAttrsNormalizer'; import * as util from '../lib/util'; +import Flatpickr from 'vendor/src/flatpickr'; const _NAME = 'datePicker'; export const NAME = util.getName(_NAME); -directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME]; -export function directive(resolve, normalizer) { +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME, '$translate']; +export function directive(resolve, normalizer, $translate) { return { restrict: 'E', template: function(_, attrs) { @@ -15,12 +16,25 @@ export function directive(resolve, normalizer) { return resolve.getTemplate(_NAME, attrs); }, link: function(scope, element, attrs) { - scope.$watch(attrs.model, () => { - let mdlField = element[0].firstChild.MaterialTextfield; - if (mdlField) - mdlField.updateClasses_(); + let input = element[0]; + let vp; + let initOptions = {}; + + if (attrs.iniOpts) + initOptions = scope.$eval(attrs.iniOpts); + + if (!initOptions.locale) + initOptions.locale = $translate.use(); + + if (!input.matches('input')) + input = input.querySelector('input'); + + if (input) + vp = new Flatpickr(input, initOptions); + + element.on('$destroy', function() { + vp.destroy(); }); - componentHandler.upgradeElement(element[0].firstChild); } }; } diff --git a/client/production/src/filter-panel/filter-panel.html b/client/production/src/filter-panel/filter-panel.html index 2bb03ead0..aa47f9066 100644 --- a/client/production/src/filter-panel/filter-panel.html +++ b/client/production/src/filter-panel/filter-panel.html @@ -2,7 +2,7 @@
- + - + diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index 4cf14099c..bdc2da7ea 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -1,5 +1,5 @@ - + Localizador diff --git a/client/vendor/src/flatpickr.js b/client/vendor/src/flatpickr.js new file mode 100644 index 000000000..8637b3b6a --- /dev/null +++ b/client/vendor/src/flatpickr.js @@ -0,0 +1,6 @@ +import Flatpickr from 'flatpickr'; +import 'flatpickr/dist/flatpickr.min.css'; +import 'flatpickr/dist/themes/material_orange.css'; +import localeEs from 'flatpickr/dist/l10n/es'; +Flatpickr.l10ns.es = localeEs.es; +export default Flatpickr; diff --git a/package.json b/package.json index fbbcc1bce..2050ddab2 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "angular-paging": "^2.2.2", "angular-translate": "^2.13.1", "angular-translate-loader-partial": "^2.13.1", + "flatpickr": "^2.6.3", "material-design-lite": "^1.3.0", "mg-crud": "^1.1.2", "oclazyload": "^0.6.3", From 6123278945f1a84d83427b3e1eee7fc1b196d4ef Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Wed, 7 Jun 2017 15:03:12 +0200 Subject: [PATCH 05/98] =?UTF-8?q?en=20progreso:=20interfaz=20gr=C3=A1fica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/production/src/index/index.html | 43 +++++++++++++++++++++++--- client/production/src/index/index.js | 5 +++ client/production/src/index/style.scss | 26 ++++++++++++++++ 3 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 client/production/src/index/style.scss diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index bdc2da7ea..7ab9356a2 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -1,5 +1,5 @@ - + Localizador @@ -23,14 +23,49 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + {{::item.id}} + {{::item.agency.id}} + {{::item.employee.name}} + {{::item.hour}} + {{::item.state.name}} + {{::item.lines}} + {{::item.meters}} + {{::item.boxes}} + + + + \ No newline at end of file diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index 3c0e9cfaf..73a40ed8b 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -1,6 +1,11 @@ import ngModule from '../module'; +import './style.scss'; export default class ProductionIndex { + constructor() { + this.model = {}; + this.checkAll = false; + } search(index) { index.filter.search = this.model.search; index.accept(); diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss new file mode 100644 index 000000000..d6f8d50e0 --- /dev/null +++ b/client/production/src/index/style.scss @@ -0,0 +1,26 @@ +vn-production-index { + button { + height: 20px; + padding: 0 6px; + } + + .list-header{ + border-bottom: 3px solid #9D9D9D; + font-weight: bold; + } + + .list-footer{ + border-top: 3px solid #9D9D9D; + font-weight: bold; + } + .list > vn-one{ + text-align: center; + } + .list > [vn-one]{ + text-align: center; + } + .list-body{ + padding: 4px 0px; + border-bottom: 1px solid #9D9D9D; + } +} \ No newline at end of file From 73c5f5581f69b714ce4b04cda5c85f3c219b3a03 Mon Sep 17 00:00:00 2001 From: Joan Date: Wed, 7 Jun 2017 15:28:42 +0200 Subject: [PATCH 06/98] Cambios en servicio mailer --- .../client/src/billing-data/billing-data.html | 2 +- .../client/src/billing-data/billing-data.js | 29 +++--- services/mailer/application/config/smtp.json | 3 + services/mailer/application/database.js | 6 +- services/mailer/application/language.js | 24 ----- .../language/es.paymentUpdate.json | 8 -- services/mailer/application/locale.js | 26 ++++++ services/mailer/application/mail.js | 36 +++----- .../mailer/application/route/manuscript.js | 28 +++--- services/mailer/application/router.js | 23 ++++- services/mailer/application/template.js | 86 +++++++++++++----- .../{images/download.png => image/action.png} | Bin 3061 -> 3225 bytes .../template/{images => image}/facebook.png | Bin .../template/{images => image}/header.png | Bin .../{images/chat.png => image/info.png} | Bin 3033 -> 3045 bytes .../template/{images => image}/instagram.png | Bin .../template/{images => image}/linkedin.png | Bin .../template/{images => image}/pinterest.png | Bin .../template/{images => image}/twitter.png | Bin .../template/{images => image}/youtube.png | Bin .../application/template/images/arrow.png | Bin 3486 -> 0 bytes .../template/payment-update/attachment.json | 1 + .../template/payment-update/locale/es.json | 9 ++ .../payment-update/payment-update.css | 0 .../payment-update/payment-update.html | 80 ++++++++++++++++ .../template/payment-update/payment-update.js | 26 ++++++ .../application/template/paymentUpdate.html | 74 --------------- services/mailer/server.js | 9 +- 28 files changed, 277 insertions(+), 193 deletions(-) delete mode 100644 services/mailer/application/language.js delete mode 100644 services/mailer/application/language/es.paymentUpdate.json create mode 100644 services/mailer/application/locale.js rename services/mailer/application/template/{images/download.png => image/action.png} (83%) rename services/mailer/application/template/{images => image}/facebook.png (100%) rename services/mailer/application/template/{images => image}/header.png (100%) rename services/mailer/application/template/{images/chat.png => image/info.png} (88%) rename services/mailer/application/template/{images => image}/instagram.png (100%) rename services/mailer/application/template/{images => image}/linkedin.png (100%) rename services/mailer/application/template/{images => image}/pinterest.png (100%) rename services/mailer/application/template/{images => image}/twitter.png (100%) rename services/mailer/application/template/{images => image}/youtube.png (100%) delete mode 100644 services/mailer/application/template/images/arrow.png create mode 100644 services/mailer/application/template/payment-update/attachment.json create mode 100644 services/mailer/application/template/payment-update/locale/es.json create mode 100644 services/mailer/application/template/payment-update/payment-update.css create mode 100644 services/mailer/application/template/payment-update/payment-update.html create mode 100644 services/mailer/application/template/payment-update/payment-update.js delete mode 100644 services/mailer/application/template/paymentUpdate.html diff --git a/client/client/src/billing-data/billing-data.html b/client/client/src/billing-data/billing-data.html index f43f41e76..43010880e 100644 --- a/client/client/src/billing-data/billing-data.html +++ b/client/client/src/billing-data/billing-data.html @@ -5,7 +5,7 @@ form="form" save="patch"> - + Información de facturación diff --git a/client/client/src/billing-data/billing-data.js b/client/client/src/billing-data/billing-data.js index 9537b5590..f45f22c1c 100644 --- a/client/client/src/billing-data/billing-data.js +++ b/client/client/src/billing-data/billing-data.js @@ -3,11 +3,11 @@ import ngModule from '../module'; export default class Controller { constructor($scope, $http, $timeout, vnApp, $translate) { this.$ = $scope; - this.http = $http; + this.$http = $http; this.timeout = $timeout; this.vnApp = vnApp; this.translate = $translate; - this.payId = null; + this.payMethodFk = null; this.dueDay = null; this.copyData(); } @@ -16,32 +16,27 @@ export default class Controller { } copyData() { if (this.client) { - this.payId = this.client.payMethodFk || null; + this.payMethodFk = this.client.payMethodFk || null; this.dueDay = this.client.dueDay ? this.client.dueDay : null; } } - checkChanges() { - let payId = this.client.payMethodFk || null; + submit() { + this.$.watcher.submit().then( + () => this.checkPaymentChanges()); + } + checkPaymentChanges() { + let payMethodFk = this.client.payMethodFk || null; let dueDay = this.client.dueDay || null; - if (this.payId !== payId || this.dueDay !== dueDay) { + if (this.payMethodFk !== payMethodFk || this.dueDay !== dueDay) this.$.sendMail.show(); - return false; - } - - return true; } returnDialog(response) { if (response === 'ACCEPT') { - this.sendMail().then( - () => this.vnApp.showMessage(this.translate.instant('Notification sent!')), - () => this.vnApp.showMessage(this.translate.instant('Notification error')) + this.$http.post(`/mailer/manuscript/${this.client.id}/payment-update`).then( + () => this.vnApp.showMessage(this.translate.instant('Notification sent!')) ); } - this.timeout(() => this.$.watcher.submit()); - } - sendMail() { - return this.http.post(`/mailer/manuscript/paymentUpdate`, {user: this.client.id}); } } Controller.$inject = ['$scope', '$http', '$timeout', 'vnApp', '$translate']; diff --git a/services/mailer/application/config/smtp.json b/services/mailer/application/config/smtp.json index a6579d067..e4953c14d 100644 --- a/services/mailer/application/config/smtp.json +++ b/services/mailer/application/config/smtp.json @@ -5,5 +5,8 @@ "auth": { "user": "noreply", "pass": "" + }, + "tls": { + "rejectUnauthorized": false } } \ No newline at end of file diff --git a/services/mailer/application/database.js b/services/mailer/application/database.js index 528cb1be6..6c33999ff 100644 --- a/services/mailer/application/database.js +++ b/services/mailer/application/database.js @@ -15,9 +15,9 @@ module.exports = { this.pool.getConnection(function(error, connection) { if (error) { - console.log('No se ha podido establecer la conexión con la base de datos. ' + error.code); - } else { - console.log('Conexión con la base de datos establecida'); + throw new Error('Can\'t connect to database: ' + error.code); + } else if (settings.app().debug) { + console.log('Database connection stablished'); } }); } diff --git a/services/mailer/application/language.js b/services/mailer/application/language.js deleted file mode 100644 index 960f3fde9..000000000 --- a/services/mailer/application/language.js +++ /dev/null @@ -1,24 +0,0 @@ -var fs = require('fs'); -var settings = require('./settings.js'); -var path = require('path'); - -module.exports = { - /** - * Devuelve las claves de idioma de una plantilla - * @param {String} templateName - Nombre de la plantilla - * @param {String} langCode - Código de idioma - * @return {Object} Devuelve el objeto con las claves de idioma - */ - load: function(templateName, langCode) { - var localeFile = path.join(__dirname, 'language', `${langCode}.${templateName}.json`); - var defaultLocaleFile = path.join(__dirname, 'language', `${settings.defaultLanguage}.${templateName}.json`); - - if (fs.existsSync(localeFile)) { - return require(localeFile); - } else if (fs.existsSync(defaultLocaleFile)) { - return require(defaultLocaleFile); - } - - throw new Error('No se ha encontrado ninguna traducción para la plantilla ' + templateName + '.'); - } -}; diff --git a/services/mailer/application/language/es.paymentUpdate.json b/services/mailer/application/language/es.paymentUpdate.json deleted file mode 100644 index 493e3bbfb..000000000 --- a/services/mailer/application/language/es.paymentUpdate.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "subject": "Cambios en las condiciones de pago", - "title": "Cambio en las condiciones", - "dear": "Estimado cliente", - "bodyDescription": "Le enviamos este email para comunicarle que las condiciones de pago han cambiado. Le indicamos las nuevas condiciones a continuación.", - "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla _ www.verdnatura.es _ clientes@verdnatura.es", - "privacy": "Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado." -} \ No newline at end of file diff --git a/services/mailer/application/locale.js b/services/mailer/application/locale.js new file mode 100644 index 000000000..bcd9d452b --- /dev/null +++ b/services/mailer/application/locale.js @@ -0,0 +1,26 @@ +var fs = require('fs'); +var settings = require('./settings.js'); +var path = require('path'); + +module.exports = { + /** + * Devuelve las claves de idioma de una plantilla + * @param {String} template - Nombre de la plantilla + * @param {String} countryCode - Código de idioma + * @param {Object} cb - Callback + */ + load: function(template, countryCode, cb) { + var localeFile = path.join(__dirname, 'template', `${template}`, 'locale', `${countryCode}.json`); + var defaultLocaleFile = path.join(__dirname, 'template', `${template}`, 'locale', `${settings.app().defaultLanguage}.json`); + + fs.stat(localeFile, (error, stats) => { + if (error) + fs.stat(defaultLocaleFile, (error, stats) => { + if (error) + cb(null, 'Translation not found for template ' + template + '.'); + return cb(require(defaultLocaleFile)); + }); + return cb(require(localeFile)); + }); + } +}; diff --git a/services/mailer/application/mail.js b/services/mailer/application/mail.js index 7e5a20456..674b05b2f 100644 --- a/services/mailer/application/mail.js +++ b/services/mailer/application/mail.js @@ -17,9 +17,9 @@ module.exports = { this.transporter.verify(function(error, success) { if (error) { - console.log(error); - } else { - console.log('Conexión SMTP establecida'); + throw new Error(error); + } else if (settings.app().debug) { + console.log('SMTP connection stablished'); } }); }, @@ -28,33 +28,21 @@ module.exports = { * Envia un email con los datos recibidos desde un vector. * @param {Object} data - Datos para el envío del email */ - send: function(data) { - var filePath = 'Template/images/'; + send: function(recipient, subject, body, attachments, cb) { let mailOptions = { from: '"' + settings.app().senderName + '" <' + settings.app().senderMail + '>', - to: data.recipient, - subject: data.subject, - html: data.body, - attachments: [ - {filename: 'header.png', path: path.join(__dirname, filePath, 'header.png'), cid: 'header'}, - {filename: 'arrow.png', path: path.join(__dirname, filePath, 'arrow.png'), cid: 'arrow'}, - {filename: 'chat.png', path: path.join(__dirname, filePath, 'chat.png'), cid: 'chat'}, - {filename: 'facebook.png', path: path.join(__dirname, filePath, 'facebook.png'), cid: 'facebook'}, - {filename: 'twitter.png', path: path.join(__dirname, filePath, 'twitter.png'), cid: 'twitter'}, - {filename: 'youtube.png', path: path.join(__dirname, filePath, 'youtube.png'), cid: 'youtube'}, - {filename: 'pinterest.png', path: path.join(__dirname, filePath, 'pinterest.png'), cid: 'pinterest'}, - {filename: 'instagram.png', path: path.join(__dirname, filePath, 'instagram.png'), cid: 'instagram'}, - {filename: 'linkedin.png', path: path.join(__dirname, filePath, 'linkedin.png'), cid: 'linkedin'} - ] + to: recipient, + subject: subject, + html: body, + attachments }; - + console.log(recipient); this.transporter.sendMail(mailOptions, (error, info) => { if (error) { - console.log(error); + return cb(null, 'Email not sent: ' + error); } else if (settings.app().debug) { - console.log('Se ha enviado el email ' + info.messageId + ' [' + info.response + ']'); - - return true; + console.log('Mail sent ' + info.messageId + ' [' + info.response + ']'); + cb(); } }); } diff --git a/services/mailer/application/route/manuscript.js b/services/mailer/application/route/manuscript.js index 0c51be6cb..6c351fad5 100644 --- a/services/mailer/application/route/manuscript.js +++ b/services/mailer/application/route/manuscript.js @@ -5,19 +5,21 @@ var database = require('../database.js'); var template = require('../template.js'); // Escrito de cambios en méto de pago del cliente -router.post('/paymentUpdate', function(request, response) { - database.pool.query('SELECT Cliente, `e-mail` AS email FROM Clientes WHERE Id_Cliente = ?', [request.body.user], function(error, rs) { - // Datos del escrito - var params = { - clientName: rs[0].Cliente - }; - // Obtener plantilla y enviar - template.getTemplate('paymentUpdate', 'es', params, function(tplResult) { - if (mail.send({recipient: rs[0].email, subject: tplResult.subject, body: tplResult.body})) { - response.json({status: "OK"}); - } else { - response.json({status: "ERROR"}); - } +router.post('/:userId/:template', function(request, response, next) { + database.pool.query('SELECT `e-mail` AS email, LOWER(p.Codigo) AS countryCode FROM Clientes AS c JOIN Paises AS p ON p.id = c.Id_Pais WHERE Id_Cliente = ?', [request.params.userId], function(error, qryRs) { + if (qryRs.length == 0) + return response.json({data: {message: 'Client not found'}}); + + template.getTemplate(request.params.template, qryRs[0].countryCode, {userId: request.params.userId}, function(tplRs, error) { + if (error) + return response.json({data: {message: error}}); + + mail.send(qryRs[0].email, tplRs.subject, tplRs.body, tplRs.attachments, (mailrs, error) => { + if (error) + return response.json({data: {message: error}}); + + return response.json({data: {message: 'Mail sent'}}); + }); }); }); }); diff --git a/services/mailer/application/router.js b/services/mailer/application/router.js index 64f91c2d2..a624eba0f 100644 --- a/services/mailer/application/router.js +++ b/services/mailer/application/router.js @@ -2,15 +2,32 @@ var express = require('express'); var router = new express.Router(); var settings = require('./settings.js'); -// Página por defecto +// Mailer default page router.get('/', function(request, response) { response.send(settings.app().name + ' v' + settings.app().version); }); -// Rutas de los escritos. +// Manuscripts router.use('/manuscript', require('./route/manuscript.js')); -// Rutas de las notificaciones. +// Notifications router.use('/notification', require('./route/notification.js')); +/*// Load template route +router.post('/:userId/:template', function(request, response, next) { + database.pool.query('SELECT `e-mail` AS email, LOWER(p.Codigo) AS countryCode FROM Clientes AS c JOIN Paises AS p ON p.id = c.Id_Pais WHERE Id_Cliente = ?', [request.params.userId], function(error, qryRs) { + if (qryRs.length == 0) + return response.json({data: {message: 'Client not found'}}); + template.getTemplate(request.params.template, qryRs[0].countryCode, {userId: request.params.userId}, function(tplRs, error) { + if (error) + return response.json({data: {message: error}}); + + mail.send(qryRs[0].email, tplRs.subject, tplRs.body, tplRs.attachments, (mailrs, error) => { + if (error) + return response.json({data: {message: error}}); + }); + }); + }); +}); +*/ module.exports = router; diff --git a/services/mailer/application/template.js b/services/mailer/application/template.js index 7589e632a..b03fd4735 100644 --- a/services/mailer/application/template.js +++ b/services/mailer/application/template.js @@ -1,32 +1,39 @@ var fs = require('fs'); var mustache = require('mustache'); -var database = require('./database.js'); -var language = require('./language.js'); +var locale = require('./locale.js'); var path = require('path'); -var Template = { +module.exports = { /** * Obtiene la plantilla. - * @param {String} templateName - Nombre de la plantilla - * @param {Object} langCode - Código del idioma + * @param {String} template - Nombre de la plantilla + * @param {Object} countryCode - Código del idioma * @param {Object} params - Datos a reemplazar. - * @param {Object} callback - Callback + * @param {Object} cb - Callback */ - getTemplate: function(templateName, langCode, params, callback) { - database.pool.query('SELECT name, attachmentPath FROM vn.mailTemplates WHERE name = ?', [templateName], function(error, rs) { - // Comprobamos que exista la plantilla - if (rs.length == 0) - throw new Error('La plantilla ' + templateName + ' no existe'); + getTemplate: function(template, countryCode, params, cb) { + var templatePath = path.join(__dirname, 'template', `${template}`, `${template}.html`); + var classPath = path.join(__dirname, 'template', `${template}`, `${template}.js`); - var langParams = language.load(templateName, langCode); - params = Object.assign({}, langParams, params); - var templatePath = path.join(__dirname, 'template', `${rs[0].name}.html`); + fs.stat(templatePath, (error, stat) => { + if (error) + return cb(null, 'Template ' + template + ' not found'); - if (!fs.existsSync(templatePath)) - throw new Error('No se ha podido cargar la plantilla ' + templateName + '.html'); + let TemplateClass = require(classPath); + let instance = new TemplateClass(); - Template.render(templatePath, params, function(tplBody) { - callback({subject: params.subject, body: tplBody}); + instance.getData(params, data => { + locale.load(template, countryCode, (rs, error) => { + data = Object.assign({}, rs, data); + + this.render(templatePath, data, body => { + var titleSubject = body.match(new RegExp('(.*?)', 'i'))[1]; + + this.getAttachments(template, body, attachments => { + cb({body: body, subject: titleSubject, attachments: attachments}); + }); + }); + }); }); }); }, @@ -34,15 +41,46 @@ var Template = { /** * Renderiza las plantillas * @param {String} path - Ruta de la plantilla - * @param {Object} params - Listado de parámetros a remplazar - * @param {Object} callback - Callback + * @param {Object} data - Listado de parámetros a remplazar + * @param {Object} cb - Callback */ - render: function(path, params, callback) { + render: function(path, data, cb) { fs.readFile(path, 'utf8', function(error, body) { mustache.parse(body); - callback(mustache.render(body, params)); + cb(mustache.render(body, data)); + }); + }, + + /** + * Obtiene todos los ficheros adjuntos de la plantilla + * @param {String} template - Nombre de la plantilla + * @param {String} body - html de la plantilla + * @param {Object} cb - Callback + */ + getAttachments: function(template, body, cb) { + var attachments = []; + var tplAttachments = body.match(new RegExp('src="cid:(.*?)"', 'ig')); + + for (var i = 0; i < tplAttachments.length; i++) { + var name = tplAttachments[i].replace('src="cid:', '').replace('"', ''); + var attachmentPath = path.join(__dirname, 'template/image', name); + + attachments.push({filename: name, path: attachmentPath, cid: name}); + } + + var attachmentsPath = path.join(__dirname, 'template', `${template}`, 'attachment.json'); + + fs.stat(attachmentsPath, (error, stats) => { + if (error) return cb(null, 'Could not load attachments from template ' + template); + + var attachObj = require(attachmentsPath); + + for (var i = 0; i < attachObj.length; i++) { + var attachmentPath = path.join(__dirname, 'template', `${template}`, 'attachment', attachObj[i]); + attachments.push({filename: attachObj[i], path: attachmentPath, cid: attachObj[i]}); + } + + cb(attachments); }); } }; - -module.exports = Template; diff --git a/services/mailer/application/template/images/download.png b/services/mailer/application/template/image/action.png similarity index 83% rename from services/mailer/application/template/images/download.png rename to services/mailer/application/template/image/action.png index d1817417797a99e1036af85cdd0c6bd00a462e81..2cd16c453d66b10611f90ee01deba70edbd7113e 100644 GIT binary patch delta 519 zcmV+i0{H#)7nvC$iBL{Q4GJ0x0000DNk~Le0000U0000U2nGNE06Q?QqOl>L3V*~& zL_t(|+Pv4hYE?lL#_^var;vbA&?qVx5eY#NY+?}wjTbag@rD*YgD+s?OW4|(!n=4E zFA+3?Hi8f&g+xKcD{4S26pzh1AYtZ^oa}K`oAojL_cwd?T5IOi>vdCOV}F0+u>+@Z z4X3mak48t6`SvDj+He+w*oR4+Q-4vkW%3JgCZLTN#AHmW3OlC@or&YFC=97K_&J8Ahy delta 354 zcmV-o0iFJt8TA(-iBL{Q4GJ0x0000DNk~Le0000j0000j2nGNE06H4tnz13D3V$F; zL_t(|+U(iS4Z$}f`-^LAoFpOq2qZ!R;Ml+hxjCN!@Q*!P+-)$26 zZUXvxS8l$5QK(kLn0EXEw@5jVci^^#!97&pi$mI-jm{k4J@Q!DE`y|BQYQ0P&T$C1sfJU;qFB07*qoM6N<$f{AdL Ar~m)} diff --git a/services/mailer/application/template/images/facebook.png b/services/mailer/application/template/image/facebook.png similarity index 100% rename from services/mailer/application/template/images/facebook.png rename to services/mailer/application/template/image/facebook.png diff --git a/services/mailer/application/template/images/header.png b/services/mailer/application/template/image/header.png similarity index 100% rename from services/mailer/application/template/images/header.png rename to services/mailer/application/template/image/header.png diff --git a/services/mailer/application/template/images/chat.png b/services/mailer/application/template/image/info.png similarity index 88% rename from services/mailer/application/template/images/chat.png rename to services/mailer/application/template/image/info.png index 0bec1ab86dcd44f14e10118e5f846eb49e9778c8..fb75cbc4efe4308149fcf4a7a7d0f6cba170c5e5 100644 GIT binary patch delta 338 zcmV-Y0j>Vo7v&criBL{Q4GJ0x0000DNk~Le0000U0000U2nGNE06Q?QqOl>L3V#qu zL_t(|+U(XnN&`_8hT&(DYfL353L=c|BW}Uo!hj1<3o(K_5b+0VOVJ&;6E|RQqp=7k zn%LZti-^_C*vwa*b8hk8bM6mcw%O~=;~YC^t5%=5$8o>~_SL5YWC8tHm|=)9LdmcX zbg+O7{SXTxbPG=vf!FYW6?6h7$$$JG@mkS{pA*)kl`Ldftnh4?@Xc%aCpF*(+<+T! z18%^nUN9|^@W)10qX(OoXaox0T=)SU#`qMwC4)Oyj`=tRk0N*vCl!zVE(O2i7TYm@ zOPonr8mIQQP>zilU*RmqWq9o@y4X>?WWp~O>l#OOJf~TbU*fQ?cic@n9VgWJfpl?G kSEq&A>v^uuP78ev0Qt%=oFl1pvj6}907*qoM6N<$f}jtPj{pDw delta 326 zcmaDVep6hrGr-TCmrII^fq{Y7)59eQNb7F!Z>}ij zF$D@7`)Gfgm+$U`HmM6Y%<=_o8J11^!lI$WWnl4VUPJMeCHWe{K zQ&QWR=W3E4Pd_`rb_@$v=TI&8fr|<{<4?Hg}ET3s;aKOr#?H*IN$gb5Jg${5@xJ;~Fb@}kE7^ch8 zP5gmRp3iz8$n;p_Q}$E;)hzR!SF_G{TFtin!mER&TR1-$-s1ToEuYK9^TC|q(nPPV U>}s~JfkDII>FVdQ&MBb@0G;EBc>n+a diff --git a/services/mailer/application/template/images/instagram.png b/services/mailer/application/template/image/instagram.png similarity index 100% rename from services/mailer/application/template/images/instagram.png rename to services/mailer/application/template/image/instagram.png diff --git a/services/mailer/application/template/images/linkedin.png b/services/mailer/application/template/image/linkedin.png similarity index 100% rename from services/mailer/application/template/images/linkedin.png rename to services/mailer/application/template/image/linkedin.png diff --git a/services/mailer/application/template/images/pinterest.png b/services/mailer/application/template/image/pinterest.png similarity index 100% rename from services/mailer/application/template/images/pinterest.png rename to services/mailer/application/template/image/pinterest.png diff --git a/services/mailer/application/template/images/twitter.png b/services/mailer/application/template/image/twitter.png similarity index 100% rename from services/mailer/application/template/images/twitter.png rename to services/mailer/application/template/image/twitter.png diff --git a/services/mailer/application/template/images/youtube.png b/services/mailer/application/template/image/youtube.png similarity index 100% rename from services/mailer/application/template/images/youtube.png rename to services/mailer/application/template/image/youtube.png diff --git a/services/mailer/application/template/images/arrow.png b/services/mailer/application/template/images/arrow.png deleted file mode 100644 index 66e5de8338c5c0dafb1367794342c8d9b392175b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3486 zcmV;P4Po+$P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0008XNklQn)Dy+5&g~DIIgUDsz2+)(L{-lO0&GKgzvs^TY^aCZJ8z={n4MbSQ4B)fCNY!7x zz@s2iXh?Jr=>^LFsP6+x^@bN6;0|DPmD&N|UZXwft3Xpq&0r9@)kx@0;GLuHTD{<@ z=tT7!(2@auy&*PYqWTqR1wJ~;hx3LPvV=wZk_NyjaU!ov6+O zCx8_P{8$i=rP>Pzcm+7M z9&k<2L1aHLYw4B-?n+drqrRG2ip@B{zkqWV@9~;|AhHLTw=_!w_a&+mQQNH`vKyFl zfB`O9oX2ZygUC)B*lc%{4<@RkQAY?iVVZM-hZ5EMQHM1_WE=jG*o~|sv6`cU$W}Wg zJm8y&YOW(+&zFE^J0 + + + {{subject}} + + + +
+ +
+ VerdNatura +
+ + + +
+

{{title}}

+
+ + + +
+

{{dear}},

+

{{bodyDescription}}

+

+

Forma de pago: {{paymentMethod}}
+
Día de pago: {{paymentDay}} de cada mes
+

+

{{paymentAdvice}}

+

En el caso de detectar algún error en los datos indicados o para cualquier aclaración, debe dirigirse a su comercial.

+
+ + + + + + + + + + + +
+

{{fiscalAddress}}

+

{{privacy}}

+

{{privacyLaw}}

+
+ +
+ + \ No newline at end of file diff --git a/services/mailer/application/template/payment-update/payment-update.js b/services/mailer/application/template/payment-update/payment-update.js new file mode 100644 index 000000000..8ac60c155 --- /dev/null +++ b/services/mailer/application/template/payment-update/payment-update.js @@ -0,0 +1,26 @@ +var path = require('path'); +var database = require(path.join(__dirname, '../../database.js')); + +module.exports = class PaymentUpdate { + getData(params, cb) { + database.pool.query('SELECT pm.name AS paymentMethod, pm.id AS paymentMethodId, vencimiento AS paymentDay FROM Clientes AS c JOIN pay_met AS pm ON pm.id = c.pay_met_id WHERE Id_Cliente = ?', [params.userId], (error, result) => { + cb({ + paymentMethod: result[0].paymentMethod, + paymentDay: result[0].paymentDay, + paymentAdvice: this.getPaymentAdvice(result[0].paymentMethodId) + }); + }); + } + _(string) { + return string; + } + getPaymentAdvice(paymentMethod) { + if (paymentMethod == 4) { + return 'Su modo de pago actual implica que se le pasará un cargo a la cuenta ESXXXX **** **** **** **** por el importe pendiente, al vencimiento establecido en las condiciones.'; + } else if (paymentMethod == 5) { + return 'Su modo de pago actual implica que deberá abonar el importe de los pedidos realizados en el mismo día para que se puedan enviar.'; + } + } +}; + + diff --git a/services/mailer/application/template/paymentUpdate.html b/services/mailer/application/template/paymentUpdate.html deleted file mode 100644 index a61bfcaf7..000000000 --- a/services/mailer/application/template/paymentUpdate.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - {{subject}} - - - -
- -
- VerdNatura -
- -
-

{{title}}

-
- - - -
-

{{dear}} {{clientName}},

-

{{bodyDescription}}

- -

??

-

??

-
- - - - - - - - - - - -
-

{{fiscalAddress}}

-

- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.

-

En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.

-
- -
- - \ No newline at end of file diff --git a/services/mailer/server.js b/services/mailer/server.js index f7d5bc571..ee15c67f1 100644 --- a/services/mailer/server.js +++ b/services/mailer/server.js @@ -15,14 +15,19 @@ app.use(bodyParser.urlencoded({extended: true})); // Cargar rutas app.use('/', require('./application/router.js')); +app.use(function(err, req, res, next) { + console.error(err.message); + res.status(500).send('Something broke!'); +}); + // Iniciar escucha del servidor app.start = function() { return app.listen(settings.app().port, function() { mail.init(); database.init(); - console.log('Servidor de correo iniciado en el puerto ' + settings.app().port); + console.log('Mailer started at port:' + settings.app().port); if (settings.app().debug) { - console.log('El modo debug está activado'); + console.log('Debug mode enabled'); } }); }; From e178bd8676b792ce8c61e6691a6af5854d2988fa Mon Sep 17 00:00:00 2001 From: Joan Date: Wed, 7 Jun 2017 19:29:16 +0200 Subject: [PATCH 07/98] =?UTF-8?q?Traducciones=20de=20plantillas=20y=20most?= =?UTF-8?q?rar=20nuevos=20datos=20de=20facturaci=C3=B3n=20en=20servicio=20?= =?UTF-8?q?mailer.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/mailer/application/mail.js | 2 +- .../mailer/application/route/notification.js | 2 +- services/mailer/application/router.js | 17 --------- services/mailer/application/template.js | 19 +++++----- .../template/payment-update/locale/es.json | 9 +++++ .../payment-update/payment-update.html | 24 ++++++------- .../template/payment-update/payment-update.js | 26 +++++++------- services/mailer/application/util/format.js | 35 +++++++++++++++++++ 8 files changed, 80 insertions(+), 54 deletions(-) create mode 100644 services/mailer/application/util/format.js diff --git a/services/mailer/application/mail.js b/services/mailer/application/mail.js index 674b05b2f..6ba40ff90 100644 --- a/services/mailer/application/mail.js +++ b/services/mailer/application/mail.js @@ -36,7 +36,7 @@ module.exports = { html: body, attachments }; - console.log(recipient); + this.transporter.sendMail(mailOptions, (error, info) => { if (error) { return cb(null, 'Email not sent: ' + error); diff --git a/services/mailer/application/route/notification.js b/services/mailer/application/route/notification.js index 5ec515dd1..a7f9904a2 100644 --- a/services/mailer/application/route/notification.js +++ b/services/mailer/application/route/notification.js @@ -1,6 +1,6 @@ var express = require('express'); var router = new express.Router(); - +var format = require('../util/format.js'); router.get('/test', function(request, response) { response.send("test"); }); diff --git a/services/mailer/application/router.js b/services/mailer/application/router.js index a624eba0f..201548632 100644 --- a/services/mailer/application/router.js +++ b/services/mailer/application/router.js @@ -12,22 +12,5 @@ router.use('/manuscript', require('./route/manuscript.js')); // Notifications router.use('/notification', require('./route/notification.js')); -/*// Load template route -router.post('/:userId/:template', function(request, response, next) { - database.pool.query('SELECT `e-mail` AS email, LOWER(p.Codigo) AS countryCode FROM Clientes AS c JOIN Paises AS p ON p.id = c.Id_Pais WHERE Id_Cliente = ?', [request.params.userId], function(error, qryRs) { - if (qryRs.length == 0) - return response.json({data: {message: 'Client not found'}}); - template.getTemplate(request.params.template, qryRs[0].countryCode, {userId: request.params.userId}, function(tplRs, error) { - if (error) - return response.json({data: {message: error}}); - - mail.send(qryRs[0].email, tplRs.subject, tplRs.body, tplRs.attachments, (mailrs, error) => { - if (error) - return response.json({data: {message: error}}); - }); - }); - }); -}); -*/ module.exports = router; diff --git a/services/mailer/application/template.js b/services/mailer/application/template.js index b03fd4735..d484393c9 100644 --- a/services/mailer/application/template.js +++ b/services/mailer/application/template.js @@ -22,18 +22,19 @@ module.exports = { let TemplateClass = require(classPath); let instance = new TemplateClass(); - instance.getData(params, data => { - locale.load(template, countryCode, (rs, error) => { - data = Object.assign({}, rs, data); + let getDataCb = () => { + this.render(templatePath, instance, body => { + var titleSubject = body.match(new RegExp('(.*?)', 'i'))[1]; - this.render(templatePath, data, body => { - var titleSubject = body.match(new RegExp('(.*?)', 'i'))[1]; - - this.getAttachments(template, body, attachments => { - cb({body: body, subject: titleSubject, attachments: attachments}); - }); + this.getAttachments(template, body, attachments => { + cb({body: body, subject: titleSubject, attachments: attachments}); }); }); + }; + + locale.load(template, countryCode, (translations, error) => { + instance._ = translations; + instance.getData(params, () => getDataCb()); }); }); }, diff --git a/services/mailer/application/template/payment-update/locale/es.json b/services/mailer/application/template/payment-update/locale/es.json index ecf908f92..144cdc346 100644 --- a/services/mailer/application/template/payment-update/locale/es.json +++ b/services/mailer/application/template/payment-update/locale/es.json @@ -3,6 +3,15 @@ "title": "Cambio en las condiciones", "dear": "Estimado cliente", "bodyDescription": "Le informamos que han cambiado las condiciones de pago de su cuenta. A continuación le indicamos las nuevas condiciones:", + "paymentMethod": "Método de pago", + "paymentDay": "Día de pago", + "everyMonth": "de cada mes", + "cardPaymentAdvice": "Su modo de pago actual implica que deberá abonar el importe de los pedidos realizados en el mismo día para que se puedan enviar.", + "accountPaymentAdviceBefore": "Su modo de pago actual implica que se le pasará un cargo a la cuenta", + "accountPaymentAdviceAfter": "por el importe pendiente, al vencimiento establecido en las condiciones.", + "notifyError": "En el caso de detectar algún error en los datos indicados o para cualquier aclaración, debe dirigirse a su comercial.", + "actionButton": "Visita nuestra Web", + "infoButton": "Ayúdanos a mejorar", "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla _ www.verdnatura.es _ clientes@verdnatura.es", "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." diff --git a/services/mailer/application/template/payment-update/payment-update.html b/services/mailer/application/template/payment-update/payment-update.html index 81086327a..a943ca94c 100644 --- a/services/mailer/application/template/payment-update/payment-update.html +++ b/services/mailer/application/template/payment-update/payment-update.html @@ -1,7 +1,7 @@ - {{subject}} + {{_.subject}} @@ -14,32 +14,32 @@
-

{{title}}

+

{{_.title}}

-

{{dear}},

-

{{bodyDescription}}

+

{{_.dear}},

+

{{_.bodyDescription}}

-

Forma de pago: {{paymentMethod}}
-
Día de pago: {{paymentDay}} de cada mes
+
{{_.paymentMethod}}: {{payMethod}}
+
{{_.paymentDay}}: {{paymentDay}} {{_.everyMonth}}

{{paymentAdvice}}

-

En el caso de detectar algún error en los datos indicados o para cualquier aclaración, debe dirigirse a su comercial.

+

{{_.notifyError}}

@@ -70,9 +70,9 @@
-

{{fiscalAddress}}

-

{{privacy}}

-

{{privacyLaw}}

+

{{_.fiscalAddress}}

+

{{_.privacy}}

+

{{_.privacyLaw}}

diff --git a/services/mailer/application/template/payment-update/payment-update.js b/services/mailer/application/template/payment-update/payment-update.js index 8ac60c155..9034a2dd9 100644 --- a/services/mailer/application/template/payment-update/payment-update.js +++ b/services/mailer/application/template/payment-update/payment-update.js @@ -1,24 +1,22 @@ var path = require('path'); var database = require(path.join(__dirname, '../../database.js')); +var format = require(path.join(__dirname, '../../util/format.js')); module.exports = class PaymentUpdate { getData(params, cb) { - database.pool.query('SELECT pm.name AS paymentMethod, pm.id AS paymentMethodId, vencimiento AS paymentDay FROM Clientes AS c JOIN pay_met AS pm ON pm.id = c.pay_met_id WHERE Id_Cliente = ?', [params.userId], (error, result) => { - cb({ - paymentMethod: result[0].paymentMethod, - paymentDay: result[0].paymentDay, - paymentAdvice: this.getPaymentAdvice(result[0].paymentMethodId) - }); + let query = `SELECT pm.name AS payMethod, pm.id AS payMethodId, c.vencimiento AS paymentDay, c.CC AS accountAddress + FROM Clientes AS c JOIN pay_met AS pm ON pm.id = c.pay_met_id WHERE Id_Cliente = ?`; + database.pool.query(query, [params.userId], (error, result) => { + Object.assign(this, result[0]); + cb(); }); } - _(string) { - return string; - } - getPaymentAdvice(paymentMethod) { - if (paymentMethod == 4) { - return 'Su modo de pago actual implica que se le pasará un cargo a la cuenta ESXXXX **** **** **** **** por el importe pendiente, al vencimiento establecido en las condiciones.'; - } else if (paymentMethod == 5) { - return 'Su modo de pago actual implica que deberá abonar el importe de los pedidos realizados en el mismo día para que se puedan enviar.'; + get paymentAdvice() { + switch (this.payMethodId) { + case 4: + return `${this._.accountPaymentAdviceBefore} ${format.partialAccountAddress(this.accountAddress)} ${this._.accountPaymentAdviceAfter}`; + case 5: + return this._.cardPaymentAdvice; } } }; diff --git a/services/mailer/application/util/format.js b/services/mailer/application/util/format.js new file mode 100644 index 000000000..e166062c7 --- /dev/null +++ b/services/mailer/application/util/format.js @@ -0,0 +1,35 @@ +let database = require('../database.js'); + +module.exports = { + + /** + * Devuelve el iban + * @param {String} addressNumber - Dirección de cuenta bancaria + * @param {Object} cb - Callback + */ + accountAddressIban: function(addressNumber, cb) { + database.pool.query('SELECT vn2008.cc_to_iban(?) AS iban', [addressNumber], function(error, result) { + cb(result[0].iban); + }); + }, + + /** + * Obtiene el numero de cuenta completo incluyendo iban + * @param {String} addressNumber - Dirección de cuenta bancaria + * @return {String} Cuenta bancaria formateada + */ + accountAddress: function(addressNumber) { + var formattedAccountAddress = addressNumber.replace(/(.{4})/g, '$1-'); + return formattedAccountAddress.substring(0, formattedAccountAddress.length - 1); + }, + + /** + * Devuelve el numero de cuenta mostrando únicamente los últimos 4 dígitos. + * @param {String} addressNumber - Dirección de cuenta bancaria + * @return {String} Cuenta bancaria formateada + */ + partialAccountAddress: function(addressNumber) { + let address = this.accountAddress(addressNumber); + return address.substring(0, 19).replace(/[0-9]/g, 'X') + address.substring(19, 24); + } +}; From 3806e9e5917dafc970f07074de20378c61d45435 Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 8 Jun 2017 09:29:03 +0200 Subject: [PATCH 08/98] nueva directiva vn-tooltip --- client/core/src/components.js | 1 + client/core/src/tooltip/style.css | 61 +++++++++++++++++++++ client/core/src/tooltip/tooltip.js | 74 ++++++++++++++++++++++++++ client/production/src/index/index.html | 17 +++++- client/production/src/index/style.scss | 9 ++-- gulpfile.js | 9 ++-- 6 files changed, 162 insertions(+), 9 deletions(-) create mode 100644 client/core/src/tooltip/style.css create mode 100644 client/core/src/tooltip/tooltip.js diff --git a/client/core/src/components.js b/client/core/src/components.js index 2c8a09630..fc5c92d34 100644 --- a/client/core/src/components.js +++ b/client/core/src/components.js @@ -14,6 +14,7 @@ import './title/title'; import './subtitle/subtitle'; import './spinner/spinner'; import './snackbar/snackbar'; +import './tooltip/tooltip'; export {NAME as BUTTON, directive as ButtonDirective} from './button/button'; export {NAME as BUTTON_MDL, factory as buttonMdl} from './button/button.mdl'; diff --git a/client/core/src/tooltip/style.css b/client/core/src/tooltip/style.css new file mode 100644 index 000000000..a85131357 --- /dev/null +++ b/client/core/src/tooltip/style.css @@ -0,0 +1,61 @@ +[vn-tooltip]{ + cursor: help; +} +.tooltip { + display: none; + position: fixed; + background-color: #fff; + padding: 15px; + max-width: 250px; + color: #222; + z-index: 999; + border: 2px solid #A7A7A7; + border-radius: 5px; + text-align: justify; +} + +.tooltip-show { + display: inherit; +} + +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; +} + +.tooltip-down .tooltip-arrow { + top: -15px; + left: 50%; + margin-left: -10px; + border-left: 10px solid transparent; + border-right: 10px solid transparent; + border-bottom: 15px solid #A7A7A7; +} + +.tooltip-up .tooltip-arrow { + bottom: -15px; + left: 50%; + margin-left: -10px; + border-left: 10px solid transparent; + border-right: 10px solid transparent; + border-top: 15px solid #A7A7A7; +} + +.tooltip-right .tooltip-arrow { + left: -15px; + top: 50%; + margin-top: -10px; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + border-right: 15px solid #A7A7A7; +} + +.tooltip-left .tooltip-arrow { + right: -15px; + top: 50%; + margin-top: -10px; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + border-left: 15px solid #A7A7A7; +} \ No newline at end of file diff --git a/client/core/src/tooltip/tooltip.js b/client/core/src/tooltip/tooltip.js new file mode 100644 index 000000000..e84836f6e --- /dev/null +++ b/client/core/src/tooltip/tooltip.js @@ -0,0 +1,74 @@ +import {module} from '../module'; +import './style.css'; + +tooltip.$inject = ['$document', '$compile']; +function tooltip($document, $compile) { + return { + restrict: 'A', + scope: true, + link: function(scope, element, attrs) { + var tip = $compile('
{{ text }}
')(scope); + var tipClassName = 'tooltip'; + var tipActiveClassName = 'tooltip-show'; + + scope.tipClass = [tipClassName]; + scope.text = attrs.vnTooltip; + + if (attrs.tooltipPosition) { + scope.tipClass.push('tooltip-' + attrs.tooltipPosition); + } else { + scope.tipClass.push('tooltip-down'); + } + + $document.find('body').append(tip); + + element.bind('mouseover', function(e) { + tip.addClass(tipActiveClassName); + + let pos = e.target.getBoundingClientRect(); + let tipPos = tip[0].getBoundingClientRect(); + let offset = {top: 0, left: 0}; + let tipWidth = tipPos.width || tipPos.right - tipPos.left; + let tipHeight = tipPos.height || tipPos.bottom - tipPos.top; + let elWidth = pos.width || pos.right - pos.left; + let elHeight = pos.height || pos.bottom - pos.top; + let tipOffset = 10; + + if (tip.hasClass('tooltip-right')) { + offset.top = pos.top - (tipHeight / 2) + (elHeight / 2); + offset.left = pos.right + tipOffset; + } else if (tip.hasClass('tooltip-left')) { + offset.top = pos.top - (tipHeight / 2) + (elHeight / 2); + offset.left = pos.left - tipWidth - tipOffset; + } else if (tip.hasClass('tooltip-down')) { + offset.top = pos.top + elHeight + tipOffset; + offset.left = pos.left - (tipWidth / 2) + (elWidth / 2); + } else { + offset.top = pos.top - tipHeight - tipOffset; + offset.left = pos.left - (tipWidth / 2) + (elWidth / 2); + } + + tip.css('top', offset.top + 'px'); + tip.css('left', offset.left + 'px'); + }); + + element.bind('mouseout', function() { + tip.removeClass(tipActiveClassName); + }); + + tip.bind('mouseover', function() { + tip.addClass(tipActiveClassName); + }); + + tip.bind('mouseout', function() { + tip.removeClass(tipActiveClassName); + }); + + element.on('$destroy', function() { + tip.remove(); + }); + } + }; +} + +module.directive('vnTooltip', tooltip); diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index 7ab9356a2..9d9a62bf6 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -51,7 +51,9 @@
- + + + @@ -66,6 +68,19 @@ + + : + {{index.model.length}} + + + + + + + + + +
\ No newline at end of file diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss index d6f8d50e0..b4013d510 100644 --- a/client/production/src/index/style.scss +++ b/client/production/src/index/style.scss @@ -13,14 +13,15 @@ vn-production-index { border-top: 3px solid #9D9D9D; font-weight: bold; } - .list > vn-one{ - text-align: center; - } - .list > [vn-one]{ + .list > vn-one, .list > [vn-one], .list > [vn-two], .list > vn-two{ text-align: center; } .list-body{ padding: 4px 0px; border-bottom: 1px solid #9D9D9D; + + i { + color: #ffa410; + } } } \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 07d99c182..b1a8968c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -36,9 +36,9 @@ gulp.task('client', ['clean'], function() { gulp.task('copy', function() { var streams = []; - for (i=0; i < services.services.length; i++) { + for (i = 0; i < services.services.length; i++) { var service = services.services[i]; - for (j=0; j < services.files.length; j++) { + for (j = 0; j < services.files.length; j++) { var file = services.files[j]; streams.push(gulp.src("./services/service/models/" + file) .pipe(gulp.dest(service + "/common/models/"))); @@ -52,14 +52,15 @@ gulp.task('services', ['copy'], function() { require('./services/salix/server/server.js').start(); require('./services/mailer/server.js').start(); - for (i=0; i < services.services.length; i++) { + for (i = 0; i < services.services.length; i++) { require(services.services[i] + "/server/server.js").start(); } }); +/* Nota (dani): Comentado para que no me borre el mock del Localizador gulp.task('clean', function() { return del(`${buildDir}/*`, {force: true}); -}); +}); */ // Spliting From 491241398a60cd1b73fa6c935b2dcc173b14ea1c Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 8 Jun 2017 10:05:11 +0200 Subject: [PATCH 09/98] localizador y tooltip arreglo estilos --- client/core/src/tooltip/style.css | 5 ++--- client/core/src/tooltip/tooltip.js | 2 +- client/production/src/index/index.html | 26 +++++++++++++------------- client/production/src/index/index.js | 1 + client/production/src/index/style.scss | 4 +++- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/client/core/src/tooltip/style.css b/client/core/src/tooltip/style.css index a85131357..943a92c9c 100644 --- a/client/core/src/tooltip/style.css +++ b/client/core/src/tooltip/style.css @@ -7,10 +7,9 @@ background-color: #fff; padding: 15px; max-width: 250px; - color: #222; + color: #424242; z-index: 999; - border: 2px solid #A7A7A7; - border-radius: 5px; + border: 1px solid #A7A7A7; text-align: justify; } diff --git a/client/core/src/tooltip/tooltip.js b/client/core/src/tooltip/tooltip.js index e84836f6e..1ea5df24a 100644 --- a/client/core/src/tooltip/tooltip.js +++ b/client/core/src/tooltip/tooltip.js @@ -7,7 +7,7 @@ function tooltip($document, $compile) { restrict: 'A', scope: true, link: function(scope, element, attrs) { - var tip = $compile('
{{ text }}
')(scope); + var tip = $compile('
{{ text }}
')(scope); var tipClassName = 'tooltip'; var tipActiveClassName = 'tooltip-show'; diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index 9d9a62bf6..49c24f3bf 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -1,5 +1,5 @@ - + Localizador @@ -50,27 +50,27 @@ - + - + - + - {{::item.id}} - {{::item.agency.id}} - {{::item.employee.name}} - {{::item.hour}} - {{::item.state.name}} - {{::item.lines}} - {{::item.meters}} - {{::item.boxes}} + {{ticket.id}} + {{ticket.agency.id}} + {{ticket.employee.name}} + {{ticket.hour}} + {{ticket.state.name}} + {{ticket.lines}} + {{ticket.meters}} + {{ticket.boxes}} : - {{index.model.length}} + {{$ctrl.tickets.length}} diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index 73a40ed8b..a901c863c 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -5,6 +5,7 @@ export default class ProductionIndex { constructor() { this.model = {}; this.checkAll = false; + this.tickets = []; } search(index) { index.filter.search = this.model.search; diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss index b4013d510..0571afb44 100644 --- a/client/production/src/index/style.scss +++ b/client/production/src/index/style.scss @@ -3,7 +3,9 @@ vn-production-index { height: 20px; padding: 0 6px; } - + .icon-square{ + height: 36px; + } .list-header{ border-bottom: 3px solid #9D9D9D; font-weight: bold; From dbb163263276aafa904059bf46d58b772f1bd34b Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Thu, 8 Jun 2017 11:08:45 +0200 Subject: [PATCH 10/98] nginx docker --- services/nginx/conf-prod.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/nginx/conf-prod.conf b/services/nginx/conf-prod.conf index 3e9f9f7c0..a1204c7a5 100644 --- a/services/nginx/conf-prod.conf +++ b/services/nginx/conf-prod.conf @@ -20,7 +20,7 @@ http { root /usr/share/nginx/html; location ~ ^/static(?:/(.*))?$ { - alias /usr/share/nginx/html; + alias /usr/share/nginx/html/$1; autoindex on; } location ~ ^/auth(?:/(.*))?$ { From f274335997e1e9b9940a8f6d6c27fe4f1b59bcae Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 8 Jun 2017 14:57:23 +0200 Subject: [PATCH 11/98] =?UTF-8?q?interfaz=20gr=C3=A1fica=20y=20correccione?= =?UTF-8?q?s=20varias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/core/src/date-picker/date-picker.js | 11 +++- client/core/src/popover/popover.js | 3 + client/core/src/tooltip/tooltip.js | 6 +- .../src/filter-panel/filter-panel.html | 10 +++- .../src/filter-panel/filter-panel.js | 8 ++- client/production/src/filter-panel/style.scss | 6 ++ client/production/src/index/index.html | 16 +++-- client/production/src/index/index.js | 59 +++++++++++++++++-- client/production/src/index/style.scss | 11 ++++ .../src/components/searchbar/searchbar.js | 4 +- client/salix/src/styles/misc.scss | 6 ++ 11 files changed, 114 insertions(+), 26 deletions(-) create mode 100644 client/production/src/filter-panel/style.scss diff --git a/client/core/src/date-picker/date-picker.js b/client/core/src/date-picker/date-picker.js index 9f4a1647b..b60f20409 100644 --- a/client/core/src/date-picker/date-picker.js +++ b/client/core/src/date-picker/date-picker.js @@ -7,8 +7,8 @@ import Flatpickr from 'vendor/src/flatpickr'; const _NAME = 'datePicker'; export const NAME = util.getName(_NAME); -directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME, '$translate']; -export function directive(resolve, normalizer, $translate) { +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME, '$translate', '$document', '$transitions']; +export function directive(resolve, normalizer, $translate, $document, $transitions) { return { restrict: 'E', template: function(_, attrs) { @@ -32,6 +32,13 @@ export function directive(resolve, normalizer, $translate) { if (input) vp = new Flatpickr(input, initOptions); + scope.$watch(attrs.model, () => { + let mdlField = element[0].firstChild.MaterialCheckbox; + if (mdlField) + mdlField.updateClasses_(); + }); + componentHandler.upgradeElement(element[0].firstChild); + element.on('$destroy', function() { vp.destroy(); }); diff --git a/client/core/src/popover/popover.js b/client/core/src/popover/popover.js index f04cb3d09..46e772681 100644 --- a/client/core/src/popover/popover.js +++ b/client/core/src/popover/popover.js @@ -21,6 +21,7 @@ export class Popover { this.$compile = $compile; } show(childElement, parent) { + this.childElement = childElement; let popover = this.document.createElement('div'); popover.className = 'vn-popover'; popover.addEventListener('mousedown', @@ -81,6 +82,7 @@ export class Popover { let childElement = this.document.createElement(childComponent); this.$compile(childElement)($scope); this.show(childElement, parent); + return childElement; } hide() { if (!this.popover) return; @@ -91,6 +93,7 @@ export class Popover { this.lastEvent = null; this.docMouseDownHandler = null; this.docKeyDownHandler = null; + angular.element(this.childElement).remove(); } onDocMouseDown(event) { if (event != this.lastEvent) diff --git a/client/core/src/tooltip/tooltip.js b/client/core/src/tooltip/tooltip.js index 1ea5df24a..d7620e41c 100644 --- a/client/core/src/tooltip/tooltip.js +++ b/client/core/src/tooltip/tooltip.js @@ -52,15 +52,15 @@ function tooltip($document, $compile) { tip.css('left', offset.left + 'px'); }); - element.bind('mouseout', function() { + element.on('mouseout', function() { tip.removeClass(tipActiveClassName); }); - tip.bind('mouseover', function() { + tip.on('mouseover', function() { tip.addClass(tipActiveClassName); }); - tip.bind('mouseout', function() { + tip.on('mouseout', function() { tip.removeClass(tipActiveClassName); }); diff --git a/client/production/src/filter-panel/filter-panel.html b/client/production/src/filter-panel/filter-panel.html index aa47f9066..8ee87823c 100644 --- a/client/production/src/filter-panel/filter-panel.html +++ b/client/production/src/filter-panel/filter-panel.html @@ -13,11 +13,19 @@ value-field="id" label="Provincia"> - + + + + + + + + + \ No newline at end of file diff --git a/client/production/src/filter-panel/filter-panel.js b/client/production/src/filter-panel/filter-panel.js index c432b3b08..907df7f14 100644 --- a/client/production/src/filter-panel/filter-panel.js +++ b/client/production/src/filter-panel/filter-panel.js @@ -1,20 +1,24 @@ import ngModule from '../module'; +import './style.scss'; export default class Controller { constructor($window) { this.$window = $window; } + /* $onDestroy() { + console.log('panel destruido'); + }*/ onSearch() { this.setStorageValue(); this.onSubmit(this.filter); } $onChanges() { - var value = JSON.parse(this.$window.sessionStorage.getItem('production')); + var value = JSON.parse(this.$window.sessionStorage.getItem('filter')); if (value !== undefined) this.filter = value; } setStorageValue() { - this.$window.sessionStorage.setItem('production', JSON.stringify(this.filter)); + this.$window.sessionStorage.setItem('filter', JSON.stringify(this.filter)); } } Controller.$inject = ['$window']; diff --git a/client/production/src/filter-panel/style.scss b/client/production/src/filter-panel/style.scss new file mode 100644 index 000000000..f94357087 --- /dev/null +++ b/client/production/src/filter-panel/style.scss @@ -0,0 +1,6 @@ +vn-production-filter-panel { + button { + color: #ffa410 !important; + background-color: white !important; + } +} \ No newline at end of file diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index 49c24f3bf..b768aab80 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -1,13 +1,13 @@ + - Localizador @@ -18,9 +18,7 @@ url="/client/api/ContactChannels" label="Almacen"> - - - + @@ -58,7 +56,7 @@ {{ticket.id}} - {{ticket.agency.id}} + {{ticket.agency.name}} {{ticket.employee.name}} {{ticket.hour}} {{ticket.state.name}} @@ -77,8 +75,8 @@ - - + {{$ctrl.lines}} + {{$ctrl.meters}} diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index a901c863c..97c5c1d5c 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -2,16 +2,63 @@ import ngModule from '../module'; import './style.scss'; export default class ProductionIndex { - constructor() { - this.model = {}; - this.checkAll = false; + constructor($element, $scope) { + this.$element = $element; + this.$ = $scope; + this.filter = {}; + this._checkAll = false; this.tickets = []; + this.lines = 0; + this.meters = 0; } - search(index) { - index.filter.search = this.model.search; - index.accept(); + get checkAll() { + return this._checkAll; + } + set checkAll(value) { + this._checkAll = value; + this.switchChecks(); + } + switchChecks() { + let checks = this.$element[0].querySelectorAll('.list-body input[type="checkbox"]'); + checks.forEach( + (el, i) => { + el.checked = this._checkAll; + this.tickets[i].cheched = this._checkAll; + } + ); + } + doAction(action) { + let checks = this.$element[0].querySelectorAll('.list-body input[type="checkbox"]:checked'); + if (checks.length) { + let ids = []; + checks.forEach( + (_, i) => { + ids.push(this.tickets[i].id); + } + ); + // TODO: call action -> endPoint with tickets's Ids + } else { + // TODO: dialog with no items selected + } + } + sumTickets() { + let lines = 0; + let meters = 0; + this.tickets.forEach( + val => { + lines += parseFloat(val.lines); + meters += parseFloat(val.meters); + } + ); + this.lines = lines; + this.meters = meters.toFixed(2); + } + onSearch() { + this.$.index.filter = this.filter; + this.$.index.accept(); } } +ProductionIndex.$inject = ['$element', '$scope']; ngModule.component('vnProductionIndex', { template: require('./index.html'), diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss index 0571afb44..13bd38bbf 100644 --- a/client/production/src/index/style.scss +++ b/client/production/src/index/style.scss @@ -3,6 +3,17 @@ vn-production-index { height: 20px; padding: 0 6px; } + vn-searchbar { + vn-icon{ + padding-top: 20px; + } + vn-icon-button{ + padding-top: 10px; + } + } + [pad-ten-top] { + padding-top: 10px; + } .icon-square{ height: 36px; } diff --git a/client/salix/src/components/searchbar/searchbar.js b/client/salix/src/components/searchbar/searchbar.js index 081f566f1..aac912788 100644 --- a/client/salix/src/components/searchbar/searchbar.js +++ b/client/salix/src/components/searchbar/searchbar.js @@ -10,9 +10,7 @@ export default class Controller { this.$window = $window; } onClick(event) { - var child = this.$document[0].createElement(this.popover); - this.$compile(child)(this.$scope); - this.vnPopover.show(child, this.element); + var child = this.vnPopover.showComponent(this.popover, this.$scope, this.element); // XXX: ¿Existe una forma más adecuada de acceder al controlador de un componente? var childCtrl = angular.element(child).isolateScope().$ctrl; diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss index 1146d9c0f..c3712646e 100644 --- a/client/salix/src/styles/misc.scss +++ b/client/salix/src/styles/misc.scss @@ -29,4 +29,10 @@ vn-button-bar { } html [text-center], .text-center { text-align: center; +} +html [vn-right], .vn-right{ + float: right; +} +html [vn-left], .vn-left{ + float: left; } \ No newline at end of file From 9aa549cfc5e769e83f21473527c0a1b07496ee0f Mon Sep 17 00:00:00 2001 From: Joan Date: Thu, 8 Jun 2017 16:53:10 +0200 Subject: [PATCH 12/98] No mostrar dia de pago en metodo de pago por tarjeta. --- gulpfile.js | 3 +-- .../template/payment-update/payment-update.html | 2 +- .../template/payment-update/payment-update.js | 9 ++++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index b1a8968c0..5722981c0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -57,10 +57,9 @@ gulp.task('services', ['copy'], function() { } }); -/* Nota (dani): Comentado para que no me borre el mock del Localizador gulp.task('clean', function() { return del(`${buildDir}/*`, {force: true}); -}); */ +}); // Spliting diff --git a/services/mailer/application/template/payment-update/payment-update.html b/services/mailer/application/template/payment-update/payment-update.html index a943ca94c..99d3a5e8b 100644 --- a/services/mailer/application/template/payment-update/payment-update.html +++ b/services/mailer/application/template/payment-update/payment-update.html @@ -24,7 +24,7 @@

{{_.bodyDescription}}

{{_.paymentMethod}}: {{payMethod}}
-
{{_.paymentDay}}: {{paymentDay}} {{_.everyMonth}}
+ {{{paymentDay}}}

{{paymentAdvice}}

{{_.notifyError}}

diff --git a/services/mailer/application/template/payment-update/payment-update.js b/services/mailer/application/template/payment-update/payment-update.js index 9034a2dd9..0bbf8b784 100644 --- a/services/mailer/application/template/payment-update/payment-update.js +++ b/services/mailer/application/template/payment-update/payment-update.js @@ -4,13 +4,20 @@ var format = require(path.join(__dirname, '../../util/format.js')); module.exports = class PaymentUpdate { getData(params, cb) { - let query = `SELECT pm.name AS payMethod, pm.id AS payMethodId, c.vencimiento AS paymentDay, c.CC AS accountAddress + let query = `SELECT pm.name AS payMethod, pm.id AS payMethodId, c.vencimiento AS payDay, c.CC AS accountAddress FROM Clientes AS c JOIN pay_met AS pm ON pm.id = c.pay_met_id WHERE Id_Cliente = ?`; database.pool.query(query, [params.userId], (error, result) => { Object.assign(this, result[0]); cb(); }); } + + get paymentDay() { + if (this.payMethodId != 5) { + return `
${this._.paymentDay}: ${this.payDay} ${this._.everyMonth}
`; + } + } + get paymentAdvice() { switch (this.payMethodId) { case 4: From e4f94206971b133a0450c8356c1b45761539bc3d Mon Sep 17 00:00:00 2001 From: Joan Date: Mon, 12 Jun 2017 13:41:02 +0200 Subject: [PATCH 13/98] Parser de estilos en plantillas para el servicio mailer. --- .../mailer/application/route/manuscript.js | 4 +- .../mailer/application/route/notification.js | 26 +++- services/mailer/application/template.js | 33 ++++- .../template/notice/attachment.json | 1 + .../template/notice/locale/es.json | 11 ++ .../application/template/notice/notice.css | 0 .../application/template/notice/notice.html | 74 ++++++++++ .../application/template/notice/notice.js | 14 ++ .../payment-update/payment-update.css | 92 ++++++++++++ .../payment-update/payment-update.html | 132 +++++++++--------- services/mailer/package.json | 1 + services/mailer/server.js | 9 +- 12 files changed, 320 insertions(+), 77 deletions(-) create mode 100644 services/mailer/application/template/notice/attachment.json create mode 100644 services/mailer/application/template/notice/locale/es.json create mode 100644 services/mailer/application/template/notice/notice.css create mode 100644 services/mailer/application/template/notice/notice.html create mode 100644 services/mailer/application/template/notice/notice.js diff --git a/services/mailer/application/route/manuscript.js b/services/mailer/application/route/manuscript.js index 6c351fad5..7c88498f5 100644 --- a/services/mailer/application/route/manuscript.js +++ b/services/mailer/application/route/manuscript.js @@ -5,12 +5,12 @@ var database = require('../database.js'); var template = require('../template.js'); // Escrito de cambios en méto de pago del cliente -router.post('/:userId/:template', function(request, response, next) { +router.post('/:userId/payment-update', function(request, response, next) { database.pool.query('SELECT `e-mail` AS email, LOWER(p.Codigo) AS countryCode FROM Clientes AS c JOIN Paises AS p ON p.id = c.Id_Pais WHERE Id_Cliente = ?', [request.params.userId], function(error, qryRs) { if (qryRs.length == 0) return response.json({data: {message: 'Client not found'}}); - template.getTemplate(request.params.template, qryRs[0].countryCode, {userId: request.params.userId}, function(tplRs, error) { + template.getTemplate('payment-update', qryRs[0].countryCode, {userId: request.params.userId}, function(tplRs, error) { if (error) return response.json({data: {message: error}}); diff --git a/services/mailer/application/route/notification.js b/services/mailer/application/route/notification.js index a7f9904a2..2c3a42743 100644 --- a/services/mailer/application/route/notification.js +++ b/services/mailer/application/route/notification.js @@ -1,8 +1,28 @@ var express = require('express'); var router = new express.Router(); -var format = require('../util/format.js'); -router.get('/test', function(request, response) { - response.send("test"); +var mail = require('../mail.js'); +var database = require('../database.js'); +var template = require('../template.js'); + +router.get('/:userId/notice', function(request, response) { + database.pool.query('SELECT `e-mail` AS email, LOWER(p.Codigo) AS countryCode FROM Clientes AS c JOIN Paises AS p ON p.id = c.Id_Pais WHERE Id_Cliente = ?', [request.params.userId], function(error, qryRs) { + if (qryRs.length == 0) + return response.json({data: {message: 'Client not found'}}); + + template.getTemplate('notice', qryRs[0].countryCode, {userId: request.params.userId}, function(tplRs, error) { + if (error) + return response.json({data: {message: error}}); + + mail.send(qryRs[0].email, tplRs.subject, tplRs.body, tplRs.attachments, (mailrs, error) => { + if (error) + return response.json({data: {message: error}}); + + return response.json({data: {message: 'Mail sent'}}); + }); + }); + }); + + response.send(request.params.userid); }); module.exports = router; diff --git a/services/mailer/application/template.js b/services/mailer/application/template.js index d484393c9..172aa2bd1 100644 --- a/services/mailer/application/template.js +++ b/services/mailer/application/template.js @@ -2,6 +2,7 @@ var fs = require('fs'); var mustache = require('mustache'); var locale = require('./locale.js'); var path = require('path'); +var inlineCss = require('inline-css'); module.exports = { /** @@ -14,6 +15,7 @@ module.exports = { getTemplate: function(template, countryCode, params, cb) { var templatePath = path.join(__dirname, 'template', `${template}`, `${template}.html`); var classPath = path.join(__dirname, 'template', `${template}`, `${template}.js`); + var stylePath = path.join(__dirname, 'template', `${template}`, `${template}.css`); fs.stat(templatePath, (error, stat) => { if (error) @@ -22,16 +24,19 @@ module.exports = { let TemplateClass = require(classPath); let instance = new TemplateClass(); - let getDataCb = () => { - this.render(templatePath, instance, body => { + let getRenderedStyles = body => { + this.renderStyles(stylePath, body, body => { var titleSubject = body.match(new RegExp('(.*?)', 'i'))[1]; - this.getAttachments(template, body, attachments => { cb({body: body, subject: titleSubject, attachments: attachments}); }); }); }; + let getDataCb = () => { + this.render(templatePath, instance, body => getRenderedStyles(body)); + }; + locale.load(template, countryCode, (translations, error) => { instance._ = translations; instance.getData(params, () => getDataCb()); @@ -52,6 +57,28 @@ module.exports = { }); }, + /** + * Renderiza los estilos de las plantillas. + * @param {String} path - Ruta de la hoja de estilos + * @param {String} body - Html renderizado + * @param {Object} cb - Callback + */ + renderStyles: function(path, html, cb) { + fs.stat(path, error => { + if (error) return cb(null, 'Template stylesheet not found'); + fs.readFile(path, 'utf8', (error, css) => { + let style = ''; + let body = style + html; + let options = {url: ' '}; + + inlineCss(body, options) + .then(function(body) { + cb(body); + }); + }); + }); + }, + /** * Obtiene todos los ficheros adjuntos de la plantilla * @param {String} template - Nombre de la plantilla diff --git a/services/mailer/application/template/notice/attachment.json b/services/mailer/application/template/notice/attachment.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/services/mailer/application/template/notice/attachment.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/services/mailer/application/template/notice/locale/es.json b/services/mailer/application/template/notice/locale/es.json new file mode 100644 index 000000000..b4a98a2f4 --- /dev/null +++ b/services/mailer/application/template/notice/locale/es.json @@ -0,0 +1,11 @@ +{ + "subject": "Has recibido una nueva notificación", + "title": "Nueva notificación", + "hello": "Hola", + "bodyDescription": "test", + "actionButton": "Visita nuestra Web", + "infoButton": "Ayúdanos a mejorar", + "fiscalAddress": "VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla _ www.verdnatura.es _ clientes@verdnatura.es", + "privacy": "- AVISO - Este mensaje es privado y confidencial, y debe ser utilizado exclusivamente por la persona destinataria del mismo. Si usted ha recibido este mensaje por error, le rogamos lo comunique al remitente y borre dicho mensaje y cualquier documento adjunto que pudiera contener. Verdnatura Levante SL no renuncia a la confidencialidad ni a ningún privilegio por causa de transmisión errónea o mal funcionamiento. Igualmente no se hace responsable de los cambios, alteraciones, errores u omisiones que pudieran hacerse al mensaje una vez enviado.", + "privacyLaw": "En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación." +} \ No newline at end of file diff --git a/services/mailer/application/template/notice/notice.css b/services/mailer/application/template/notice/notice.css new file mode 100644 index 000000000..e69de29bb diff --git a/services/mailer/application/template/notice/notice.html b/services/mailer/application/template/notice/notice.html new file mode 100644 index 000000000..f9990d2d2 --- /dev/null +++ b/services/mailer/application/template/notice/notice.html @@ -0,0 +1,74 @@ + + + + {{_.subject}} + + + +
+ +
+ VerdNatura +
+ + + +
+

{{_.title}}

+
+ + + +
+

Hola, {{username}}

+

{{_.bodyDescription}}

+
+ + + + + + + + + + + +
+

{{_.fiscalAddress}}

+

{{_.privacy}}

+

{{_.privacyLaw}}

+
+ +
+ + \ No newline at end of file diff --git a/services/mailer/application/template/notice/notice.js b/services/mailer/application/template/notice/notice.js new file mode 100644 index 000000000..c81d05e7a --- /dev/null +++ b/services/mailer/application/template/notice/notice.js @@ -0,0 +1,14 @@ +var path = require('path'); +var database = require(path.join(__dirname, '../../database.js')); + +module.exports = class Notice { + getData(params, cb) { + let query = `SELECT c. Cliente FROM Clientes AS c WHERE Id_Cliente = ?`; + database.pool.query(query, [params.userId], (error, result) => { + Object.assign(this, result[0]); + cb(); + }); + } +}; + + diff --git a/services/mailer/application/template/payment-update/payment-update.css b/services/mailer/application/template/payment-update/payment-update.css index e69de29bb..83fe2dd6d 100644 --- a/services/mailer/application/template/payment-update/payment-update.css +++ b/services/mailer/application/template/payment-update/payment-update.css @@ -0,0 +1,92 @@ +img { + margin: 0 +} + +.wrapper { + background-color: #EEE +} + +.container { + font-family: arial, sans-serif; + max-width: 600px; + min-width: 320px; + font-size: 16px; + margin: 0 auto; + color: #555 +} + +.banner img { + width: 100% +} + +.title { + background-color: #95d831; + text-align: center; + padding: 35px 0 +} + +.title h1 { + font-size: 32px; + color: #333; + margin: 0 +} + +.body { + background-color:#FFF; + padding: 20px +} + +.buttons { + background-color: #FFF; + text-align: center; + width: 100% +} + +.buttons a { + text-decoration: none; + font-size: 18px; + color: #fff +} + +.buttons .btn { + background-color: #333; + min-width: 300px; + height: 72px; + display: inline-block; + text-align: center +} + +.buttons .btn .text { + display: inline-block; + padding-top: 22px +} + +.buttons .btn .icon { + background-color: #95d831; + text-align: center; + padding-top: 22px; + float: right; + height: 50px; + width: 70px +} + +.footer { + background-color: #555; + text-align: center; + padding: 20px 0 +} + +.footer a { + text-decoration: none; + margin-right: 5px +} + +.footer a img { + margin: 0 +} + +.privacy { + padding: 20px 0; + font-size: 10px; + font-weight: 100 +} \ No newline at end of file diff --git a/services/mailer/application/template/payment-update/payment-update.html b/services/mailer/application/template/payment-update/payment-update.html index 99d3a5e8b..c1586225e 100644 --- a/services/mailer/application/template/payment-update/payment-update.html +++ b/services/mailer/application/template/payment-update/payment-update.html @@ -5,76 +5,76 @@ -
- -
- VerdNatura -
- +
+
+ + + - -
-

{{_.title}}

-
- + +
+

{{_.title}}

+
+ - -
-

{{_.dear}},

-

{{_.bodyDescription}}

-

-

{{_.paymentMethod}}: {{payMethod}}
- {{{paymentDay}}} -

-

{{paymentAdvice}}

-

{{_.notifyError}}

-
- + +
+

{{_.dear}},

+

{{_.bodyDescription}}

+

+

{{_.paymentMethod}}: {{payMethod}}
+ {{{paymentDay}}} +

+

{{paymentAdvice}}

+

{{_.notifyError}}

+
+ + + + + - - - + + + - -
- - Visita nuestro Facebook - - - Visita nuestro Twitter - - - Visita nuestro canal de Youtube - - - Visita nuestro Pinterest - - - Visita nuestro Instagram - - - Visita nuestro Linkedin - + +
+

{{_.fiscalAddress}}

+

{{_.privacy}}

+

{{_.privacyLaw}}

+
+ +
- - - -
-

{{_.fiscalAddress}}

-

{{_.privacy}}

-

{{_.privacyLaw}}

-
- -
\ No newline at end of file diff --git a/services/mailer/package.json b/services/mailer/package.json index 2cdcf26f1..6061d7b7c 100644 --- a/services/mailer/package.json +++ b/services/mailer/package.json @@ -6,6 +6,7 @@ "dependencies": { "body-parser": "^1.17.2", "express": "^4.15.3", + "inline-css": "^2.2.2", "mustache": "^2.3.0", "mysql": "^2.13.0", "nodemailer": "^4.0.1", diff --git a/services/mailer/server.js b/services/mailer/server.js index ee15c67f1..cb4d1a435 100644 --- a/services/mailer/server.js +++ b/services/mailer/server.js @@ -22,14 +22,17 @@ app.use(function(err, req, res, next) { // Iniciar escucha del servidor app.start = function() { - return app.listen(settings.app().port, function() { + var listener = app.listen(settings.app().port, function() { + var servicePath = 'http://' + listener.address().address + ':' + listener.address().port; mail.init(); database.init(); - console.log('Mailer started at port:' + settings.app().port); + console.log('Web service ' + settings.app().name.toUpperCase() + ' listening at: ' + servicePath); + console.log('Browse your REST API at: ' + servicePath + '/mailer'); if (settings.app().debug) { - console.log('Debug mode enabled'); + console.log(settings.app().name.toUpperCase() + ' service debug mode enabled'); } }); + return listener; }; if (require.main === module) { From c24c12673430809fe62f5d437e31e978518b5455 Mon Sep 17 00:00:00 2001 From: nelo Date: Tue, 13 Jun 2017 08:44:40 +0200 Subject: [PATCH 14/98] fake son de tickets my model tiene el meted raw sql --- services/client/common/models/my-model.js | 10 +- .../common/methods/ticket/list-fake.json | 1012 +++++++++++++++++ .../production/common/methods/ticket/list.js | 44 + services/production/common/models/Ticket.json | 10 +- services/production/common/models/my-model.js | 10 +- services/production/common/models/state.json | 30 + .../common/models/ticket-state.json | 47 + services/production/common/models/ticket.js | 9 + services/production/server/model-config.json | 35 +- services/service/models/my-model.js | 10 +- 10 files changed, 1205 insertions(+), 12 deletions(-) create mode 100644 services/production/common/methods/ticket/list-fake.json create mode 100644 services/production/common/methods/ticket/list.js create mode 100644 services/production/common/models/state.json create mode 100644 services/production/common/models/ticket-state.json create mode 100644 services/production/common/models/ticket.js diff --git a/services/client/common/models/my-model.js b/services/client/common/models/my-model.js index 009b025f3..4d98e7f62 100644 --- a/services/client/common/models/my-model.js +++ b/services/client/common/models/my-model.js @@ -1,5 +1,6 @@ module.exports = function(self) { + self.setup = function() { self.super_.setup.call(this); @@ -25,7 +26,14 @@ module.exports = function(self) { for(let method in disableMethods) { //this.disableRemoteMethod(method, disableMethods[method]); } - } + + }; + + self.rawSql = function(query, params, cb) { + this.dataSource.connector.execute(query, params, function(error, response) { + cb(error, response); + }); + }; self.installMethod = function(methodName, filterCb) { this.remoteMethod(methodName, { diff --git a/services/production/common/methods/ticket/list-fake.json b/services/production/common/methods/ticket/list-fake.json new file mode 100644 index 000000000..34c5e714e --- /dev/null +++ b/services/production/common/methods/ticket/list-fake.json @@ -0,0 +1,1012 @@ +[ + { + "Ticket": 1532629, + "Agency": "REC_MADRID", + "Worker": "LOLI LOZANO RAEZ", + "Hout": 20, + "State": "OK", + "Lines": 2, + "m3": 0.03, + "Boxes": 0 + }, + { + "Ticket": 1532645, + "Agency": "CORREOSEXPRESS", + "Worker": "COMPUTER SYSTEM", + "Hout": 17, + "State": "Libre", + "Lines": 9, + "m3": 0.21, + "Boxes": 0 + }, + { + "Ticket": 1532656, + "Agency": "ZONA 32", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 35, + "m3": 0.42, + "Boxes": 0 + }, + { + "Ticket": 1532690, + "Agency": "MRW 24h", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 17, + "State": "OK", + "Lines": 4, + "m3": 0.21, + "Boxes": 0 + }, + { + "Ticket": 1532729, + "Agency": "ZONA 25", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 17, + "m3": 0.45, + "Boxes": 0 + }, + { + "Ticket": 1532742, + "Agency": "CORREOSEXPRESS", + "Worker": "DEMBA SAKHO", + "Hout": 17, + "State": "Encajado", + "Lines": 13, + "m3": 0.27, + "Boxes": 0 + }, + { + "Ticket": 1532792, + "Agency": "ZONA 25", + "Worker": "JUAN BAUTISTA PASTOR REDONDO", + "Hout": 20, + "State": "OK", + "Lines": 10, + "m3": 0.26, + "Boxes": 0 + }, + { + "Ticket": 1532803, + "Agency": "ZONA 31", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 12, + "m3": 0.49, + "Boxes": 0 + }, + { + "Ticket": 1532812, + "Agency": "ZELERIS", + "Worker": "JULIA LLOPIS CASTELL", + "Hout": 17, + "State": "Arreglar", + "Lines": 19, + "m3": 0.67, + "Boxes": 0 + }, + { + "Ticket": 1532879, + "Agency": "ZONA 20", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 20, + "State": "OK", + "Lines": 1, + "m3": 0.41, + "Boxes": 0 + }, + { + "Ticket": 1532880, + "Agency": "ZONA 20", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 8, + "m3": 0.08, + "Boxes": 0 + }, + { + "Ticket": 1532923, + "Agency": "ZONA 20", + "Worker": "JESUS DANIEL VALLES PEREZ", + "Hout": 20, + "State": "OK", + "Lines": 30, + "m3": 0.63, + "Boxes": 1 + }, + { + "Ticket": 1532995, + "Agency": "ZONA 20", + "Worker": "DANIEL YAREHAM PALOMO", + "Hout": 20, + "State": "Arreglar", + "Lines": 54, + "m3": 1.62, + "Boxes": 0 + }, + { + "Ticket": 1533009, + "Agency": "ZONA 25", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 20, + "State": "Sin Acabar", + "Lines": 38, + "m3": 0.78, + "Boxes": 0 + }, + { + "Ticket": 1533051, + "Agency": "MRW 24h", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 17, + "State": "Sin Acabar", + "Lines": 19, + "m3": 0.91, + "Boxes": 2 + }, + { + "Ticket": 1533064, + "Agency": "MRW 24h", + "Worker": "JOSE JAVIER ECHEVARRIA", + "Hout": 17, + "State": "OK", + "Lines": 11, + "m3": 0.22, + "Boxes": 0 + }, + { + "Ticket": 1533102, + "Agency": "MRW 24h", + "Worker": "LOLI LOZANO RAEZ", + "Hout": 17, + "State": "OK", + "Lines": 9, + "m3": 0.35, + "Boxes": 0 + }, + { + "Ticket": 1533151, + "Agency": "ZONA 32", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 7, + "m3": 0.05, + "Boxes": 0 + }, + { + "Ticket": 1533182, + "Agency": "ZONA 25", + "Worker": "CARLOS LOPEZ AMORES", + "Hout": 20, + "State": "OK", + "Lines": 20, + "m3": 0.26, + "Boxes": 0 + }, + { + "Ticket": 1533257, + "Agency": "MRW 24h", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 17, + "State": "OK", + "Lines": 14, + "m3": 0.07, + "Boxes": 0 + }, + { + "Ticket": 1533279, + "Agency": "ZONA 46", + "Worker": "RICARD SENDRA", + "Hout": 15, + "State": "Impreso", + "Lines": 50, + "m3": 1.05, + "Boxes": 2 + }, + { + "Ticket": 1533284, + "Agency": "ZONA 20", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 20, + "State": "OK", + "Lines": 18, + "m3": 0.21, + "Boxes": 0 + }, + { + "Ticket": 1533314, + "Agency": "MRW 24h", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 17, + "State": "OK", + "Lines": 3, + "m3": 0.05, + "Boxes": 0 + }, + { + "Ticket": 1533316, + "Agency": "ZONA 25", + "Worker": "LOLI LOZANO RAEZ", + "Hout": 20, + "State": "OK", + "Lines": 17, + "m3": 0.49, + "Boxes": 0 + }, + { + "Ticket": 1533319, + "Agency": "ZONA 25", + "Worker": "ELENA BASCUÑANA TORNERO", + "Hout": 20, + "State": "OK", + "Lines": 2, + "m3": 0.04, + "Boxes": 0 + }, + { + "Ticket": 1533327, + "Agency": "ZONA 25", + "Worker": "FRAN NATEK ECHEVARRIA", + "Hout": 20, + "State": "OK", + "Lines": 13, + "m3": 0.32, + "Boxes": 0 + }, + { + "Ticket": 1533339, + "Agency": "ZONA 20", + "Worker": "ELENA BASCUÑANA TORNERO", + "Hout": 20, + "State": "OK", + "Lines": 9, + "m3": 0.17, + "Boxes": 0 + }, + { + "Ticket": 1533340, + "Agency": "ZONA 25", + "Worker": "JULIA LLOPIS CASTELL", + "Hout": 20, + "State": "Arreglar", + "Lines": 48, + "m3": 1.59, + "Boxes": 4.5 + }, + { + "Ticket": 1533345, + "Agency": "ZONA 31", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 56, + "m3": 0.79, + "Boxes": 0 + }, + { + "Ticket": 1533349, + "Agency": "ZONA 20", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 12, + "m3": 0.34, + "Boxes": 0 + }, + { + "Ticket": 1533353, + "Agency": "ZONA 11", + "Worker": "COMPUTER SYSTEM", + "Hout": 21, + "State": "Libre", + "Lines": 10, + "m3": 0.08, + "Boxes": 0 + }, + { + "Ticket": 1533359, + "Agency": "ZONA 20", + "Worker": "CARLOS LOPEZ AMORES", + "Hout": 20, + "State": "OK", + "Lines": 9, + "m3": 0.52, + "Boxes": 0 + }, + { + "Ticket": 1533369, + "Agency": "INTEGRA2", + "Worker": "CARLOS LOPEZ AMORES", + "Hout": 17, + "State": "OK", + "Lines": 7, + "m3": 0.1, + "Boxes": 0 + }, + { + "Ticket": 1533392, + "Agency": "ZONA 25", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 16, + "m3": 0.35, + "Boxes": 0 + }, + { + "Ticket": 1533403, + "Agency": "ZONA 31", + "Worker": "Mª CARMEN SERRANO BAU", + "Hout": 19, + "State": "OK", + "Lines": 1, + "m3": 2.04, + "Boxes": 0 + }, + { + "Ticket": 1533412, + "Agency": "ZELERIS", + "Worker": "CARLOS BORRAS MARTINEZ", + "Hout": 17, + "State": "OK", + "Lines": 5, + "m3": 0.04, + "Boxes": 0 + }, + { + "Ticket": 1533425, + "Agency": "INTEGRA2", + "Worker": "CARLOS LOPEZ AMORES", + "Hout": 17, + "State": "OK", + "Lines": 11, + "m3": 0.14, + "Boxes": 0 + }, + { + "Ticket": 1533429, + "Agency": "ZONA 25", + "Worker": "DANIEL YAREHAM PALOMO", + "Hout": 20, + "State": "OK", + "Lines": 43, + "m3": 0.6, + "Boxes": 0 + }, + { + "Ticket": 1533438, + "Agency": "ZELERIS", + "Worker": "MIGUEL ANGEL LORITE", + "Hout": 17, + "State": "Preparación", + "Lines": 10, + "m3": 0.17, + "Boxes": 0 + }, + { + "Ticket": 1533482, + "Agency": "ZONA 25", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 20, + "State": "Sin Acabar", + "Lines": 30, + "m3": 0.42, + "Boxes": 0 + }, + { + "Ticket": 1533486, + "Agency": "DHL", + "Worker": "JOSE JAVIER ECHEVARRIA", + "Hout": 17, + "State": "OK", + "Lines": 28, + "m3": 0.25, + "Boxes": 0 + }, + { + "Ticket": 1533495, + "Agency": "REC_VILASSAR", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 16, + "m3": 0.08, + "Boxes": 0 + }, + { + "Ticket": 1533507, + "Agency": "MRW 24h", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 17, + "State": "OK", + "Lines": 16, + "m3": 0.39, + "Boxes": 0 + }, + { + "Ticket": 1533557, + "Agency": "ZONA 11", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 21, + "State": "OK", + "Lines": 50, + "m3": 1.16, + "Boxes": 0 + }, + { + "Ticket": 1533566, + "Agency": "ZONA 10", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 23, + "State": "Sin Acabar", + "Lines": 14, + "m3": 0.18, + "Boxes": 0 + }, + { + "Ticket": 1533570, + "Agency": "MRW 24h", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 17, + "State": "OK", + "Lines": 13, + "m3": 0.17, + "Boxes": 0 + }, + { + "Ticket": 1533580, + "Agency": "ZELERIS_10", + "Worker": "DEMBA SAKHO", + "Hout": 17, + "State": "Encajado", + "Lines": 4, + "m3": 0.13, + "Boxes": 0 + }, + { + "Ticket": 1533584, + "Agency": "ZONA 20", + "Worker": "JESUS DANIEL VALLES PEREZ", + "Hout": 20, + "State": "OK", + "Lines": 20, + "m3": 0.67, + "Boxes": 0 + }, + { + "Ticket": 1533585, + "Agency": "ZELERIS_10", + "Worker": "FRAN NATEK ECHEVARRIA", + "Hout": 17, + "State": "Sin Acabar", + "Lines": 1, + "m3": 0.01, + "Boxes": 0 + }, + { + "Ticket": 1533591, + "Agency": "ZONA 46", + "Worker": "JUANLU GALLETERO", + "Hout": 15, + "State": "Revisado", + "Lines": 16, + "m3": 0.3, + "Boxes": 0 + }, + { + "Ticket": 1533641, + "Agency": "ZONA 25", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 28, + "m3": 0.75, + "Boxes": 0 + }, + { + "Ticket": 1533685, + "Agency": "ZONA 20", + "Worker": "Mª CARMEN SERRANO BAU", + "Hout": 20, + "State": "OK", + "Lines": 39, + "m3": 0.78, + "Boxes": 1 + }, + { + "Ticket": 1533688, + "Agency": "ZONA 20", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 7, + "m3": 0.19, + "Boxes": 0 + }, + { + "Ticket": 1533795, + "Agency": "ZONA 25", + "Worker": "MANOLI PULIDO", + "Hout": 20, + "State": "OK", + "Lines": 16, + "m3": 0.3, + "Boxes": 0 + }, + { + "Ticket": 1533797, + "Agency": "ZONA 25", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 20, + "m3": 0.33, + "Boxes": 0 + }, + { + "Ticket": 1533807, + "Agency": "ZONA 25", + "Worker": "ESDENKA CALERO PEREZ", + "Hout": 20, + "State": "Arreglar", + "Lines": 16, + "m3": 0.14, + "Boxes": 0 + }, + { + "Ticket": 1533815, + "Agency": "ZELERIS_10", + "Worker": "RODRIGO HALABI ROCHA", + "Hout": 17, + "State": "OK", + "Lines": 15, + "m3": 0.2, + "Boxes": 0 + }, + { + "Ticket": 1533849, + "Agency": "MRW 24h", + "Worker": "JUAN CARLOS LORENZO SANCHEZ", + "Hout": 17, + "State": "OK", + "Lines": 18, + "m3": 0.25, + "Boxes": 0 + }, + { + "Ticket": 1533852, + "Agency": "MRW 24h", + "Worker": "DANIEL YAREHAM PALOMO", + "Hout": 17, + "State": "OK", + "Lines": 17, + "m3": 0.68, + "Boxes": 0 + }, + { + "Ticket": 1533854, + "Agency": "ZONA 20", + "Worker": "MANOLI PULIDO", + "Hout": 20, + "State": "OK", + "Lines": 11, + "m3": 0.13, + "Boxes": 0 + }, + { + "Ticket": 1533863, + "Agency": "ZELERIS_10", + "Worker": "DEMBA SAKHO", + "Hout": 17, + "State": "Encajado", + "Lines": 6, + "m3": 0.16, + "Boxes": 0 + }, + { + "Ticket": 1533882, + "Agency": "ZONA 20", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 20, + "State": "OK", + "Lines": 9, + "m3": 0.44, + "Boxes": 0 + }, + { + "Ticket": 1533889, + "Agency": "MRW 24h", + "Worker": "ELENA BASCUÑANA TORNERO", + "Hout": 17, + "State": "OK", + "Lines": 10, + "m3": 0.5, + "Boxes": 0 + }, + { + "Ticket": 1533893, + "Agency": "ZONA 32", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 2, + "m3": 0.13, + "Boxes": 0 + }, + { + "Ticket": 1533915, + "Agency": "CORREOSEXPRESS", + "Worker": "JUAN BAUTISTA PASTOR REDONDO", + "Hout": 17, + "State": "OK", + "Lines": 9, + "m3": 0.36, + "Boxes": 0 + }, + { + "Ticket": 1533919, + "Agency": "ZONA 20", + "Worker": "JULIA LLOPIS CASTELL", + "Hout": 20, + "State": "Arreglar", + "Lines": 16, + "m3": 0.23, + "Boxes": 0 + }, + { + "Ticket": 1533983, + "Agency": "ZONA 11", + "Worker": "MANOLI PULIDO", + "Hout": 21, + "State": "OK", + "Lines": 30, + "m3": 1.92, + "Boxes": 0 + }, + { + "Ticket": 1533992, + "Agency": "ZONA 25", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 32, + "m3": 0.23, + "Boxes": 0 + }, + { + "Ticket": 1534032, + "Agency": "MRW 24h", + "Worker": "JESUS DANIEL VALLES PEREZ", + "Hout": 17, + "State": "Sin Acabar", + "Lines": 4, + "m3": 0.04, + "Boxes": 0 + }, + { + "Ticket": 1534033, + "Agency": "ZONA 31", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 14, + "m3": 0.65, + "Boxes": 0 + }, + { + "Ticket": 1534055, + "Agency": "ZONA 32", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 42, + "m3": 1.09, + "Boxes": 0 + }, + { + "Ticket": 1534076, + "Agency": "REC_VILASSAR", + "Worker": "CRISTINA SANCHEZ BARRUGUER", + "Hout": 19, + "State": "OK", + "Lines": 4, + "m3": 0.03, + "Boxes": 0 + }, + { + "Ticket": 1534101, + "Agency": "CORREOSEXPRESS", + "Worker": "JESUS DANIEL VALLES PEREZ", + "Hout": 17, + "State": "Sin Acabar", + "Lines": 1, + "m3": 0.02, + "Boxes": 0 + }, + { + "Ticket": 1534186, + "Agency": "ZONA 32", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 16, + "m3": 0.4, + "Boxes": 0 + }, + { + "Ticket": 1534187, + "Agency": "ZONA 46", + "Worker": "MIGUEL ANGEL LORITE", + "Hout": 15, + "State": "Preparado", + "Lines": 3, + "m3": 0.17, + "Boxes": 0 + }, + { + "Ticket": 1534212, + "Agency": "ZELERIS_10", + "Worker": "RODRIGO HALABI ROCHA", + "Hout": 17, + "State": "Bloqueado", + "Lines": 2, + "m3": 0.07, + "Boxes": 0 + }, + { + "Ticket": 1534223, + "Agency": "ZONA 10", + "Worker": "JESUS DANIEL VALLES PEREZ", + "Hout": 23, + "State": "Sin Acabar", + "Lines": 4, + "m3": 0.05, + "Boxes": 0 + }, + { + "Ticket": 1534236, + "Agency": "REC_MADRID", + "Worker": "COMPUTER SYSTEM", + "Hout": 20, + "State": "Libre", + "Lines": 5, + "m3": 0.04, + "Boxes": 0 + }, + { + "Ticket": 1534240, + "Agency": "ZONA 46", + "Worker": "MARIA JOSE LAMELA FELIPE", + "Hout": 15, + "State": "OK", + "Lines": 47, + "m3": 0.91, + "Boxes": 1 + }, + { + "Ticket": 1534252, + "Agency": "VIAEXPRESS Interdia", + "Worker": "DEMBA SAKHO", + "Hout": 12, + "State": "Encajado", + "Lines": 2, + "m3": 0.02, + "Boxes": 0 + }, + { + "Ticket": 1534258, + "Agency": "ZONA 20", + "Worker": "DANIEL YAREHAM PALOMO", + "Hout": 20, + "State": "OK", + "Lines": 5, + "m3": 0.18, + "Boxes": 0 + }, + { + "Ticket": 1534261, + "Agency": "REC_VILASSAR", + "Worker": "COMPUTER SYSTEM", + "Hout": 19, + "State": "Libre", + "Lines": 5, + "m3": 0.18, + "Boxes": 0 + }, + { + "Ticket": 1534264, + "Agency": "ZONA 20", + "Worker": "JOSE VICENTE DOMINGO SANCHEZ", + "Hout": 20, + "State": "Sin Acabar", + "Lines": 2, + "m3": 0.37, + "Boxes": 2 + }, + { + "Ticket": 1534300, + "Agency": "ZONA 20", + "Worker": "RODRIGO HALABI ROCHA", + "Hout": 20, + "State": "Sin Acabar", + "Lines": 1, + "m3": 0.02, + "Boxes": 0 + }, + { + "Ticket": 1534302, + "Agency": "ZONA 25", + "Worker": "LOLI LOZANO RAEZ", + "Hout": 20, + "State": "OK", + "Lines": 19, + "m3": 1.11, + "Boxes": 0 + }, + { + "Ticket": 1534311, + "Agency": "ZONA 32", + "Worker": "JULIA LLOPIS CASTELL", + "Hout": 19, + "State": "Arreglar", + "Lines": 43, + "m3": 0.8, + "Boxes": 0 + }, + { + "Ticket": 1534315, + "Agency": "ZONA 20", + "Worker": "DANIEL YAREHAM PALOMO", + "Hout": 20, + "State": "Asignado", + "Lines": 6, + "m3": 0.34, + "Boxes": 0 + }, + { + "Ticket": 1534327, + "Agency": "ZONA 43", + "Worker": "COMPUTER SYSTEM", + "Hout": 14, + "State": "Libre", + "Lines": 23, + "m3": 0.41, + "Boxes": 0 + }, + { + "Ticket": 1534354, + "Agency": "ZONA 46", + "Worker": "MARIA DEL MAR GIRBES FERRUS", + "Hout": 15, + "State": "Asignado", + "Lines": 23, + "m3": 1.67, + "Boxes": 0 + }, + { + "Ticket": 1534359, + "Agency": "ZELERIS", + "Worker": "JULIA LLOPIS CASTELL", + "Hout": 17, + "State": "Arreglar", + "Lines": 3, + "m3": 0.06, + "Boxes": 0 + }, + { + "Ticket": 1534366, + "Agency": "REC_SILLA", + "Worker": "COMPUTER SYSTEM", + "Hout": 23, + "State": "Libre", + "Lines": 23, + "m3": 0.4, + "Boxes": 0 + }, + { + "Ticket": 1534385, + "Agency": "ZELERIS", + "Worker": "CARLOS LOPEZ AMORES", + "Hout": 17, + "State": "OK", + "Lines": 4, + "m3": 0.12, + "Boxes": 0 + }, + { + "Ticket": 1534397, + "Agency": "ZONA 20", + "Worker": "JUAN CARLOS LORENZO SANCHEZ", + "Hout": 20, + "State": "OK", + "Lines": 14, + "m3": 0.21, + "Boxes": 0 + }, + { + "Ticket": 1534428, + "Agency": "ZELERIS", + "Worker": "FRAN NATEK ECHEVARRIA", + "Hout": 17, + "State": "OK", + "Lines": 9, + "m3": 0.3, + "Boxes": 0 + }, + { + "Ticket": 1534467, + "Agency": "MRW 24h", + "Worker": "COMPUTER SYSTEM", + "Hout": 17, + "State": "Libre", + "Lines": 15, + "m3": 0.12, + "Boxes": 0 + }, + { + "Ticket": 1534477, + "Agency": "ZONA 11", + "Worker": "CRISTINA SANCHEZ BARRUGUER", + "Hout": 21, + "State": "OK", + "Lines": 8, + "m3": 0.09, + "Boxes": 0 + }, + { + "Ticket": 1534490, + "Agency": "ZONA 43", + "Worker": "JULIA LLOPIS CASTELL", + "Hout": 14, + "State": "Arreglar", + "Lines": 38, + "m3": 1.15, + "Boxes": 0 + }, + { + "Ticket": 1534500, + "Agency": "ZONA 20", + "Worker": "CARLOS LOPEZ AMORES", + "Hout": 20, + "State": "OK", + "Lines": 10, + "m3": 0.35, + "Boxes": 0 + }, + { + "Ticket": 1534504, + "Agency": "ZONA 20", + "Worker": "LOLI LOZANO RAEZ", + "Hout": 20, + "State": "OK", + "Lines": 18, + "m3": 0.18, + "Boxes": 0 + }, + { + "Ticket": 1534505, + "Agency": "ZONA 20", + "Worker": "JUAN BAUTISTA PASTOR REDONDO", + "Hout": 20, + "State": "OK", + "Lines": 5, + "m3": 0.23, + "Boxes": 0 + }, + { + "Ticket": 1534533, + "Agency": "ZONA 45", + "Worker": "DANIEL YAREHAM PALOMO", + "Hout": 24, + "State": "OK", + "Lines": 2, + "m3": 0.25, + "Boxes": 2 + } +] \ No newline at end of file diff --git a/services/production/common/methods/ticket/list.js b/services/production/common/methods/ticket/list.js new file mode 100644 index 000000000..79dad23b9 --- /dev/null +++ b/services/production/common/methods/ticket/list.js @@ -0,0 +1,44 @@ +var json = require("./list-fake.json"); + +module.exports = function(Ticket) { + Ticket.remoteMethod('list', { + description: 'List tickets for production', + /*accepts: { + arg: 'id', + type: 'number', + required: true, + description: 'Model id', + http: {source: 'path'} + },*/ + returns: { + arg: 'tickets', + type: 'object' + }, + http: { + verb: 'get', + path: '/list' + } + }); + + Ticket.list = function(cb) { + //list(); + return fake(cb); + }; + + var fake = function(cb){ + cb(null, json); + } + + var list = function(){ + var params = [1, 0]; + + var query = "CALL production_control_source(?, ?)" + + var cb = function(error, res){ + if(error) console.log(error); + else console.log(res); + }; + + Ticket.rawSql(query, params, cb); + } +} \ No newline at end of file diff --git a/services/production/common/models/Ticket.json b/services/production/common/models/Ticket.json index 16d5e07a5..4ae89da10 100644 --- a/services/production/common/models/Ticket.json +++ b/services/production/common/models/Ticket.json @@ -1,8 +1,14 @@ { "name": "Ticket", - "base": "PersistedModel", + "base": "MyModel", "validateUpsert": true, - "properties": {}, + "properties": { + "id": { + "id": true, + "type": "Number", + "forceId": false + } + }, "acls": [ { "accessType": "*", diff --git a/services/production/common/models/my-model.js b/services/production/common/models/my-model.js index 009b025f3..4d98e7f62 100644 --- a/services/production/common/models/my-model.js +++ b/services/production/common/models/my-model.js @@ -1,5 +1,6 @@ module.exports = function(self) { + self.setup = function() { self.super_.setup.call(this); @@ -25,7 +26,14 @@ module.exports = function(self) { for(let method in disableMethods) { //this.disableRemoteMethod(method, disableMethods[method]); } - } + + }; + + self.rawSql = function(query, params, cb) { + this.dataSource.connector.execute(query, params, function(error, response) { + cb(error, response); + }); + }; self.installMethod = function(methodName, filterCb) { this.remoteMethod(methodName, { diff --git a/services/production/common/models/state.json b/services/production/common/models/state.json new file mode 100644 index 000000000..97e2eecf3 --- /dev/null +++ b/services/production/common/models/state.json @@ -0,0 +1,30 @@ +{ + "name": "State", + "base": "MyModel", + "validateUpsert": true, + "properties": { + "id": { + "id": true, + "type": "Number", + "forceId": false + }, + "name": { + "type": "String", + "required": false + } + }, + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "root", + "permission": "ALLOW" + } + ] +} diff --git a/services/production/common/models/ticket-state.json b/services/production/common/models/ticket-state.json new file mode 100644 index 000000000..5f919ff2a --- /dev/null +++ b/services/production/common/models/ticket-state.json @@ -0,0 +1,47 @@ +{ + "name": "TicketState", + "base": "MyModel", + "validateUpsert": true, + "properties": { + "id": { + "id": true, + "type": "Number", + "forceId": false + }, + "updated": { + "type": "Date", + "required": false + } + }, + "relations": { + "ticket": { + "type": "belongsTo", + "model": "Ticket", + "foreignKey": "ticketFk" + }, + "state": { + "type": "belongsTo", + "model": "State", + "foreignKey": "stateFk" + }, + "employee": { + "type": "belongsTo", + "model": "Employee", + "foreignKey": "employeeFk" + } + }, + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "root", + "permission": "ALLOW" + } + ] +} diff --git a/services/production/common/models/ticket.js b/services/production/common/models/ticket.js new file mode 100644 index 000000000..ab62f6309 --- /dev/null +++ b/services/production/common/models/ticket.js @@ -0,0 +1,9 @@ +var app = require('../../server/server'); + +module.exports = function(Ticket) { + var models = app.models; + + // Methods + + require('../methods/ticket/list.js')(Ticket); +}; \ No newline at end of file diff --git a/services/production/server/model-config.json b/services/production/server/model-config.json index 8a1204120..7f29155b0 100644 --- a/services/production/server/model-config.json +++ b/services/production/server/model-config.json @@ -13,23 +13,44 @@ "./mixins" ] }, - "User": { - "dataSource": "db" + "user": { + "dataSource": "auth" }, "AccessToken": { - "dataSource": "db", - "public": false + "dataSource": "auth", + "relations": { + "user": { + "type": "belongsTo", + "model": "user", + "foreignKey": "userId" + } + } }, "ACL": { - "dataSource": "db", + "dataSource": "auth", "public": false }, "RoleMapping": { - "dataSource": "db", + "dataSource": "auth", "public": false }, "Role": { - "dataSource": "db", + "dataSource": "auth", "public": false + }, + "Account": { + "dataSource": "auth" + }, + "Ticket": { + "dataSource": "vn", + "public": true + }, + "State":{ + "dataSource": "vn", + "public": true + }, + "TicketState":{ + "dataSource": "vn", + "public": true } } diff --git a/services/service/models/my-model.js b/services/service/models/my-model.js index 009b025f3..4d98e7f62 100644 --- a/services/service/models/my-model.js +++ b/services/service/models/my-model.js @@ -1,5 +1,6 @@ module.exports = function(self) { + self.setup = function() { self.super_.setup.call(this); @@ -25,7 +26,14 @@ module.exports = function(self) { for(let method in disableMethods) { //this.disableRemoteMethod(method, disableMethods[method]); } - } + + }; + + self.rawSql = function(query, params, cb) { + this.dataSource.connector.execute(query, params, function(error, response) { + cb(error, response); + }); + }; self.installMethod = function(methodName, filterCb) { this.remoteMethod(methodName, { From ecf347e7e22ac9321ae09a67d9a9135d69033ea8 Mon Sep 17 00:00:00 2001 From: nelo Date: Tue, 13 Jun 2017 09:07:14 +0200 Subject: [PATCH 15/98] modificaciones fake --- .../common/methods/ticket/list-fake.json | 404 +++++++++--------- 1 file changed, 202 insertions(+), 202 deletions(-) diff --git a/services/production/common/methods/ticket/list-fake.json b/services/production/common/methods/ticket/list-fake.json index 34c5e714e..f8fcce9f8 100644 --- a/services/production/common/methods/ticket/list-fake.json +++ b/services/production/common/methods/ticket/list-fake.json @@ -3,1010 +3,1010 @@ "Ticket": 1532629, "Agency": "REC_MADRID", "Worker": "LOLI LOZANO RAEZ", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 2, - "m3": 0.03, + "M3": 0.03, "Boxes": 0 }, { "Ticket": 1532645, "Agency": "CORREOSEXPRESS", "Worker": "COMPUTER SYSTEM", - "Hout": 17, + "Hour": 17, "State": "Libre", "Lines": 9, - "m3": 0.21, + "M3": 0.21, "Boxes": 0 }, { "Ticket": 1532656, "Agency": "ZONA 32", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 35, - "m3": 0.42, + "M3": 0.42, "Boxes": 0 }, { "Ticket": 1532690, "Agency": "MRW 24h", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 4, - "m3": 0.21, + "M3": 0.21, "Boxes": 0 }, { "Ticket": 1532729, "Agency": "ZONA 25", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 17, - "m3": 0.45, + "M3": 0.45, "Boxes": 0 }, { "Ticket": 1532742, "Agency": "CORREOSEXPRESS", "Worker": "DEMBA SAKHO", - "Hout": 17, + "Hour": 17, "State": "Encajado", "Lines": 13, - "m3": 0.27, + "M3": 0.27, "Boxes": 0 }, { "Ticket": 1532792, "Agency": "ZONA 25", "Worker": "JUAN BAUTISTA PASTOR REDONDO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 10, - "m3": 0.26, + "M3": 0.26, "Boxes": 0 }, { "Ticket": 1532803, "Agency": "ZONA 31", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 12, - "m3": 0.49, + "M3": 0.49, "Boxes": 0 }, { "Ticket": 1532812, "Agency": "ZELERIS", "Worker": "JULIA LLOPIS CASTELL", - "Hout": 17, + "Hour": 17, "State": "Arreglar", "Lines": 19, - "m3": 0.67, + "M3": 0.67, "Boxes": 0 }, { "Ticket": 1532879, "Agency": "ZONA 20", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 1, - "m3": 0.41, + "M3": 0.41, "Boxes": 0 }, { "Ticket": 1532880, "Agency": "ZONA 20", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 8, - "m3": 0.08, + "M3": 0.08, "Boxes": 0 }, { "Ticket": 1532923, "Agency": "ZONA 20", "Worker": "JESUS DANIEL VALLES PEREZ", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 30, - "m3": 0.63, + "M3": 0.63, "Boxes": 1 }, { "Ticket": 1532995, "Agency": "ZONA 20", "Worker": "DANIEL YAREHAM PALOMO", - "Hout": 20, + "Hour": 20, "State": "Arreglar", "Lines": 54, - "m3": 1.62, + "M3": 1.62, "Boxes": 0 }, { "Ticket": 1533009, "Agency": "ZONA 25", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 20, + "Hour": 20, "State": "Sin Acabar", "Lines": 38, - "m3": 0.78, + "M3": 0.78, "Boxes": 0 }, { "Ticket": 1533051, "Agency": "MRW 24h", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 17, + "Hour": 17, "State": "Sin Acabar", "Lines": 19, - "m3": 0.91, + "M3": 0.91, "Boxes": 2 }, { "Ticket": 1533064, "Agency": "MRW 24h", "Worker": "JOSE JAVIER ECHEVARRIA", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 11, - "m3": 0.22, + "M3": 0.22, "Boxes": 0 }, { "Ticket": 1533102, "Agency": "MRW 24h", "Worker": "LOLI LOZANO RAEZ", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 9, - "m3": 0.35, + "M3": 0.35, "Boxes": 0 }, { "Ticket": 1533151, "Agency": "ZONA 32", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 7, - "m3": 0.05, + "M3": 0.05, "Boxes": 0 }, { "Ticket": 1533182, "Agency": "ZONA 25", "Worker": "CARLOS LOPEZ AMORES", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 20, - "m3": 0.26, + "M3": 0.26, "Boxes": 0 }, { "Ticket": 1533257, "Agency": "MRW 24h", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 14, - "m3": 0.07, + "M3": 0.07, "Boxes": 0 }, { "Ticket": 1533279, "Agency": "ZONA 46", "Worker": "RICARD SENDRA", - "Hout": 15, + "Hour": 15, "State": "Impreso", "Lines": 50, - "m3": 1.05, + "M3": 1.05, "Boxes": 2 }, { "Ticket": 1533284, "Agency": "ZONA 20", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 18, - "m3": 0.21, + "M3": 0.21, "Boxes": 0 }, { "Ticket": 1533314, "Agency": "MRW 24h", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 3, - "m3": 0.05, + "M3": 0.05, "Boxes": 0 }, { "Ticket": 1533316, "Agency": "ZONA 25", "Worker": "LOLI LOZANO RAEZ", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 17, - "m3": 0.49, + "M3": 0.49, "Boxes": 0 }, { "Ticket": 1533319, "Agency": "ZONA 25", "Worker": "ELENA BASCUÑANA TORNERO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 2, - "m3": 0.04, + "M3": 0.04, "Boxes": 0 }, { "Ticket": 1533327, "Agency": "ZONA 25", "Worker": "FRAN NATEK ECHEVARRIA", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 13, - "m3": 0.32, + "M3": 0.32, "Boxes": 0 }, { "Ticket": 1533339, "Agency": "ZONA 20", "Worker": "ELENA BASCUÑANA TORNERO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 9, - "m3": 0.17, + "M3": 0.17, "Boxes": 0 }, { "Ticket": 1533340, "Agency": "ZONA 25", "Worker": "JULIA LLOPIS CASTELL", - "Hout": 20, + "Hour": 20, "State": "Arreglar", "Lines": 48, - "m3": 1.59, + "M3": 1.59, "Boxes": 4.5 }, { "Ticket": 1533345, "Agency": "ZONA 31", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 56, - "m3": 0.79, + "M3": 0.79, "Boxes": 0 }, { "Ticket": 1533349, "Agency": "ZONA 20", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 12, - "m3": 0.34, + "M3": 0.34, "Boxes": 0 }, { "Ticket": 1533353, "Agency": "ZONA 11", "Worker": "COMPUTER SYSTEM", - "Hout": 21, + "Hour": 21, "State": "Libre", "Lines": 10, - "m3": 0.08, + "M3": 0.08, "Boxes": 0 }, { "Ticket": 1533359, "Agency": "ZONA 20", "Worker": "CARLOS LOPEZ AMORES", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 9, - "m3": 0.52, + "M3": 0.52, "Boxes": 0 }, { "Ticket": 1533369, "Agency": "INTEGRA2", "Worker": "CARLOS LOPEZ AMORES", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 7, - "m3": 0.1, + "M3": 0.1, "Boxes": 0 }, { "Ticket": 1533392, "Agency": "ZONA 25", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 16, - "m3": 0.35, + "M3": 0.35, "Boxes": 0 }, { "Ticket": 1533403, "Agency": "ZONA 31", "Worker": "Mª CARMEN SERRANO BAU", - "Hout": 19, + "Hour": 19, "State": "OK", "Lines": 1, - "m3": 2.04, + "M3": 2.04, "Boxes": 0 }, { "Ticket": 1533412, "Agency": "ZELERIS", "Worker": "CARLOS BORRAS MARTINEZ", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 5, - "m3": 0.04, + "M3": 0.04, "Boxes": 0 }, { "Ticket": 1533425, "Agency": "INTEGRA2", "Worker": "CARLOS LOPEZ AMORES", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 11, - "m3": 0.14, + "M3": 0.14, "Boxes": 0 }, { "Ticket": 1533429, "Agency": "ZONA 25", "Worker": "DANIEL YAREHAM PALOMO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 43, - "m3": 0.6, + "M3": 0.6, "Boxes": 0 }, { "Ticket": 1533438, "Agency": "ZELERIS", "Worker": "MIGUEL ANGEL LORITE", - "Hout": 17, + "Hour": 17, "State": "Preparación", "Lines": 10, - "m3": 0.17, + "M3": 0.17, "Boxes": 0 }, { "Ticket": 1533482, "Agency": "ZONA 25", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 20, + "Hour": 20, "State": "Sin Acabar", "Lines": 30, - "m3": 0.42, + "M3": 0.42, "Boxes": 0 }, { "Ticket": 1533486, "Agency": "DHL", "Worker": "JOSE JAVIER ECHEVARRIA", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 28, - "m3": 0.25, + "M3": 0.25, "Boxes": 0 }, { "Ticket": 1533495, "Agency": "REC_VILASSAR", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 16, - "m3": 0.08, + "M3": 0.08, "Boxes": 0 }, { "Ticket": 1533507, "Agency": "MRW 24h", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 16, - "m3": 0.39, + "M3": 0.39, "Boxes": 0 }, { "Ticket": 1533557, "Agency": "ZONA 11", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 21, + "Hour": 21, "State": "OK", "Lines": 50, - "m3": 1.16, + "M3": 1.16, "Boxes": 0 }, { "Ticket": 1533566, "Agency": "ZONA 10", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 23, + "Hour": 23, "State": "Sin Acabar", "Lines": 14, - "m3": 0.18, + "M3": 0.18, "Boxes": 0 }, { "Ticket": 1533570, "Agency": "MRW 24h", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 13, - "m3": 0.17, + "M3": 0.17, "Boxes": 0 }, { "Ticket": 1533580, "Agency": "ZELERIS_10", "Worker": "DEMBA SAKHO", - "Hout": 17, + "Hour": 17, "State": "Encajado", "Lines": 4, - "m3": 0.13, + "M3": 0.13, "Boxes": 0 }, { "Ticket": 1533584, "Agency": "ZONA 20", "Worker": "JESUS DANIEL VALLES PEREZ", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 20, - "m3": 0.67, + "M3": 0.67, "Boxes": 0 }, { "Ticket": 1533585, "Agency": "ZELERIS_10", "Worker": "FRAN NATEK ECHEVARRIA", - "Hout": 17, + "Hour": 17, "State": "Sin Acabar", "Lines": 1, - "m3": 0.01, + "M3": 0.01, "Boxes": 0 }, { "Ticket": 1533591, "Agency": "ZONA 46", "Worker": "JUANLU GALLETERO", - "Hout": 15, + "Hour": 15, "State": "Revisado", "Lines": 16, - "m3": 0.3, + "M3": 0.3, "Boxes": 0 }, { "Ticket": 1533641, "Agency": "ZONA 25", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 28, - "m3": 0.75, + "M3": 0.75, "Boxes": 0 }, { "Ticket": 1533685, "Agency": "ZONA 20", "Worker": "Mª CARMEN SERRANO BAU", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 39, - "m3": 0.78, + "M3": 0.78, "Boxes": 1 }, { "Ticket": 1533688, "Agency": "ZONA 20", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 7, - "m3": 0.19, + "M3": 0.19, "Boxes": 0 }, { "Ticket": 1533795, "Agency": "ZONA 25", "Worker": "MANOLI PULIDO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 16, - "m3": 0.3, + "M3": 0.3, "Boxes": 0 }, { "Ticket": 1533797, "Agency": "ZONA 25", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 20, - "m3": 0.33, + "M3": 0.33, "Boxes": 0 }, { "Ticket": 1533807, "Agency": "ZONA 25", "Worker": "ESDENKA CALERO PEREZ", - "Hout": 20, + "Hour": 20, "State": "Arreglar", "Lines": 16, - "m3": 0.14, + "M3": 0.14, "Boxes": 0 }, { "Ticket": 1533815, "Agency": "ZELERIS_10", "Worker": "RODRIGO HALABI ROCHA", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 15, - "m3": 0.2, + "M3": 0.2, "Boxes": 0 }, { "Ticket": 1533849, "Agency": "MRW 24h", "Worker": "JUAN CARLOS LORENZO SANCHEZ", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 18, - "m3": 0.25, + "M3": 0.25, "Boxes": 0 }, { "Ticket": 1533852, "Agency": "MRW 24h", "Worker": "DANIEL YAREHAM PALOMO", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 17, - "m3": 0.68, + "M3": 0.68, "Boxes": 0 }, { "Ticket": 1533854, "Agency": "ZONA 20", "Worker": "MANOLI PULIDO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 11, - "m3": 0.13, + "M3": 0.13, "Boxes": 0 }, { "Ticket": 1533863, "Agency": "ZELERIS_10", "Worker": "DEMBA SAKHO", - "Hout": 17, + "Hour": 17, "State": "Encajado", "Lines": 6, - "m3": 0.16, + "M3": 0.16, "Boxes": 0 }, { "Ticket": 1533882, "Agency": "ZONA 20", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 9, - "m3": 0.44, + "M3": 0.44, "Boxes": 0 }, { "Ticket": 1533889, "Agency": "MRW 24h", "Worker": "ELENA BASCUÑANA TORNERO", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 10, - "m3": 0.5, + "M3": 0.5, "Boxes": 0 }, { "Ticket": 1533893, "Agency": "ZONA 32", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 2, - "m3": 0.13, + "M3": 0.13, "Boxes": 0 }, { "Ticket": 1533915, "Agency": "CORREOSEXPRESS", "Worker": "JUAN BAUTISTA PASTOR REDONDO", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 9, - "m3": 0.36, + "M3": 0.36, "Boxes": 0 }, { "Ticket": 1533919, "Agency": "ZONA 20", "Worker": "JULIA LLOPIS CASTELL", - "Hout": 20, + "Hour": 20, "State": "Arreglar", "Lines": 16, - "m3": 0.23, + "M3": 0.23, "Boxes": 0 }, { "Ticket": 1533983, "Agency": "ZONA 11", "Worker": "MANOLI PULIDO", - "Hout": 21, + "Hour": 21, "State": "OK", "Lines": 30, - "m3": 1.92, + "M3": 1.92, "Boxes": 0 }, { "Ticket": 1533992, "Agency": "ZONA 25", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 32, - "m3": 0.23, + "M3": 0.23, "Boxes": 0 }, { "Ticket": 1534032, "Agency": "MRW 24h", "Worker": "JESUS DANIEL VALLES PEREZ", - "Hout": 17, + "Hour": 17, "State": "Sin Acabar", "Lines": 4, - "m3": 0.04, + "M3": 0.04, "Boxes": 0 }, { "Ticket": 1534033, "Agency": "ZONA 31", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 14, - "m3": 0.65, + "M3": 0.65, "Boxes": 0 }, { "Ticket": 1534055, "Agency": "ZONA 32", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 42, - "m3": 1.09, + "M3": 1.09, "Boxes": 0 }, { "Ticket": 1534076, "Agency": "REC_VILASSAR", "Worker": "CRISTINA SANCHEZ BARRUGUER", - "Hout": 19, + "Hour": 19, "State": "OK", "Lines": 4, - "m3": 0.03, + "M3": 0.03, "Boxes": 0 }, { "Ticket": 1534101, "Agency": "CORREOSEXPRESS", "Worker": "JESUS DANIEL VALLES PEREZ", - "Hout": 17, + "Hour": 17, "State": "Sin Acabar", "Lines": 1, - "m3": 0.02, + "M3": 0.02, "Boxes": 0 }, { "Ticket": 1534186, "Agency": "ZONA 32", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 16, - "m3": 0.4, + "M3": 0.4, "Boxes": 0 }, { "Ticket": 1534187, "Agency": "ZONA 46", "Worker": "MIGUEL ANGEL LORITE", - "Hout": 15, + "Hour": 15, "State": "Preparado", "Lines": 3, - "m3": 0.17, + "M3": 0.17, "Boxes": 0 }, { "Ticket": 1534212, "Agency": "ZELERIS_10", "Worker": "RODRIGO HALABI ROCHA", - "Hout": 17, + "Hour": 17, "State": "Bloqueado", "Lines": 2, - "m3": 0.07, + "M3": 0.07, "Boxes": 0 }, { "Ticket": 1534223, "Agency": "ZONA 10", "Worker": "JESUS DANIEL VALLES PEREZ", - "Hout": 23, + "Hour": 23, "State": "Sin Acabar", "Lines": 4, - "m3": 0.05, + "M3": 0.05, "Boxes": 0 }, { "Ticket": 1534236, "Agency": "REC_MADRID", "Worker": "COMPUTER SYSTEM", - "Hout": 20, + "Hour": 20, "State": "Libre", "Lines": 5, - "m3": 0.04, + "M3": 0.04, "Boxes": 0 }, { "Ticket": 1534240, "Agency": "ZONA 46", "Worker": "MARIA JOSE LAMELA FELIPE", - "Hout": 15, + "Hour": 15, "State": "OK", "Lines": 47, - "m3": 0.91, + "M3": 0.91, "Boxes": 1 }, { "Ticket": 1534252, "Agency": "VIAEXPRESS Interdia", "Worker": "DEMBA SAKHO", - "Hout": 12, + "Hour": 12, "State": "Encajado", "Lines": 2, - "m3": 0.02, + "M3": 0.02, "Boxes": 0 }, { "Ticket": 1534258, "Agency": "ZONA 20", "Worker": "DANIEL YAREHAM PALOMO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 5, - "m3": 0.18, + "M3": 0.18, "Boxes": 0 }, { "Ticket": 1534261, "Agency": "REC_VILASSAR", "Worker": "COMPUTER SYSTEM", - "Hout": 19, + "Hour": 19, "State": "Libre", "Lines": 5, - "m3": 0.18, + "M3": 0.18, "Boxes": 0 }, { "Ticket": 1534264, "Agency": "ZONA 20", "Worker": "JOSE VICENTE DOMINGO SANCHEZ", - "Hout": 20, + "Hour": 20, "State": "Sin Acabar", "Lines": 2, - "m3": 0.37, + "M3": 0.37, "Boxes": 2 }, { "Ticket": 1534300, "Agency": "ZONA 20", "Worker": "RODRIGO HALABI ROCHA", - "Hout": 20, + "Hour": 20, "State": "Sin Acabar", "Lines": 1, - "m3": 0.02, + "M3": 0.02, "Boxes": 0 }, { "Ticket": 1534302, "Agency": "ZONA 25", "Worker": "LOLI LOZANO RAEZ", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 19, - "m3": 1.11, + "M3": 1.11, "Boxes": 0 }, { "Ticket": 1534311, "Agency": "ZONA 32", "Worker": "JULIA LLOPIS CASTELL", - "Hout": 19, + "Hour": 19, "State": "Arreglar", "Lines": 43, - "m3": 0.8, + "M3": 0.8, "Boxes": 0 }, { "Ticket": 1534315, "Agency": "ZONA 20", "Worker": "DANIEL YAREHAM PALOMO", - "Hout": 20, + "Hour": 20, "State": "Asignado", "Lines": 6, - "m3": 0.34, + "M3": 0.34, "Boxes": 0 }, { "Ticket": 1534327, "Agency": "ZONA 43", "Worker": "COMPUTER SYSTEM", - "Hout": 14, + "Hour": 14, "State": "Libre", "Lines": 23, - "m3": 0.41, + "M3": 0.41, "Boxes": 0 }, { "Ticket": 1534354, "Agency": "ZONA 46", "Worker": "MARIA DEL MAR GIRBES FERRUS", - "Hout": 15, + "Hour": 15, "State": "Asignado", "Lines": 23, - "m3": 1.67, + "M3": 1.67, "Boxes": 0 }, { "Ticket": 1534359, "Agency": "ZELERIS", "Worker": "JULIA LLOPIS CASTELL", - "Hout": 17, + "Hour": 17, "State": "Arreglar", "Lines": 3, - "m3": 0.06, + "M3": 0.06, "Boxes": 0 }, { "Ticket": 1534366, "Agency": "REC_SILLA", "Worker": "COMPUTER SYSTEM", - "Hout": 23, + "Hour": 23, "State": "Libre", "Lines": 23, - "m3": 0.4, + "M3": 0.4, "Boxes": 0 }, { "Ticket": 1534385, "Agency": "ZELERIS", "Worker": "CARLOS LOPEZ AMORES", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 4, - "m3": 0.12, + "M3": 0.12, "Boxes": 0 }, { "Ticket": 1534397, "Agency": "ZONA 20", "Worker": "JUAN CARLOS LORENZO SANCHEZ", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 14, - "m3": 0.21, + "M3": 0.21, "Boxes": 0 }, { "Ticket": 1534428, "Agency": "ZELERIS", "Worker": "FRAN NATEK ECHEVARRIA", - "Hout": 17, + "Hour": 17, "State": "OK", "Lines": 9, - "m3": 0.3, + "M3": 0.3, "Boxes": 0 }, { "Ticket": 1534467, "Agency": "MRW 24h", "Worker": "COMPUTER SYSTEM", - "Hout": 17, + "Hour": 17, "State": "Libre", "Lines": 15, - "m3": 0.12, + "M3": 0.12, "Boxes": 0 }, { "Ticket": 1534477, "Agency": "ZONA 11", "Worker": "CRISTINA SANCHEZ BARRUGUER", - "Hout": 21, + "Hour": 21, "State": "OK", "Lines": 8, - "m3": 0.09, + "M3": 0.09, "Boxes": 0 }, { "Ticket": 1534490, "Agency": "ZONA 43", "Worker": "JULIA LLOPIS CASTELL", - "Hout": 14, + "Hour": 14, "State": "Arreglar", "Lines": 38, - "m3": 1.15, + "M3": 1.15, "Boxes": 0 }, { "Ticket": 1534500, "Agency": "ZONA 20", "Worker": "CARLOS LOPEZ AMORES", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 10, - "m3": 0.35, + "M3": 0.35, "Boxes": 0 }, { "Ticket": 1534504, "Agency": "ZONA 20", "Worker": "LOLI LOZANO RAEZ", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 18, - "m3": 0.18, + "M3": 0.18, "Boxes": 0 }, { "Ticket": 1534505, "Agency": "ZONA 20", "Worker": "JUAN BAUTISTA PASTOR REDONDO", - "Hout": 20, + "Hour": 20, "State": "OK", "Lines": 5, - "m3": 0.23, + "M3": 0.23, "Boxes": 0 }, { "Ticket": 1534533, "Agency": "ZONA 45", "Worker": "DANIEL YAREHAM PALOMO", - "Hout": 24, + "Hour": 24, "State": "OK", "Lines": 2, - "m3": 0.25, + "M3": 0.25, "Boxes": 2 } ] \ No newline at end of file From cbc364db3827bcc8df8a8e8fa197bdc90c6edb39 Mon Sep 17 00:00:00 2001 From: nelo Date: Tue, 13 Jun 2017 11:26:54 +0200 Subject: [PATCH 16/98] get states production --- .../production/common/methods/state/find.js | 31 +++++++++++++++++++ services/production/common/models/state.js | 9 ++++++ services/production/common/models/state.json | 14 ++++++++- .../common/models/ticket-state.json | 2 +- services/production/server/datasources.json | 27 +++++++++++++++- 5 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 services/production/common/methods/state/find.js create mode 100644 services/production/common/models/state.js diff --git a/services/production/common/methods/state/find.js b/services/production/common/methods/state/find.js new file mode 100644 index 000000000..f40937891 --- /dev/null +++ b/services/production/common/methods/state/find.js @@ -0,0 +1,31 @@ +module.exports = function(State) { + State.remoteMethod('productionStates', { + description: 'Get production states', + returns: { + arg: 'states', + type: 'object' + }, + http: { + verb: 'get', + path: '/productionStates' + } + }); + + State.productionStates = function(cb) { + State.find(where(), function(err, states) { + if(!err){ + cb(null, states); + } + }); + }; + + function where() { + return { + where: { + "order": {gt: 0} + }, + order: "order, name" + } + } + +} \ No newline at end of file diff --git a/services/production/common/models/state.js b/services/production/common/models/state.js new file mode 100644 index 000000000..aef20d465 --- /dev/null +++ b/services/production/common/models/state.js @@ -0,0 +1,9 @@ +var app = require('../../server/server'); + +module.exports = function(State) { + var models = app.models; + + // Methods + + require('../methods/state/find.js')(State); +}; \ No newline at end of file diff --git a/services/production/common/models/state.json b/services/production/common/models/state.json index 97e2eecf3..9dff62432 100644 --- a/services/production/common/models/state.json +++ b/services/production/common/models/state.json @@ -3,7 +3,7 @@ "base": "MyModel", "validateUpsert": true, "properties": { - "id": { + "id": { "id": true, "type": "Number", "forceId": false @@ -11,6 +11,18 @@ "name": { "type": "String", "required": false + }, + "order":{ + "type": "Number", + "required": false + }, + "alertLevel":{ + "type": "Number", + "required": false + }, + "code":{ + "type": "String", + "required": false } }, "acls": [ diff --git a/services/production/common/models/ticket-state.json b/services/production/common/models/ticket-state.json index 5f919ff2a..8ece52942 100644 --- a/services/production/common/models/ticket-state.json +++ b/services/production/common/models/ticket-state.json @@ -3,7 +3,7 @@ "base": "MyModel", "validateUpsert": true, "properties": { - "id": { + "id": { "id": true, "type": "Number", "forceId": false diff --git a/services/production/server/datasources.json b/services/production/server/datasources.json index d6caf56d4..ba7db7577 100644 --- a/services/production/server/datasources.json +++ b/services/production/server/datasources.json @@ -1,6 +1,31 @@ { "db": { "name": "db", - "connector": "memory" + "connector": "memory", + "file": "db.json" + }, + "auth": { + "name": "mysql", + "connector": "mysql", + "database": "salix", + "debug": false, + "host": "localhost", + "port": 3306, + "username": "root", + "password": "", + "connectTimeout": 20000, + "acquireTimeout": 20000 + }, + "vn": { + "name": "mysql", + "connector": "mysql", + "database": "salix", + "debug": false, + "host": "localhost", + "port": 3306, + "username": "root", + "password": "", + "connectTimeout": 20000, + "acquireTimeout": 20000 } } From 87857488c0d692424e6c658f87e1c65b48cb1831 Mon Sep 17 00:00:00 2001 From: nelo Date: Tue, 13 Jun 2017 12:00:11 +0200 Subject: [PATCH 17/98] modificaciones fake son --- .../common/methods/ticket/list-fake.json | 2420 ++++++++++------- 1 file changed, 1412 insertions(+), 1008 deletions(-) diff --git a/services/production/common/methods/ticket/list-fake.json b/services/production/common/methods/ticket/list-fake.json index f8fcce9f8..26089c37a 100644 --- a/services/production/common/methods/ticket/list-fake.json +++ b/services/production/common/methods/ticket/list-fake.json @@ -1,1012 +1,1416 @@ [ { - "Ticket": 1532629, - "Agency": "REC_MADRID", - "Worker": "LOLI LOZANO RAEZ", - "Hour": 20, - "State": "OK", - "Lines": 2, - "M3": 0.03, - "Boxes": 0 - }, - { - "Ticket": 1532645, - "Agency": "CORREOSEXPRESS", - "Worker": "COMPUTER SYSTEM", - "Hour": 17, - "State": "Libre", - "Lines": 9, - "M3": 0.21, - "Boxes": 0 - }, - { - "Ticket": 1532656, - "Agency": "ZONA 32", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 35, - "M3": 0.42, - "Boxes": 0 - }, - { - "Ticket": 1532690, - "Agency": "MRW 24h", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 17, - "State": "OK", - "Lines": 4, - "M3": 0.21, - "Boxes": 0 - }, - { - "Ticket": 1532729, - "Agency": "ZONA 25", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 17, - "M3": 0.45, - "Boxes": 0 - }, - { - "Ticket": 1532742, - "Agency": "CORREOSEXPRESS", - "Worker": "DEMBA SAKHO", - "Hour": 17, - "State": "Encajado", - "Lines": 13, - "M3": 0.27, - "Boxes": 0 - }, - { - "Ticket": 1532792, - "Agency": "ZONA 25", - "Worker": "JUAN BAUTISTA PASTOR REDONDO", - "Hour": 20, - "State": "OK", - "Lines": 10, - "M3": 0.26, - "Boxes": 0 - }, - { - "Ticket": 1532803, - "Agency": "ZONA 31", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 12, - "M3": 0.49, - "Boxes": 0 - }, - { - "Ticket": 1532812, - "Agency": "ZELERIS", - "Worker": "JULIA LLOPIS CASTELL", - "Hour": 17, - "State": "Arreglar", - "Lines": 19, - "M3": 0.67, - "Boxes": 0 - }, - { - "Ticket": 1532879, - "Agency": "ZONA 20", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 20, - "State": "OK", - "Lines": 1, - "M3": 0.41, - "Boxes": 0 - }, - { - "Ticket": 1532880, - "Agency": "ZONA 20", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 8, - "M3": 0.08, - "Boxes": 0 - }, - { - "Ticket": 1532923, - "Agency": "ZONA 20", - "Worker": "JESUS DANIEL VALLES PEREZ", - "Hour": 20, - "State": "OK", - "Lines": 30, - "M3": 0.63, - "Boxes": 1 - }, - { - "Ticket": 1532995, - "Agency": "ZONA 20", - "Worker": "DANIEL YAREHAM PALOMO", - "Hour": 20, - "State": "Arreglar", - "Lines": 54, - "M3": 1.62, - "Boxes": 0 - }, - { - "Ticket": 1533009, - "Agency": "ZONA 25", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 20, - "State": "Sin Acabar", - "Lines": 38, - "M3": 0.78, - "Boxes": 0 - }, - { - "Ticket": 1533051, - "Agency": "MRW 24h", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 17, - "State": "Sin Acabar", - "Lines": 19, - "M3": 0.91, - "Boxes": 2 - }, - { - "Ticket": 1533064, - "Agency": "MRW 24h", - "Worker": "JOSE JAVIER ECHEVARRIA", - "Hour": 17, - "State": "OK", - "Lines": 11, - "M3": 0.22, - "Boxes": 0 - }, - { - "Ticket": 1533102, - "Agency": "MRW 24h", - "Worker": "LOLI LOZANO RAEZ", - "Hour": 17, - "State": "OK", - "Lines": 9, - "M3": 0.35, - "Boxes": 0 - }, - { - "Ticket": 1533151, - "Agency": "ZONA 32", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 7, - "M3": 0.05, - "Boxes": 0 - }, - { - "Ticket": 1533182, - "Agency": "ZONA 25", - "Worker": "CARLOS LOPEZ AMORES", - "Hour": 20, - "State": "OK", - "Lines": 20, - "M3": 0.26, - "Boxes": 0 - }, - { - "Ticket": 1533257, - "Agency": "MRW 24h", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 17, - "State": "OK", - "Lines": 14, - "M3": 0.07, - "Boxes": 0 - }, - { - "Ticket": 1533279, - "Agency": "ZONA 46", - "Worker": "RICARD SENDRA", - "Hour": 15, - "State": "Impreso", - "Lines": 50, - "M3": 1.05, - "Boxes": 2 - }, - { - "Ticket": 1533284, - "Agency": "ZONA 20", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 20, - "State": "OK", - "Lines": 18, - "M3": 0.21, - "Boxes": 0 - }, - { - "Ticket": 1533314, - "Agency": "MRW 24h", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 17, - "State": "OK", - "Lines": 3, - "M3": 0.05, - "Boxes": 0 - }, - { - "Ticket": 1533316, - "Agency": "ZONA 25", - "Worker": "LOLI LOZANO RAEZ", - "Hour": 20, - "State": "OK", - "Lines": 17, - "M3": 0.49, - "Boxes": 0 - }, - { - "Ticket": 1533319, - "Agency": "ZONA 25", - "Worker": "ELENA BASCUÑANA TORNERO", - "Hour": 20, - "State": "OK", - "Lines": 2, - "M3": 0.04, - "Boxes": 0 - }, - { - "Ticket": 1533327, - "Agency": "ZONA 25", - "Worker": "FRAN NATEK ECHEVARRIA", - "Hour": 20, - "State": "OK", - "Lines": 13, - "M3": 0.32, - "Boxes": 0 - }, - { - "Ticket": 1533339, - "Agency": "ZONA 20", - "Worker": "ELENA BASCUÑANA TORNERO", - "Hour": 20, - "State": "OK", - "Lines": 9, - "M3": 0.17, - "Boxes": 0 - }, - { - "Ticket": 1533340, - "Agency": "ZONA 25", - "Worker": "JULIA LLOPIS CASTELL", - "Hour": 20, - "State": "Arreglar", - "Lines": 48, - "M3": 1.59, - "Boxes": 4.5 - }, - { - "Ticket": 1533345, - "Agency": "ZONA 31", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 56, - "M3": 0.79, - "Boxes": 0 - }, - { - "Ticket": 1533349, - "Agency": "ZONA 20", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 12, - "M3": 0.34, - "Boxes": 0 - }, - { - "Ticket": 1533353, - "Agency": "ZONA 11", - "Worker": "COMPUTER SYSTEM", - "Hour": 21, - "State": "Libre", - "Lines": 10, - "M3": 0.08, - "Boxes": 0 - }, - { - "Ticket": 1533359, - "Agency": "ZONA 20", - "Worker": "CARLOS LOPEZ AMORES", - "Hour": 20, - "State": "OK", - "Lines": 9, - "M3": 0.52, - "Boxes": 0 - }, - { - "Ticket": 1533369, - "Agency": "INTEGRA2", - "Worker": "CARLOS LOPEZ AMORES", - "Hour": 17, - "State": "OK", - "Lines": 7, - "M3": 0.1, - "Boxes": 0 - }, - { - "Ticket": 1533392, - "Agency": "ZONA 25", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 16, - "M3": 0.35, - "Boxes": 0 - }, - { - "Ticket": 1533403, - "Agency": "ZONA 31", - "Worker": "Mª CARMEN SERRANO BAU", - "Hour": 19, - "State": "OK", - "Lines": 1, - "M3": 2.04, - "Boxes": 0 - }, - { - "Ticket": 1533412, - "Agency": "ZELERIS", - "Worker": "CARLOS BORRAS MARTINEZ", - "Hour": 17, - "State": "OK", - "Lines": 5, - "M3": 0.04, - "Boxes": 0 - }, - { - "Ticket": 1533425, - "Agency": "INTEGRA2", - "Worker": "CARLOS LOPEZ AMORES", - "Hour": 17, - "State": "OK", - "Lines": 11, - "M3": 0.14, - "Boxes": 0 - }, - { - "Ticket": 1533429, - "Agency": "ZONA 25", - "Worker": "DANIEL YAREHAM PALOMO", - "Hour": 20, - "State": "OK", - "Lines": 43, - "M3": 0.6, - "Boxes": 0 - }, - { - "Ticket": 1533438, - "Agency": "ZELERIS", - "Worker": "MIGUEL ANGEL LORITE", - "Hour": 17, - "State": "Preparación", - "Lines": 10, - "M3": 0.17, - "Boxes": 0 - }, - { - "Ticket": 1533482, - "Agency": "ZONA 25", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 20, - "State": "Sin Acabar", - "Lines": 30, - "M3": 0.42, - "Boxes": 0 - }, - { - "Ticket": 1533486, - "Agency": "DHL", - "Worker": "JOSE JAVIER ECHEVARRIA", - "Hour": 17, - "State": "OK", - "Lines": 28, - "M3": 0.25, - "Boxes": 0 - }, - { - "Ticket": 1533495, - "Agency": "REC_VILASSAR", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 16, - "M3": 0.08, - "Boxes": 0 - }, - { - "Ticket": 1533507, - "Agency": "MRW 24h", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 17, - "State": "OK", - "Lines": 16, - "M3": 0.39, - "Boxes": 0 - }, - { - "Ticket": 1533557, - "Agency": "ZONA 11", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 21, - "State": "OK", - "Lines": 50, - "M3": 1.16, - "Boxes": 0 - }, - { - "Ticket": 1533566, - "Agency": "ZONA 10", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 23, - "State": "Sin Acabar", - "Lines": 14, - "M3": 0.18, - "Boxes": 0 - }, - { - "Ticket": 1533570, - "Agency": "MRW 24h", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 17, - "State": "OK", - "Lines": 13, - "M3": 0.17, - "Boxes": 0 - }, - { - "Ticket": 1533580, - "Agency": "ZELERIS_10", - "Worker": "DEMBA SAKHO", - "Hour": 17, - "State": "Encajado", - "Lines": 4, - "M3": 0.13, - "Boxes": 0 - }, - { - "Ticket": 1533584, - "Agency": "ZONA 20", - "Worker": "JESUS DANIEL VALLES PEREZ", - "Hour": 20, - "State": "OK", - "Lines": 20, - "M3": 0.67, - "Boxes": 0 - }, - { - "Ticket": 1533585, - "Agency": "ZELERIS_10", - "Worker": "FRAN NATEK ECHEVARRIA", - "Hour": 17, - "State": "Sin Acabar", - "Lines": 1, - "M3": 0.01, - "Boxes": 0 - }, - { - "Ticket": 1533591, - "Agency": "ZONA 46", - "Worker": "JUANLU GALLETERO", - "Hour": 15, - "State": "Revisado", - "Lines": 16, - "M3": 0.3, - "Boxes": 0 - }, - { - "Ticket": 1533641, - "Agency": "ZONA 25", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 28, - "M3": 0.75, - "Boxes": 0 - }, - { - "Ticket": 1533685, - "Agency": "ZONA 20", - "Worker": "Mª CARMEN SERRANO BAU", - "Hour": 20, - "State": "OK", - "Lines": 39, - "M3": 0.78, - "Boxes": 1 - }, - { - "Ticket": 1533688, - "Agency": "ZONA 20", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 7, - "M3": 0.19, - "Boxes": 0 - }, - { - "Ticket": 1533795, - "Agency": "ZONA 25", - "Worker": "MANOLI PULIDO", - "Hour": 20, - "State": "OK", - "Lines": 16, - "M3": 0.3, - "Boxes": 0 - }, - { - "Ticket": 1533797, - "Agency": "ZONA 25", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 20, - "M3": 0.33, - "Boxes": 0 - }, - { - "Ticket": 1533807, - "Agency": "ZONA 25", - "Worker": "ESDENKA CALERO PEREZ", - "Hour": 20, - "State": "Arreglar", - "Lines": 16, - "M3": 0.14, - "Boxes": 0 - }, - { - "Ticket": 1533815, - "Agency": "ZELERIS_10", - "Worker": "RODRIGO HALABI ROCHA", - "Hour": 17, - "State": "OK", - "Lines": 15, - "M3": 0.2, - "Boxes": 0 - }, - { - "Ticket": 1533849, - "Agency": "MRW 24h", - "Worker": "JUAN CARLOS LORENZO SANCHEZ", - "Hour": 17, - "State": "OK", - "Lines": 18, - "M3": 0.25, - "Boxes": 0 - }, - { - "Ticket": 1533852, - "Agency": "MRW 24h", - "Worker": "DANIEL YAREHAM PALOMO", - "Hour": 17, - "State": "OK", - "Lines": 17, - "M3": 0.68, - "Boxes": 0 - }, - { - "Ticket": 1533854, - "Agency": "ZONA 20", - "Worker": "MANOLI PULIDO", - "Hour": 20, - "State": "OK", - "Lines": 11, - "M3": 0.13, - "Boxes": 0 - }, - { - "Ticket": 1533863, - "Agency": "ZELERIS_10", - "Worker": "DEMBA SAKHO", - "Hour": 17, - "State": "Encajado", - "Lines": 6, - "M3": 0.16, - "Boxes": 0 - }, - { - "Ticket": 1533882, - "Agency": "ZONA 20", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 20, - "State": "OK", - "Lines": 9, - "M3": 0.44, - "Boxes": 0 - }, - { - "Ticket": 1533889, - "Agency": "MRW 24h", - "Worker": "ELENA BASCUÑANA TORNERO", - "Hour": 17, - "State": "OK", - "Lines": 10, - "M3": 0.5, - "Boxes": 0 - }, - { - "Ticket": 1533893, - "Agency": "ZONA 32", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 2, - "M3": 0.13, - "Boxes": 0 - }, - { - "Ticket": 1533915, - "Agency": "CORREOSEXPRESS", - "Worker": "JUAN BAUTISTA PASTOR REDONDO", - "Hour": 17, - "State": "OK", - "Lines": 9, - "M3": 0.36, - "Boxes": 0 - }, - { - "Ticket": 1533919, - "Agency": "ZONA 20", - "Worker": "JULIA LLOPIS CASTELL", - "Hour": 20, - "State": "Arreglar", - "Lines": 16, - "M3": 0.23, - "Boxes": 0 - }, - { - "Ticket": 1533983, - "Agency": "ZONA 11", - "Worker": "MANOLI PULIDO", - "Hour": 21, - "State": "OK", - "Lines": 30, - "M3": 1.92, - "Boxes": 0 - }, - { - "Ticket": 1533992, - "Agency": "ZONA 25", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 32, - "M3": 0.23, - "Boxes": 0 - }, - { - "Ticket": 1534032, - "Agency": "MRW 24h", - "Worker": "JESUS DANIEL VALLES PEREZ", - "Hour": 17, - "State": "Sin Acabar", - "Lines": 4, - "M3": 0.04, - "Boxes": 0 - }, - { - "Ticket": 1534033, - "Agency": "ZONA 31", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 14, - "M3": 0.65, - "Boxes": 0 - }, - { - "Ticket": 1534055, - "Agency": "ZONA 32", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 42, - "M3": 1.09, - "Boxes": 0 - }, - { - "Ticket": 1534076, - "Agency": "REC_VILASSAR", - "Worker": "CRISTINA SANCHEZ BARRUGUER", - "Hour": 19, - "State": "OK", - "Lines": 4, - "M3": 0.03, - "Boxes": 0 - }, - { - "Ticket": 1534101, - "Agency": "CORREOSEXPRESS", - "Worker": "JESUS DANIEL VALLES PEREZ", - "Hour": 17, - "State": "Sin Acabar", - "Lines": 1, - "M3": 0.02, - "Boxes": 0 - }, - { - "Ticket": 1534186, - "Agency": "ZONA 32", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 16, - "M3": 0.4, - "Boxes": 0 - }, - { - "Ticket": 1534187, - "Agency": "ZONA 46", - "Worker": "MIGUEL ANGEL LORITE", - "Hour": 15, - "State": "Preparado", - "Lines": 3, - "M3": 0.17, - "Boxes": 0 - }, - { - "Ticket": 1534212, - "Agency": "ZELERIS_10", - "Worker": "RODRIGO HALABI ROCHA", - "Hour": 17, - "State": "Bloqueado", - "Lines": 2, - "M3": 0.07, - "Boxes": 0 - }, - { - "Ticket": 1534223, - "Agency": "ZONA 10", - "Worker": "JESUS DANIEL VALLES PEREZ", - "Hour": 23, - "State": "Sin Acabar", - "Lines": 4, - "M3": 0.05, - "Boxes": 0 - }, - { - "Ticket": 1534236, - "Agency": "REC_MADRID", - "Worker": "COMPUTER SYSTEM", - "Hour": 20, - "State": "Libre", - "Lines": 5, - "M3": 0.04, - "Boxes": 0 - }, - { - "Ticket": 1534240, - "Agency": "ZONA 46", - "Worker": "MARIA JOSE LAMELA FELIPE", - "Hour": 15, - "State": "OK", - "Lines": 47, - "M3": 0.91, - "Boxes": 1 - }, - { - "Ticket": 1534252, - "Agency": "VIAEXPRESS Interdia", - "Worker": "DEMBA SAKHO", - "Hour": 12, - "State": "Encajado", - "Lines": 2, - "M3": 0.02, - "Boxes": 0 - }, - { - "Ticket": 1534258, - "Agency": "ZONA 20", - "Worker": "DANIEL YAREHAM PALOMO", - "Hour": 20, - "State": "OK", - "Lines": 5, - "M3": 0.18, - "Boxes": 0 - }, - { - "Ticket": 1534261, - "Agency": "REC_VILASSAR", - "Worker": "COMPUTER SYSTEM", - "Hour": 19, - "State": "Libre", - "Lines": 5, - "M3": 0.18, - "Boxes": 0 - }, - { - "Ticket": 1534264, - "Agency": "ZONA 20", - "Worker": "JOSE VICENTE DOMINGO SANCHEZ", - "Hour": 20, - "State": "Sin Acabar", - "Lines": 2, - "M3": 0.37, - "Boxes": 2 - }, - { - "Ticket": 1534300, - "Agency": "ZONA 20", - "Worker": "RODRIGO HALABI ROCHA", - "Hour": 20, - "State": "Sin Acabar", - "Lines": 1, - "M3": 0.02, - "Boxes": 0 - }, - { - "Ticket": 1534302, - "Agency": "ZONA 25", - "Worker": "LOLI LOZANO RAEZ", - "Hour": 20, - "State": "OK", - "Lines": 19, - "M3": 1.11, - "Boxes": 0 - }, - { - "Ticket": 1534311, - "Agency": "ZONA 32", - "Worker": "JULIA LLOPIS CASTELL", - "Hour": 19, - "State": "Arreglar", - "Lines": 43, - "M3": 0.8, - "Boxes": 0 - }, - { - "Ticket": 1534315, - "Agency": "ZONA 20", - "Worker": "DANIEL YAREHAM PALOMO", - "Hour": 20, - "State": "Asignado", - "Lines": 6, - "M3": 0.34, - "Boxes": 0 - }, - { - "Ticket": 1534327, - "Agency": "ZONA 43", - "Worker": "COMPUTER SYSTEM", - "Hour": 14, - "State": "Libre", - "Lines": 23, - "M3": 0.41, - "Boxes": 0 - }, - { - "Ticket": 1534354, - "Agency": "ZONA 46", - "Worker": "MARIA DEL MAR GIRBES FERRUS", - "Hour": 15, - "State": "Asignado", - "Lines": 23, - "M3": 1.67, - "Boxes": 0 - }, - { - "Ticket": 1534359, - "Agency": "ZELERIS", - "Worker": "JULIA LLOPIS CASTELL", - "Hour": 17, - "State": "Arreglar", - "Lines": 3, - "M3": 0.06, - "Boxes": 0 - }, - { - "Ticket": 1534366, - "Agency": "REC_SILLA", - "Worker": "COMPUTER SYSTEM", - "Hour": 23, - "State": "Libre", - "Lines": 23, - "M3": 0.4, - "Boxes": 0 - }, - { - "Ticket": 1534385, - "Agency": "ZELERIS", - "Worker": "CARLOS LOPEZ AMORES", - "Hour": 17, - "State": "OK", - "Lines": 4, - "M3": 0.12, - "Boxes": 0 - }, - { - "Ticket": 1534397, - "Agency": "ZONA 20", - "Worker": "JUAN CARLOS LORENZO SANCHEZ", - "Hour": 20, - "State": "OK", - "Lines": 14, - "M3": 0.21, - "Boxes": 0 - }, - { - "Ticket": 1534428, - "Agency": "ZELERIS", - "Worker": "FRAN NATEK ECHEVARRIA", - "Hour": 17, - "State": "OK", - "Lines": 9, - "M3": 0.3, - "Boxes": 0 - }, - { - "Ticket": 1534467, - "Agency": "MRW 24h", - "Worker": "COMPUTER SYSTEM", - "Hour": 17, - "State": "Libre", - "Lines": 15, - "M3": 0.12, - "Boxes": 0 - }, - { - "Ticket": 1534477, - "Agency": "ZONA 11", - "Worker": "CRISTINA SANCHEZ BARRUGUER", - "Hour": 21, - "State": "OK", - "Lines": 8, - "M3": 0.09, - "Boxes": 0 - }, - { - "Ticket": 1534490, - "Agency": "ZONA 43", - "Worker": "JULIA LLOPIS CASTELL", - "Hour": 14, - "State": "Arreglar", - "Lines": 38, - "M3": 1.15, - "Boxes": 0 - }, - { - "Ticket": 1534500, - "Agency": "ZONA 20", - "Worker": "CARLOS LOPEZ AMORES", - "Hour": 20, - "State": "OK", - "Lines": 10, - "M3": 0.35, - "Boxes": 0 - }, - { - "Ticket": 1534504, - "Agency": "ZONA 20", - "Worker": "LOLI LOZANO RAEZ", - "Hour": 20, - "State": "OK", - "Lines": 18, - "M3": 0.18, - "Boxes": 0 - }, - { - "Ticket": 1534505, - "Agency": "ZONA 20", - "Worker": "JUAN BAUTISTA PASTOR REDONDO", - "Hour": 20, - "State": "OK", - "Lines": 5, - "M3": 0.23, - "Boxes": 0 - }, - { - "Ticket": 1534533, - "Agency": "ZONA 45", - "Worker": "DANIEL YAREHAM PALOMO", - "Hour": 24, - "State": "OK", - "Lines": 2, - "M3": 0.25, - "Boxes": 2 + "ticket": 1535516, + "agency": "MRW 24h", + "worker": "MARIA JOSE LAMELA FELIPE", + "hour": 17, + "state": "Sin Acabar", + "lines": 4, + "m3": 0.07, + "boxes": 0, + "city": "SAN FERNANDO", + "province": "Cádiz", + "client": 7315, + "salePerson": "MARIA JOSE LAMELA FELIPE" + }, + { + "ticket": 1535518, + "agency": "ZELERIS", + "worker": "JUAN CARLOS LORENZO SANCHEZ", + "hour": 17, + "state": "OK", + "lines": 10, + "m3": 0.25, + "boxes": 0, + "city": "ANDORRA", + "province": "Teruel", + "client": 1911, + "salePerson": "JUAN CARLOS LORENZO SANCHEZ" + }, + { + "ticket": 1535519, + "agency": "ZELERIS", + "worker": "JOSE JULIAN SAEZ FERNANDEZ", + "hour": 17, + "state": "Sin Acabar", + "lines": 8, + "m3": 0.42, + "boxes": 0, + "city": "AVILES", + "province": "Asturias", + "client": 4471, + "salePerson": "JOSE JULIAN SAEZ FERNANDEZ" + }, + { + "ticket": 1535521, + "agency": "INTEGRA2", + "worker": "JUAN CARLOS LORENZO SANCHEZ", + "hour": 17, + "state": "Arreglar", + "lines": 21, + "m3": 0.21, + "boxes": 0, + "city": "SANXENXO", + "province": "Pontevedra", + "client": 5075, + "salePerson": "JUAN CARLOS LORENZO SANCHEZ" + }, + { + "ticket": 1535523, + "agency": "ZELERIS", + "worker": "Mª CARMEN SERRANO BAU", + "hour": 17, + "state": "OK", + "lines": 12, + "m3": 0.32, + "boxes": 0, + "city": "ALHENDIN", + "province": "Granada", + "client": 1501, + "salePerson": "Mª CARMEN SERRANO BAU" + }, + { + "ticket": 1535524, + "agency": "INTEGRA2", + "worker": "COMPUTER SYSTEM", + "hour": 17, + "state": "Libre", + "lines": 15, + "m3": 0.33, + "boxes": 0, + "city": "A CORUÑA", + "province": "La Coruña", + "client": 8002, + "salePerson": "COMPUTER SYSTEM" + }, + { + "ticket": 1535526, + "agency": "ZELERIS", + "worker": "RODRIGO HALABI ROCHA", + "hour": 17, + "state": "Sin Acabar", + "lines": 11, + "m3": 0.1, + "boxes": 0, + "city": "LOGROÑO", + "province": "La Rioja", + "client": 2197, + "salePerson": "RODRIGO HALABI ROCHA" + }, + { + "ticket": 1535531, + "agency": "INTEGRA2", + "worker": "FRAN NATEK ECHEVARRIA", + "hour": 17, + "state": "OK", + "lines": 7, + "m3": 0.28, + "boxes": 0, + "city": "LLEIDA", + "province": "Lleida", + "client": 4227, + "salePerson": "FRAN NATEK ECHEVARRIA" + }, + { + "ticket": 1535544, + "agency": "VIAEXPRESS Interdia", + "worker": "DEMBA SAKHO", + "hour": 12, + "state": "Encajado", + "lines": 13, + "m3": 0.2, + "boxes": 0, + "city": "LA POBLA DE VALLBONA", + "province": "Valencia", + "client": 2053, + "salePerson": "DEMBA SAKHO" + }, + { + "ticket": 1535548, + "agency": "ZONA 10", + "worker": "CONCHA ESTEBAN VILLENA", + "hour": 23, + "state": "OK", + "lines": 6, + "m3": 0.06, + "boxes": 0, + "city": "PICANYA", + "province": "Valencia", + "client": 2879, + "salePerson": "CONCHA ESTEBAN VILLENA" + }, + { + "ticket": 1535549, + "agency": "CORREOSEXPRESS", + "worker": "JAVIER VILAR PASTOR", + "hour": 17, + "state": "OK", + "lines": 3, + "m3": 0.14, + "boxes": 0, + "city": "LOJA", + "province": "Granada", + "client": 329, + "salePerson": "JAVIER VILAR PASTOR" + }, + { + "ticket": 1535555, + "agency": "REC_VILASSAR", + "worker": "COMPUTER SYSTEM", + "hour": 19, + "state": "Libre", + "lines": 8, + "m3": 0.38, + "boxes": 0, + "city": "VILASSAR DE MAR", + "province": "Barcelona", + "client": 6945, + "salePerson": "COMPUTER SYSTEM" + }, + { + "ticket": 1535557, + "agency": "CORREOSEXPRESS", + "worker": "MARIA DEL MAR GIRBES FERRUS", + "hour": 17, + "state": "Sin Acabar", + "lines": 7, + "m3": 0.08, + "boxes": 0, + "city": "EL ALTET", + "province": "Alicante", + "client": 8000, + "salePerson": "MARIA DEL MAR GIRBES FERRUS" + }, + { + "ticket": 1535558, + "agency": "ZONA 11", + "worker": 0, + "hour": 21, + "state": "Libre", + "lines": 13, + "m3": 0.41, + "boxes": 0, + "city": "TORREBLANCA", + "province": "Castellón", + "client": 5377, + "salePerson": 0 + }, + { + "ticket": 1535559, + "agency": "ZONA 20", + "worker": "ELENA BASCUÑANA TORNERO", + "hour": 20, + "state": "OK", + "lines": 17, + "m3": 0.36, + "boxes": 0, + "city": "MADRID", + "province": "Madrid", + "client": 3574, + "salePerson": "ELENA BASCUÑANA TORNERO" + }, + { + "ticket": 1535560, + "agency": "ZONA 43", + "worker": "DEMBA SAKHO", + "hour": 14, + "state": "Encajado", + "lines": 1, + "m3": 0.02, + "boxes": 0, + "city": "INCA", + "province": "Baleares (Mallorca)", + "client": 7500, + "salePerson": "DEMBA SAKHO" + }, + { + "ticket": 1535561, + "agency": "ZELERIS", + "worker": "MANOLI PULIDO", + "hour": 17, + "state": "Sin Acabar", + "lines": 1, + "m3": 0.05, + "boxes": 0, + "city": "TERUEL", + "province": "Teruel", + "client": 860, + "salePerson": "MANOLI PULIDO" + }, + { + "ticket": 1535562, + "agency": "ZONA 46", + "worker": "MIGUEL ANGEL LAGUNA", + "hour": 15, + "state": "Impreso", + "lines": 1, + "m3": 0.16, + "boxes": 2, + "city": "MALAGA", + "province": "Málaga", + "client": 5630, + "salePerson": "MIGUEL ANGEL LAGUNA" + }, + { + "ticket": 1535573, + "agency": "ZONA 43", + "worker": "JULIAN RAMIREZ SAYAGO", + "hour": 14, + "state": "Encajado", + "lines": 19, + "m3": 0.12, + "boxes": 0, + "city": "PALMA", + "province": "Baleares (Mallorca)", + "client": 6966, + "salePerson": "JULIAN RAMIREZ SAYAGO" + }, + { + "ticket": 1535578, + "agency": "MRW 24h", + "worker": "ESDENKA CALERO PEREZ", + "hour": 17, + "state": "Arreglar", + "lines": 7, + "m3": 0.12, + "boxes": 0, + "city": "VILLAMARIN DE VALDEORRAS", + "province": "Orense", + "client": 6671, + "salePerson": "ESDENKA CALERO PEREZ" + }, + { + "ticket": 1535579, + "agency": "ZONA 46", + "worker": "JUANLU GALLETERO", + "hour": 15, + "state": "Revisado", + "lines": 5, + "m3": 0.14, + "boxes": 0, + "city": "MALAGA", + "province": "Málaga", + "client": 6534, + "salePerson": "JUANLU GALLETERO" + }, + { + "ticket": 1535583, + "agency": "MRW 24h", + "worker": "CARLOS ZAMBRANO GARCIA", + "hour": 17, + "state": "OK", + "lines": 4, + "m3": 0.11, + "boxes": 0, + "city": "PALOMARES DEL RIO", + "province": "Sevilla", + "client": 8506, + "salePerson": "CARLOS ZAMBRANO GARCIA" + }, + { + "ticket": 1535584, + "agency": "ZONA 46", + "worker": "JULIAN RAMIREZ SAYAGO", + "hour": 15, + "state": "Encajado", + "lines": 10, + "m3": 0.46, + "boxes": 0, + "city": "MARBELLA", + "province": "Málaga", + "client": 3018, + "salePerson": "JULIAN RAMIREZ SAYAGO" + }, + { + "ticket": 1535589, + "agency": "VIAEXPRESS Interdia", + "worker": "DEMBA SAKHO", + "hour": 12, + "state": "Encajado", + "lines": 5, + "m3": 0.22, + "boxes": 0, + "city": "valencia", + "province": "Valencia", + "client": 3781, + "salePerson": "DEMBA SAKHO" + }, + { + "ticket": 1535594, + "agency": "VIAEXPRESS Interdia", + "worker": "JULIAN RAMIREZ SAYAGO", + "hour": 12, + "state": "Encajado", + "lines": 5, + "m3": 0.2, + "boxes": 0, + "city": "BENISSODA", + "province": "Valencia", + "client": 958, + "salePerson": "JULIAN RAMIREZ SAYAGO" + }, + { + "ticket": 1535597, + "agency": "CORREOSEXPRESS", + "worker": 0, + "hour": 17, + "state": "Libre", + "lines": 9, + "m3": 0.19, + "boxes": 0, + "city": "SORIA", + "province": "Soria", + "client": 2082, + "salePerson": 0 + }, + { + "ticket": 1535604, + "agency": "OTRA AGENCIA", + "worker": "BEGOÑA RODRIGUEZ", + "hour": 24, + "state": "Entregado", + "lines": 1, + "m3": 0, + "boxes": 0, + "city": "MADRID", + "province": "Madrid", + "client": 5134, + "salePerson": "BEGOÑA RODRIGUEZ" + }, + { + "ticket": 1535610, + "agency": "ZELERIS", + "worker": 0, + "hour": 17, + "state": "Libre", + "lines": 3, + "m3": 0.06, + "boxes": 0, + "city": "VILLANUEVA DE LA SERENA", + "province": "Badajoz", + "client": 2816, + "salePerson": 0 + }, + { + "ticket": 1535617, + "agency": "REC_SILLA", + "worker": "OKSANA KHODORIVSKA", + "hour": 23, + "state": "Entregado", + "lines": 10, + "m3": 0.39, + "boxes": 0, + "city": "TORRENT", + "province": "Valencia", + "client": 1072, + "salePerson": "OKSANA KHODORIVSKA" + }, + { + "ticket": 1535622, + "agency": "ZONA 25", + "worker": "JAVIER VILAR PASTOR", + "hour": 20, + "state": "Sin Acabar", + "lines": 13, + "m3": 0.4, + "boxes": 2, + "city": "CALZADA DE CALATRAVA", + "province": "Ciudad Real", + "client": 3921, + "salePerson": "JAVIER VILAR PASTOR" + }, + { + "ticket": 1535624, + "agency": "ZONA 20", + "worker": 0, + "hour": 20, + "state": "Libre", + "lines": 10, + "m3": 0.29, + "boxes": 0, + "city": "MADRID", + "province": "Madrid", + "client": 6131, + "salePerson": 0 + }, + { + "ticket": 1535631, + "agency": "REC_VILASSAR", + "worker": 0, + "hour": 19, + "state": "Libre", + "lines": 15, + "m3": 0.33, + "boxes": 0, + "city": "VILASSAR DE MAR", + "province": "Barcelona", + "client": 4658, + "salePerson": 0 + }, + { + "ticket": 1535637, + "agency": "ZONA 43", + "worker": "JUANLU GALLETERO", + "hour": 14, + "state": "Revisado", + "lines": 10, + "m3": 0.08, + "boxes": 0, + "city": "FELANITX", + "province": "Baleares (Mallorca)", + "client": 2477, + "salePerson": "JUANLU GALLETERO" + }, + { + "ticket": 1535643, + "agency": "VIAEXPRESS Interdia", + "worker": "DEMBA SAKHO", + "hour": 12, + "state": "Encajado", + "lines": 26, + "m3": 0.49, + "boxes": 0, + "city": "BURRIAN", + "province": "Castellón", + "client": 3027, + "salePerson": "DEMBA SAKHO" + }, + { + "ticket": 1535644, + "agency": "REC_MADRID", + "worker": 0, + "hour": 20, + "state": "Libre", + "lines": 7, + "m3": 0.22, + "boxes": 0, + "city": "SAN FERNANDO DE HENARES", + "province": "Madrid", + "client": 3005, + "salePerson": 0 + }, + { + "ticket": 1535648, + "agency": "OTRA AGENCIA", + "worker": "BEGOÑA RODRIGUEZ", + "hour": 24, + "state": "Entregado", + "lines": 1, + "m3": 0, + "boxes": 0, + "city": "CATADAU", + "province": "Valencia", + "client": 1425, + "salePerson": "BEGOÑA RODRIGUEZ" + }, + { + "ticket": 1535652, + "agency": "INTEGRA2", + "worker": "FRAN NATEK ECHEVARRIA", + "hour": 17, + "state": "Sin Acabar", + "lines": 1, + "m3": 0.02, + "boxes": 0, + "city": "PALACIOS Y VILLAFRAN", + "province": "Sevilla", + "client": 3063, + "salePerson": "FRAN NATEK ECHEVARRIA" + }, + { + "ticket": 1535657, + "agency": "OTRA AGENCIA", + "worker": "BEGOÑA RODRIGUEZ", + "hour": 24, + "state": "Entregado", + "lines": 1, + "m3": 0, + "boxes": 0, + "city": "PALMA DE GANDIA", + "province": "Valencia", + "client": 1261, + "salePerson": "BEGOÑA RODRIGUEZ" + }, + { + "ticket": 1535658, + "agency": "OTRA AGENCIA", + "worker": "BEGOÑA RODRIGUEZ", + "hour": 24, + "state": "Entregado", + "lines": 1, + "m3": 0, + "boxes": 0, + "city": "GALDACANO", + "province": "Vizcaya", + "client": 1309, + "salePerson": "BEGOÑA RODRIGUEZ" + }, + { + "ticket": 1535660, + "agency": "ZELERIS", + "worker": "ELENA BASCUÑANA TORNERO", + "hour": 17, + "state": "OK", + "lines": 2, + "m3": 0.05, + "boxes": 0, + "city": "CEHEGIN", + "province": "Murcia", + "client": 178, + "salePerson": "ELENA BASCUÑANA TORNERO" + }, + { + "ticket": 1535663, + "agency": "MRW 24h", + "worker": "Mª CARMEN SERRANO BAU", + "hour": 17, + "state": "OK", + "lines": 6, + "m3": 0.06, + "boxes": 0, + "city": "ROCIANA DEL CONDADO", + "province": "Huelva", + "client": 6471, + "salePerson": "Mª CARMEN SERRANO BAU" + }, + { + "ticket": 1535673, + "agency": "MRW 24h", + "worker": "CRISTINA SANCHEZ BARRUGUER", + "hour": 17, + "state": "Sin Acabar", + "lines": 19, + "m3": 0.3, + "boxes": 0, + "city": "CIUDAD RODRIGO", + "province": "Salamanca", + "client": 7821, + "salePerson": "CRISTINA SANCHEZ BARRUGUER" + }, + { + "ticket": 1535678, + "agency": "ZONA 11", + "worker": "JESUS DANIEL VALLES PEREZ", + "hour": 21, + "state": "OK", + "lines": 5, + "m3": 0.18, + "boxes": 0, + "city": "BURRIANA", + "province": "Castellón", + "client": 3021, + "salePerson": "JESUS DANIEL VALLES PEREZ" + }, + { + "ticket": 1535679, + "agency": "ZONA 20", + "worker": 0, + "hour": 20, + "state": "Libre", + "lines": 1, + "m3": 0.03, + "boxes": 0, + "city": "MADRID", + "province": "Madrid", + "client": 3222, + "salePerson": 0 + }, + { + "ticket": 1535682, + "agency": "VIAEXPRESS Interdia", + "worker": "DEMBA SAKHO", + "hour": 12, + "state": "Encajado", + "lines": 15, + "m3": 0.08, + "boxes": 0, + "city": "PUZOL", + "province": "Valencia", + "client": 389, + "salePerson": "DEMBA SAKHO" + }, + { + "ticket": 1535684, + "agency": "REC_SILLA", + "worker": "GISELA LLOPIS COLOM", + "hour": 23, + "state": "Entregado", + "lines": 2, + "m3": 0.3, + "boxes": 3, + "city": "MONTSERRAT", + "province": "Valencia", + "client": 3075, + "salePerson": "GISELA LLOPIS COLOM" + }, + { + "ticket": 1535686, + "agency": "ZONA 31", + "worker": "COMPUTER SYSTEM", + "hour": 19, + "state": "Libre", + "lines": 9, + "m3": 0.15, + "boxes": 0, + "city": "BARBERA DEL VALLES", + "province": "Barcelona", + "client": 4631, + "salePerson": "COMPUTER SYSTEM" + }, + { + "ticket": 1535687, + "agency": "MRW 24h", + "worker": "CARLOS BORRAS MARTINEZ", + "hour": 17, + "state": "Sin Acabar", + "lines": 6, + "m3": 0.03, + "boxes": 0, + "city": "BECERREA", + "province": "Lugo", + "client": 5410, + "salePerson": "CARLOS BORRAS MARTINEZ" + }, + { + "ticket": 1535690, + "agency": "ZELERIS", + "worker": "DAVID SARRION RIVERO", + "hour": 17, + "state": "OK", + "lines": 8, + "m3": 0.09, + "boxes": 0, + "city": "REINOSA", + "province": "Cantabria", + "client": 4268, + "salePerson": "DAVID SARRION RIVERO" + }, + { + "ticket": 1535693, + "agency": "ZONA 25", + "worker": "RODRIGO HALABI ROCHA", + "hour": 20, + "state": "OK", + "lines": 1, + "m3": 0.06, + "boxes": 0, + "city": "DAIMIEL", + "province": "Ciudad Real", + "client": 904, + "salePerson": "RODRIGO HALABI ROCHA" + }, + { + "ticket": 1535694, + "agency": "CORREOSEXPRESS", + "worker": "CARLOS ZAMBRANO GARCIA", + "hour": 17, + "state": "OK", + "lines": 4, + "m3": 0.1, + "boxes": 0, + "city": "VILLARALBO", + "province": "Zamora", + "client": 5801, + "salePerson": "CARLOS ZAMBRANO GARCIA" + }, + { + "ticket": 1535699, + "agency": "ZONA 20", + "worker": "MANOLI PULIDO", + "hour": 20, + "state": "OK", + "lines": 7, + "m3": 0.28, + "boxes": 0, + "city": "ALCORCON", + "province": "Madrid", + "client": 422, + "salePerson": "MANOLI PULIDO" + }, + { + "ticket": 1535702, + "agency": "ZELERIS", + "worker": "Mª CARMEN SERRANO BAU", + "hour": 17, + "state": "OK", + "lines": 3, + "m3": 0.23, + "boxes": 0, + "city": "PURULLENA", + "province": "Granada", + "client": 3224, + "salePerson": "Mª CARMEN SERRANO BAU" + }, + { + "ticket": 1535713, + "agency": "REC_MADRID", + "worker": "ELENA BASCUÑANA TORNERO", + "hour": 20, + "state": "OK", + "lines": 16, + "m3": 0.36, + "boxes": 0, + "city": "TORREJON DE ARDOZ", + "province": "Madrid", + "client": 680, + "salePerson": "ELENA BASCUÑANA TORNERO" + }, + { + "ticket": 1535719, + "agency": "ZELERIS", + "worker": 0, + "hour": 17, + "state": "Libre", + "lines": 15, + "m3": 0.22, + "boxes": 0, + "city": "RIBADESELLA", + "province": "Asturias", + "client": 2428, + "salePerson": 0 + }, + { + "ticket": 1535720, + "agency": "REC_VILASSAR", + "worker": 0, + "hour": 19, + "state": "Libre", + "lines": 11, + "m3": 0.07, + "boxes": 0, + "city": "BARCELONA", + "province": "Barcelona", + "client": 7628, + "salePerson": 0 + }, + { + "ticket": 1535724, + "agency": "REC_SILLA", + "worker": 0, + "hour": 23, + "state": "Libre", + "lines": 3, + "m3": 0.04, + "boxes": 0, + "city": "QUART DE POBLET", + "province": "Valencia", + "client": 326, + "salePerson": 0 + }, + { + "ticket": 1535727, + "agency": "ZONA 43", + "worker": "DEMBA SAKHO", + "hour": 14, + "state": "Encajando", + "lines": 21, + "m3": 0.35, + "boxes": 0, + "city": "PALMA MALLORCA", + "province": "Baleares (Mallorca)", + "client": 3436, + "salePerson": "DEMBA SAKHO" + }, + { + "ticket": 1535732, + "agency": "ZONA 20", + "worker": "MARIA DEL MAR GIRBES FERRUS", + "hour": 20, + "state": "Sin Acabar", + "lines": 10, + "m3": 0.44, + "boxes": 0, + "city": "MADRID", + "province": "Madrid", + "client": 7303, + "salePerson": "MARIA DEL MAR GIRBES FERRUS" + }, + { + "ticket": 1535736, + "agency": "ZONA 42", + "worker": "JUANLU GALLETERO", + "hour": 14, + "state": "Preparación", + "lines": 6, + "m3": 0.09, + "boxes": 0, + "city": "SANT JOSEP DE SATALIA", + "province": "Baleares (Ibiza)", + "client": 3472, + "salePerson": "JUANLU GALLETERO" + }, + { + "ticket": 1535737, + "agency": "MRW 24h", + "worker": "DEBORA SANCHEZ TORIO", + "hour": 17, + "state": "OK", + "lines": 6, + "m3": 0.18, + "boxes": 0, + "city": "MARCILLA", + "province": "Navarra", + "client": 957, + "salePerson": "DEBORA SANCHEZ TORIO" + }, + { + "ticket": 1535742, + "agency": "ZONA 46", + "worker": "MIGUEL ANGEL LAGUNA", + "hour": 15, + "state": "Impreso", + "lines": 3, + "m3": 0.11, + "boxes": 0, + "city": "MALAGA", + "province": "Málaga", + "client": 4812, + "salePerson": "MIGUEL ANGEL LAGUNA" + }, + { + "ticket": 1535747, + "agency": "MRW 24h", + "worker": "FRAN NATEK ECHEVARRIA", + "hour": 17, + "state": "Sin Acabar", + "lines": 1, + "m3": 0.23, + "boxes": 2, + "city": "SEVILLA", + "province": "Sevilla", + "client": 4095, + "salePerson": "FRAN NATEK ECHEVARRIA" + }, + { + "ticket": 1535749, + "agency": "ZELERIS", + "worker": "DEBORA SANCHEZ TORIO", + "hour": 17, + "state": "Sin Acabar", + "lines": 1, + "m3": 0.03, + "boxes": 0, + "city": "VIVEIRO", + "province": "Lugo", + "client": 5928, + "salePerson": "DEBORA SANCHEZ TORIO" + }, + { + "ticket": 1535751, + "agency": "ZELERIS", + "worker": "JOSE JULIAN SAEZ FERNANDEZ", + "hour": 17, + "state": "OK", + "lines": 27, + "m3": 0.95, + "boxes": 2.99, + "city": "RABADE LUGO", + "province": "Lugo", + "client": 5652, + "salePerson": "JOSE JULIAN SAEZ FERNANDEZ" + }, + { + "ticket": 1535756, + "agency": "MRW 24h", + "worker": "DAVID SARRION RIVERO", + "hour": 17, + "state": "OK", + "lines": 11, + "m3": 0.31, + "boxes": 0, + "city": "LANDETE", + "province": "Cuenca", + "client": 3857, + "salePerson": "DAVID SARRION RIVERO" + }, + { + "ticket": 1535758, + "agency": "VIAEXPRESS Interdia", + "worker": 0, + "hour": 12, + "state": "Libre", + "lines": 21, + "m3": 0.49, + "boxes": 0, + "city": "LA POBLA DE VALLBONA", + "province": "Valencia", + "client": 2053, + "salePerson": 0 + }, + { + "ticket": 1535765, + "agency": "ZONA 31", + "worker": 0, + "hour": 19, + "state": "Libre", + "lines": 1, + "m3": 0.07, + "boxes": 0, + "city": "SANT HIPÒLIT DE VOLTREGÀ", + "province": "Barcelona", + "client": 5876, + "salePerson": 0 + }, + { + "ticket": 1535770, + "agency": "ZONA 25", + "worker": "DEBORA SANCHEZ TORIO", + "hour": 20, + "state": "OK", + "lines": 16, + "m3": 0.18, + "boxes": 0, + "city": "ILLESCAS", + "province": "Toledo", + "client": 4283, + "salePerson": "DEBORA SANCHEZ TORIO" + }, + { + "ticket": 1535771, + "agency": "ZELERIS", + "worker": "JUANLU GALLETERO", + "hour": 17, + "state": "Revisado", + "lines": 1, + "m3": 0.03, + "boxes": 0, + "city": "SEVILLA", + "province": "Sevilla", + "client": 2000, + "salePerson": "JUANLU GALLETERO" + }, + { + "ticket": 1535772, + "agency": "ZELERIS_10", + "worker": "MARIA JOSE LAMELA FELIPE", + "hour": 17, + "state": "OK", + "lines": 3, + "m3": 0.07, + "boxes": 0, + "city": "SEVILLA", + "province": "Sevilla", + "client": 2635, + "salePerson": "MARIA JOSE LAMELA FELIPE" + }, + { + "ticket": 1535774, + "agency": "ZELERIS", + "worker": "JESUS DANIEL VALLES PEREZ", + "hour": 17, + "state": "OK", + "lines": 19, + "m3": 0.18, + "boxes": 0, + "city": "LEON", + "province": "León", + "client": 8321, + "salePerson": "JESUS DANIEL VALLES PEREZ" + }, + { + "ticket": 1535775, + "agency": "ZONA 10", + "worker": "JESUS DANIEL VALLES PEREZ", + "hour": 23, + "state": "OK", + "lines": 1, + "m3": 0.69, + "boxes": 0, + "city": "PUIG PLAYA", + "province": "Valencia", + "client": 3781, + "salePerson": "JESUS DANIEL VALLES PEREZ" + }, + { + "ticket": 1535776, + "agency": "REC_MADRID", + "worker": "CRISTINA SANCHEZ BARRUGUER", + "hour": 20, + "state": "Sin Acabar", + "lines": 10, + "m3": 0.09, + "boxes": 0, + "city": "TORREJON DE ARDOZ", + "province": "Madrid", + "client": 1600, + "salePerson": "CRISTINA SANCHEZ BARRUGUER" + }, + { + "ticket": 1535777, + "agency": "ZELERIS", + "worker": "MANOLI PULIDO", + "hour": 17, + "state": "Sin Acabar", + "lines": 3, + "m3": 0.06, + "boxes": 0, + "city": "PALENCIA", + "province": "Palencia", + "client": 3717, + "salePerson": "MANOLI PULIDO" + }, + { + "ticket": 1535779, + "agency": "ZONA 11", + "worker": "ELENA BASCUÑANA TORNERO", + "hour": 21, + "state": "OK", + "lines": 16, + "m3": 0.21, + "boxes": 0, + "city": "ESLIDA", + "province": "Castellón", + "client": 7423, + "salePerson": "ELENA BASCUÑANA TORNERO" + }, + { + "ticket": 1535899, + "agency": "ZONA 31", + "worker": "CLAUDI SANROMA REYNARES", + "hour": 19, + "state": "OK", + "lines": 7, + "m3": 0.33, + "boxes": 0, + "city": "MARTORELL", + "province": "Barcelona", + "client": 4058, + "salePerson": "CLAUDI SANROMA REYNARES" + }, + { + "ticket": 1535903, + "agency": "MRW 24h", + "worker": "SILVERIO DOMINGUEZ", + "hour": 17, + "state": "OK", + "lines": 9, + "m3": 0.24, + "boxes": 0, + "city": "TOLOSA", + "province": "Guipuzcoa", + "client": 6308, + "salePerson": "SILVERIO DOMINGUEZ" + }, + { + "ticket": 1535905, + "agency": "ZONA 20", + "worker": "ELENA BASCUÑANA TORNERO", + "hour": 20, + "state": "OK", + "lines": 19, + "m3": 0.33, + "boxes": 0, + "city": "MADRID", + "province": "Madrid", + "client": 3574, + "salePerson": "ELENA BASCUÑANA TORNERO" + }, + { + "ticket": 1535908, + "agency": "INTEGRA2", + "worker": 0, + "hour": 17, + "state": "Libre", + "lines": 1, + "m3": 0.04, + "boxes": 0, + "city": "LA PUEBLA DE CAZALLA", + "province": "Sevilla", + "client": 5007, + "salePerson": 0 + }, + { + "ticket": 1535911, + "agency": "ZONA 43", + "worker": "MIGUEL ANGEL LAGUNA", + "hour": 14, + "state": "Impreso", + "lines": 53, + "m3": 0.61, + "boxes": 0, + "city": "INCA", + "province": "Baleares (Mallorca)", + "client": 6032, + "salePerson": "MIGUEL ANGEL LAGUNA" + }, + { + "ticket": 1535912, + "agency": "REC_SILLA", + "worker": "COMPUTER SYSTEM", + "hour": 23, + "state": "Libre", + "lines": 2, + "m3": 0.11, + "boxes": 0, + "city": "VALENCIA", + "province": "Valencia", + "client": 3613, + "salePerson": "COMPUTER SYSTEM" + }, + { + "ticket": 1535918, + "agency": "ZONA 10", + "worker": 0, + "hour": 23, + "state": "Libre", + "lines": 15, + "m3": 0.12, + "boxes": 0, + "city": "VALENCIA", + "province": "Valencia", + "client": 2574, + "salePerson": 0 + }, + { + "ticket": 1535919, + "agency": "ZONA 43", + "worker": "MARIA DEL MAR GIRBES FERRUS", + "hour": 14, + "state": "Sin Acabar", + "lines": 1, + "m3": 0.01, + "boxes": 0, + "city": "PALMA", + "province": "Baleares (Mallorca)", + "client": 7445, + "salePerson": "MARIA DEL MAR GIRBES FERRUS" + }, + { + "ticket": 1535920, + "agency": "INTEGRA2", + "worker": "JULIA LLOPIS CASTELL", + "hour": 17, + "state": "Arreglar", + "lines": 9, + "m3": 0.1, + "boxes": 0, + "city": "Benahavis", + "province": "Málaga", + "client": 7796, + "salePerson": "JULIA LLOPIS CASTELL" + }, + { + "ticket": 1535921, + "agency": "REC_SILLA", + "worker": "FRAN NATEK ECHEVARRIA", + "hour": 23, + "state": "Entregado", + "lines": 2, + "m3": 0, + "boxes": 0, + "city": "SUECA", + "province": "Valencia", + "client": 1160, + "salePerson": "FRAN NATEK ECHEVARRIA" + }, + { + "ticket": 1535928, + "agency": "CORREOSEXPRESS", + "worker": 0, + "hour": 17, + "state": "Libre", + "lines": 8, + "m3": 0.07, + "boxes": 0, + "city": "ESCALONA", + "province": "Toledo", + "client": 2787, + "salePerson": 0 + }, + { + "ticket": 1535931, + "agency": "ZONA 20", + "worker": "CARLOS ZAMBRANO GARCIA", + "hour": 20, + "state": "Sin Acabar", + "lines": 1, + "m3": 0.02, + "boxes": 0, + "city": "PARLA", + "province": "Madrid", + "client": 2725, + "salePerson": "CARLOS ZAMBRANO GARCIA" + }, + { + "ticket": 1535935, + "agency": "REC_MADRID", + "worker": 0, + "hour": 20, + "state": "Libre", + "lines": 1, + "m3": 0.12, + "boxes": 3, + "city": "SAN FERNADO DE HENARES", + "province": "Madrid", + "client": 3240, + "salePerson": 0 + }, + { + "ticket": 1535936, + "agency": "ZELERIS", + "worker": "DAVID SARRION RIVERO", + "hour": 17, + "state": "OK", + "lines": 2, + "m3": 0.11, + "boxes": 0, + "city": "VINAROS", + "province": "Castellón", + "client": 768, + "salePerson": "DAVID SARRION RIVERO" + }, + { + "ticket": 1535938, + "agency": "ZONA 46", + "worker": 0, + "hour": 15, + "state": "Libre", + "lines": 5, + "m3": 0.11, + "boxes": 0, + "city": "VELEZ-MALAGA", + "province": "Málaga", + "client": 5358, + "salePerson": 0 + }, + { + "ticket": 1535941, + "agency": "CORREOSEXPRESS", + "worker": "LOLI LOZANO RAEZ", + "hour": 17, + "state": "OK", + "lines": 1, + "m3": 0.01, + "boxes": 0, + "city": "HUERCAL DE ALMERIA", + "province": "Almería", + "client": 475, + "salePerson": "LOLI LOZANO RAEZ" + }, + { + "ticket": 1535942, + "agency": "CORREOSEXPRESS", + "worker": "CARLOS ZAMBRANO GARCIA", + "hour": 17, + "state": "OK", + "lines": 3, + "m3": 0.41, + "boxes": 10, + "city": "CHIPIONA", + "province": "Cádiz", + "client": 1479, + "salePerson": "CARLOS ZAMBRANO GARCIA" + }, + { + "ticket": 1535943, + "agency": "ZONA 43", + "worker": 0, + "hour": 14, + "state": "Libre", + "lines": 1, + "m3": 0.14, + "boxes": 0, + "city": "PALMA DE MALLORCA", + "province": "Baleares (Mallorca)", + "client": 5840, + "salePerson": 0 + }, + { + "ticket": 1535946, + "agency": "REC_VILASSAR", + "worker": 0, + "hour": 19, + "state": "Libre", + "lines": 1, + "m3": 0.01, + "boxes": 0, + "city": "VILASSAR DE MAR", + "province": "Barcelona", + "client": 3951, + "salePerson": 0 + }, + { + "ticket": 1535956, + "agency": "ZONA 10", + "worker": "JOSE JAVIER ECHEVARRIA", + "hour": 23, + "state": "OK", + "lines": 5, + "m3": 0.12, + "boxes": 0, + "city": "CATARROJA", + "province": "Valencia", + "client": 4193, + "salePerson": "JOSE JAVIER ECHEVARRIA" + }, + { + "ticket": 1535957, + "agency": "ZONA 43", + "worker": 0, + "hour": 14, + "state": "Libre", + "lines": 9, + "m3": 0.08, + "boxes": 0, + "city": "BINISSALEM", + "province": "Baleares (Mallorca)", + "client": 5172, + "salePerson": 0 + }, + { + "ticket": 1535960, + "agency": "MRW 24h", + "worker": "FRAN NATEK ECHEVARRIA", + "hour": 17, + "state": "OK", + "lines": 3, + "m3": 0.09, + "boxes": 0, + "city": "BAENA", + "province": "Córdoba", + "client": 1667, + "salePerson": "FRAN NATEK ECHEVARRIA" + }, + { + "ticket": 1535961, + "agency": "ZONA 20", + "worker": 0, + "hour": 20, + "state": "Libre", + "lines": 3, + "m3": 0.11, + "boxes": 0, + "city": "MADRID", + "province": "Madrid", + "client": 5762, + "salePerson": 0 + }, + { + "ticket": 1535962, + "agency": "MRW 24h", + "worker": 0, + "hour": 17, + "state": "Libre", + "lines": 19, + "m3": 0.26, + "boxes": 0, + "city": "CUEVAS DEL VALLE", + "province": "Ávila", + "client": 6070, + "salePerson": 0 + }, + { + "ticket": 1535967, + "agency": "ZELERIS", + "worker": "FRAN NATEK ECHEVARRIA", + "hour": 17, + "state": "Sin Acabar", + "lines": 1, + "m3": 0.1, + "boxes": 0, + "city": "SEVILLA", + "province": "Sevilla", + "client": 2000, + "salePerson": "FRAN NATEK ECHEVARRIA" } ] \ No newline at end of file From e09f60a53a550cc03a0504efaa0f1191f3fa91e0 Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Tue, 13 Jun 2017 13:08:06 +0200 Subject: [PATCH 18/98] =?UTF-8?q?Nuevos=20componentes:=20drop-down,=20icon?= =?UTF-8?q?-menu.=20Refactorizaci=C3=B3n=20de=20icon=20e=20icon-button=20(?= =?UTF-8?q?pasados=20a=20componentes=20sin=20template=20manager)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/core/src/components.js | 2 + client/core/src/drop-down/drop-down.html | 3 ++ client/core/src/drop-down/drop-down.js | 16 ++++++ client/core/src/drop-down/style.scss | 20 +++++++ client/core/src/filters/index.js | 1 + client/core/src/filters/ucwords.js | 20 +++++++ client/core/src/icon-button/icon-button.html | 3 ++ client/core/src/icon-button/icon-button.js | 18 +++++-- client/core/src/icon-menu/icon-menu.html | 4 ++ client/core/src/icon-menu/icon-menu.js | 54 +++++++++++++++++++ client/core/src/icon/icon.js | 16 ++++-- client/core/src/icon/icon.mdl.js | 2 +- client/production/src/index/index.html | 55 ++++++++++---------- client/production/src/index/index.js | 19 ++++++- client/production/src/index/style.scss | 3 ++ 15 files changed, 199 insertions(+), 37 deletions(-) create mode 100644 client/core/src/drop-down/drop-down.html create mode 100644 client/core/src/drop-down/drop-down.js create mode 100644 client/core/src/drop-down/style.scss create mode 100644 client/core/src/filters/ucwords.js create mode 100644 client/core/src/icon-button/icon-button.html create mode 100644 client/core/src/icon-menu/icon-menu.html create mode 100644 client/core/src/icon-menu/icon-menu.js diff --git a/client/core/src/components.js b/client/core/src/components.js index fc5c92d34..f0303ebe2 100644 --- a/client/core/src/components.js +++ b/client/core/src/components.js @@ -15,6 +15,8 @@ import './subtitle/subtitle'; import './spinner/spinner'; import './snackbar/snackbar'; import './tooltip/tooltip'; +import './icon-menu/icon-menu'; +import './drop-down/drop-down'; export {NAME as BUTTON, directive as ButtonDirective} from './button/button'; export {NAME as BUTTON_MDL, factory as buttonMdl} from './button/button.mdl'; diff --git a/client/core/src/drop-down/drop-down.html b/client/core/src/drop-down/drop-down.html new file mode 100644 index 000000000..4b354ae62 --- /dev/null +++ b/client/core/src/drop-down/drop-down.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/client/core/src/drop-down/drop-down.js b/client/core/src/drop-down/drop-down.js new file mode 100644 index 000000000..c33aea7b5 --- /dev/null +++ b/client/core/src/drop-down/drop-down.js @@ -0,0 +1,16 @@ +import {module} from '../module'; +import './style.scss'; + +/* export default class DropDown { +}*/ + +module.component('vnDropDown', { + template: require('./drop-down.html'), + // controller: DropDown, + bindings: { + items: '<', + show: '<', + selected: '=' + }, + controllerAs: 'dd' +}); diff --git a/client/core/src/drop-down/style.scss b/client/core/src/drop-down/style.scss new file mode 100644 index 000000000..07cf592d9 --- /dev/null +++ b/client/core/src/drop-down/style.scss @@ -0,0 +1,20 @@ +vn-drop-down { + position: absolute; + z-index: 9999; + + ul{ + padding: 0; + margin: 10px 0 0 0; + background: white; + border: 1px solid #A7A7A7; + li { + list-style-type: none; + padding: 5px 20px 5px 5px; + cursor: pointer; + } + li:hover{ + background-color: #3D3A3B; + color: white; + } + } +} \ No newline at end of file diff --git a/client/core/src/filters/index.js b/client/core/src/filters/index.js index de0560b2f..885f3cd66 100644 --- a/client/core/src/filters/index.js +++ b/client/core/src/filters/index.js @@ -1 +1,2 @@ import './phone'; +import './ucwords'; diff --git a/client/core/src/filters/ucwords.js b/client/core/src/filters/ucwords.js new file mode 100644 index 000000000..08ca725eb --- /dev/null +++ b/client/core/src/filters/ucwords.js @@ -0,0 +1,20 @@ +import {module} from '../module'; + +/** + * Uppercase the first character of each word in a string + * + * @return {String} The formated string + */ +export default function ucwords() { + return function(input) { + input = input || ''; + let out = ''; + let aux = input.split(' '); + for (let i = 0; i < aux.length; i++) { + out += (aux[i]) ? aux[i].charAt(0).toUpperCase() + aux[i].substr(1).toLowerCase() : ''; + out += ' '; + } + return out.trim(); + }; +} +module.filter('ucwords', ucwords); diff --git a/client/core/src/icon-button/icon-button.html b/client/core/src/icon-button/icon-button.html new file mode 100644 index 000000000..4f80d96b5 --- /dev/null +++ b/client/core/src/icon-button/icon-button.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/client/core/src/icon-button/icon-button.js b/client/core/src/icon-button/icon-button.js index 62ce9a2a4..806b86d83 100644 --- a/client/core/src/icon-button/icon-button.js +++ b/client/core/src/icon-button/icon-button.js @@ -1,10 +1,10 @@ import {module as _module} from '../module'; -import * as resolveFactory from '../lib/resolveDefaultComponents'; +// import * as resolveFactory from '../lib/resolveDefaultComponents'; import * as util from '../lib/util'; const _NAME = 'iconButton'; export const NAME = util.getName(_NAME); - +/* directive.$inject = [resolveFactory.NAME]; export function directive(resolve) { return { @@ -14,4 +14,16 @@ export function directive(resolve) { } }; } -_module.directive(NAME, directive); +_module.directive(NAME, directive); */ + +_module.component(NAME, { + template: require('./icon-button.html'), + bindings: { + icon: '@', + className: ' + + +
\ No newline at end of file diff --git a/client/core/src/icon-menu/icon-menu.js b/client/core/src/icon-menu/icon-menu.js new file mode 100644 index 000000000..d1119bedb --- /dev/null +++ b/client/core/src/icon-menu/icon-menu.js @@ -0,0 +1,54 @@ +import {module} from '../module'; + +export default class IconMenu { + constructor($element, $http, $timeout) { + this.$element = $element; + this.$http = $http; + this.$timeout = $timeout; + this._showDropDown = false; + } + get showDropDown() { + return this._showDropDown; + } + set showDropDown(value) { + this._showDropDown = value; + } + + getItems() { + this.$http.get(this.url).then( + json => { + this.items = json.data; + } + ); + } + $onInit() { + if (!this.items && this.url) { + this.getItems(); + } + + this.$element.bind('mouseover', () => { + this.$timeout(() => { + this.showDropDown = true; + }); + }); + + this.$element.bind('mouseout', () => { + this.$timeout(() => { + this.showDropDown = false; + }); + }); + } +} +IconMenu.$inject = ['$element', '$http', '$timeout']; + +module.component('vnIconMenu', { + template: require('./icon-menu.html'), + bindings: { + url: '@?', + items: '=?', + icon: '@', + selected: '=' + }, + controller: IconMenu, + controllerAs: 'im' +}); diff --git a/client/core/src/icon/icon.js b/client/core/src/icon/icon.js index 31e9ca565..29f3d0747 100644 --- a/client/core/src/icon/icon.js +++ b/client/core/src/icon/icon.js @@ -1,12 +1,12 @@ import {module} from '../module'; import './icon.mdl'; import './style.css'; -import * as resolveFactory from '../lib/resolveDefaultComponents'; +// import * as resolveFactory from '../lib/resolveDefaultComponents'; -const _NAME = 'icon'; +// const _NAME = 'icon'; export const NAME = 'vnIcon'; -export function directive(resolver) { +/* export function directive(resolver) { return { restrict: 'E', template: function(_, attrs) { @@ -16,4 +16,12 @@ export function directive(resolver) { } directive.$inject = [resolveFactory.NAME]; -module.directive(NAME, directive); +module.directive(NAME, directive);*/ + +module.component(NAME, { + template: '{{i.icon}}', + bindings: { + icon: '@' + }, + controllerAs: 'i' +}); diff --git a/client/core/src/icon/icon.mdl.js b/client/core/src/icon/icon.mdl.js index ce3f82856..6a558285c 100644 --- a/client/core/src/icon/icon.mdl.js +++ b/client/core/src/icon/icon.mdl.js @@ -6,7 +6,7 @@ export function factory() { return { template: template, default: {} - } + }; } module.factory(NAME, factory); diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index b768aab80..cc1b7511a 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -1,4 +1,4 @@ - + @@ -25,7 +25,10 @@ - + + + + @@ -34,51 +37,49 @@ - - + + - + - - + + - + - - + + - - + + - - {{ticket.id}} - {{ticket.agency.name}} - {{ticket.employee.name}} + + {{ticket.ticket}} + {{ticket.agency}} + {{ticket.worker | ucwords}} {{ticket.hour}} - {{ticket.state.name}} + {{ticket.state}} {{ticket.lines}} - {{ticket.meters}} + {{ticket.m3}} {{ticket.boxes}} - + - + + + : {{$ctrl.tickets.length}} - - - - - - + + {{$ctrl.lines}} {{$ctrl.meters}} - + \ No newline at end of file diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index 97c5c1d5c..8fed9a431 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -10,6 +10,7 @@ export default class ProductionIndex { this.tickets = []; this.lines = 0; this.meters = 0; + this.state = null; } get checkAll() { return this._checkAll; @@ -18,6 +19,12 @@ export default class ProductionIndex { this._checkAll = value; this.switchChecks(); } + /*get state() { + return this._state; + } + set state(value) { + this._state = value; + }*/ switchChecks() { let checks = this.$element[0].querySelectorAll('.list-body input[type="checkbox"]'); checks.forEach( @@ -33,11 +40,13 @@ export default class ProductionIndex { let ids = []; checks.forEach( (_, i) => { - ids.push(this.tickets[i].id); + ids.push(this.tickets[i].ticket); } ); + console.log("TODO: call action -> endPoint with tickets's Ids", action, ids, arguments[1]); // TODO: call action -> endPoint with tickets's Ids } else { + console.log("TODO: dialog with no items selected", action); // TODO: dialog with no items selected } } @@ -47,7 +56,7 @@ export default class ProductionIndex { this.tickets.forEach( val => { lines += parseFloat(val.lines); - meters += parseFloat(val.meters); + meters += parseFloat(val.m3); } ); this.lines = lines; @@ -57,6 +66,12 @@ export default class ProductionIndex { this.$.index.filter = this.filter; this.$.index.accept(); } + $doCheck() { + if (this.state) { + this.doAction('changeState', Object.assign({}, this.state)); + this.state = null; + } + } } ProductionIndex.$inject = ['$element', '$scope']; diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss index 13bd38bbf..cafeb13cb 100644 --- a/client/production/src/index/style.scss +++ b/client/production/src/index/style.scss @@ -29,6 +29,9 @@ vn-production-index { .list > vn-one, .list > [vn-one], .list > [vn-two], .list > vn-two{ text-align: center; } + .list > vn-none{ + min-width: 60px; + } .list-body{ padding: 4px 0px; border-bottom: 1px solid #9D9D9D; From 6adc734f69f5dbe79de64afea6b8bc0ef746ac6c Mon Sep 17 00:00:00 2001 From: nelo Date: Tue, 13 Jun 2017 13:57:40 +0200 Subject: [PATCH 19/98] change state ticket --- .../methods/ticket-state/change-state.js | 46 +++++++++++++++++++ .../production/common/models/ticket-state.js | 9 ++++ 2 files changed, 55 insertions(+) create mode 100644 services/production/common/methods/ticket-state/change-state.js create mode 100644 services/production/common/models/ticket-state.js diff --git a/services/production/common/methods/ticket-state/change-state.js b/services/production/common/methods/ticket-state/change-state.js new file mode 100644 index 000000000..99254bd66 --- /dev/null +++ b/services/production/common/methods/ticket-state/change-state.js @@ -0,0 +1,46 @@ +module.exports = function(TicketState) { + TicketState.remoteMethod('changeState', { + description: 'Change state of tickets', + accepts: [ + { + arg: 'tickets', + type: 'array', + required: true, + description: 'Array of tickets', + http: {source: 'path'} + }, + { + arg: 'state', + type: 'number', + required: true, + description: 'New state', + http: {source: 'path'} + }, + ], + returns: { + arg: 'response', + type: 'boolean' + }, + http: { + verb: 'put', + path: '/:tickets/:state/changeState' + } + }); + + TicketState.changeState = function(tickets, state, cb) { + changeState(tickets, state, cb); + }; + + var changeState = function(tickets, state, cb){ + TicketState.update(where(tickets), {"state": state}, function(error, response){ + if(!error) + cb(null, true); + cb(error); + }); + } + + var where = function(tickets){ + return {"where": {"ticketFk": {"inq": tickets } } }; + } + +} \ No newline at end of file diff --git a/services/production/common/models/ticket-state.js b/services/production/common/models/ticket-state.js new file mode 100644 index 000000000..f6890964d --- /dev/null +++ b/services/production/common/models/ticket-state.js @@ -0,0 +1,9 @@ +var app = require('../../server/server'); + +module.exports = function(TicketState) { + var models = app.models; + + // Methods + + require('../methods/ticket-state/change-state.js')(TicketState); +}; \ No newline at end of file From 7713d0bd6f09e4aa6759cabd3e25c3c7ab32bc93 Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Tue, 13 Jun 2017 14:57:09 +0200 Subject: [PATCH 20/98] cambio estilos dropdown --- client/core/src/drop-down/style.scss | 4 +++- client/production/src/index/index.html | 17 ++++++++++------- client/production/src/index/index.js | 7 +++++-- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/client/core/src/drop-down/style.scss b/client/core/src/drop-down/style.scss index 07cf592d9..626b68156 100644 --- a/client/core/src/drop-down/style.scss +++ b/client/core/src/drop-down/style.scss @@ -1,7 +1,9 @@ vn-drop-down { position: absolute; z-index: 9999; - + padding: 0 15px; + margin-left: -15px; + ul{ padding: 0; margin: 10px 0 0 0; diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index cc1b7511a..eb033eeff 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -28,6 +28,9 @@ + + + @@ -58,14 +61,14 @@ - {{ticket.ticket}} - {{ticket.agency}} - {{ticket.worker | ucwords}} - {{ticket.hour}} + {{::ticket.ticket}} + {{::ticket.agency}} + {{::ticket.worker | ucwords}} + {{::ticket.hour}} {{ticket.state}} - {{ticket.lines}} - {{ticket.m3}} - {{ticket.boxes}} + {{::ticket.lines}} + {{::ticket.m3}} + {{::ticket.boxes}}
diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index 8fed9a431..6b1706de3 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -41,9 +41,12 @@ export default class ProductionIndex { checks.forEach( (_, i) => { ids.push(this.tickets[i].ticket); + // Fake change state + this.tickets[i].state = this.state.name; } ); - console.log("TODO: call action -> endPoint with tickets's Ids", action, ids, arguments[1]); + console.log("TODO: call action -> endPoint with tickets's Ids", action, ids, this.state); + // TODO: call action -> endPoint with tickets's Ids } else { console.log("TODO: dialog with no items selected", action); @@ -68,7 +71,7 @@ export default class ProductionIndex { } $doCheck() { if (this.state) { - this.doAction('changeState', Object.assign({}, this.state)); + this.doAction('changeState'); this.state = null; } } From 3da67266bbc58dc31587cc6e87a5bd6853dd9143 Mon Sep 17 00:00:00 2001 From: nelo Date: Wed, 14 Jun 2017 08:54:45 +0200 Subject: [PATCH 21/98] promesa para obtener usuario --- services/client/common/models/my-model.js | 14 ++++++++++- .../methods/ticket-state/change-state.js | 23 +++++++++++-------- services/production/common/models/my-model.js | 14 ++++++++++- services/production/server/middleware.json | 12 +++++++++- .../server/middleware/currentUser.js | 13 +++++++++++ services/service/models/my-model.js | 13 +++++++++++ 6 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 services/production/server/middleware/currentUser.js diff --git a/services/client/common/models/my-model.js b/services/client/common/models/my-model.js index 4d98e7f62..bfa55efbd 100644 --- a/services/client/common/models/my-model.js +++ b/services/client/common/models/my-model.js @@ -1,4 +1,3 @@ - module.exports = function(self) { self.setup = function() { @@ -26,7 +25,20 @@ module.exports = function(self) { for(let method in disableMethods) { //this.disableRemoteMethod(method, disableMethods[method]); } + }; + self.getUser = function() { + let loopBackContext = require('loopback-context'); + let currentUser = loopBackContext.getCurrentContext(); + let userId = currentUser.get('currentUser'); + return userId; + }; + + self.getEmployee = function() { + let app = require('../../server/server'); + let userId = self.getUser(); + let employee = app.models.Employee; + return employee.findOne({where: {userFk: userId}}); }; self.rawSql = function(query, params, cb) { diff --git a/services/production/common/methods/ticket-state/change-state.js b/services/production/common/methods/ticket-state/change-state.js index 99254bd66..ce6802288 100644 --- a/services/production/common/methods/ticket-state/change-state.js +++ b/services/production/common/methods/ticket-state/change-state.js @@ -28,19 +28,22 @@ module.exports = function(TicketState) { }); TicketState.changeState = function(tickets, state, cb) { - changeState(tickets, state, cb); + TicketState.getEmployee().then(function(emp){ + changeState(emp, tickets, state, cb); + }); }; - var changeState = function(tickets, state, cb){ - TicketState.update(where(tickets), {"state": state}, function(error, response){ - if(!error) - cb(null, true); - cb(error); + var changeState = function(emp, tickets, state, cb){ + var inserts = []; + + tickets.forEach(function(t) { + inserts.push({ticketFk: t, stateFk: state, employeeFk: emp}); + }, this); + + TicketState.create(inserts, function(err, res){ + if(!err) + cb(null, res); }); } - var where = function(tickets){ - return {"where": {"ticketFk": {"inq": tickets } } }; - } - } \ No newline at end of file diff --git a/services/production/common/models/my-model.js b/services/production/common/models/my-model.js index 4d98e7f62..bfa55efbd 100644 --- a/services/production/common/models/my-model.js +++ b/services/production/common/models/my-model.js @@ -1,4 +1,3 @@ - module.exports = function(self) { self.setup = function() { @@ -26,7 +25,20 @@ module.exports = function(self) { for(let method in disableMethods) { //this.disableRemoteMethod(method, disableMethods[method]); } + }; + self.getUser = function() { + let loopBackContext = require('loopback-context'); + let currentUser = loopBackContext.getCurrentContext(); + let userId = currentUser.get('currentUser'); + return userId; + }; + + self.getEmployee = function() { + let app = require('../../server/server'); + let userId = self.getUser(); + let employee = app.models.Employee; + return employee.findOne({where: {userFk: userId}}); }; self.rawSql = function(query, params, cb) { diff --git a/services/production/server/middleware.json b/services/production/server/middleware.json index fbfff8165..810050770 100644 --- a/services/production/server/middleware.json +++ b/services/production/server/middleware.json @@ -28,10 +28,20 @@ "helmet#noSniff": {}, "helmet#noCache": { "enabled": false + }, + "loopback-context#per-request": { + "params": { + "enableHttpContext": true + } } }, "session": {}, - "auth": {}, + "auth": { + "loopback#token": {} + }, + "auth:after": { + "./middleware/currentUser": {} + }, "parse": {}, "routes": { "loopback#rest": { diff --git a/services/production/server/middleware/currentUser.js b/services/production/server/middleware/currentUser.js new file mode 100644 index 000000000..6024b442e --- /dev/null +++ b/services/production/server/middleware/currentUser.js @@ -0,0 +1,13 @@ +module.exports = function(options) { + return function storeCurrentUser(req, res, next) { + if (!req.accessToken) { + return next(); + } + let LoopBackContext = require('loopback-context'); + let loopbackContext = LoopBackContext.getCurrentContext(); + if (loopbackContext) { + loopbackContext.set('currentUser', req.accessToken.userId); + } + next(); + }; +}; diff --git a/services/service/models/my-model.js b/services/service/models/my-model.js index 4d98e7f62..9246e02a9 100644 --- a/services/service/models/my-model.js +++ b/services/service/models/my-model.js @@ -1,3 +1,5 @@ +let loopBackContext = require('loopback-context'); +let app = require('../../server/server'); module.exports = function(self) { @@ -26,7 +28,18 @@ module.exports = function(self) { for(let method in disableMethods) { //this.disableRemoteMethod(method, disableMethods[method]); } + }; + self.getUser = function() { + let currentUser = loopBackContext.getCurrentContext(); + let userId = currentUser.get('currentUser'); + return userId; + }; + + self.getEmployee = function() { + let userId = self.getUser(); + let employee = app.models.Employee; + return employee.findOne({where: {userFk: userId}}); }; self.rawSql = function(query, params, cb) { From afff93cce61612d54fc729c86e4c47adf8258c3f Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Wed, 14 Jun 2017 09:54:00 +0200 Subject: [PATCH 22/98] =?UTF-8?q?Tooltip:=20admite=20html,=20Localizador:?= =?UTF-8?q?=20a=C3=B1adido=20icono=20con=20informaci=C3=B3n=20adicional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/core/src/drop-down/style.scss | 2 +- client/core/src/tooltip/style.css | 5 ++- client/core/src/tooltip/tooltip.js | 33 ++++++++++++++++--- client/production/src/index/index.html | 23 ++++++++----- client/production/src/index/index.js | 32 +++++++++++------- .../src/index/more-info-tooltip.tpl.html | 18 ++++++++++ client/production/src/index/style.scss | 23 ------------- client/salix/src/styles/misc.scss | 24 ++++++++++++++ .../methods/ticket-state/change-state.js | 2 +- 9 files changed, 110 insertions(+), 52 deletions(-) create mode 100644 client/production/src/index/more-info-tooltip.tpl.html diff --git a/client/core/src/drop-down/style.scss b/client/core/src/drop-down/style.scss index 626b68156..52adc1199 100644 --- a/client/core/src/drop-down/style.scss +++ b/client/core/src/drop-down/style.scss @@ -3,7 +3,7 @@ vn-drop-down { z-index: 9999; padding: 0 15px; margin-left: -15px; - + background: transparent; ul{ padding: 0; margin: 10px 0 0 0; diff --git a/client/core/src/tooltip/style.css b/client/core/src/tooltip/style.css index 943a92c9c..9d27976c0 100644 --- a/client/core/src/tooltip/style.css +++ b/client/core/src/tooltip/style.css @@ -6,7 +6,6 @@ position: fixed; background-color: #fff; padding: 15px; - max-width: 250px; color: #424242; z-index: 999; border: 1px solid #A7A7A7; @@ -23,6 +22,10 @@ height: 0; } +.tooltip-text{ + max-width: 250px; +} + .tooltip-down .tooltip-arrow { top: -15px; left: 50%; diff --git a/client/core/src/tooltip/tooltip.js b/client/core/src/tooltip/tooltip.js index d7620e41c..ff3f7472f 100644 --- a/client/core/src/tooltip/tooltip.js +++ b/client/core/src/tooltip/tooltip.js @@ -1,18 +1,41 @@ import {module} from '../module'; import './style.css'; -tooltip.$inject = ['$document', '$compile']; -function tooltip($document, $compile) { +tooltip.$inject = ['$document', '$compile', '$sce', '$templateCache', '$http']; +function tooltip($document, $compile, $sce, $templateCache, $http) { + function getTemplate(tooltipTemplateUrl) { + var template = $templateCache.get(tooltipTemplateUrl); + if (typeof template === 'undefined') { + template = $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) { + return response.data; + }); + $templateCache.put(tooltipTemplateUrl, template); + } + return template; + } + return { restrict: 'A', - scope: true, + priority: -1, link: function(scope, element, attrs) { - var tip = $compile('
{{ text }}
')(scope); + var tip = $compile('
{{ text }}
')(scope); var tipClassName = 'tooltip'; var tipActiveClassName = 'tooltip-show'; scope.tipClass = [tipClassName]; - scope.text = attrs.vnTooltip; + scope.text = attrs.vnTooltip || ''; + + if (attrs.tooltipHtml) { + scope.isHtmlContent = true; + scope.htmlContent = $sce.trustAsHtml(attrs.tooltipHtml); + } else if (attrs.tooltipTemplate) { + var template = getTemplate(attrs.tooltipTemplate); + scope.isHtmlContent = true; + scope.htmlContent = $sce.trustAsHtml(template); + } else { + scope.isHtmlContent = false; + scope.htmlContent = null; + } if (attrs.tooltipPosition) { scope.tipClass.push('tooltip-' + attrs.tooltipPosition); diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index eb033eeff..e132f0033 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -26,15 +26,18 @@ - - + + - - + + + + + + + + - - - @@ -56,7 +59,7 @@
- + @@ -69,7 +72,9 @@ {{::ticket.lines}} {{::ticket.m3}} {{::ticket.boxes}} - + + + diff --git a/client/production/src/index/index.js b/client/production/src/index/index.js index 6b1706de3..c2d811af3 100644 --- a/client/production/src/index/index.js +++ b/client/production/src/index/index.js @@ -10,7 +10,12 @@ export default class ProductionIndex { this.tickets = []; this.lines = 0; this.meters = 0; - this.state = null; + this.actions = { + state: null, + worker: null, + hour: null + }; + this.hourItems = []; } get checkAll() { return this._checkAll; @@ -19,12 +24,6 @@ export default class ProductionIndex { this._checkAll = value; this.switchChecks(); } - /*get state() { - return this._state; - } - set state(value) { - this._state = value; - }*/ switchChecks() { let checks = this.$element[0].querySelectorAll('.list-body input[type="checkbox"]'); checks.forEach( @@ -42,11 +41,10 @@ export default class ProductionIndex { (_, i) => { ids.push(this.tickets[i].ticket); // Fake change state - this.tickets[i].state = this.state.name; + this.tickets[i].state = this.actions.state.name; } ); - console.log("TODO: call action -> endPoint with tickets's Ids", action, ids, this.state); - + console.log("TODO: call action -> endPoint with tickets's Ids", action, ids, this.actions); // TODO: call action -> endPoint with tickets's Ids } else { console.log("TODO: dialog with no items selected", action); @@ -70,9 +68,19 @@ export default class ProductionIndex { this.$.index.accept(); } $doCheck() { - if (this.state) { + if (this.actions.state) { this.doAction('changeState'); - this.state = null; + this.actions.state = null; + } + } + $onInit() { + for (let i = 6; i < 21; i++) { + let hour = [i].join(''); + if (hour.length === 1) { + hour = [0, i].join(''); + } + hour += ':00'; + this.hourItems.push({id: i, name: hour}); } } } diff --git a/client/production/src/index/more-info-tooltip.tpl.html b/client/production/src/index/more-info-tooltip.tpl.html new file mode 100644 index 000000000..085187043 --- /dev/null +++ b/client/production/src/index/more-info-tooltip.tpl.html @@ -0,0 +1,18 @@ + + + + Población + Provincia + ID_Cliente + Comercial + + + + + {{ticket.city}} + {{ticket.province}} + {{ticket.client}} + {{ticket.salePerson}} + + + \ No newline at end of file diff --git a/client/production/src/index/style.scss b/client/production/src/index/style.scss index cafeb13cb..63d0cd9a7 100644 --- a/client/production/src/index/style.scss +++ b/client/production/src/index/style.scss @@ -17,27 +17,4 @@ vn-production-index { .icon-square{ height: 36px; } - .list-header{ - border-bottom: 3px solid #9D9D9D; - font-weight: bold; - } - - .list-footer{ - border-top: 3px solid #9D9D9D; - font-weight: bold; - } - .list > vn-one, .list > [vn-one], .list > [vn-two], .list > vn-two{ - text-align: center; - } - .list > vn-none{ - min-width: 60px; - } - .list-body{ - padding: 4px 0px; - border-bottom: 1px solid #9D9D9D; - - i { - color: #ffa410; - } - } } \ No newline at end of file diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss index c3712646e..604e40d51 100644 --- a/client/salix/src/styles/misc.scss +++ b/client/salix/src/styles/misc.scss @@ -35,4 +35,28 @@ html [vn-right], .vn-right{ } html [vn-left], .vn-left{ float: left; +} + +.list-header{ + border-bottom: 3px solid #9D9D9D; + font-weight: bold; + } + +.list-footer{ + border-top: 3px solid #9D9D9D; + font-weight: bold; +} +.list > vn-one, .list > [vn-one], .list > [vn-two], .list > vn-two{ + text-align: center; +} +.list > vn-none{ + min-width: 60px; +} +.list-body{ + padding: 4px 0px; + border-bottom: 1px solid #9D9D9D; + + i { + color: #ffa410; + } } \ No newline at end of file diff --git a/services/production/common/methods/ticket-state/change-state.js b/services/production/common/methods/ticket-state/change-state.js index 99254bd66..8951ec13e 100644 --- a/services/production/common/methods/ticket-state/change-state.js +++ b/services/production/common/methods/ticket-state/change-state.js @@ -32,7 +32,7 @@ module.exports = function(TicketState) { }; var changeState = function(tickets, state, cb){ - TicketState.update(where(tickets), {"state": state}, function(error, response){ + TicketState.updateAll(where(tickets), {"state": state}, function(error, response){ if(!error) cb(null, true); cb(error); From 956264a529f93924c6830fe526ec9e768af2f045 Mon Sep 17 00:00:00 2001 From: nelo Date: Wed, 14 Jun 2017 09:56:08 +0200 Subject: [PATCH 23/98] fake son con notas --- .../common/methods/ticket/list-fake.json | 300 ++++++++++++------ 1 file changed, 200 insertions(+), 100 deletions(-) diff --git a/services/production/common/methods/ticket/list-fake.json b/services/production/common/methods/ticket/list-fake.json index 26089c37a..cda5ae63f 100644 --- a/services/production/common/methods/ticket/list-fake.json +++ b/services/production/common/methods/ticket/list-fake.json @@ -11,7 +11,8 @@ "city": "SAN FERNANDO", "province": "Cádiz", "client": 7315, - "salePerson": "MARIA JOSE LAMELA FELIPE" + "salePerson": "MARIA JOSE LAMELA FELIPE", + "notes": null }, { "ticket": 1535518, @@ -25,7 +26,8 @@ "city": "ANDORRA", "province": "Teruel", "client": 1911, - "salePerson": "JUAN CARLOS LORENZO SANCHEZ" + "salePerson": "JUAN CARLOS LORENZO SANCHEZ", + "notes": null }, { "ticket": 1535519, @@ -39,7 +41,8 @@ "city": "AVILES", "province": "Asturias", "client": 4471, - "salePerson": "JOSE JULIAN SAEZ FERNANDEZ" + "salePerson": "JOSE JULIAN SAEZ FERNANDEZ", + "notes": null }, { "ticket": 1535521, @@ -53,7 +56,8 @@ "city": "SANXENXO", "province": "Pontevedra", "client": 5075, - "salePerson": "JUAN CARLOS LORENZO SANCHEZ" + "salePerson": "JUAN CARLOS LORENZO SANCHEZ", + "notes": null }, { "ticket": 1535523, @@ -67,7 +71,8 @@ "city": "ALHENDIN", "province": "Granada", "client": 1501, - "salePerson": "Mª CARMEN SERRANO BAU" + "salePerson": "Mª CARMEN SERRANO BAU", + "notes": null }, { "ticket": 1535524, @@ -81,7 +86,8 @@ "city": "A CORUÑA", "province": "La Coruña", "client": 8002, - "salePerson": "COMPUTER SYSTEM" + "salePerson": "COMPUTER SYSTEM", + "notes": null }, { "ticket": 1535526, @@ -95,7 +101,8 @@ "city": "LOGROÑO", "province": "La Rioja", "client": 2197, - "salePerson": "RODRIGO HALABI ROCHA" + "salePerson": "RODRIGO HALABI ROCHA", + "notes": null }, { "ticket": 1535531, @@ -109,7 +116,8 @@ "city": "LLEIDA", "province": "Lleida", "client": 4227, - "salePerson": "FRAN NATEK ECHEVARRIA" + "salePerson": "FRAN NATEK ECHEVARRIA", + "notes": null }, { "ticket": 1535544, @@ -123,7 +131,8 @@ "city": "LA POBLA DE VALLBONA", "province": "Valencia", "client": 2053, - "salePerson": "DEMBA SAKHO" + "salePerson": "DEMBA SAKHO", + "notes": null }, { "ticket": 1535548, @@ -137,7 +146,8 @@ "city": "PICANYA", "province": "Valencia", "client": 2879, - "salePerson": "CONCHA ESTEBAN VILLENA" + "salePerson": "CONCHA ESTEBAN VILLENA", + "notes": null }, { "ticket": 1535549, @@ -151,7 +161,8 @@ "city": "LOJA", "province": "Granada", "client": 329, - "salePerson": "JAVIER VILAR PASTOR" + "salePerson": "JAVIER VILAR PASTOR", + "notes": null }, { "ticket": 1535555, @@ -165,7 +176,8 @@ "city": "VILASSAR DE MAR", "province": "Barcelona", "client": 6945, - "salePerson": "COMPUTER SYSTEM" + "salePerson": "COMPUTER SYSTEM", + "notes": null }, { "ticket": 1535557, @@ -179,7 +191,8 @@ "city": "EL ALTET", "province": "Alicante", "client": 8000, - "salePerson": "MARIA DEL MAR GIRBES FERRUS" + "salePerson": "MARIA DEL MAR GIRBES FERRUS", + "notes": null }, { "ticket": 1535558, @@ -193,7 +206,8 @@ "city": "TORREBLANCA", "province": "Castellón", "client": 5377, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535559, @@ -207,7 +221,8 @@ "city": "MADRID", "province": "Madrid", "client": 3574, - "salePerson": "ELENA BASCUÑANA TORNERO" + "salePerson": "ELENA BASCUÑANA TORNERO", + "notes": null }, { "ticket": 1535560, @@ -221,7 +236,8 @@ "city": "INCA", "province": "Baleares (Mallorca)", "client": 7500, - "salePerson": "DEMBA SAKHO" + "salePerson": "DEMBA SAKHO", + "notes": null }, { "ticket": 1535561, @@ -235,7 +251,8 @@ "city": "TERUEL", "province": "Teruel", "client": 860, - "salePerson": "MANOLI PULIDO" + "salePerson": "MANOLI PULIDO", + "notes": null }, { "ticket": 1535562, @@ -249,7 +266,8 @@ "city": "MALAGA", "province": "Málaga", "client": 5630, - "salePerson": "MIGUEL ANGEL LAGUNA" + "salePerson": "MIGUEL ANGEL LAGUNA", + "notes": null }, { "ticket": 1535573, @@ -263,7 +281,8 @@ "city": "PALMA", "province": "Baleares (Mallorca)", "client": 6966, - "salePerson": "JULIAN RAMIREZ SAYAGO" + "salePerson": "JULIAN RAMIREZ SAYAGO", + "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535578, @@ -277,7 +296,8 @@ "city": "VILLAMARIN DE VALDEORRAS", "province": "Orense", "client": 6671, - "salePerson": "ESDENKA CALERO PEREZ" + "salePerson": "ESDENKA CALERO PEREZ", + "notes": null }, { "ticket": 1535579, @@ -291,7 +311,8 @@ "city": "MALAGA", "province": "Málaga", "client": 6534, - "salePerson": "JUANLU GALLETERO" + "salePerson": "JUANLU GALLETERO", + "notes": null }, { "ticket": 1535583, @@ -305,7 +326,8 @@ "city": "PALOMARES DEL RIO", "province": "Sevilla", "client": 8506, - "salePerson": "CARLOS ZAMBRANO GARCIA" + "salePerson": "CARLOS ZAMBRANO GARCIA", + "notes": null }, { "ticket": 1535584, @@ -319,7 +341,8 @@ "city": "MARBELLA", "province": "Málaga", "client": 3018, - "salePerson": "JULIAN RAMIREZ SAYAGO" + "salePerson": "JULIAN RAMIREZ SAYAGO", + "notes": null }, { "ticket": 1535589, @@ -333,7 +356,8 @@ "city": "valencia", "province": "Valencia", "client": 3781, - "salePerson": "DEMBA SAKHO" + "salePerson": "DEMBA SAKHO", + "notes": null }, { "ticket": 1535594, @@ -347,7 +371,8 @@ "city": "BENISSODA", "province": "Valencia", "client": 958, - "salePerson": "JULIAN RAMIREZ SAYAGO" + "salePerson": "JULIAN RAMIREZ SAYAGO", + "notes": null }, { "ticket": 1535597, @@ -361,7 +386,8 @@ "city": "SORIA", "province": "Soria", "client": 2082, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535604, @@ -375,7 +401,8 @@ "city": "MADRID", "province": "Madrid", "client": 5134, - "salePerson": "BEGOÑA RODRIGUEZ" + "salePerson": "BEGOÑA RODRIGUEZ", + "notes": null }, { "ticket": 1535610, @@ -389,7 +416,8 @@ "city": "VILLANUEVA DE LA SERENA", "province": "Badajoz", "client": 2816, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535617, @@ -403,7 +431,8 @@ "city": "TORRENT", "province": "Valencia", "client": 1072, - "salePerson": "OKSANA KHODORIVSKA" + "salePerson": "OKSANA KHODORIVSKA", + "notes": null }, { "ticket": 1535622, @@ -417,7 +446,8 @@ "city": "CALZADA DE CALATRAVA", "province": "Ciudad Real", "client": 3921, - "salePerson": "JAVIER VILAR PASTOR" + "salePerson": "JAVIER VILAR PASTOR", + "notes": null }, { "ticket": 1535624, @@ -431,7 +461,8 @@ "city": "MADRID", "province": "Madrid", "client": 6131, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535631, @@ -445,7 +476,8 @@ "city": "VILASSAR DE MAR", "province": "Barcelona", "client": 4658, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535637, @@ -459,7 +491,8 @@ "city": "FELANITX", "province": "Baleares (Mallorca)", "client": 2477, - "salePerson": "JUANLU GALLETERO" + "salePerson": "JUANLU GALLETERO", + "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535643, @@ -473,7 +506,8 @@ "city": "BURRIAN", "province": "Castellón", "client": 3027, - "salePerson": "DEMBA SAKHO" + "salePerson": "DEMBA SAKHO", + "notes": null }, { "ticket": 1535644, @@ -487,7 +521,8 @@ "city": "SAN FERNANDO DE HENARES", "province": "Madrid", "client": 3005, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535648, @@ -501,7 +536,8 @@ "city": "CATADAU", "province": "Valencia", "client": 1425, - "salePerson": "BEGOÑA RODRIGUEZ" + "salePerson": "BEGOÑA RODRIGUEZ", + "notes": null }, { "ticket": 1535652, @@ -515,7 +551,8 @@ "city": "PALACIOS Y VILLAFRAN", "province": "Sevilla", "client": 3063, - "salePerson": "FRAN NATEK ECHEVARRIA" + "salePerson": "FRAN NATEK ECHEVARRIA", + "notes": null }, { "ticket": 1535657, @@ -529,7 +566,8 @@ "city": "PALMA DE GANDIA", "province": "Valencia", "client": 1261, - "salePerson": "BEGOÑA RODRIGUEZ" + "salePerson": "BEGOÑA RODRIGUEZ", + "notes": null }, { "ticket": 1535658, @@ -543,7 +581,8 @@ "city": "GALDACANO", "province": "Vizcaya", "client": 1309, - "salePerson": "BEGOÑA RODRIGUEZ" + "salePerson": "BEGOÑA RODRIGUEZ", + "notes": null }, { "ticket": 1535660, @@ -557,7 +596,8 @@ "city": "CEHEGIN", "province": "Murcia", "client": 178, - "salePerson": "ELENA BASCUÑANA TORNERO" + "salePerson": "ELENA BASCUÑANA TORNERO", + "notes": null }, { "ticket": 1535663, @@ -571,7 +611,8 @@ "city": "ROCIANA DEL CONDADO", "province": "Huelva", "client": 6471, - "salePerson": "Mª CARMEN SERRANO BAU" + "salePerson": "Mª CARMEN SERRANO BAU", + "notes": null }, { "ticket": 1535673, @@ -585,7 +626,8 @@ "city": "CIUDAD RODRIGO", "province": "Salamanca", "client": 7821, - "salePerson": "CRISTINA SANCHEZ BARRUGUER" + "salePerson": "CRISTINA SANCHEZ BARRUGUER", + "notes": null }, { "ticket": 1535678, @@ -599,7 +641,8 @@ "city": "BURRIANA", "province": "Castellón", "client": 3021, - "salePerson": "JESUS DANIEL VALLES PEREZ" + "salePerson": "JESUS DANIEL VALLES PEREZ", + "notes": null }, { "ticket": 1535679, @@ -613,7 +656,8 @@ "city": "MADRID", "province": "Madrid", "client": 3222, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535682, @@ -627,7 +671,8 @@ "city": "PUZOL", "province": "Valencia", "client": 389, - "salePerson": "DEMBA SAKHO" + "salePerson": "DEMBA SAKHO", + "notes": null }, { "ticket": 1535684, @@ -641,7 +686,8 @@ "city": "MONTSERRAT", "province": "Valencia", "client": 3075, - "salePerson": "GISELA LLOPIS COLOM" + "salePerson": "GISELA LLOPIS COLOM", + "notes": null }, { "ticket": 1535686, @@ -655,7 +701,8 @@ "city": "BARBERA DEL VALLES", "province": "Barcelona", "client": 4631, - "salePerson": "COMPUTER SYSTEM" + "salePerson": "COMPUTER SYSTEM", + "notes": null }, { "ticket": 1535687, @@ -669,7 +716,8 @@ "city": "BECERREA", "province": "Lugo", "client": 5410, - "salePerson": "CARLOS BORRAS MARTINEZ" + "salePerson": "CARLOS BORRAS MARTINEZ", + "notes": null }, { "ticket": 1535690, @@ -683,7 +731,8 @@ "city": "REINOSA", "province": "Cantabria", "client": 4268, - "salePerson": "DAVID SARRION RIVERO" + "salePerson": "DAVID SARRION RIVERO", + "notes": null }, { "ticket": 1535693, @@ -697,7 +746,8 @@ "city": "DAIMIEL", "province": "Ciudad Real", "client": 904, - "salePerson": "RODRIGO HALABI ROCHA" + "salePerson": "RODRIGO HALABI ROCHA", + "notes": null }, { "ticket": 1535694, @@ -711,7 +761,8 @@ "city": "VILLARALBO", "province": "Zamora", "client": 5801, - "salePerson": "CARLOS ZAMBRANO GARCIA" + "salePerson": "CARLOS ZAMBRANO GARCIA", + "notes": null }, { "ticket": 1535699, @@ -725,7 +776,8 @@ "city": "ALCORCON", "province": "Madrid", "client": 422, - "salePerson": "MANOLI PULIDO" + "salePerson": "MANOLI PULIDO", + "notes": null }, { "ticket": 1535702, @@ -739,7 +791,8 @@ "city": "PURULLENA", "province": "Granada", "client": 3224, - "salePerson": "Mª CARMEN SERRANO BAU" + "salePerson": "Mª CARMEN SERRANO BAU", + "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535713, @@ -753,7 +806,8 @@ "city": "TORREJON DE ARDOZ", "province": "Madrid", "client": 680, - "salePerson": "ELENA BASCUÑANA TORNERO" + "salePerson": "ELENA BASCUÑANA TORNERO", + "notes": null }, { "ticket": 1535719, @@ -767,7 +821,8 @@ "city": "RIBADESELLA", "province": "Asturias", "client": 2428, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535720, @@ -781,7 +836,8 @@ "city": "BARCELONA", "province": "Barcelona", "client": 7628, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535724, @@ -795,7 +851,8 @@ "city": "QUART DE POBLET", "province": "Valencia", "client": 326, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535727, @@ -809,7 +866,8 @@ "city": "PALMA MALLORCA", "province": "Baleares (Mallorca)", "client": 3436, - "salePerson": "DEMBA SAKHO" + "salePerson": "DEMBA SAKHO", + "notes": null }, { "ticket": 1535732, @@ -823,7 +881,8 @@ "city": "MADRID", "province": "Madrid", "client": 7303, - "salePerson": "MARIA DEL MAR GIRBES FERRUS" + "salePerson": "MARIA DEL MAR GIRBES FERRUS", + "notes": null }, { "ticket": 1535736, @@ -837,7 +896,8 @@ "city": "SANT JOSEP DE SATALIA", "province": "Baleares (Ibiza)", "client": 3472, - "salePerson": "JUANLU GALLETERO" + "salePerson": "JUANLU GALLETERO", + "notes": null }, { "ticket": 1535737, @@ -851,7 +911,8 @@ "city": "MARCILLA", "province": "Navarra", "client": 957, - "salePerson": "DEBORA SANCHEZ TORIO" + "salePerson": "DEBORA SANCHEZ TORIO", + "notes": null }, { "ticket": 1535742, @@ -865,7 +926,8 @@ "city": "MALAGA", "province": "Málaga", "client": 4812, - "salePerson": "MIGUEL ANGEL LAGUNA" + "salePerson": "MIGUEL ANGEL LAGUNA", + "notes": null }, { "ticket": 1535747, @@ -879,7 +941,8 @@ "city": "SEVILLA", "province": "Sevilla", "client": 4095, - "salePerson": "FRAN NATEK ECHEVARRIA" + "salePerson": "FRAN NATEK ECHEVARRIA", + "notes": null }, { "ticket": 1535749, @@ -893,7 +956,8 @@ "city": "VIVEIRO", "province": "Lugo", "client": 5928, - "salePerson": "DEBORA SANCHEZ TORIO" + "salePerson": "DEBORA SANCHEZ TORIO", + "notes": null }, { "ticket": 1535751, @@ -907,7 +971,8 @@ "city": "RABADE LUGO", "province": "Lugo", "client": 5652, - "salePerson": "JOSE JULIAN SAEZ FERNANDEZ" + "salePerson": "JOSE JULIAN SAEZ FERNANDEZ", + "notes": null }, { "ticket": 1535756, @@ -921,7 +986,8 @@ "city": "LANDETE", "province": "Cuenca", "client": 3857, - "salePerson": "DAVID SARRION RIVERO" + "salePerson": "DAVID SARRION RIVERO", + "notes": null }, { "ticket": 1535758, @@ -935,7 +1001,8 @@ "city": "LA POBLA DE VALLBONA", "province": "Valencia", "client": 2053, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535765, @@ -949,7 +1016,8 @@ "city": "SANT HIPÒLIT DE VOLTREGÀ", "province": "Barcelona", "client": 5876, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535770, @@ -963,7 +1031,8 @@ "city": "ILLESCAS", "province": "Toledo", "client": 4283, - "salePerson": "DEBORA SANCHEZ TORIO" + "salePerson": "DEBORA SANCHEZ TORIO", + "notes": null }, { "ticket": 1535771, @@ -977,7 +1046,8 @@ "city": "SEVILLA", "province": "Sevilla", "client": 2000, - "salePerson": "JUANLU GALLETERO" + "salePerson": "JUANLU GALLETERO", + "notes": null }, { "ticket": 1535772, @@ -991,7 +1061,8 @@ "city": "SEVILLA", "province": "Sevilla", "client": 2635, - "salePerson": "MARIA JOSE LAMELA FELIPE" + "salePerson": "MARIA JOSE LAMELA FELIPE", + "notes": null }, { "ticket": 1535774, @@ -1005,7 +1076,8 @@ "city": "LEON", "province": "León", "client": 8321, - "salePerson": "JESUS DANIEL VALLES PEREZ" + "salePerson": "JESUS DANIEL VALLES PEREZ", + "notes": null }, { "ticket": 1535775, @@ -1019,7 +1091,8 @@ "city": "PUIG PLAYA", "province": "Valencia", "client": 3781, - "salePerson": "JESUS DANIEL VALLES PEREZ" + "salePerson": "JESUS DANIEL VALLES PEREZ", + "notes": null }, { "ticket": 1535776, @@ -1033,7 +1106,8 @@ "city": "TORREJON DE ARDOZ", "province": "Madrid", "client": 1600, - "salePerson": "CRISTINA SANCHEZ BARRUGUER" + "salePerson": "CRISTINA SANCHEZ BARRUGUER", + "notes": null }, { "ticket": 1535777, @@ -1047,7 +1121,8 @@ "city": "PALENCIA", "province": "Palencia", "client": 3717, - "salePerson": "MANOLI PULIDO" + "salePerson": "MANOLI PULIDO", + "notes": null }, { "ticket": 1535779, @@ -1061,7 +1136,8 @@ "city": "ESLIDA", "province": "Castellón", "client": 7423, - "salePerson": "ELENA BASCUÑANA TORNERO" + "salePerson": "ELENA BASCUÑANA TORNERO", + "notes": null }, { "ticket": 1535899, @@ -1075,7 +1151,8 @@ "city": "MARTORELL", "province": "Barcelona", "client": 4058, - "salePerson": "CLAUDI SANROMA REYNARES" + "salePerson": "CLAUDI SANROMA REYNARES", + "notes": null }, { "ticket": 1535903, @@ -1089,7 +1166,8 @@ "city": "TOLOSA", "province": "Guipuzcoa", "client": 6308, - "salePerson": "SILVERIO DOMINGUEZ" + "salePerson": "SILVERIO DOMINGUEZ", + "notes": null }, { "ticket": 1535905, @@ -1103,7 +1181,8 @@ "city": "MADRID", "province": "Madrid", "client": 3574, - "salePerson": "ELENA BASCUÑANA TORNERO" + "salePerson": "ELENA BASCUÑANA TORNERO", + "notes": null }, { "ticket": 1535908, @@ -1131,7 +1210,8 @@ "city": "INCA", "province": "Baleares (Mallorca)", "client": 6032, - "salePerson": "MIGUEL ANGEL LAGUNA" + "salePerson": "MIGUEL ANGEL LAGUNA", + "notes": null }, { "ticket": 1535912, @@ -1145,7 +1225,8 @@ "city": "VALENCIA", "province": "Valencia", "client": 3613, - "salePerson": "COMPUTER SYSTEM" + "salePerson": "COMPUTER SYSTEM", + "notes": null }, { "ticket": 1535918, @@ -1159,7 +1240,8 @@ "city": "VALENCIA", "province": "Valencia", "client": 2574, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535919, @@ -1173,7 +1255,8 @@ "city": "PALMA", "province": "Baleares (Mallorca)", "client": 7445, - "salePerson": "MARIA DEL MAR GIRBES FERRUS" + "salePerson": "MARIA DEL MAR GIRBES FERRUS", + "notes": null }, { "ticket": 1535920, @@ -1187,7 +1270,8 @@ "city": "Benahavis", "province": "Málaga", "client": 7796, - "salePerson": "JULIA LLOPIS CASTELL" + "salePerson": "JULIA LLOPIS CASTELL", + "notes": null }, { "ticket": 1535921, @@ -1201,7 +1285,8 @@ "city": "SUECA", "province": "Valencia", "client": 1160, - "salePerson": "FRAN NATEK ECHEVARRIA" + "salePerson": "FRAN NATEK ECHEVARRIA", + "notes": null }, { "ticket": 1535928, @@ -1215,7 +1300,8 @@ "city": "ESCALONA", "province": "Toledo", "client": 2787, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535931, @@ -1229,7 +1315,8 @@ "city": "PARLA", "province": "Madrid", "client": 2725, - "salePerson": "CARLOS ZAMBRANO GARCIA" + "salePerson": "CARLOS ZAMBRANO GARCIA", + "notes": null }, { "ticket": 1535935, @@ -1243,7 +1330,8 @@ "city": "SAN FERNADO DE HENARES", "province": "Madrid", "client": 3240, - "salePerson": 0 + "salePerson": 0, + "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535936, @@ -1257,7 +1345,8 @@ "city": "VINAROS", "province": "Castellón", "client": 768, - "salePerson": "DAVID SARRION RIVERO" + "salePerson": "DAVID SARRION RIVERO", + "notes": null }, { "ticket": 1535938, @@ -1271,7 +1360,8 @@ "city": "VELEZ-MALAGA", "province": "Málaga", "client": 5358, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535941, @@ -1285,7 +1375,8 @@ "city": "HUERCAL DE ALMERIA", "province": "Almería", "client": 475, - "salePerson": "LOLI LOZANO RAEZ" + "salePerson": "LOLI LOZANO RAEZ", + "notes": null }, { "ticket": 1535942, @@ -1299,7 +1390,8 @@ "city": "CHIPIONA", "province": "Cádiz", "client": 1479, - "salePerson": "CARLOS ZAMBRANO GARCIA" + "salePerson": "CARLOS ZAMBRANO GARCIA", + "notes": null }, { "ticket": 1535943, @@ -1313,7 +1405,8 @@ "city": "PALMA DE MALLORCA", "province": "Baleares (Mallorca)", "client": 5840, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535946, @@ -1327,7 +1420,8 @@ "city": "VILASSAR DE MAR", "province": "Barcelona", "client": 3951, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535956, @@ -1341,7 +1435,8 @@ "city": "CATARROJA", "province": "Valencia", "client": 4193, - "salePerson": "JOSE JAVIER ECHEVARRIA" + "salePerson": "JOSE JAVIER ECHEVARRIA", + "notes": null }, { "ticket": 1535957, @@ -1355,7 +1450,8 @@ "city": "BINISSALEM", "province": "Baleares (Mallorca)", "client": 5172, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535960, @@ -1369,7 +1465,8 @@ "city": "BAENA", "province": "Córdoba", "client": 1667, - "salePerson": "FRAN NATEK ECHEVARRIA" + "salePerson": "FRAN NATEK ECHEVARRIA", + "notes": null }, { "ticket": 1535961, @@ -1383,7 +1480,8 @@ "city": "MADRID", "province": "Madrid", "client": 5762, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535962, @@ -1397,7 +1495,8 @@ "city": "CUEVAS DEL VALLE", "province": "Ávila", "client": 6070, - "salePerson": 0 + "salePerson": 0, + "notes": null }, { "ticket": 1535967, @@ -1411,6 +1510,7 @@ "city": "SEVILLA", "province": "Sevilla", "client": 2000, - "salePerson": "FRAN NATEK ECHEVARRIA" + "salePerson": "FRAN NATEK ECHEVARRIA", + "notes": null } ] \ No newline at end of file From 16302e1f9aa4f1ee8e6894c7321b95f204af369e Mon Sep 17 00:00:00 2001 From: nelo Date: Wed, 14 Jun 2017 12:16:53 +0200 Subject: [PATCH 24/98] problemas con riesgo --- .../common/methods/ticket/list-fake.json | 200 +++++++++--------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/services/production/common/methods/ticket/list-fake.json b/services/production/common/methods/ticket/list-fake.json index cda5ae63f..6cf32bc13 100644 --- a/services/production/common/methods/ticket/list-fake.json +++ b/services/production/common/methods/ticket/list-fake.json @@ -12,7 +12,7 @@ "province": "Cádiz", "client": 7315, "salePerson": "MARIA JOSE LAMELA FELIPE", - "notes": null + "problems": null }, { "ticket": 1535518, @@ -27,7 +27,7 @@ "province": "Teruel", "client": 1911, "salePerson": "JUAN CARLOS LORENZO SANCHEZ", - "notes": null + "problems": null }, { "ticket": 1535519, @@ -42,7 +42,7 @@ "province": "Asturias", "client": 4471, "salePerson": "JOSE JULIAN SAEZ FERNANDEZ", - "notes": null + "problems": null }, { "ticket": 1535521, @@ -57,7 +57,7 @@ "province": "Pontevedra", "client": 5075, "salePerson": "JUAN CARLOS LORENZO SANCHEZ", - "notes": null + "problems": null }, { "ticket": 1535523, @@ -72,7 +72,7 @@ "province": "Granada", "client": 1501, "salePerson": "Mª CARMEN SERRANO BAU", - "notes": null + "problems": null }, { "ticket": 1535524, @@ -87,7 +87,7 @@ "province": "La Coruña", "client": 8002, "salePerson": "COMPUTER SYSTEM", - "notes": null + "problems": null }, { "ticket": 1535526, @@ -102,7 +102,7 @@ "province": "La Rioja", "client": 2197, "salePerson": "RODRIGO HALABI ROCHA", - "notes": null + "problems": null }, { "ticket": 1535531, @@ -117,7 +117,7 @@ "province": "Lleida", "client": 4227, "salePerson": "FRAN NATEK ECHEVARRIA", - "notes": null + "problems": null }, { "ticket": 1535544, @@ -132,7 +132,7 @@ "province": "Valencia", "client": 2053, "salePerson": "DEMBA SAKHO", - "notes": null + "problems": null }, { "ticket": 1535548, @@ -147,7 +147,7 @@ "province": "Valencia", "client": 2879, "salePerson": "CONCHA ESTEBAN VILLENA", - "notes": null + "problems": null }, { "ticket": 1535549, @@ -162,7 +162,7 @@ "province": "Granada", "client": 329, "salePerson": "JAVIER VILAR PASTOR", - "notes": null + "problems": null }, { "ticket": 1535555, @@ -177,7 +177,7 @@ "province": "Barcelona", "client": 6945, "salePerson": "COMPUTER SYSTEM", - "notes": null + "problems": null }, { "ticket": 1535557, @@ -192,7 +192,7 @@ "province": "Alicante", "client": 8000, "salePerson": "MARIA DEL MAR GIRBES FERRUS", - "notes": null + "problems": null }, { "ticket": 1535558, @@ -207,7 +207,7 @@ "province": "Castellón", "client": 5377, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535559, @@ -222,7 +222,7 @@ "province": "Madrid", "client": 3574, "salePerson": "ELENA BASCUÑANA TORNERO", - "notes": null + "problems": null }, { "ticket": 1535560, @@ -237,7 +237,7 @@ "province": "Baleares (Mallorca)", "client": 7500, "salePerson": "DEMBA SAKHO", - "notes": null + "problems": null }, { "ticket": 1535561, @@ -252,7 +252,7 @@ "province": "Teruel", "client": 860, "salePerson": "MANOLI PULIDO", - "notes": null + "problems": null }, { "ticket": 1535562, @@ -267,7 +267,7 @@ "province": "Málaga", "client": 5630, "salePerson": "MIGUEL ANGEL LAGUNA", - "notes": null + "problems": null }, { "ticket": 1535573, @@ -282,7 +282,7 @@ "province": "Baleares (Mallorca)", "client": 6966, "salePerson": "JULIAN RAMIREZ SAYAGO", - "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " + "problems": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535578, @@ -297,7 +297,7 @@ "province": "Orense", "client": 6671, "salePerson": "ESDENKA CALERO PEREZ", - "notes": null + "problems": null }, { "ticket": 1535579, @@ -312,7 +312,7 @@ "province": "Málaga", "client": 6534, "salePerson": "JUANLU GALLETERO", - "notes": null + "problems": null }, { "ticket": 1535583, @@ -327,7 +327,7 @@ "province": "Sevilla", "client": 8506, "salePerson": "CARLOS ZAMBRANO GARCIA", - "notes": null + "problems": null }, { "ticket": 1535584, @@ -342,7 +342,7 @@ "province": "Málaga", "client": 3018, "salePerson": "JULIAN RAMIREZ SAYAGO", - "notes": null + "problems": null }, { "ticket": 1535589, @@ -357,7 +357,7 @@ "province": "Valencia", "client": 3781, "salePerson": "DEMBA SAKHO", - "notes": null + "problems": null }, { "ticket": 1535594, @@ -372,7 +372,7 @@ "province": "Valencia", "client": 958, "salePerson": "JULIAN RAMIREZ SAYAGO", - "notes": null + "problems": null }, { "ticket": 1535597, @@ -387,7 +387,7 @@ "province": "Soria", "client": 2082, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535604, @@ -402,7 +402,7 @@ "province": "Madrid", "client": 5134, "salePerson": "BEGOÑA RODRIGUEZ", - "notes": null + "problems": null }, { "ticket": 1535610, @@ -417,7 +417,7 @@ "province": "Badajoz", "client": 2816, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535617, @@ -432,7 +432,7 @@ "province": "Valencia", "client": 1072, "salePerson": "OKSANA KHODORIVSKA", - "notes": null + "problems": null }, { "ticket": 1535622, @@ -447,7 +447,7 @@ "province": "Ciudad Real", "client": 3921, "salePerson": "JAVIER VILAR PASTOR", - "notes": null + "problems": "RIESGO" }, { "ticket": 1535624, @@ -462,7 +462,7 @@ "province": "Madrid", "client": 6131, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535631, @@ -477,7 +477,7 @@ "province": "Barcelona", "client": 4658, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535637, @@ -492,7 +492,7 @@ "province": "Baleares (Mallorca)", "client": 2477, "salePerson": "JUANLU GALLETERO", - "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " + "problems": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535643, @@ -507,7 +507,7 @@ "province": "Castellón", "client": 3027, "salePerson": "DEMBA SAKHO", - "notes": null + "problems": null }, { "ticket": 1535644, @@ -522,7 +522,7 @@ "province": "Madrid", "client": 3005, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535648, @@ -537,7 +537,7 @@ "province": "Valencia", "client": 1425, "salePerson": "BEGOÑA RODRIGUEZ", - "notes": null + "problems": null }, { "ticket": 1535652, @@ -552,7 +552,7 @@ "province": "Sevilla", "client": 3063, "salePerson": "FRAN NATEK ECHEVARRIA", - "notes": null + "problems": null }, { "ticket": 1535657, @@ -567,7 +567,7 @@ "province": "Valencia", "client": 1261, "salePerson": "BEGOÑA RODRIGUEZ", - "notes": null + "problems": null }, { "ticket": 1535658, @@ -582,7 +582,7 @@ "province": "Vizcaya", "client": 1309, "salePerson": "BEGOÑA RODRIGUEZ", - "notes": null + "problems": null }, { "ticket": 1535660, @@ -597,7 +597,7 @@ "province": "Murcia", "client": 178, "salePerson": "ELENA BASCUÑANA TORNERO", - "notes": null + "problems": null }, { "ticket": 1535663, @@ -612,7 +612,7 @@ "province": "Huelva", "client": 6471, "salePerson": "Mª CARMEN SERRANO BAU", - "notes": null + "problems": null }, { "ticket": 1535673, @@ -627,7 +627,7 @@ "province": "Salamanca", "client": 7821, "salePerson": "CRISTINA SANCHEZ BARRUGUER", - "notes": null + "problems": null }, { "ticket": 1535678, @@ -642,7 +642,7 @@ "province": "Castellón", "client": 3021, "salePerson": "JESUS DANIEL VALLES PEREZ", - "notes": null + "problems": null }, { "ticket": 1535679, @@ -657,7 +657,7 @@ "province": "Madrid", "client": 3222, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535682, @@ -672,7 +672,7 @@ "province": "Valencia", "client": 389, "salePerson": "DEMBA SAKHO", - "notes": null + "problems": null }, { "ticket": 1535684, @@ -687,7 +687,7 @@ "province": "Valencia", "client": 3075, "salePerson": "GISELA LLOPIS COLOM", - "notes": null + "problems": null }, { "ticket": 1535686, @@ -702,7 +702,7 @@ "province": "Barcelona", "client": 4631, "salePerson": "COMPUTER SYSTEM", - "notes": null + "problems": null }, { "ticket": 1535687, @@ -717,7 +717,7 @@ "province": "Lugo", "client": 5410, "salePerson": "CARLOS BORRAS MARTINEZ", - "notes": null + "problems": null }, { "ticket": 1535690, @@ -732,7 +732,7 @@ "province": "Cantabria", "client": 4268, "salePerson": "DAVID SARRION RIVERO", - "notes": null + "problems": null }, { "ticket": 1535693, @@ -747,7 +747,7 @@ "province": "Ciudad Real", "client": 904, "salePerson": "RODRIGO HALABI ROCHA", - "notes": null + "problems": null }, { "ticket": 1535694, @@ -762,7 +762,7 @@ "province": "Zamora", "client": 5801, "salePerson": "CARLOS ZAMBRANO GARCIA", - "notes": null + "problems": null }, { "ticket": 1535699, @@ -777,7 +777,7 @@ "province": "Madrid", "client": 422, "salePerson": "MANOLI PULIDO", - "notes": null + "problems": null }, { "ticket": 1535702, @@ -792,7 +792,7 @@ "province": "Granada", "client": 3224, "salePerson": "Mª CARMEN SERRANO BAU", - "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " + "problems": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535713, @@ -807,7 +807,7 @@ "province": "Madrid", "client": 680, "salePerson": "ELENA BASCUÑANA TORNERO", - "notes": null + "problems": "RIESGO" }, { "ticket": 1535719, @@ -822,7 +822,7 @@ "province": "Asturias", "client": 2428, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535720, @@ -837,7 +837,7 @@ "province": "Barcelona", "client": 7628, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535724, @@ -852,7 +852,7 @@ "province": "Valencia", "client": 326, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535727, @@ -867,7 +867,7 @@ "province": "Baleares (Mallorca)", "client": 3436, "salePerson": "DEMBA SAKHO", - "notes": null + "problems": null }, { "ticket": 1535732, @@ -882,7 +882,7 @@ "province": "Madrid", "client": 7303, "salePerson": "MARIA DEL MAR GIRBES FERRUS", - "notes": null + "problems": null }, { "ticket": 1535736, @@ -897,7 +897,7 @@ "province": "Baleares (Ibiza)", "client": 3472, "salePerson": "JUANLU GALLETERO", - "notes": null + "problems": null }, { "ticket": 1535737, @@ -912,7 +912,7 @@ "province": "Navarra", "client": 957, "salePerson": "DEBORA SANCHEZ TORIO", - "notes": null + "problems": null }, { "ticket": 1535742, @@ -927,7 +927,7 @@ "province": "Málaga", "client": 4812, "salePerson": "MIGUEL ANGEL LAGUNA", - "notes": null + "problems": null }, { "ticket": 1535747, @@ -942,7 +942,7 @@ "province": "Sevilla", "client": 4095, "salePerson": "FRAN NATEK ECHEVARRIA", - "notes": null + "problems": null }, { "ticket": 1535749, @@ -957,7 +957,7 @@ "province": "Lugo", "client": 5928, "salePerson": "DEBORA SANCHEZ TORIO", - "notes": null + "problems": null }, { "ticket": 1535751, @@ -972,7 +972,7 @@ "province": "Lugo", "client": 5652, "salePerson": "JOSE JULIAN SAEZ FERNANDEZ", - "notes": null + "problems": null }, { "ticket": 1535756, @@ -987,7 +987,7 @@ "province": "Cuenca", "client": 3857, "salePerson": "DAVID SARRION RIVERO", - "notes": null + "problems": null }, { "ticket": 1535758, @@ -1002,7 +1002,7 @@ "province": "Valencia", "client": 2053, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535765, @@ -1017,7 +1017,7 @@ "province": "Barcelona", "client": 5876, "salePerson": 0, - "notes": null + "problems": "RIESGO" }, { "ticket": 1535770, @@ -1032,7 +1032,7 @@ "province": "Toledo", "client": 4283, "salePerson": "DEBORA SANCHEZ TORIO", - "notes": null + "problems": null }, { "ticket": 1535771, @@ -1047,7 +1047,7 @@ "province": "Sevilla", "client": 2000, "salePerson": "JUANLU GALLETERO", - "notes": null + "problems": null }, { "ticket": 1535772, @@ -1062,7 +1062,7 @@ "province": "Sevilla", "client": 2635, "salePerson": "MARIA JOSE LAMELA FELIPE", - "notes": null + "problems": null }, { "ticket": 1535774, @@ -1077,7 +1077,7 @@ "province": "León", "client": 8321, "salePerson": "JESUS DANIEL VALLES PEREZ", - "notes": null + "problems": null }, { "ticket": 1535775, @@ -1092,7 +1092,7 @@ "province": "Valencia", "client": 3781, "salePerson": "JESUS DANIEL VALLES PEREZ", - "notes": null + "problems": null }, { "ticket": 1535776, @@ -1107,7 +1107,7 @@ "province": "Madrid", "client": 1600, "salePerson": "CRISTINA SANCHEZ BARRUGUER", - "notes": null + "problems": null }, { "ticket": 1535777, @@ -1122,7 +1122,7 @@ "province": "Palencia", "client": 3717, "salePerson": "MANOLI PULIDO", - "notes": null + "problems": null }, { "ticket": 1535779, @@ -1137,7 +1137,7 @@ "province": "Castellón", "client": 7423, "salePerson": "ELENA BASCUÑANA TORNERO", - "notes": null + "problems": null }, { "ticket": 1535899, @@ -1152,7 +1152,7 @@ "province": "Barcelona", "client": 4058, "salePerson": "CLAUDI SANROMA REYNARES", - "notes": null + "problems": null }, { "ticket": 1535903, @@ -1167,7 +1167,7 @@ "province": "Guipuzcoa", "client": 6308, "salePerson": "SILVERIO DOMINGUEZ", - "notes": null + "problems": null }, { "ticket": 1535905, @@ -1182,7 +1182,7 @@ "province": "Madrid", "client": 3574, "salePerson": "ELENA BASCUÑANA TORNERO", - "notes": null + "problems": null }, { "ticket": 1535908, @@ -1211,7 +1211,7 @@ "province": "Baleares (Mallorca)", "client": 6032, "salePerson": "MIGUEL ANGEL LAGUNA", - "notes": null + "problems": null }, { "ticket": 1535912, @@ -1226,7 +1226,7 @@ "province": "Valencia", "client": 3613, "salePerson": "COMPUTER SYSTEM", - "notes": null + "problems": null }, { "ticket": 1535918, @@ -1241,7 +1241,7 @@ "province": "Valencia", "client": 2574, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535919, @@ -1256,7 +1256,7 @@ "province": "Baleares (Mallorca)", "client": 7445, "salePerson": "MARIA DEL MAR GIRBES FERRUS", - "notes": null + "problems": null }, { "ticket": 1535920, @@ -1271,7 +1271,7 @@ "province": "Málaga", "client": 7796, "salePerson": "JULIA LLOPIS CASTELL", - "notes": null + "problems": null }, { "ticket": 1535921, @@ -1286,7 +1286,7 @@ "province": "Valencia", "client": 1160, "salePerson": "FRAN NATEK ECHEVARRIA", - "notes": null + "problems": null }, { "ticket": 1535928, @@ -1301,7 +1301,7 @@ "province": "Toledo", "client": 2787, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535931, @@ -1316,7 +1316,7 @@ "province": "Madrid", "client": 2725, "salePerson": "CARLOS ZAMBRANO GARCIA", - "notes": null + "problems": "RIESGO" }, { "ticket": 1535935, @@ -1331,7 +1331,7 @@ "province": "Madrid", "client": 3240, "salePerson": 0, - "notes": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " + "problems": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent non mattis ante. Curabitur id malesuada sapien. Praesent convallis erat id. " }, { "ticket": 1535936, @@ -1346,7 +1346,7 @@ "province": "Castellón", "client": 768, "salePerson": "DAVID SARRION RIVERO", - "notes": null + "problems": null }, { "ticket": 1535938, @@ -1361,7 +1361,7 @@ "province": "Málaga", "client": 5358, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535941, @@ -1376,7 +1376,7 @@ "province": "Almería", "client": 475, "salePerson": "LOLI LOZANO RAEZ", - "notes": null + "problems": null }, { "ticket": 1535942, @@ -1391,7 +1391,7 @@ "province": "Cádiz", "client": 1479, "salePerson": "CARLOS ZAMBRANO GARCIA", - "notes": null + "problems": null }, { "ticket": 1535943, @@ -1406,7 +1406,7 @@ "province": "Baleares (Mallorca)", "client": 5840, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535946, @@ -1421,7 +1421,7 @@ "province": "Barcelona", "client": 3951, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535956, @@ -1436,7 +1436,7 @@ "province": "Valencia", "client": 4193, "salePerson": "JOSE JAVIER ECHEVARRIA", - "notes": null + "problems": null }, { "ticket": 1535957, @@ -1451,7 +1451,7 @@ "province": "Baleares (Mallorca)", "client": 5172, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535960, @@ -1466,7 +1466,7 @@ "province": "Córdoba", "client": 1667, "salePerson": "FRAN NATEK ECHEVARRIA", - "notes": null + "problems": null }, { "ticket": 1535961, @@ -1481,7 +1481,7 @@ "province": "Madrid", "client": 5762, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535962, @@ -1496,7 +1496,7 @@ "province": "Ávila", "client": 6070, "salePerson": 0, - "notes": null + "problems": null }, { "ticket": 1535967, @@ -1511,6 +1511,6 @@ "province": "Sevilla", "client": 2000, "salePerson": "FRAN NATEK ECHEVARRIA", - "notes": null + "problems": null } ] \ No newline at end of file From 699635202922e2d43668a187f9538db4dcc28855 Mon Sep 17 00:00:00 2001 From: nelo Date: Wed, 14 Jun 2017 12:55:10 +0200 Subject: [PATCH 25/98] get warehouses --- .../methods/warehouse/list-warehouses.js | 24 +++++++++++++ .../production/common/models/warehouse.js | 9 +++++ .../production/common/models/warehouse.json | 35 +++++++++++++++++++ services/production/server/model-config.json | 4 +++ 4 files changed, 72 insertions(+) create mode 100644 services/production/common/methods/warehouse/list-warehouses.js create mode 100644 services/production/common/models/warehouse.js create mode 100644 services/production/common/models/warehouse.json diff --git a/services/production/common/methods/warehouse/list-warehouses.js b/services/production/common/methods/warehouse/list-warehouses.js new file mode 100644 index 000000000..326244943 --- /dev/null +++ b/services/production/common/methods/warehouse/list-warehouses.js @@ -0,0 +1,24 @@ +module.exports = function(Warehouse) { + Warehouse.remoteMethod('list', { + description: 'List production warehouses', + returns: { + arg: 'warehouses', + type: 'object' + }, + http: { + verb: 'get', + path: '/list' + } + }); + + Warehouse.list = function(cb) { + Warehouse.find(where(), function(err, warehouses){ + if(!err) + cb(null, warehouses); + }); + }; + + var where = function(){ + return {"where": {"tpv": {"neq": 0}}} + } +} \ No newline at end of file diff --git a/services/production/common/models/warehouse.js b/services/production/common/models/warehouse.js new file mode 100644 index 000000000..b46253ae1 --- /dev/null +++ b/services/production/common/models/warehouse.js @@ -0,0 +1,9 @@ +var app = require('../../server/server'); + +module.exports = function(Warehouse) { + var models = app.models; + + // Methods + + require('../methods/warehouse/list-warehouses.js')(Warehouse); +}; \ No newline at end of file diff --git a/services/production/common/models/warehouse.json b/services/production/common/models/warehouse.json new file mode 100644 index 000000000..208914085 --- /dev/null +++ b/services/production/common/models/warehouse.json @@ -0,0 +1,35 @@ +{ + "name": "Warehouse", + "base": "MyModel", + "validateUpsert": true, + "properties": { + "id": { + "id": true, + "type": "Number", + "forceId": false + }, + "name": { + "type": "String" + }, + "tpv": { + "type": "Number" + }, + "inventary": { + "type": "Number" + } + }, + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "root", + "permission": "ALLOW" + } + ] +} diff --git a/services/production/server/model-config.json b/services/production/server/model-config.json index 7f29155b0..edfa734b5 100644 --- a/services/production/server/model-config.json +++ b/services/production/server/model-config.json @@ -52,5 +52,9 @@ "TicketState":{ "dataSource": "vn", "public": true + }, + "Warehouse":{ + "dataSource": "vn", + "public": true } } From 18ff74b17f988ea3f81724bd76b9bb144da946bd Mon Sep 17 00:00:00 2001 From: nelo Date: Wed, 14 Jun 2017 14:27:16 +0200 Subject: [PATCH 26/98] get user and employee --- services/client/common/models/my-model.js | 5 +++-- .../production/common/methods/ticket-state/change-state.js | 6 +++--- services/production/common/models/my-model.js | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/services/client/common/models/my-model.js b/services/client/common/models/my-model.js index bfa55efbd..9246e02a9 100644 --- a/services/client/common/models/my-model.js +++ b/services/client/common/models/my-model.js @@ -1,3 +1,6 @@ +let loopBackContext = require('loopback-context'); +let app = require('../../server/server'); + module.exports = function(self) { self.setup = function() { @@ -28,14 +31,12 @@ module.exports = function(self) { }; self.getUser = function() { - let loopBackContext = require('loopback-context'); let currentUser = loopBackContext.getCurrentContext(); let userId = currentUser.get('currentUser'); return userId; }; self.getEmployee = function() { - let app = require('../../server/server'); let userId = self.getUser(); let employee = app.models.Employee; return employee.findOne({where: {userFk: userId}}); diff --git a/services/production/common/methods/ticket-state/change-state.js b/services/production/common/methods/ticket-state/change-state.js index c778330c7..90f2f041d 100644 --- a/services/production/common/methods/ticket-state/change-state.js +++ b/services/production/common/methods/ticket-state/change-state.js @@ -28,12 +28,11 @@ module.exports = function(TicketState) { }); TicketState.changeState = function(tickets, state, cb) { - TicketState.getEmployee().then(function(emp){ - changeState(emp, tickets, state, cb); + icketState.getEmployee().then(function(emp){ + changeState(emp, tickets, state, cb); }); }; - var changeState = function(emp, tickets, state, cb){ var inserts = []; @@ -47,4 +46,5 @@ module.exports = function(TicketState) { }); } + } \ No newline at end of file diff --git a/services/production/common/models/my-model.js b/services/production/common/models/my-model.js index bfa55efbd..9246e02a9 100644 --- a/services/production/common/models/my-model.js +++ b/services/production/common/models/my-model.js @@ -1,3 +1,6 @@ +let loopBackContext = require('loopback-context'); +let app = require('../../server/server'); + module.exports = function(self) { self.setup = function() { @@ -28,14 +31,12 @@ module.exports = function(self) { }; self.getUser = function() { - let loopBackContext = require('loopback-context'); let currentUser = loopBackContext.getCurrentContext(); let userId = currentUser.get('currentUser'); return userId; }; self.getEmployee = function() { - let app = require('../../server/server'); let userId = self.getUser(); let employee = app.models.Employee; return employee.findOne({where: {userFk: userId}}); From 9072b100f9be4513c824705de089f9bb707eab98 Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 15 Jun 2017 07:45:01 +0200 Subject: [PATCH 27/98] tooltip admite plantilla html, icon-menu forzado de posicion en dropDown --- client/core/src/drop-down/drop-down.js | 19 ++- client/core/src/icon-menu/icon-menu.html | 2 +- client/core/src/icon-menu/icon-menu.js | 15 ++- client/core/src/tooltip/tooltip.js | 120 +++++++++++------- client/production/src/index/index.html | 10 +- .../src/index/more-info-tooltip.tpl.html | 28 ++-- client/salix/src/styles/colors.scss | 3 +- client/salix/src/styles/misc.scss | 27 +++- gulpfile.js | 2 +- 9 files changed, 146 insertions(+), 80 deletions(-) diff --git a/client/core/src/drop-down/drop-down.js b/client/core/src/drop-down/drop-down.js index c33aea7b5..c40d28672 100644 --- a/client/core/src/drop-down/drop-down.js +++ b/client/core/src/drop-down/drop-down.js @@ -1,16 +1,27 @@ import {module} from '../module'; import './style.scss'; -/* export default class DropDown { -}*/ +export default class DropDown { + constructor($element, $window) { + this.$element = $element; + this.$window = $window; + } + $onChanges(changesObj) { + if (changesObj.show && changesObj.top && changesObj.top.currentValue) { + this.$element.css('top', changesObj.top.currentValue + 'px'); + } + } +} +DropDown.$inject = ['$element', '$window']; module.component('vnDropDown', { template: require('./drop-down.html'), - // controller: DropDown, + controller: DropDown, bindings: { items: '<', show: '<', - selected: '=' + selected: '=', + top: ' - + \ No newline at end of file diff --git a/client/core/src/icon-menu/icon-menu.js b/client/core/src/icon-menu/icon-menu.js index d1119bedb..2a521ce4f 100644 --- a/client/core/src/icon-menu/icon-menu.js +++ b/client/core/src/icon-menu/icon-menu.js @@ -6,6 +6,7 @@ export default class IconMenu { this.$http = $http; this.$timeout = $timeout; this._showDropDown = false; + this._pos = undefined; } get showDropDown() { return this._showDropDown; @@ -14,6 +15,13 @@ export default class IconMenu { this._showDropDown = value; } + get pos() { + return this._pos; + } + set pos(value) { + this._pos = value; + } + getItems() { this.$http.get(this.url).then( json => { @@ -26,9 +34,10 @@ export default class IconMenu { this.getItems(); } - this.$element.bind('mouseover', () => { + this.$element.bind('mouseover', e => { this.$timeout(() => { this.showDropDown = true; + this.pos = e.target.getBoundingClientRect(); }); }); @@ -38,6 +47,10 @@ export default class IconMenu { }); }); } + $onDestroy() { + this.$element.unbind('mouseover'); + this.$element.unbind('mouseout'); + } } IconMenu.$inject = ['$element', '$http', '$timeout']; diff --git a/client/core/src/tooltip/tooltip.js b/client/core/src/tooltip/tooltip.js index ff3f7472f..484297977 100644 --- a/client/core/src/tooltip/tooltip.js +++ b/client/core/src/tooltip/tooltip.js @@ -1,12 +1,18 @@ import {module} from '../module'; import './style.css'; -tooltip.$inject = ['$document', '$compile', '$sce', '$templateCache', '$http']; -function tooltip($document, $compile, $sce, $templateCache, $http) { - function getTemplate(tooltipTemplateUrl) { +tooltip.$inject = ['$document', '$compile', '$interpolate', '$sce', '$templateCache', '$http', '$q']; +function tooltip($document, $compile, $interpolate, $sce, $templateCache, $http, $q) { + var promise; + + function _getTemplate(tooltipTemplateUrl) { var template = $templateCache.get(tooltipTemplateUrl); if (typeof template === 'undefined') { template = $http.get(tooltipTemplateUrl).then(function onGetTemplateSuccess(response) { + if (promise) { + promise.resolve(response.data); + } + promise = undefined; return response.data; }); $templateCache.put(tooltipTemplateUrl, template); @@ -14,11 +20,23 @@ function tooltip($document, $compile, $sce, $templateCache, $http) { return template; } + function getTemplate(tooltipTemplateUrl) { + var _promise = $q.defer(); + var template = _getTemplate(tooltipTemplateUrl); + if (template) { + _promise.resolve(template); + } else { + promise = _promise; + } + return _promise.promise; + } + return { restrict: 'A', priority: -1, link: function(scope, element, attrs) { - var tip = $compile('
{{ text }}
')(scope); + var tipHtml = '
{{text}}
'; + var tip; var tipClassName = 'tooltip'; var tipActiveClassName = 'tooltip-show'; @@ -28,13 +46,17 @@ function tooltip($document, $compile, $sce, $templateCache, $http) { if (attrs.tooltipHtml) { scope.isHtmlContent = true; scope.htmlContent = $sce.trustAsHtml(attrs.tooltipHtml); + _compileTip(); } else if (attrs.tooltipTemplate) { - var template = getTemplate(attrs.tooltipTemplate); - scope.isHtmlContent = true; - scope.htmlContent = $sce.trustAsHtml(template); + getTemplate(attrs.tooltipTemplate).then(template => { + scope.isHtmlContent = true; + scope.htmlContent = $sce.trustAsHtml($interpolate(template)(scope)); + _compileTip(); + }); } else { scope.isHtmlContent = false; scope.htmlContent = null; + _compileTip(); } if (attrs.tooltipPosition) { @@ -43,53 +65,59 @@ function tooltip($document, $compile, $sce, $templateCache, $http) { scope.tipClass.push('tooltip-down'); } - $document.find('body').append(tip); + function _compileTip() { + tip = $compile(tipHtml)(scope); + $document.find('body').append(tip); + _bindEvents(); + } - element.bind('mouseover', function(e) { - tip.addClass(tipActiveClassName); + function _bindEvents() { + element.bind('mouseover', function(e) { + tip.addClass(tipActiveClassName); - let pos = e.target.getBoundingClientRect(); - let tipPos = tip[0].getBoundingClientRect(); - let offset = {top: 0, left: 0}; - let tipWidth = tipPos.width || tipPos.right - tipPos.left; - let tipHeight = tipPos.height || tipPos.bottom - tipPos.top; - let elWidth = pos.width || pos.right - pos.left; - let elHeight = pos.height || pos.bottom - pos.top; - let tipOffset = 10; + let pos = e.target.getBoundingClientRect(); + let tipPos = tip[0].getBoundingClientRect(); + let offset = {top: 0, left: 0}; + let tipWidth = tipPos.width || tipPos.right - tipPos.left; + let tipHeight = tipPos.height || tipPos.bottom - tipPos.top; + let elWidth = pos.width || pos.right - pos.left; + let elHeight = pos.height || pos.bottom - pos.top; + let tipOffset = 10; - if (tip.hasClass('tooltip-right')) { - offset.top = pos.top - (tipHeight / 2) + (elHeight / 2); - offset.left = pos.right + tipOffset; - } else if (tip.hasClass('tooltip-left')) { - offset.top = pos.top - (tipHeight / 2) + (elHeight / 2); - offset.left = pos.left - tipWidth - tipOffset; - } else if (tip.hasClass('tooltip-down')) { - offset.top = pos.top + elHeight + tipOffset; - offset.left = pos.left - (tipWidth / 2) + (elWidth / 2); - } else { - offset.top = pos.top - tipHeight - tipOffset; - offset.left = pos.left - (tipWidth / 2) + (elWidth / 2); - } + if (tip.hasClass('tooltip-right')) { + offset.top = pos.top - (tipHeight / 2) + (elHeight / 2); + offset.left = pos.right + tipOffset; + } else if (tip.hasClass('tooltip-left')) { + offset.top = pos.top - (tipHeight / 2) + (elHeight / 2); + offset.left = pos.left - tipWidth - tipOffset; + } else if (tip.hasClass('tooltip-down')) { + offset.top = pos.top + elHeight + tipOffset; + offset.left = pos.left - (tipWidth / 2) + (elWidth / 2); + } else { + offset.top = pos.top - tipHeight - tipOffset; + offset.left = pos.left - (tipWidth / 2) + (elWidth / 2); + } - tip.css('top', offset.top + 'px'); - tip.css('left', offset.left + 'px'); - }); + tip.css('top', offset.top + 'px'); + tip.css('left', offset.left + 'px'); + }); - element.on('mouseout', function() { - tip.removeClass(tipActiveClassName); - }); + element.on('mouseout', function() { + tip.removeClass(tipActiveClassName); + }); - tip.on('mouseover', function() { - tip.addClass(tipActiveClassName); - }); + tip.on('mouseover', function() { + tip.addClass(tipActiveClassName); + }); - tip.on('mouseout', function() { - tip.removeClass(tipActiveClassName); - }); + tip.on('mouseout', function() { + tip.removeClass(tipActiveClassName); + }); - element.on('$destroy', function() { - tip.remove(); - }); + element.on('$destroy', function() { + tip.remove(); + }); + } } }; } diff --git a/client/production/src/index/index.html b/client/production/src/index/index.html index e132f0033..44e0d3f5a 100644 --- a/client/production/src/index/index.html +++ b/client/production/src/index/index.html @@ -49,7 +49,7 @@ - + @@ -57,23 +57,23 @@
- + - + {{::ticket.ticket}} {{::ticket.agency}} - {{::ticket.worker | ucwords}} + {{::ticket.salePerson | ucwords}} {{::ticket.hour}} {{ticket.state}} {{::ticket.lines}} {{::ticket.m3}} {{::ticket.boxes}} - + diff --git a/client/production/src/index/more-info-tooltip.tpl.html b/client/production/src/index/more-info-tooltip.tpl.html index 085187043..e7cfddc50 100644 --- a/client/production/src/index/more-info-tooltip.tpl.html +++ b/client/production/src/index/more-info-tooltip.tpl.html @@ -1,18 +1,14 @@ - - - Población - Provincia - ID_Cliente - Comercial - - - - - {{ticket.city}} - {{ticket.province}} - {{ticket.client}} - {{ticket.salePerson}} - - + + Población + Provincia + ID_Cliente + Comercial + + + {{::ticket.city | ucwords}} + {{::ticket.province | ucwords}} + {{::ticket.client}} + {{::ticket.salePerson | ucwords}} + \ No newline at end of file diff --git a/client/salix/src/styles/colors.scss b/client/salix/src/styles/colors.scss index 9638ac0c8..dc939d113 100644 --- a/client/salix/src/styles/colors.scss +++ b/client/salix/src/styles/colors.scss @@ -4,4 +4,5 @@ $color-orange: rgb(255,171,64); $color-white: white; $color-dark: #3c393b; $color-dark-grey: #424242; -$color-light-grey: #e6e6e6; \ No newline at end of file +$color-light-grey: #e6e6e6; +$color-medium-grey: #9D9D9D; \ No newline at end of file diff --git a/client/salix/src/styles/misc.scss b/client/salix/src/styles/misc.scss index 604e40d51..2823fe4ea 100644 --- a/client/salix/src/styles/misc.scss +++ b/client/salix/src/styles/misc.scss @@ -1,5 +1,6 @@ @import "padding"; @import "margin"; +@import "colors"; .form { height: 100%; @@ -38,12 +39,12 @@ html [vn-left], .vn-left{ } .list-header{ - border-bottom: 3px solid #9D9D9D; + border-bottom: 3px solid $color-medium-grey; font-weight: bold; } .list-footer{ - border-top: 3px solid #9D9D9D; + border-top: 3px solid $color-medium-grey; font-weight: bold; } .list > vn-one, .list > [vn-one], .list > [vn-two], .list > vn-two{ @@ -54,9 +55,25 @@ html [vn-left], .vn-left{ } .list-body{ padding: 4px 0px; - border-bottom: 1px solid #9D9D9D; - + border-bottom: 1px solid $color-medium-grey; i { - color: #ffa410; + color: $color-orange; + } +} +.list-body:last-child{ + border: none; +} +.list-body.warning{ + background-color: $color-orange; + color:$color-white; + font-weight: bold; + i { + color: $color-white; + } + .mdl-checkbox.is-checked .mdl-checkbox__box-outline{ + border-color: $color-white; + } + .mdl-checkbox.is-checked .mdl-checkbox__tick-outline{ + background-color: $color-white; } } \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 5722981c0..057483795 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -58,7 +58,7 @@ gulp.task('services', ['copy'], function() { }); gulp.task('clean', function() { - return del(`${buildDir}/*`, {force: true}); + return del([`${buildDir}/*`, `!${buildDir}/templates`], {force: true}); }); // Spliting From f346e5e83c4300cd30411c6f4cbfc4028e3fbb28 Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 15 Jun 2017 08:26:03 +0200 Subject: [PATCH 28/98] arreglos en drop-down --- client/core/src/drop-down/drop-down.html | 4 ++-- client/core/src/drop-down/drop-down.js | 3 +-- client/core/src/icon-menu/icon-menu.js | 3 ++- client/production/src/index/index.html | 10 +++------- .../src/index/more-info-tooltip.tpl.html | 14 -------------- 5 files changed, 8 insertions(+), 26 deletions(-) delete mode 100644 client/production/src/index/more-info-tooltip.tpl.html diff --git a/client/core/src/drop-down/drop-down.html b/client/core/src/drop-down/drop-down.html index 4b354ae62..c448520fa 100644 --- a/client/core/src/drop-down/drop-down.html +++ b/client/core/src/drop-down/drop-down.html @@ -1,3 +1,3 @@ -