From 159f8fdd6f0ec7d5d850ddfe378fa6c19cc1b19d Mon Sep 17 00:00:00 2001 From: jgallego Date: Mon, 4 Mar 2019 08:34:01 +0100 Subject: [PATCH 01/45] Quito la traduccion porque ya no existe --- loopback/locale/en.json | 1 - loopback/locale/es.json | 1 - 2 files changed, 2 deletions(-) diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 84c2bba4c..ff07a26e8 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -18,7 +18,6 @@ "Package cannot be blank": "Package cannot be blank", "The new quantity should be smaller than the old one": "The new quantity should be smaller than the old one", "The sales of this ticket can't be modified": "The sales of this ticket can't be modified", - "Cannot check VIES and Equalization Tax": "Cannot check VIES and Equalization Tax", "Cannot check Equalization Tax in this NIF/CIF": "Cannot check Equalization Tax in this NIF/CIF", "You can't create an order for a frozen client": "You can't create an order for a frozen client", "This address doesn't exist": "This address doesn't exist", diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 05e100fb7..be33836f0 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -59,7 +59,6 @@ "You can't create an order for a client that doesn't has tax data verified": "You can't create an order for a client that doesn't has tax data verified", "You must delete the claim id %d first": "Antes debes borrar la reclamacion %d", "You don't have enough privileges": "No tienes suficientes permisos", - "Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo", "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF", "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos", "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ", From d37d314304e7eea559ac3ff8bfdc21da2e05453c Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Tue, 5 Mar 2019 12:01:53 +0100 Subject: [PATCH 02/45] #1202 refactor del cambio de estado de un ticket --- .../methods/ticket-tracking/changeState.js | 17 +++++---- modules/ticket/front/summary/index.js | 35 +++++++++---------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/modules/ticket/back/methods/ticket-tracking/changeState.js b/modules/ticket/back/methods/ticket-tracking/changeState.js index e93eb25f3..f70ae93a5 100644 --- a/modules/ticket/back/methods/ticket-tracking/changeState.js +++ b/modules/ticket/back/methods/ticket-tracking/changeState.js @@ -23,23 +23,28 @@ module.exports = Self => { } }); - Self.changeState = async(ctx, data) => { + Self.changeState = async(ctx, params) => { let userId = ctx.req.accessToken.userId; let $ = Self.app.models; - if (!data.stateFk) + if (!params.stateFk && !params.code) throw new UserError('State cannot be blank'); + if (params.code) { + let state = await $.State.findOne({where: {code: params.code}, fields: ['id']}); + params.stateFk = state.id; + } + let isProduction = await $.Account.hasRole(userId, 'production'); let isSalesPerson = await $.Account.hasRole(userId, 'salesPerson'); let ticket = await $.TicketState.findById( - data.ticketFk, + params.ticketFk, {fields: ['stateFk']} ); let oldState = await $.State.findById(ticket.stateFk); - let newState = await $.State.findById(data.stateFk); + let newState = await $.State.findById(params.stateFk); let isAllowed = isProduction || isSalesPerson && oldState.isEditable() @@ -50,9 +55,9 @@ module.exports = Self => { if (newState.code != 'PICKER_DESIGNED') { let worker = await $.Worker.findOne({where: {userFk: userId}}); - data.workerFk = worker.id; + params.workerFk = worker.id; } - return await $.TicketTracking.create(data); + return await $.TicketTracking.create(params); }; }; diff --git a/modules/ticket/front/summary/index.js b/modules/ticket/front/summary/index.js index 3c99acaa4..52ffa40cf 100644 --- a/modules/ticket/front/summary/index.js +++ b/modules/ticket/front/summary/index.js @@ -17,12 +17,7 @@ class Controller { set ticket(value) { this._ticket = value; - if (!value) return; - - this.$http.get(`/ticket/api/Tickets/${this.ticket.id}/summary`).then(res => { - if (res && res.data) - this.summary = res.data; - }); + if (value) this.getSummary(); } get formattedAddress() { @@ -34,6 +29,13 @@ class Controller { return `${address.street} - ${address.city} ${province}`; } + getSummary() { + this.$http.get(`/ticket/api/Tickets/${this.ticket.id}/summary`).then(res => { + if (res && res.data) + this.summary = res.data; + }); + } + showDescriptor(event, itemFk) { this.quicklinks = { btnThree: { @@ -64,25 +66,22 @@ class Controller { } setOkState() { - let filter = {where: {code: 'OK'}, fields: ['id']}; - let json = encodeURIComponent(JSON.stringify(filter)); - this.$http.get(`/ticket/api/States?filter=${json}`).then(res => { - this.changeTicketState(res.data[0].id); - }); - } - - changeTicketState(value) { - let params; + let params = {}; if (this.$state.params.id) - params = {ticketFk: this.$state.params.id, stateFk: value}; + params = {ticketFk: this.$state.params.id}; if (!this.$state.params.id) - params = {ticketFk: this.ticket.id, stateFk: value}; + params = {ticketFk: this.ticket.id}; + + params.code = 'OK'; this.$http.post(`/ticket/api/TicketTrackings/changeState`, params).then(() => { this.vnApp.showSuccess(this.$translate.instant('Data saved!')); - if (this.card) this.card.reload(); + if (this.card) + this.card.reload(); + else + this.getSummary(); }); } } From 17654ef71e58d51d347f15ef73d651b0b159b7f6 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Tue, 5 Mar 2019 12:37:43 +0100 Subject: [PATCH 03/45] #1183 Crear enlace a client summary en /order/descriptor --- modules/order/front/descriptor/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/order/front/descriptor/index.js b/modules/order/front/descriptor/index.js index 4b052526c..26fedd6a3 100644 --- a/modules/order/front/descriptor/index.js +++ b/modules/order/front/descriptor/index.js @@ -15,6 +15,11 @@ class Controller { icon: 'icon-ticket', state: `ticket.index({q: '{"orderFk": ${value.id}}'})`, tooltip: 'Order ticket list' + }, + btnTwo: { + icon: 'person', + state: `client.card.summary({id: ${value.clientFk}})`, + tooltip: 'Client card' } }; } From 11603f8d903511fef660518527d39348daaebef6 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 5 Mar 2019 14:59:18 +0100 Subject: [PATCH 04/45] Add services to deliver-note #1201. Renamed receipt --- .../back/methods/packaging/listPackaging.js | 5 +- modules/ticket/front/descriptor/index.js | 2 +- modules/ticket/front/services/index.js | 1 - package-lock.json | 400 ++++++++---------- package.json | 2 +- print/config/routes.json | 2 +- print/lib/reportEngine.js | 3 +- print/package-lock.json | 61 ++- print/package.json | 8 +- print/report/printer-setup/locale.js | 2 + .../rpt-delivery-note/assets/css/style.css | 15 +- print/report/rpt-delivery-note/index.html | 59 ++- print/report/rpt-delivery-note/index.js | 22 +- print/report/rpt-delivery-note/locale.js | 8 +- print/report/rpt-informe/index.js | 33 -- print/report/rpt-informe/locale.js | 10 - .../assets/css/index.js | 0 .../assets/css/style.css | 4 - .../assets/images/signature.png | Bin .../{rpt-informe => rpt-receipt}/index.html | 21 +- print/report/rpt-receipt/index.js | 71 ++++ print/report/rpt-receipt/locale.js | 24 ++ 22 files changed, 400 insertions(+), 353 deletions(-) delete mode 100755 print/report/rpt-informe/index.js delete mode 100644 print/report/rpt-informe/locale.js rename print/report/{rpt-informe => rpt-receipt}/assets/css/index.js (100%) rename print/report/{rpt-informe => rpt-receipt}/assets/css/style.css (81%) rename print/report/{rpt-informe => rpt-receipt}/assets/images/signature.png (100%) rename print/report/{rpt-informe => rpt-receipt}/index.html (51%) create mode 100755 print/report/rpt-receipt/index.js create mode 100644 print/report/rpt-receipt/locale.js diff --git a/modules/ticket/back/methods/packaging/listPackaging.js b/modules/ticket/back/methods/packaging/listPackaging.js index 46be79c77..033201818 100644 --- a/modules/ticket/back/methods/packaging/listPackaging.js +++ b/modules/ticket/back/methods/packaging/listPackaging.js @@ -13,7 +13,7 @@ module.exports = Self => { http: {source: 'query'} }], returns: { - type: ["Object"], + type: ['Object'], root: true }, http: { @@ -28,7 +28,8 @@ module.exports = Self => { `SELECT name, itemFk, packagingFk FROM (SELECT i.name, i.id itemFk, p.id packagingFk FROM item i - JOIN packaging p ON i.id = p.itemFk) p` + JOIN packaging p ON i.id = p.itemFk + WHERE i.name <> '') p` ); stmt.merge(conn.makeSuffix(filter)); diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index d18063ef7..a236b0d5a 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -11,7 +11,7 @@ class Controller { {callback: this.showAddTurnDialog, name: 'Add turn', show: true}, {callback: this.showAddStowaway, name: 'Add stowaway', show: () => this.isTicketModule()}, {callback: this.showRemoveStowaway, name: 'Remove stowaway', show: () => this.shouldShowRemoveStowaway()}, - /* {callback: this.showDeliveryNote, name: 'Show Delivery Note', show: true}, */ + {callback: this.showDeliveryNote, name: 'Show Delivery Note', show: true}, {callback: this.showDeleteTicketDialog, name: 'Delete ticket', show: true}, /* callback: this.showChangeShipped, name: 'Change shipped hour', show: true} */ ]; diff --git a/modules/ticket/front/services/index.js b/modules/ticket/front/services/index.js index b9bccd446..ce228bf8a 100644 --- a/modules/ticket/front/services/index.js +++ b/modules/ticket/front/services/index.js @@ -18,7 +18,6 @@ class Controller { this.$scope.watcher.check(); this.$scope.model.save().then(() => { this.$scope.watcher.notifySaved(); - this.$scope.model.refresh(); }); } } diff --git a/package-lock.json b/package-lock.json index 8b04fbf96..4e29d792d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1505,7 +1505,7 @@ }, "util": { "version": "0.10.3", - "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -1733,7 +1733,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -2052,7 +2052,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -2097,7 +2097,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2147,7 +2147,7 @@ }, "buffer": { "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -2322,7 +2322,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -2366,7 +2366,7 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { @@ -2497,7 +2497,7 @@ "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -2657,7 +2657,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -2731,19 +2731,10 @@ }, "colors": { "version": "1.1.2", - "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, - "combine-lists": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", - "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", - "dev": true, - "requires": { - "lodash": "^4.5.0" - } - }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", @@ -2886,6 +2877,18 @@ "xdg-basedir": "^3.0.0" } }, + "connect": { + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", + "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.0", + "parseurl": "~1.3.2", + "utils-merge": "1.0.1" + } + }, "connect-history-api-fallback": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz", @@ -2924,7 +2927,7 @@ }, "content-disposition": { "version": "0.5.2", - "resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "content-security-policy-builder": { @@ -3017,7 +3020,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -3030,7 +3033,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -3193,13 +3196,13 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true }, "regexpu-core": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", "dev": true, "requires": { @@ -3210,13 +3213,13 @@ }, "regjsgen": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", "dev": true }, "regjsparser": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "dev": true, "requires": { @@ -3287,9 +3290,9 @@ "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" }, "date-format": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-1.2.0.tgz", - "integrity": "sha1-YV6CjiM90aubua4JUODOzPpuytg=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.0.0.tgz", + "integrity": "sha512-M6UqVvZVgFYqZL1SfHsRGIQSz3ZL+qgbsV5Lp1Vj61LZVYuEwcMXYay7DRDtYs2HQQBK5hQtQ0fD9aEJ89V0LA==", "dev": true }, "date-now": { @@ -3565,7 +3568,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -3686,7 +3689,7 @@ "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha1-HxngwuGqDjJ5fEl5nyg3rGr2nFc=", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "dev": true, "requires": { "is-obj": "^1.0.0" @@ -3694,12 +3697,12 @@ }, "duplex": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/duplex/-/duplex-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/duplex/-/duplex-1.0.0.tgz", "integrity": "sha1-arxcFuwX5MV4V4cnEmcAWQ06Ldo=" }, "duplexer": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.0.4.tgz", "integrity": "sha1-r8t/H4uNdPggcmFx1dZKyeSo/yA=" }, "duplexer2": { @@ -3719,7 +3722,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -3846,7 +3849,7 @@ "dependencies": { "fs-extra": { "version": "0.30.0", - "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { @@ -3972,7 +3975,7 @@ }, "engine.io-client": { "version": "3.2.1", - "resolved": "http://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", "integrity": "sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw==", "dev": true, "requires": { @@ -4123,7 +4126,7 @@ }, "es6-promisify": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" @@ -4442,40 +4445,6 @@ "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", "dev": true }, - "expand-braces": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", - "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", - "dev": true, - "requires": { - "array-slice": "^0.2.3", - "array-unique": "^0.2.1", - "braces": "^0.1.2" - }, - "dependencies": { - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", - "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", - "dev": true, - "requires": { - "expand-range": "^0.1.0" - } - } - } - }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -4511,30 +4480,6 @@ } } }, - "expand-range": { - "version": "0.1.1", - "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", - "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", - "dev": true, - "requires": { - "is-number": "^0.1.1", - "repeat-string": "^0.2.2" - }, - "dependencies": { - "is-number": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-0.1.1.tgz", - "integrity": "sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY=", - "dev": true - }, - "repeat-string": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-0.2.2.tgz", - "integrity": "sha1-x6jTI2BoNiBZp+RlH8aITosftK4=", - "dev": true - } - } - }, "expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", @@ -4901,7 +4846,7 @@ }, "file-loader": { "version": "1.1.11", - "resolved": "http://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", "dev": true, "requires": { @@ -4932,6 +4877,29 @@ } } }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + } + } + }, "find-cache-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", @@ -5139,7 +5107,7 @@ }, "fs-access": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", "dev": true, "requires": { @@ -5938,7 +5906,7 @@ "global-modules": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=", "dev": true, "requires": { "global-prefix": "^1.0.1", @@ -5975,7 +5943,7 @@ }, "globby": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { @@ -6020,7 +5988,7 @@ }, "got": { "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { @@ -6197,7 +6165,7 @@ }, "kind-of": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", "dev": true }, @@ -6381,7 +6349,7 @@ "dependencies": { "es6-promise": { "version": "3.3.1", - "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=", "dev": true }, @@ -7144,7 +7112,7 @@ "is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=", "dev": true, "requires": { "is-relative": "^1.0.0", @@ -7193,7 +7161,7 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { @@ -7340,7 +7308,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -7371,7 +7339,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -7407,7 +7375,7 @@ "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "integrity": "sha1-obtpNc6MXboei5dUubLcwCDiJg0=", "dev": true, "requires": { "is-unc-path": "^1.0.0" @@ -7441,7 +7409,7 @@ "is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=", "dev": true, "requires": { "unc-path-regex": "^0.1.2" @@ -7487,7 +7455,7 @@ }, "isemail": { "version": "2.2.1", - "resolved": "http://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz", + "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz", "integrity": "sha1-A1PT2aYpUQgMJiwqoKQrjqjp4qY=" }, "isexe": { @@ -7542,7 +7510,7 @@ }, "jasmine-core": { "version": "2.99.1", - "resolved": "http://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", "integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=", "dev": true }, @@ -7559,7 +7527,7 @@ "jasmine-spec-reporter": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", - "integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", + "integrity": "sha1-HWMq7ANBZwrTJPkrqEtLMrNeniI=", "dev": true, "requires": { "colors": "1.1.2" @@ -7647,7 +7615,7 @@ }, "json-buffer": { "version": "2.0.11", - "resolved": "http://registry.npmjs.org/json-buffer/-/json-buffer-2.0.11.tgz", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-2.0.11.tgz", "integrity": "sha1-PkQf2jCYvo0eMXGtWRvGKjPi1V8=" }, "json-loader": { @@ -7729,28 +7697,27 @@ "dev": true }, "karma": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/karma/-/karma-3.1.4.tgz", - "integrity": "sha512-31Vo8Qr5glN+dZEVIpnPCxEGleqE0EY6CtC2X9TagRV3rRQ3SNrvfhddICkJgUK3AgqpeKSZau03QumTGhGoSw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-4.0.1.tgz", + "integrity": "sha512-ind+4s03BqIXas7ZmraV3/kc5+mnqwCd+VDX1FndS6jxbt03kQKX2vXrWxNLuCjVYmhMwOZosAEKMM0a2q7w7A==", "dev": true, "requires": { "bluebird": "^3.3.0", "body-parser": "^1.16.1", + "braces": "^2.3.2", "chokidar": "^2.0.3", "colors": "^1.1.0", - "combine-lists": "^1.0.0", "connect": "^3.6.0", "core-js": "^2.2.0", "di": "^0.0.1", "dom-serialize": "^2.2.0", - "expand-braces": "^0.1.1", "flatted": "^2.0.0", "glob": "^7.1.1", "graceful-fs": "^4.1.2", "http-proxy": "^1.13.0", "isbinaryfile": "^3.0.0", - "lodash": "^4.17.5", - "log4js": "^3.0.0", + "lodash": "^4.17.11", + "log4js": "^4.0.0", "mime": "^2.3.1", "minimatch": "^3.0.2", "optimist": "^0.6.1", @@ -7764,33 +7731,6 @@ "useragent": "2.3.0" }, "dependencies": { - "connect": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", - "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", - "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.0", - "parseurl": "~1.3.2", - "utils-merge": "1.0.1" - } - }, - "finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.1", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.2", - "statuses": "~1.3.1", - "unpipe": "~1.0.0" - } - }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -7805,12 +7745,6 @@ "path-is-absolute": "^1.0.0" } }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, "mime": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz", @@ -7822,18 +7756,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", - "dev": true - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true } } }, @@ -8030,7 +7952,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { @@ -8259,24 +8181,18 @@ } }, "log4js": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-3.0.6.tgz", - "integrity": "sha512-ezXZk6oPJCWL483zj64pNkMuY/NcRX5MPiB0zE6tjZM137aeusrOnW1ecxgF9cmwMWkBMhjteQxBPoZBh9FDxQ==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.0.2.tgz", + "integrity": "sha512-KE7HjiieVDPPdveA3bJZSuu0n8chMkFl8mIoisBFxwEJ9FmXe4YzNuiqSwYUiR1K8q8/5/8Yd6AClENY1RA9ww==", "dev": true, "requires": { - "circular-json": "^0.5.5", - "date-format": "^1.2.0", + "date-format": "^2.0.0", "debug": "^3.1.0", + "flatted": "^2.0.0", "rfdc": "^1.1.2", - "streamroller": "0.7.0" + "streamroller": "^1.0.1" }, "dependencies": { - "circular-json": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.5.9.tgz", - "integrity": "sha512-4ivwqHpIFJZBuhN3g/pEcdbnGUywkBblloGbkglyloVjjR3uT6tieI89MVOfbP2tHX5sgb01FuLgAOzebNlJNQ==", - "dev": true - }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -9510,7 +9426,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "mem": { @@ -9533,7 +9449,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { @@ -9656,7 +9572,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "minstache": { @@ -9670,7 +9586,7 @@ "dependencies": { "commander": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/commander/-/commander-1.0.4.tgz", + "resolved": "http://registry.npmjs.org/commander/-/commander-1.0.4.tgz", "integrity": "sha1-Xt6xruI8T7VBprcNaSq+8ZZpotM=", "dev": true, "requires": { @@ -9738,7 +9654,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -9746,7 +9662,7 @@ "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } @@ -9821,7 +9737,7 @@ "dependencies": { "through": { "version": "2.3.4", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.4.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.4.tgz", "integrity": "sha1-SV5A6Nio6uvHwnXqiMK4/BTFZFU=" } } @@ -9898,7 +9814,7 @@ }, "multipipe": { "version": "0.1.2", - "resolved": "http://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", "dev": true, "requires": { @@ -9924,7 +9840,7 @@ }, "mux-demux": { "version": "3.7.9", - "resolved": "http://registry.npmjs.org/mux-demux/-/mux-demux-3.7.9.tgz", + "resolved": "https://registry.npmjs.org/mux-demux/-/mux-demux-3.7.9.tgz", "integrity": "sha1-NTZ3GP02AcgLzi63YlMVdtekrO8=", "requires": { "duplex": "~1.0.0", @@ -10128,7 +10044,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -11581,7 +11497,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, @@ -11643,7 +11559,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, @@ -11659,7 +11575,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -11848,7 +11764,7 @@ }, "path-browserify": { "version": "0.0.0", - "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, @@ -12137,7 +12053,7 @@ }, "pretty-bytes": { "version": "1.0.4", - "resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", "dev": true, "requires": { @@ -12208,7 +12124,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -12220,13 +12136,13 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, "through2": { "version": "0.2.3", - "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", "dev": true, "requires": { @@ -12693,7 +12609,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -12918,7 +12834,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", - "dev": true, "requires": { "lodash": "^4.17.11" } @@ -12927,7 +12842,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", - "dev": true, "requires": { "request-promise-core": "1.1.2", "stealthy-require": "^1.1.1", @@ -13119,7 +13033,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -13244,7 +13158,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { @@ -13384,7 +13298,7 @@ "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -13417,7 +13331,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -13495,7 +13409,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { @@ -13571,7 +13485,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", "dev": true, "requires": { "define-property": "^1.0.0", @@ -13622,7 +13536,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -13705,7 +13619,7 @@ }, "socket.io-parser": { "version": "3.2.0", - "resolved": "http://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", "integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==", "dev": true, "requires": { @@ -13958,7 +13872,7 @@ "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -13967,7 +13881,7 @@ "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=", "dev": true, "requires": { "through2": "^2.0.2" @@ -14070,8 +13984,7 @@ "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "dev": true + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" }, "stream-browserify": { "version": "2.0.2", @@ -14085,7 +13998,7 @@ }, "stream-combiner": { "version": "0.0.2", - "resolved": "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.2.tgz", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.2.tgz", "integrity": "sha1-3+DnRnV0JWXnbGBWeI6lwjvZfbQ=", "requires": { "duplexer": "~0.0.3" @@ -14128,7 +14041,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -14143,7 +14056,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -14154,7 +14067,7 @@ }, "stream-serializer": { "version": "1.1.2", - "resolved": "http://registry.npmjs.org/stream-serializer/-/stream-serializer-1.1.2.tgz", + "resolved": "https://registry.npmjs.org/stream-serializer/-/stream-serializer-1.1.2.tgz", "integrity": "sha1-wfl9FdolH1lK4n1B7IraCahG408=" }, "stream-shift": { @@ -14164,17 +14077,27 @@ "dev": true }, "streamroller": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-0.7.0.tgz", - "integrity": "sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-1.0.3.tgz", + "integrity": "sha512-P7z9NwP51EltdZ81otaGAN3ob+/F88USJE546joNq7bqRNTe6jc74fTBDyynxP4qpIfKlt/CesEYicuMzI0yJg==", "dev": true, "requires": { - "date-format": "^1.2.0", + "async": "^2.6.1", + "date-format": "^2.0.0", "debug": "^3.1.0", - "mkdirp": "^0.5.1", - "readable-stream": "^2.3.0" + "fs-extra": "^7.0.0", + "lodash": "^4.17.10" }, "dependencies": { + "async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", + "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "dev": true, + "requires": { + "lodash": "^4.17.11" + } + }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -14184,6 +14107,17 @@ "ms": "^2.1.1" } }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -14229,7 +14163,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -14645,7 +14579,7 @@ }, "tar": { "version": "2.2.1", - "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { @@ -14815,7 +14749,7 @@ }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "through2": { @@ -14998,7 +14932,7 @@ "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", "dev": true, "requires": { "nopt": "~1.0.10" @@ -15087,7 +15021,7 @@ }, "tty-browserify": { "version": "0.0.0", - "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, @@ -15200,7 +15134,7 @@ }, "underscore": { "version": "1.7.0", - "resolved": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" }, "underscore.string": { @@ -15532,6 +15466,12 @@ "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", "dev": true }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", @@ -15713,7 +15653,7 @@ }, "vm-browserify": { "version": "0.0.4", - "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", "dev": true, "requires": { @@ -16216,7 +16156,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -16229,7 +16169,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -16646,7 +16586,7 @@ }, "xmlbuilder": { "version": "9.0.7", - "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" }, "xmlcreate": { diff --git a/package.json b/package.json index 13ae9bd7f..a6ca2f697 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "jasmine-reporters": "^2.3.2", "jasmine-spec-reporter": "^4.2.1", "json-loader": "^0.5.7", - "karma": "^3.1.4", + "karma": "^4.0.1", "karma-chrome-launcher": "^2.2.0", "karma-firefox-launcher": "^1.1.0", "karma-jasmine": "^2.0.1", diff --git a/print/config/routes.json b/print/config/routes.json index c8326effa..88365b1d0 100644 --- a/print/config/routes.json +++ b/print/config/routes.json @@ -11,7 +11,7 @@ {"type": "report", "name": "rpt-claim-pickup-order"}, {"type": "report", "name": "rpt-letter-debtor"}, {"type": "report", "name": "rpt-sepa-core"}, - {"type": "report", "name": "rpt-informe"}, + {"type": "report", "name": "rpt-receipt"}, {"type": "static", "name": "email-header"}, {"type": "static", "name": "email-footer"}, {"type": "static", "name": "report-header"}, diff --git a/print/lib/reportEngine.js b/print/lib/reportEngine.js index dccb18b4a..8c771c449 100644 --- a/print/lib/reportEngine.js +++ b/print/lib/reportEngine.js @@ -26,7 +26,8 @@ module.exports = { const result = await this.preFetch(component, ctx); const i18n = new VueI18n({ locale: 'es', - fallbackLocale: 'es' + fallbackLocale: 'es', + silentTranslationWarn: true }); const app = new Vue({i18n, render: h => h(result.component)}); diff --git a/print/package-lock.json b/print/package-lock.json index 65f4abb6f..2be86cc84 100644 --- a/print/package-lock.json +++ b/print/package-lock.json @@ -242,9 +242,9 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "denque": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-1.3.0.tgz", - "integrity": "sha512-4SRaSj+PqmrS1soW5/Avd7eJIM2JJIqLLmwhRqIGleZM/8KwZq80njbSS2Iqas+6oARkSkLDHEk4mm78q3JlIg==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.4.0.tgz", + "integrity": "sha512-gh513ac7aiKrAgjiIBWZG0EASyDF9p4JMWwKA8YU5s9figrL5SRNEMT6FDynsegakuhWd1wVqTvqvqAoDxw7wQ==" }, "dom-serializer": { "version": "0.1.0", @@ -690,9 +690,9 @@ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "requires": { "pseudomap": "^1.0.2", "yallist": "^2.1.2" @@ -743,33 +743,26 @@ "optional": true }, "mysql2": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-1.6.4.tgz", - "integrity": "sha512-ZYbYgK06HKfxU45tYYLfwW5gKt8BslfE7FGyULNrf2K2fh+DuEX+e0QKsd2ObpZkMILefaVn8hsakVsTFqravQ==", + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-1.6.5.tgz", + "integrity": "sha512-zedaOOyb3msuuZcJJnxIX/EGOpmljDG7B+UevRH5lqcv+yhy9eCwkArBz8/AO+/rlY3/oCsOdG8R5oD6k0hNfg==", "requires": { - "denque": "1.3.0", + "denque": "^1.4.0", "generate-function": "^2.3.1", "iconv-lite": "^0.4.24", "long": "^4.0.0", - "lru-cache": "4.1.3", - "named-placeholders": "1.1.1", - "seq-queue": "0.0.5", - "sqlstring": "2.3.1" + "lru-cache": "^4.1.3", + "named-placeholders": "^1.1.2", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.1" } }, "named-placeholders": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.1.tgz", - "integrity": "sha1-O3oNJiA910s6nfTJz7gnsvuQfmQ=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", + "integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", "requires": { - "lru-cache": "2.5.0" - }, - "dependencies": { - "lru-cache": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", - "integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus=" - } + "lru-cache": "^4.1.3" } }, "nice-try": { @@ -1131,19 +1124,19 @@ } }, "vue": { - "version": "2.5.22", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.5.22.tgz", - "integrity": "sha512-pxY3ZHlXNJMFQbkjEgGVMaMMkSV1ONpz+4qB55kZuJzyJOhn6MSy/YZdzhdnumegNzVTL/Dn3Pp4UrVBYt1j/g==" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.7.tgz", + "integrity": "sha512-g7ADfQ82QU+j6F/bVDioVQf2ccIMYLuR4E8ev+RsDBlmwRkhGO3HhgF4PF9vpwjdPpxyb1zzLur2nQ2oIMAMEg==" }, "vue-i18n": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.7.0.tgz", - "integrity": "sha512-qey+OyZSUIje0xJW8HZrvpIss1jW8yBBRe+0QlUn7HENU31m/+Med/u4pcwjoeCaErHU9WMscBEhqK5aAvvEEQ==" + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.8.2.tgz", + "integrity": "sha512-P09ZN2S0mX1AmhSR/+wP2owP3izGVx1pSoDFcOXTLya5xvP95dG7kc9LQUnboPgSzK/JKe9FkYmoYdDTKDjPSw==" }, "vue-server-renderer": { - "version": "2.5.22", - "resolved": "https://registry.npmjs.org/vue-server-renderer/-/vue-server-renderer-2.5.22.tgz", - "integrity": "sha512-PQ0PubA6b2MyZud/gepWeiUuDFSbRfa6h1qYINcbwXRr4Z3yLTHprEQuFnWikdkTkZpeLFYUqZrDxPbDcJ71mA==", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/vue-server-renderer/-/vue-server-renderer-2.6.7.tgz", + "integrity": "sha512-CVtGR+bE63y4kyIeOcCEF2UNKquSquFQAsTHZ5R1cGM4L4Z0BXgAUEcngTOy8kN+tubt3c1zpRvbrok/bHKeDg==", "requires": { "chalk": "^1.1.3", "hash-sum": "^1.0.2", diff --git a/print/package.json b/print/package.json index 8c922b8a9..bb7c32a3e 100755 --- a/print/package.json +++ b/print/package.json @@ -16,11 +16,11 @@ "fs-extra": "^7.0.1", "html-pdf": "^2.2.0", "juice": "^5.0.1", - "mysql2": "^1.6.1", + "mysql2": "^1.6.5", "nodemailer": "^4.7.0", "strftime": "^0.10.0", - "vue": "^2.5.17", - "vue-i18n": "^8.3.1", - "vue-server-renderer": "^2.5.17" + "vue": "^2.6.7", + "vue-i18n": "^8.8.2", + "vue-server-renderer": "^2.6.7" } } diff --git a/print/report/printer-setup/locale.js b/print/report/printer-setup/locale.js index 34365cca7..e39a4a088 100644 --- a/print/report/printer-setup/locale.js +++ b/print/report/printer-setup/locale.js @@ -21,6 +21,8 @@ module.exports = { 'Abre el programa QLabel', 'Haz clic en el icono de la barra superior con forma de "carpeta"', 'Selecciona el archivo llamado "model.ezp" adjunto en este correo, y haz click en abrir', + 'Ve a "File" -> "Save as" y guárdalo en el escritorio con otro nombre', + 'Cierra el Qlabel y abre el archivo que acabamos de guardar', 'Haz clic encima del texto con el botón secundario del ratón', 'Elige la primera opción "setup"', 'Cambia el texto para imprimir', diff --git a/print/report/rpt-delivery-note/assets/css/style.css b/print/report/rpt-delivery-note/assets/css/style.css index e05617e6e..04474d4c8 100644 --- a/print/report/rpt-delivery-note/assets/css/style.css +++ b/print/report/rpt-delivery-note/assets/css/style.css @@ -9,16 +9,11 @@ max-width: 150px } -#packagings { - box-sizing: border-box; - padding-right: 10px -} - -#taxes { - box-sizing: border-box; - padding-left: 10px -} - .description.phytosanitary { background-color: #e5e5e5 +} + +h3 { + font-weight: 100; + color: #555 } \ No newline at end of file diff --git a/print/report/rpt-delivery-note/index.html b/print/report/rpt-delivery-note/index.html index 65b1866ae..4a994f847 100644 --- a/print/report/rpt-delivery-note/index.html +++ b/print/report/rpt-delivery-note/index.html @@ -58,6 +58,9 @@ + + +

{{$t('saleLines')}}

@@ -116,32 +119,40 @@
+ +
-
-

{{$t('packaging')}}

+ +
+

{{$t('services')}}

- + + - - - - + + + + + - - - + + +
Id {{$t('concept')}} {{$t('quantity')}}{{$t('vatType')}}{{$t('amount')}}
{{packaging.itemFk}}{{packaging.name}}{{packaging.quantity}}
{{service.description}}{{service.quantity}}{{service.taxDescription}}{{service.price | currency('EUR')}}
{{$t('total')}}0
{{$t('total')}} {{serviceTotal | currency('EUR')}}
+ + +

{{$t('taxBreakdown')}}

@@ -175,15 +186,41 @@
+ + + +
+

{{$t('packagings')}}

+ + + + + + + + + + + + + + + +
Id{{$t('concept')}}{{$t('quantity')}}
{{packaging.itemFk}}{{packaging.name}}{{packaging.quantity}}
+
+ + +
-
Firma digital
+
{{$t('digitalSignature')}}
{{signature.created | date}}
+
diff --git a/print/report/rpt-delivery-note/index.js b/print/report/rpt-delivery-note/index.js index 0a1afc7e5..68450252c 100755 --- a/print/report/rpt-delivery-note/index.js +++ b/print/report/rpt-delivery-note/index.js @@ -14,11 +14,12 @@ module.exports = { const [[taxes]] = await this.fetchTaxes(params.ticketFk); const [sales] = await this.fetchSales(params.ticketFk); const [packagings] = await this.fetchPackagings(params.ticketFk); + const [services] = await this.fetchServices(params.ticketFk); if (!ticket) throw new UserException('No ticket data found'); - return {client, ticket, address, sales, taxes, packagings, signature}; + return {client, ticket, address, sales, taxes, packagings, services, signature}; }, created() { if (this.client.locale) @@ -35,6 +36,14 @@ module.exports = { }, shipped() { return strftime('%d-%m-%Y', this.ticket.shipped); + }, + serviceTotal() { + let total = 0.00; + this.services.forEach(service => { + total += parseFloat(service.price) * service.quantity; + }); + + return total; } }, filters: { @@ -169,6 +178,17 @@ module.exports = { WHERE tp.ticketFk = ? ORDER BY itemFk`, [ticketFk]); }, + fetchServices(ticketFk) { + return database.pool.query( + `SELECT + tc.description taxDescription, + ts.description, + ts.quantity, + ts.price + FROM ticketService ts + JOIN taxClass tc ON tc.id = ts.taxClassFk + WHERE ts.ticketFk = ?`, [ticketFk]); + }, fetchSignature(ticketFk) { return database.pool.query( `SELECT diff --git a/print/report/rpt-delivery-note/locale.js b/print/report/rpt-delivery-note/locale.js index afc54c72c..c637d9977 100644 --- a/print/report/rpt-delivery-note/locale.js +++ b/print/report/rpt-delivery-note/locale.js @@ -6,6 +6,7 @@ module.exports = { clientId: 'Cliente', deliveryAddress: 'Dirección de entrega', fiscalData: 'Datos fiscales', + saleLines: 'Líneas de pedido', date: 'Fecha', reference: 'Ref.', quantity: 'Cant.', @@ -18,10 +19,13 @@ module.exports = { taxBase: 'Base imp.', tax: 'Tasa', fee: 'Cuota', - packaging: 'Cubos y embalajes', - taxBreakdown: 'Desglose impositivo', total: 'Total', subtotal: 'Subtotal', + taxBreakdown: 'Desglose impositivo', + packagings: 'Cubos y embalajes', + services: 'Servicios', + vatType: 'Tipo de IVA', + digitalSignature: 'Firma digital', ticket: 'Albarán {0}' }, }, diff --git a/print/report/rpt-informe/index.js b/print/report/rpt-informe/index.js deleted file mode 100755 index b5204e8c7..000000000 --- a/print/report/rpt-informe/index.js +++ /dev/null @@ -1,33 +0,0 @@ -const strftime = require('strftime'); - -module.exports = { - name: 'rpt-informe', - created() { - if (this.locale) - this.$i18n.locale = this.locale; - - const embeded = []; - this.files.map(file => { - embeded[file] = `file://${__dirname + file}`; - }); - this.embeded = embeded; - }, - data() { - return { - client: { - id: 101, - name: 'Batman' - }, - files: ['/assets/images/signature.png'], - }; - }, - methods: { - /* dated: () => { - return strftime('%d-%m-%Y', new Date()); - }, */ - }, - components: { - 'report-header': require('../report-header'), - 'report-footer': require('../report-footer'), - }, -}; diff --git a/print/report/rpt-informe/locale.js b/print/report/rpt-informe/locale.js deleted file mode 100644 index 69f63bce6..000000000 --- a/print/report/rpt-informe/locale.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - messages: { - es: { - title: 'Recibo', - date: 'Fecha', - dated: 'En {0}, a {1} de {2} de {3}', - client: 'Cliente {0}', - }, - }, -}; diff --git a/print/report/rpt-informe/assets/css/index.js b/print/report/rpt-receipt/assets/css/index.js similarity index 100% rename from print/report/rpt-informe/assets/css/index.js rename to print/report/rpt-receipt/assets/css/index.js diff --git a/print/report/rpt-informe/assets/css/style.css b/print/report/rpt-receipt/assets/css/style.css similarity index 81% rename from print/report/rpt-informe/assets/css/style.css rename to print/report/rpt-receipt/assets/css/style.css index 9dd6ff5b8..350925428 100644 --- a/print/report/rpt-informe/assets/css/style.css +++ b/print/report/rpt-receipt/assets/css/style.css @@ -3,10 +3,6 @@ p { margin: 0 } -.main { - position: relative; - height: 100% -} .content { position: absolute; diff --git a/print/report/rpt-informe/assets/images/signature.png b/print/report/rpt-receipt/assets/images/signature.png similarity index 100% rename from print/report/rpt-informe/assets/images/signature.png rename to print/report/rpt-receipt/assets/images/signature.png diff --git a/print/report/rpt-informe/index.html b/print/report/rpt-receipt/index.html similarity index 51% rename from print/report/rpt-informe/index.html rename to print/report/rpt-receipt/index.html index f77c5d2ae..99058dd9c 100644 --- a/print/report/rpt-informe/index.html +++ b/print/report/rpt-receipt/index.html @@ -3,20 +3,27 @@
- +

{{$t('title')}}

- Recibo de LEON LLORENS LUIS ENRIQUE, - la cantidad de 259,96 € en concepto de 'entrega a cuenta', quedando pendiente en la cuenta del cliente - un saldo de 0,00 €. + Recibo de {{client.socialName}}, + la cantidad de {{receipt.amountPaid}} € en concepto de 'entrega a cuenta', + quedando pendiente en la cuenta del cliente + un saldo de {{receipt.amountUnpaid}} €.

-

{{$t('dated', ['Silla', '20', 'enero', '2019'])}}

+

{{$t('payed', [ + 'Silla', + receipt.payed.getDate(), + $t('months')[receipt.payed.getMonth()], + receipt.payed.getFullYear()]) + }} +

@@ -24,8 +31,8 @@ + :center-text="client.socialName" + :locale="client.locale">
diff --git a/print/report/rpt-receipt/index.js b/print/report/rpt-receipt/index.js new file mode 100755 index 000000000..7a173e6ee --- /dev/null +++ b/print/report/rpt-receipt/index.js @@ -0,0 +1,71 @@ +const strftime = require('strftime'); +const database = require(`${appPath}/lib/database`); +const UserException = require(`${appPath}/lib/exceptions/userException`); + +module.exports = { + name: 'rpt-receipt', + /* serverPrefetch() { + console.log(arguments); + return new Promise(accept => { + this.client = this.getReceipt(); + }); + }, */ + async asyncData(ctx, params) { + Object.assign(this, this.methods); + + const [[client]] = await this.fetchClient(params.receiptFk); + const [[receipt]] = await this.fetchReceipt(params.receiptFk); + + if (!receipt) + throw new UserException('No receipt data found'); + + return {client, receipt}; + }, + created() { + if (this.client.locale) + this.$i18n.locale = this.client.locale; + + const embeded = []; + this.files.map(file => { + embeded[file] = `file://${__dirname + file}`; + }); + this.embeded = embeded; + }, + data() { + return { + files: ['/assets/images/signature.png'] + }; + }, + methods: { + fetchClient(receiptFk) { + return database.pool.query( + `SELECT + c.id, + c.socialName, + u.lang locale + FROM receipt r + JOIN client c ON c.id = r.clientFk + JOIN account.user u ON u.id = c.id + WHERE r.id = ?`, [receiptFk]); + }, + fetchReceipt(receiptFk) { + return database.pool.query( + `SELECT + r.id, + r.amountPaid, + r.amountUnpaid, + r.payed, + r.companyFk + FROM receipt r + JOIN client c ON c.id = r.clientFk + WHERE r.id = ?`, [receiptFk]); + } + /* dated: () => { + return strftime('%d-%m-%Y', new Date()); + }, */ + }, + components: { + 'report-header': require('../report-header'), + 'report-footer': require('../report-footer'), + }, +}; diff --git a/print/report/rpt-receipt/locale.js b/print/report/rpt-receipt/locale.js new file mode 100644 index 000000000..b8d524274 --- /dev/null +++ b/print/report/rpt-receipt/locale.js @@ -0,0 +1,24 @@ +module.exports = { + messages: { + es: { + title: 'Recibo', + date: 'Fecha', + payed: 'En {0}, a {1} de {2} de {3}', + client: 'Cliente {0}', + months: [ + 'Enero', + 'Febrero', + 'Marzo', + 'Abril', + 'Mayo', + 'Junio', + 'Julio', + 'Agosto', + 'Septiembre', + 'Octubre', + 'Noviembre', + 'Diciembre' + ] + }, + }, +}; From dd7ded018bd4d6534d11a449539de858e2b9f9f7 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 5 Mar 2019 15:00:17 +0100 Subject: [PATCH 05/45] test fixed --- modules/ticket/back/methods/ticket/specs/filter.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket/specs/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js index 5b27bd0dc..648cfe3ba 100644 --- a/modules/ticket/back/methods/ticket/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js @@ -2,7 +2,7 @@ const app = require('vn-loopback/server/server'); describe('ticket filter()', () => { it('should call the filter method', async() => { - let ctx = {req: {accessToken: {userId: 9}}}; + let ctx = {req: {accessToken: {userId: 9}}, args: {}}; let filter = {order: 'shipped DESC'}; let result = await app.models.Ticket.filter(ctx, filter); From 8923970e75d94634b7fc8e33af40f4f10a307d7e Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Mar 2019 08:54:04 +0100 Subject: [PATCH 06/45] e2e fixed --- e2e/helpers/selectors.js | 2 +- modules/ticket/front/services/index.html | 7 ++++--- modules/ticket/front/services/index.js | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index a37d63854..818232ef5 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -425,7 +425,7 @@ export default { addServiceButton: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(3) > vn-icon-button > button > vn-icon', firstDescriptionInput: 'vn-ticket-service vn-textfield[label="Description"] input', firstQuantityInput: 'vn-ticket-service vn-textfield[label="Quantity"] input', - firstPriceInput: 'vn-ticket-service vn-textfield[label="Price"] input', + firstPriceInput: 'vn-ticket-service vn-input-number[label="Price"] input', firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]', fistDeleteServiceButton: 'vn-ticket-card > vn-main-block > div.content-block.ng-scope > vn-ticket-service > form > vn-card > div > vn-one:nth-child(1) > vn-horizontal:nth-child(1) > vn-auto > vn-icon-button[icon="delete"]', serviceLine: 'vn-ticket-service > form > vn-card > div > vn-one:nth-child(2) > vn-horizontal', diff --git a/modules/ticket/front/services/index.html b/modules/ticket/front/services/index.html index ba50c4651..83b504021 100644 --- a/modules/ticket/front/services/index.html +++ b/modules/ticket/front/services/index.html @@ -27,12 +27,13 @@ model="service.quantity" rule="TicketService.quantity"> - - + display-controls="false"> + { this.$scope.watcher.notifySaved(); + this.$scope.model.refresh(); }); } } From 80168900fee2cab8de6ab8b7cfa9c732737165d2 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Mar 2019 08:54:32 +0100 Subject: [PATCH 07/45] e2e fixed --- e2e/paths/ticket-module/13_create_ticket_services.spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/e2e/paths/ticket-module/13_create_ticket_services.spec.js b/e2e/paths/ticket-module/13_create_ticket_services.spec.js index 394b7cd9f..0d9ae610c 100644 --- a/e2e/paths/ticket-module/13_create_ticket_services.spec.js +++ b/e2e/paths/ticket-module/13_create_ticket_services.spec.js @@ -17,7 +17,6 @@ describe('Ticket services path', () => { .write(selectors.ticketService.firstDescriptionInput, 'my service') .clearInput(selectors.ticketService.firstQuantityInput) .write(selectors.ticketService.firstQuantityInput, 99) - .clearInput(selectors.ticketService.firstPriceInput) .write(selectors.ticketService.firstPriceInput, 999) .autocompleteSearch(selectors.ticketService.firstVatTypeAutocomplete, 'General VAT') .waitToClick(selectors.ticketService.saveServiceButton) From b2adde4ba341ff5a7046c2d1a48b1344c256dbd4 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Mar 2019 08:54:56 +0100 Subject: [PATCH 08/45] #1176 ticket.sale actualizar descuento --- .../ticket/back/methods/sale/updateDiscount.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/ticket/back/methods/sale/updateDiscount.js b/modules/ticket/back/methods/sale/updateDiscount.js index 1c1db1927..e1793241b 100644 --- a/modules/ticket/back/methods/sale/updateDiscount.js +++ b/modules/ticket/back/methods/sale/updateDiscount.js @@ -1,7 +1,7 @@ let UserError = require('vn-loopback/util/user-error'); module.exports = Self => { - Self.remoteMethod('updateDiscount', { + Self.remoteMethodCtx('updateDiscount', { description: 'Changes the discount of a sale', accessType: '', accepts: [{ @@ -21,16 +21,12 @@ module.exports = Self => { } }); - Self.updateDiscount = async params => { + Self.updateDiscount = async(ctx, params) => { if (isNaN(params.editLines[0].discount)) throw new UserError(`The value should be a number`); let model = Self.app.models; let thisTicketIsEditable = await model.Ticket.isEditable(params.editLines[0].ticketFk); - - if (!thisTicketIsEditable) - throw new UserError(`The sales of this ticket can't be modified`); - let ticket = await model.Ticket.find({ where: { id: params.editLines[0].ticketFk @@ -41,9 +37,16 @@ module.exports = Self => { fields: ['salesPersonFk'] } }], - fields: ['id', 'clientFk'] + fields: ['id', 'clientFk', 'refFk'] }); + let userId = ctx.req.accessToken.userId; + let isSalesAssistant = await Self.app.models.Account.hasRole(userId, 'salesAssistant'); + + if ((!thisTicketIsEditable && !isSalesAssistant) || (ticket.refFk && isSalesAssistant)) + throw new UserError(`The sales of this ticket can't be modified`); + + let componentToUse; let usesMana = await model.WorkerMana.findOne({where: {workerFk: ticket[0].client().salesPersonFk}, fields: 'amount'}); From 49d2a367eaf0b4bcce506e3d77564017acc9dd47 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 6 Mar 2019 09:26:05 +0100 Subject: [PATCH 09/45] #1210 e2e item.index ocultar columnas selectors --- e2e/helpers/selectors.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index a37d63854..1267a8708 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -171,7 +171,7 @@ export default { firstPaymentConfirmed: 'vn-client-web-payment vn-tr:nth-child(1) vn-icon[icon="check"][aria-hidden="false"]' }, itemsIndex: { - goBackToModuleIndexButton: `vn-ticket-descriptor a[href="#!/ticket/index"]`, + goBackToModuleIndexButton: `vn-item-descriptor a[href="#!/item/index"]`, createItemButton: `${components.vnFloatButton}`, searchResult: `vn-item-index a.vn-tr`, searchResultPreviewButton: `vn-item-index .buttons > [icon="desktop_windows"]`, @@ -179,7 +179,23 @@ export default { acceptClonationAlertButton: `vn-item-index [vn-id="clone"] [response="ACCEPT"]`, searchItemInput: `vn-searchbar vn-textfield input`, searchButton: `vn-searchbar vn-icon[icon="search"]`, - closeItemSummaryPreview: 'vn-item-index [vn-id="preview"] button.close' + closeItemSummaryPreview: 'vn-item-index [vn-id="preview"] button.close', + fieldsToShowButton: 'vn-item-index vn-table > div.ng-scope > div > vn-icon-button[icon="menu"]', + fieldsToShowForm: 'vn-item-index > div > vn-card > div > vn-table > div.ng-scope > div > vn-dialog > div > form', + firstItemImage: 'vn-item-index vn-tbody > a:nth-child(1) > vn-td:nth-child(1)', + firstItemId: 'vn-item-index vn-tbody > a:nth-child(1) > vn-td:nth-child(2)', + idCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(2) > vn-check > md-checkbox', + stemsCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(3) > vn-check > md-checkbox', + sizeCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(4) > vn-check > md-checkbox', + nicheCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(5) > vn-check > md-checkbox', + typeCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(6) > vn-check > md-checkbox', + categoryCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(7) > vn-check > md-checkbox', + intrastadCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(8) > vn-check > md-checkbox', + originCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(9) > vn-check > md-checkbox', + buyerCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(10) > vn-check > md-checkbox', + destinyCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(11) > vn-check > md-checkbox', + taxClassCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(12) > vn-check > md-checkbox', + saveFieldsButton: 'vn-item-index vn-dialog vn-horizontal:nth-child(17) > vn-button > button' }, itemCreateView: { temporalName: `${components.vnTextfield}[name="provisionalName"]`, From c4bcd52d3c9f2dfd22114737f95cf8604f3d1b50 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 6 Mar 2019 09:50:12 +0100 Subject: [PATCH 10/45] #1210 e2e item.index ocultar columnas --- e2e/paths/item-module/10_item_index.spec.js | 86 ++++++++++ package-lock.json | 172 ++++++++++---------- 2 files changed, 172 insertions(+), 86 deletions(-) create mode 100644 e2e/paths/item-module/10_item_index.spec.js diff --git a/e2e/paths/item-module/10_item_index.spec.js b/e2e/paths/item-module/10_item_index.spec.js new file mode 100644 index 000000000..32e855cee --- /dev/null +++ b/e2e/paths/item-module/10_item_index.spec.js @@ -0,0 +1,86 @@ +import selectors from '../../helpers/selectors.js'; +import createNightmare from '../../helpers/nightmare'; + +// #1216 item.index ocultar columnas no refresca la vista al guardar la información +xdescribe('Item index path', () => { + const nightmare = createNightmare(); + + beforeAll(() => { + nightmare + .loginAndModule('salesPerson', 'item'); + }); + + it('should click on the fields to show button to open the list of columns to show', async() => { + const visible = await nightmare + .waitToClick(selectors.itemsIndex.fieldsToShowButton) + .isVisible(selectors.itemsIndex.fieldsToShowForm); + + expect(visible).toBeTruthy(); + }); + + it('should unmark all checkboxes except the first and the last ones', async() => { + const result = await nightmare + .waitToClick(selectors.itemsIndex.idCheckbox) + .waitToClick(selectors.itemsIndex.stemsCheckbox) + .waitToClick(selectors.itemsIndex.sizeCheckbox) + .waitToClick(selectors.itemsIndex.nicheCheckbox) + .waitToClick(selectors.itemsIndex.typeCheckbox) + .waitToClick(selectors.itemsIndex.categoryCheckbox) + .waitToClick(selectors.itemsIndex.intrastadCheckbox) + .waitToClick(selectors.itemsIndex.originCheckbox) + .waitToClick(selectors.itemsIndex.buyerCheckbox) + .waitToClick(selectors.itemsIndex.destinyCheckbox) + .waitToClick(selectors.itemsIndex.taxClassCheckbox) + .waitToClick(selectors.itemsIndex.saveFieldsButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); + + it('should navigate forth and back to see the images column is still visible', async() => { + const imageVisible = await nightmare + .waitToClick(selectors.itemsIndex.searchResult) + .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) + .wait(selectors.itemsIndex.searchResult) + .isVisible(selectors.itemsIndex.firstItemImage); + + expect(imageVisible).toBeTruthy(); + }); + + it('should check the ids column is not visible', async() => { + const idVisible = await nightmare + .isVisible(selectors.itemsIndex.firstItemId); + + expect(idVisible).toBeFalsy(); + }); + + it('should mark all unchecked boxes to leave the index as it was', async() => { + const result = await nightmare + .waitToClick(selectors.itemsIndex.fieldsToShowButton) + .waitToClick(selectors.itemsIndex.idCheckbox) + .waitToClick(selectors.itemsIndex.stemsCheckbox) + .waitToClick(selectors.itemsIndex.sizeCheckbox) + .waitToClick(selectors.itemsIndex.nicheCheckbox) + .waitToClick(selectors.itemsIndex.typeCheckbox) + .waitToClick(selectors.itemsIndex.categoryCheckbox) + .waitToClick(selectors.itemsIndex.intrastadCheckbox) + .waitToClick(selectors.itemsIndex.originCheckbox) + .waitToClick(selectors.itemsIndex.buyerCheckbox) + .waitToClick(selectors.itemsIndex.destinyCheckbox) + .waitToClick(selectors.itemsIndex.taxClassCheckbox) + .waitToClick(selectors.itemsIndex.saveFieldsButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); + + it('should now navigate forth and back to see the ids column is now visible', async() => { + const idVisible = await nightmare + .waitToClick(selectors.itemsIndex.searchResult) + .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) + .wait(1999) + .isVisible(selectors.itemsIndex.firstItemId); + + expect(idVisible).toBeTruthy(); + }); +}); diff --git a/package-lock.json b/package-lock.json index 4e29d792d..e774036c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1505,7 +1505,7 @@ }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -1733,7 +1733,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -2052,7 +2052,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -2097,7 +2097,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2147,7 +2147,7 @@ }, "buffer": { "version": "4.9.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -2322,7 +2322,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -2366,7 +2366,7 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { @@ -2497,7 +2497,7 @@ "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -2657,7 +2657,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -2731,7 +2731,7 @@ }, "colors": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, @@ -2927,7 +2927,7 @@ }, "content-disposition": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "content-security-policy-builder": { @@ -3020,7 +3020,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -3033,7 +3033,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -3196,13 +3196,13 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true }, "regexpu-core": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", "dev": true, "requires": { @@ -3213,13 +3213,13 @@ }, "regjsgen": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", "dev": true }, "regjsparser": { "version": "0.1.5", - "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "dev": true, "requires": { @@ -3568,7 +3568,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -3689,7 +3689,7 @@ "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "integrity": "sha1-HxngwuGqDjJ5fEl5nyg3rGr2nFc=", "dev": true, "requires": { "is-obj": "^1.0.0" @@ -3697,12 +3697,12 @@ }, "duplex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/duplex/-/duplex-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/duplex/-/duplex-1.0.0.tgz", "integrity": "sha1-arxcFuwX5MV4V4cnEmcAWQ06Ldo=" }, "duplexer": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.0.4.tgz", + "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.0.4.tgz", "integrity": "sha1-r8t/H4uNdPggcmFx1dZKyeSo/yA=" }, "duplexer2": { @@ -3722,7 +3722,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -3849,7 +3849,7 @@ "dependencies": { "fs-extra": { "version": "0.30.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { @@ -3975,7 +3975,7 @@ }, "engine.io-client": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", + "resolved": "http://registry.npmjs.org/engine.io-client/-/engine.io-client-3.2.1.tgz", "integrity": "sha512-y5AbkytWeM4jQr7m/koQLc5AxpRKC1hEVUb/s1FUAWEJq5AzJJ4NLvzuKPuxtDi5Mq755WuDvZ6Iv2rXj4PTzw==", "dev": true, "requires": { @@ -4126,7 +4126,7 @@ }, "es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { "es6-promise": "^4.0.3" @@ -4846,7 +4846,7 @@ }, "file-loader": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", + "resolved": "http://registry.npmjs.org/file-loader/-/file-loader-1.1.11.tgz", "integrity": "sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg==", "dev": true, "requires": { @@ -5107,7 +5107,7 @@ }, "fs-access": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", "dev": true, "requires": { @@ -5906,7 +5906,7 @@ "global-modules": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { "global-prefix": "^1.0.1", @@ -5943,7 +5943,7 @@ }, "globby": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "resolved": "http://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { @@ -5988,7 +5988,7 @@ }, "got": { "version": "6.7.1", - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { @@ -6165,7 +6165,7 @@ }, "kind-of": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", "dev": true }, @@ -6349,7 +6349,7 @@ "dependencies": { "es6-promise": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=", "dev": true }, @@ -7112,7 +7112,7 @@ "is-absolute": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", "dev": true, "requires": { "is-relative": "^1.0.0", @@ -7161,7 +7161,7 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { @@ -7308,7 +7308,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -7339,7 +7339,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "^3.0.1" @@ -7375,7 +7375,7 @@ "is-relative": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha1-obtpNc6MXboei5dUubLcwCDiJg0=", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "dev": true, "requires": { "is-unc-path": "^1.0.0" @@ -7409,7 +7409,7 @@ "is-unc-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "dev": true, "requires": { "unc-path-regex": "^0.1.2" @@ -7455,7 +7455,7 @@ }, "isemail": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz", + "resolved": "http://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz", "integrity": "sha1-A1PT2aYpUQgMJiwqoKQrjqjp4qY=" }, "isexe": { @@ -7510,7 +7510,7 @@ }, "jasmine-core": { "version": "2.99.1", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", + "resolved": "http://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", "integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=", "dev": true }, @@ -7527,7 +7527,7 @@ "jasmine-spec-reporter": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.2.1.tgz", - "integrity": "sha1-HWMq7ANBZwrTJPkrqEtLMrNeniI=", + "integrity": "sha512-FZBoZu7VE5nR7Nilzy+Np8KuVIOxF4oXDPDknehCYBDE080EnlPu0afdZNmpGDBRCUBv3mj5qgqCRmk6W/K8vg==", "dev": true, "requires": { "colors": "1.1.2" @@ -7615,7 +7615,7 @@ }, "json-buffer": { "version": "2.0.11", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-2.0.11.tgz", + "resolved": "http://registry.npmjs.org/json-buffer/-/json-buffer-2.0.11.tgz", "integrity": "sha1-PkQf2jCYvo0eMXGtWRvGKjPi1V8=" }, "json-loader": { @@ -7952,7 +7952,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { @@ -9426,7 +9426,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "mem": { @@ -9449,7 +9449,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { @@ -9572,7 +9572,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "minstache": { @@ -9586,7 +9586,7 @@ "dependencies": { "commander": { "version": "1.0.4", - "resolved": "http://registry.npmjs.org/commander/-/commander-1.0.4.tgz", + "resolved": "https://registry.npmjs.org/commander/-/commander-1.0.4.tgz", "integrity": "sha1-Xt6xruI8T7VBprcNaSq+8ZZpotM=", "dev": true, "requires": { @@ -9654,7 +9654,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" @@ -9662,7 +9662,7 @@ "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } @@ -9737,7 +9737,7 @@ "dependencies": { "through": { "version": "2.3.4", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.4.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.4.tgz", "integrity": "sha1-SV5A6Nio6uvHwnXqiMK4/BTFZFU=" } } @@ -9814,7 +9814,7 @@ }, "multipipe": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "resolved": "http://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", "dev": true, "requires": { @@ -9840,7 +9840,7 @@ }, "mux-demux": { "version": "3.7.9", - "resolved": "https://registry.npmjs.org/mux-demux/-/mux-demux-3.7.9.tgz", + "resolved": "http://registry.npmjs.org/mux-demux/-/mux-demux-3.7.9.tgz", "integrity": "sha1-NTZ3GP02AcgLzi63YlMVdtekrO8=", "requires": { "duplex": "~1.0.0", @@ -10044,7 +10044,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -11497,7 +11497,7 @@ "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, @@ -11559,7 +11559,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, @@ -11575,7 +11575,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, @@ -11764,7 +11764,7 @@ }, "path-browserify": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "resolved": "http://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, @@ -12053,7 +12053,7 @@ }, "pretty-bytes": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", "dev": true, "requires": { @@ -12124,7 +12124,7 @@ }, "readable-stream": { "version": "1.1.14", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { @@ -12136,13 +12136,13 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, "through2": { "version": "0.2.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", + "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", "dev": true, "requires": { @@ -12609,7 +12609,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true } @@ -13033,7 +13033,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { @@ -13158,7 +13158,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { @@ -13298,7 +13298,7 @@ "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -13331,7 +13331,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -13409,7 +13409,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { @@ -13485,7 +13485,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { "define-property": "^1.0.0", @@ -13536,7 +13536,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -13619,7 +13619,7 @@ }, "socket.io-parser": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", + "resolved": "http://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.2.0.tgz", "integrity": "sha512-FYiBx7rc/KORMJlgsXysflWx/RIvtqZbyGLlHZvjfmPTPeuD/I8MaW7cfFrj5tRltICJdgwflhfZ3NVVbVLFQA==", "dev": true, "requires": { @@ -13872,7 +13872,7 @@ "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -13881,7 +13881,7 @@ "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, "requires": { "through2": "^2.0.2" @@ -13998,7 +13998,7 @@ }, "stream-combiner": { "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.2.tgz", + "resolved": "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.2.tgz", "integrity": "sha1-3+DnRnV0JWXnbGBWeI6lwjvZfbQ=", "requires": { "duplexer": "~0.0.3" @@ -14041,7 +14041,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -14056,7 +14056,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -14067,7 +14067,7 @@ }, "stream-serializer": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/stream-serializer/-/stream-serializer-1.1.2.tgz", + "resolved": "http://registry.npmjs.org/stream-serializer/-/stream-serializer-1.1.2.tgz", "integrity": "sha1-wfl9FdolH1lK4n1B7IraCahG408=" }, "stream-shift": { @@ -14163,7 +14163,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -14579,7 +14579,7 @@ }, "tar": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { @@ -14749,7 +14749,7 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "through2": { @@ -14932,7 +14932,7 @@ "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", + "integrity": "sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=", "dev": true, "requires": { "nopt": "~1.0.10" @@ -15021,7 +15021,7 @@ }, "tty-browserify": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "resolved": "http://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, @@ -15134,7 +15134,7 @@ }, "underscore": { "version": "1.7.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "resolved": "http://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=" }, "underscore.string": { @@ -15653,7 +15653,7 @@ }, "vm-browserify": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "resolved": "http://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", "dev": true, "requires": { @@ -16156,7 +16156,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -16169,7 +16169,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -16586,7 +16586,7 @@ }, "xmlbuilder": { "version": "9.0.7", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" }, "xmlcreate": { From 6289978de8c79a80981418d289d4376c16c4f09c Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 6 Mar 2019 11:40:37 +0100 Subject: [PATCH 11/45] increased default timeout for 1 single test which failed constantly --- e2e/paths/ticket-module/13_create_ticket_services.spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/e2e/paths/ticket-module/13_create_ticket_services.spec.js b/e2e/paths/ticket-module/13_create_ticket_services.spec.js index 0d9ae610c..0b1c08463 100644 --- a/e2e/paths/ticket-module/13_create_ticket_services.spec.js +++ b/e2e/paths/ticket-module/13_create_ticket_services.spec.js @@ -7,7 +7,7 @@ describe('Ticket services path', () => { beforeAll(() => { nightmare .loginAndModule('employee', 'ticket') - .accessToSearchResult('id:1') + .accessToSearchResult('1') .accessToSection('ticket.card.service'); }); @@ -17,13 +17,14 @@ describe('Ticket services path', () => { .write(selectors.ticketService.firstDescriptionInput, 'my service') .clearInput(selectors.ticketService.firstQuantityInput) .write(selectors.ticketService.firstQuantityInput, 99) + .clearInput(selectors.ticketService.firstPriceInput) .write(selectors.ticketService.firstPriceInput, 999) .autocompleteSearch(selectors.ticketService.firstVatTypeAutocomplete, 'General VAT') .waitToClick(selectors.ticketService.saveServiceButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); - }); + }, 15000); it('should confirm the service description was edited correctly', async() => { const result = await nightmare From eef85a47db2cae96b82a83e84d41ae0ccc85dc53 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 6 Mar 2019 11:40:52 +0100 Subject: [PATCH 12/45] #1210 e2e item.index ocultar columnas --- e2e/paths/item-module/10_item_index.spec.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/e2e/paths/item-module/10_item_index.spec.js b/e2e/paths/item-module/10_item_index.spec.js index 32e855cee..36d8d07d8 100644 --- a/e2e/paths/item-module/10_item_index.spec.js +++ b/e2e/paths/item-module/10_item_index.spec.js @@ -1,8 +1,7 @@ import selectors from '../../helpers/selectors.js'; import createNightmare from '../../helpers/nightmare'; -// #1216 item.index ocultar columnas no refresca la vista al guardar la información -xdescribe('Item index path', () => { +describe('Item index path', () => { const nightmare = createNightmare(); beforeAll(() => { From 5efce3699c349fd15771042b0b5597778432238d Mon Sep 17 00:00:00 2001 From: Bernat Date: Wed, 6 Mar 2019 11:45:05 +0100 Subject: [PATCH 13/45] cau 9994 new procedure ticketCalculateSale --- db/install/changes/11-ticketCalculateSale.sql | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 db/install/changes/11-ticketCalculateSale.sql diff --git a/db/install/changes/11-ticketCalculateSale.sql b/db/install/changes/11-ticketCalculateSale.sql new file mode 100644 index 000000000..3f0f424da --- /dev/null +++ b/db/install/changes/11-ticketCalculateSale.sql @@ -0,0 +1,72 @@ +USE `vn`; +DROP procedure IF EXISTS `ticketCalculateSale`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` PROCEDURE `ticketCalculateSale`(IN vSale BIGINT) +proc: BEGIN + +/* +Este procedimiento bioniza una linea de movimiento +*/ + DECLARE vShipped DATE; + DECLARE vWarehouse SMALLINT; + DECLARE vAgencyMode INT; + DECLARE vAddress INT; + DECLARE vTicket BIGINT; + DECLARE vItem BIGINT; + DECLARE vLanded DATE; + DECLARE vTicketFree BOOLEAN DEFAULT TRUE; + + SELECT FALSE + INTO vTicketFree + FROM vn.ticket t + JOIN vn.sale s ON s.ticketFk = t.id + LEFT JOIN vn.ticketState ts ON ts.ticketFk = t.id + WHERE s.id = vSale + AND (t.refFk != "" OR (ts.alertLevel > 0 AND s.price != 0)) + LIMIT 1; + + SELECT ticketFk, itemFk + INTO vTicket, vItem + FROM sale + WHERE id = vSale; + + SELECT t.warehouseFk, DATE(t.shipped), t.addressFk, t.agencyModeFk, t.landed + INTO vWarehouse, vShipped, vAddress, vAgencyMode, vLanded + FROM agencyMode a + JOIN ticket t ON t.agencyModeFk = a.id + WHERE t.id = vTicket; + + DROP TEMPORARY TABLE IF EXISTS tmp.agencyHourGetShipped; + CREATE TEMPORARY TABLE tmp.agencyHourGetShipped ENGINE = MEMORY + SELECT vWarehouse warehouseFk, vShipped shipped, vLanded landed; + + CALL buyUltimate (vWarehouse, vShipped); -- rellena la tabla tmp.buyUltimate con la ultima compra + + DELETE FROM tmp.buyUltimate WHERE itemFk != vItem; + + DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot; + CREATE TEMPORARY TABLE tmp.ticketLot + SELECT vWarehouse warehouseFk, NULL available, vItem itemFk, buyFk + FROM tmp.buyUltimate + WHERE itemFk = vItem; + + CALL ticketComponentCalculate(vAddress, vAgencyMode); + + DROP TEMPORARY TABLE IF EXISTS tmp.sale; + CREATE TEMPORARY TABLE tmp.sale + (PRIMARY KEY (saleFk)) ENGINE = MEMORY + SELECT vSale saleFk,vWarehouse warehouseFk; + + CALL ticketComponentUpdateSale(IF(vTicketFree,1,6)); -- si el ticket esta facturado, respeta los precios + + -- Log + INSERT INTO vn.ticketLog (originFk, userFk, `action`, description) + VALUES (vTicket, account.userGetId(), 'update', CONCAT('Bionizo linea id ', vSale)); + + -- Limpieza + DROP TEMPORARY TABLE tmp.buyUltimate; +END$$ + +DELIMITER ; \ No newline at end of file From fdfddd260a8520c0a0dd0af77f644c5107806963 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 6 Mar 2019 12:27:56 +0100 Subject: [PATCH 14/45] #1208 Cambiar componente de icono papelera vn-icon por vn-icon-button --- e2e/helpers/selectors.js | 2 +- modules/ticket/front/note/index.html | 4 ++-- modules/ticket/front/package/index.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index db1a50b38..68aa59a09 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -341,7 +341,7 @@ export default { packagesButton: `vn-left-menu a[ui-sref="ticket.card.package.index"]`, firstPackageAutocomplete: `vn-autocomplete[label="Package"]`, firstQuantityInput: `vn-textfield[label="Quantity"] input`, - firstRemovePackageButton: `vn-icon[vn-tooltip="Remove package"]`, + firstRemovePackageButton: `vn-icon-button[vn-tooltip="Remove package"]`, addPackageButton: `vn-icon-button[vn-tooltip="Add package"]`, clearPackageAutocompleteButton: `vn-autocomplete[label="Package"] > div > div > div > vn-icon > i`, savePackagesButton: `${components.vnSubmit}` diff --git a/modules/ticket/front/note/index.html b/modules/ticket/front/note/index.html index ce177b4cb..bc808ce8e 100644 --- a/modules/ticket/front/note/index.html +++ b/modules/ticket/front/note/index.html @@ -35,12 +35,12 @@ rule="ticketObservation.description"> - - + diff --git a/modules/ticket/front/package/index.html b/modules/ticket/front/package/index.html index d8a25c11a..5baf0580c 100644 --- a/modules/ticket/front/package/index.html +++ b/modules/ticket/front/package/index.html @@ -39,12 +39,12 @@ ng-readonly="true"> - - + From b709930db559441c09c02ab4ed4f7f276c044054 Mon Sep 17 00:00:00 2001 From: Bernat Date: Thu, 7 Mar 2019 07:51:29 +0100 Subject: [PATCH 15/45] cau 10041 update fixtures for workers and fix test --- db/install/dump/fixtures.sql | 39 ++++++++---- .../back/methods/client/isValidClient.js | 19 +++--- .../client/specs/isValidClient.spec.js | 60 ++++++++----------- 3 files changed, 61 insertions(+), 57 deletions(-) diff --git a/db/install/dump/fixtures.sql b/db/install/dump/fixtures.sql index 2488c231b..ea867559a 100644 --- a/db/install/dump/fixtures.sql +++ b/db/install/dump/fixtures.sql @@ -191,18 +191,23 @@ INSERT INTO `vn`.`contactChannel`(`id`, `name`) INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`fax`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`,`clientTypeFk`,`mailAddress`,`cplusTerIdNifFk`,`hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`) VALUES - (101, 'Bruce Wayne', '84612325V', 'Batman', 'Alfred', '1007 Mountain Drive, Gotham', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'BruceWayne@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1), - (102, 'Petter Parker', '87945234L', 'Spider-Man', 'Aunt May', '20 Ingram Street', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'PetterParker@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 1, NULL, 0, 0, 18, 0, 1), - (103, 'Clark Kent', '06815934E', 'Super-Man', 'lois lane', '344 Clinton Street', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'ClarkKent@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 0, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1), - (104, 'Tony Stark', '06089160W', 'Iron-Man', 'Pepper Potts', '10880 Malibu Point', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'TonyStark@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1), - (105, 'Max Eisenhardt', '39182496H', 'Magneto', 'Rogue', 'Unknown Whereabouts', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'MaxEisenhardt@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, NULL, 0, 1), - (106, 'DavidCharlesHaller', '53136686Q', 'Legion', 'Charles Xavier', 'Evil hideout', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'DavidCharlesHaller@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1), - (107, 'Hank Pym', '09854837G', 'Ant-Man', 'Hawk', 'Anthill', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'HankPym@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1), - (108, 'Charles Xavier', '22641921P', 'Professor X', 'Beast', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'CharlesXavier@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1), - (109, 'Bruce Banner', '16104829E', 'Hulk', 'Black widow', 'Somewhere in New York', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'BruceBanner@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 1, NULL, 0, 0, 19, 0, 1), - (110, 'Jessica Jones', '58282869H', 'Jessica Jones', 'Luke Cage', 'NYCC 2015 Poster', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'JessicaJones@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 1, NULL, 0, 0, NULL, 0, 1), - (200, 'Missing', NULL, 'Missing man', 'Anton', 'The space', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 4, NULL, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1), - (400, 'Trash', NULL, 'Garbage man', 'Unknown name', 'New York city', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 4, NULL, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1); + (101, 'Bruce Wayne', '84612325V', 'Batman', 'Alfred', '1007 Mountain Drive, Gotham', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'BruceWayne@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1), + (102, 'Petter Parker', '87945234L', 'Spider-Man', 'Aunt May', '20 Ingram Street', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'PetterParker@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 1, NULL, 0, 0, 18, 0, 1), + (103, 'Clark Kent', '06815934E', 'Super-Man', 'lois lane', '344 Clinton Street', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'ClarkKent@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 0, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1), + (104, 'Tony Stark', '06089160W', 'Iron-Man', 'Pepper Potts', '10880 Malibu Point', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'TonyStark@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1), + (105, 'Max Eisenhardt', '39182496H', 'Magneto', 'Rogue', 'Unknown Whereabouts', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'MaxEisenhardt@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, NULL, 0, 1), + (106, 'DavidCharlesHaller', '53136686Q', 'Legion', 'Charles Xavier', 'Evil hideout', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'DavidCharlesHaller@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1), + (107, 'Hank Pym', '09854837G', 'Ant-Man', 'Hawk', 'Anthill', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'HankPym@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1), + (108, 'Charles Xavier', '22641921P', 'Professor X', 'Beast', '3800 Victory Pkwy, Cincinnati, OH 45207, USA', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'CharlesXavier@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1), + (109, 'Bruce Banner', '16104829E', 'Hulk', 'Black widow', 'Somewhere in New York', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'BruceBanner@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 1, NULL, 0, 0, 19, 0, 1), + (110, 'Jessica Jones', '58282869H', 'Jessica Jones', 'Luke Cage', 'NYCC 2015 Poster', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, 'JessicaJones@verdnatura.es', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 1, NULL, 1, 1, 0, 1, NULL, 0, 0, NULL, 0, 1), + (200, 'Missing', NULL, 'Missing man', 'Anton', 'The space', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 4, NULL, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1), + (400, 'Trash', NULL, 'Garbage man', 'Unknown name', 'New York city', 'Silla', 46460, 1111111111, 222222222, 333333333, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5,CURDATE(), 1, 5, 1, 1, 1,'0000-00-00', 4, NULL, 1, 0, 1, 0, NULL, 1, 0, NULL, 0, 1); + +INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `phone`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`) + SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'SILLA', 46460, 623111111, 1, CONCAT(name,'@verdnatura.es'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, CURDATE(), 1 + FROM `account`.`role` `r` + WHERE `r`.`hasLogin` = 1; INSERT INTO `vn`.`clientManaCache`(`clientFk`, `mana`, `dated`) VALUES @@ -258,6 +263,11 @@ INSERT INTO `vn`.`address`(`id`, `nickname`, `street`, `city`, `postalCode`, `pr (131, 'Missing', 'The space', 'Silla', 46460, 1, 1111111111, 222222222, 1, 200, 2, NULL, NULL, 0, 0), (132, 'Trash', 'New York city', 'Silla', 46460, 1, 1111111111, 222222222, 1, 400, 2, NULL, NULL, 0, 0); +INSERT INTO `vn`.`address`( `nickname`, `street`, `city`, `postalCode`, `provinceFk`, `isActive`, `clientFk`, `agencyModeFk`, `isDefaultAddress`) + SELECT name, CONCAT(name, 'Street'), 'SILLA', 46460, 1, 1, id, 2, 1 + FROM `account`.`role` `r` + WHERE `r`.`hasLogin` = 1; + UPDATE `vn`.`client` SET defaultAddressFk = 1 WHERE id = 101; UPDATE `vn`.`client` SET defaultAddressFk = 2 WHERE id = 102; UPDATE `vn`.`client` SET defaultAddressFk = 3 WHERE id = 103; @@ -271,6 +281,11 @@ UPDATE `vn`.`client` SET defaultAddressFk = 10 WHERE id = 110; UPDATE `vn`.`client` SET defaultAddressFk = 11 WHERE id = 200; UPDATE `vn`.`client` SET defaultAddressFk = 12 WHERE id = 400; +UPDATE `vn`.`client` `c` + JOIN `vn`.`address` `a` ON `a`.`clientFk` = `c`.`id` + SET `c`.`defaultAddressFk` = `a`.`id` + WHERE `defaultAddressFk` IS NULL; + INSERT INTO `vn`.`clientCredit`(`id`, `clientFk`, `workerFk`, `amount`, `created`) VALUES (1 , 101, 5, 300, DATE_ADD(CURDATE(), INTERVAL -1 MONTH)), diff --git a/modules/client/back/methods/client/isValidClient.js b/modules/client/back/methods/client/isValidClient.js index 583efa299..241121927 100644 --- a/modules/client/back/methods/client/isValidClient.js +++ b/modules/client/back/methods/client/isValidClient.js @@ -29,22 +29,23 @@ module.exports = Self => { } }); - Self.isValidClient = async function(id) { + Self.isValidClient = async id => { let query = `SELECT r.name - FROM salix.Account A - JOIN vn.client C ON A.id = C.id - JOIN salix.RoleMapping rm ON rm.principalId = A.id + FROM salix.Account a + JOIN vn.client c ON a.id = c.id + JOIN salix.RoleMapping rm ON rm.principalId = a.id JOIN salix.Role r ON r.id = rm.roleId - WHERE A.id = ? AND C.isActive AND C.isTaxDataChecked`; + WHERE a.id = ? AND c.isActive AND c.isTaxDataChecked`; let roleNames = await Self.rawSql(query, [id]); - if (!roleNames.length) return false; - roleNames.forEach(role => { - if (role.name === 'employee') - return false; + let isEmployee = roleNames.findIndex(role => { + return role.name === 'employee'; }); + + if (!roleNames.length || isEmployee > -1 ) return false; + return true; }; }; diff --git a/modules/client/back/methods/client/specs/isValidClient.spec.js b/modules/client/back/methods/client/specs/isValidClient.spec.js index f995bb7ab..446392374 100644 --- a/modules/client/back/methods/client/specs/isValidClient.spec.js +++ b/modules/client/back/methods/client/specs/isValidClient.spec.js @@ -1,57 +1,45 @@ const app = require('vn-loopback/server/server'); describe('Client isValidClient', () => { - it('should call the isValidClient() method with a client id and receive true', done => { + it('should call the isValidClient() method with a client id and receive true', async() => { let id = 101; - app.models.Client.isValidClient(id) - .then(result => { - expect(result).toBeTruthy(); - done(); - }); + let result = await app.models.Client.isValidClient(id); + + expect(result).toBeTruthy(); }); - it('should call the isValidClient() method with a employee id and receive false', done => { + it('should call the isValidClient() method with an employee id to receive false', async() => { let id = 1; - app.models.Client.isValidClient(id) - .then(result => { - expect(result).toBeFalsy(); - done(); - }); + let result = await app.models.Client.isValidClient(id); + + expect(result).toBeFalsy(); }); - it('should call the isValidClient() method with a unexistant id and receive false', done => { + it('should call the isValidClient() method with an unexistant id and receive false', async() => { let id = 999999; - app.models.Client.isValidClient(id) - .then(result => { - expect(result).toBeFalsy(); - done(); - }); + let result = await app.models.Client.isValidClient(id); + + expect(result).toBeFalsy(); }); - it('should call the isValidClient() method with a invalid id and receive false', done => { + it('should call the isValidClient() method with an invalid id and receive false', async() => { let id = 'Pepinillos'; - app.models.Client.isValidClient(id) - .then(result => { - expect(result).toBeFalsy(); - done(); - }); + let result = await app.models.Client.isValidClient(id); + + expect(result).toBeFalsy(); }); - it('should call the isValidClient() method with a customer id which isnt active and return false', done => { + it('should call the isValidClient() method with a customer id which isnt active and return false', async() => { let id = '106'; - app.models.Client.isValidClient(id) - .then(result => { - expect(result).toBeFalsy(); - done(); - }); + let result = await app.models.Client.isValidClient(id); + + expect(result).toBeFalsy(); }); - it('should call the isValidClient() method with a customer id which his data isnt verified and return false', done => { + it('should call the isValidClient() method with a customer id which his data isnt verified and return false', async() => { let id = '110'; - app.models.Client.isValidClient(id) - .then(result => { - expect(result).toBeFalsy(); - done(); - }); + let result = await app.models.Client.isValidClient(id); + + expect(result).toBeFalsy(); }); }); From 1bf7aa112aca725e4c9d1b71eac32a768c430b84 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Thu, 7 Mar 2019 09:55:03 +0100 Subject: [PATCH 16/45] Bug #1194 configuracion de usuario, buscar por id --- .../user-configuration-popover/index.html | 11 +++-------- .../user-configuration-popover/index.js | 15 +++++++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/front/salix/components/user-configuration-popover/index.html b/front/salix/components/user-configuration-popover/index.html index 3fe9a40a5..7761fcc4c 100644 --- a/front/salix/components/user-configuration-popover/index.html +++ b/front/salix/components/user-configuration-popover/index.html @@ -1,9 +1,3 @@ - - + value-field="id" + search-function="{or: [{id: $search}, {bank: {like: '%'+ $search +'%'}}]}"> {{id}}: {{bank}} Date: Thu, 7 Mar 2019 09:55:22 +0100 Subject: [PATCH 17/45] #1211 client.billingData --- loopback/locale/es.json | 5 +++-- modules/client/front/billing-data/index.html | 6 ++++++ modules/client/front/billing-data/index.js | 3 +++ modules/client/front/billing-data/locale/es.yml | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 05e100fb7..b62cd53aa 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -71,6 +71,7 @@ "You can't create a ticket for a client that has a debt": "No puedes crear un ticket para un client con deuda", "NO SE PUEDE DESACTIVAR EL CONSIGNAT": "NO SE PUEDE DESACTIVAR EL CONSIGNAT", "Error. El NIF/CIF está repetido": "Error. El NIF/CIF está repetido", - "Street cannot be empty": "Street cannot be empty", - "City cannot be empty": "City cannot be empty" + "Street cannot be empty": "Dirección no puede estar en blanco", + "City cannot be empty": "Cuidad no puede estar en blanco", + "Code cannot be blank": "Código no puede estar en blanco" } \ No newline at end of file diff --git a/modules/client/front/billing-data/index.html b/modules/client/front/billing-data/index.html index 300919acc..ce4748829 100644 --- a/modules/client/front/billing-data/index.html +++ b/modules/client/front/billing-data/index.html @@ -111,6 +111,12 @@ show-field="country"> + + + + Date: Thu, 7 Mar 2019 12:11:06 +0100 Subject: [PATCH 18/45] #1211 client.billingData --- e2e/helpers/selectors.js | 1 + .../client-module/04_edit_pay_method.spec.js | 1 + .../client/front/billing-data/index.spec.js | 21 ++++++++++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 68aa59a09..9c7f71770 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -87,6 +87,7 @@ export default { newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button', newBankEntityName: 'vn-client-billing-data > vn-dialog vn-textfield[label="Name"] input', newBankEntityBIC: 'vn-client-billing-data > vn-dialog vn-textfield[label="Swift / BIC"] input', + newBankEntityCode: 'vn-client-billing-data > vn-dialog vn-textfield[label="Code"] input', acceptBankEntityButton: 'vn-client-billing-data > vn-dialog button[response="ACCEPT"]', saveButton: `${components.vnSubmit}` }, diff --git a/e2e/paths/client-module/04_edit_pay_method.spec.js b/e2e/paths/client-module/04_edit_pay_method.spec.js index a8b58ca11..ef8c514d8 100644 --- a/e2e/paths/client-module/04_edit_pay_method.spec.js +++ b/e2e/paths/client-module/04_edit_pay_method.spec.js @@ -44,6 +44,7 @@ describe('Client Edit pay method path', () => { const newcode = await nightmare .waitToClick(selectors.clientPayMethod.newBankEntityButton) .write(selectors.clientPayMethod.newBankEntityName, 'Gotham City Bank') + .write(selectors.clientPayMethod.newBankEntityCode, 999) .write(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT') .waitToClick(selectors.clientPayMethod.acceptBankEntityButton) .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value'); diff --git a/modules/client/front/billing-data/index.spec.js b/modules/client/front/billing-data/index.spec.js index 277ff7a2d..7ce5440df 100644 --- a/modules/client/front/billing-data/index.spec.js +++ b/modules/client/front/billing-data/index.spec.js @@ -51,7 +51,8 @@ describe('Client', () => { controller.newBankEntity = { name: '', bic: 'ES123', - countryFk: 1 + countryFk: 1, + id: 999 }; controller.onBankEntityResponse('ACCEPT'); @@ -62,18 +63,32 @@ describe('Client', () => { controller.newBankEntity = { name: 'My new bank entity', bic: '', - countryFk: 1 + countryFk: 1, + id: 999 }; controller.onBankEntityResponse('ACCEPT'); expect(vnApp.showError).toHaveBeenCalledWith(`Swift / BIC can't be empty`); }); + it(`should throw an error if id property is empty`, () => { + controller.newBankEntity = { + name: 'My new bank entity', + bic: 'ES123', + countryFk: 1, + id: null + }; + controller.onBankEntityResponse('ACCEPT'); + + expect(vnApp.showError).toHaveBeenCalledWith(`Code can't be empty`); + }); + it('should request to create a new bank entity', () => { let newBankEntity = { name: 'My new bank entity', bic: 'ES123', - countryFk: 1 + countryFk: 1, + id: 999 }; controller.newBankEntity = newBankEntity; $httpBackend.when('POST', '/client/api/BankEntities').respond('done'); From 9f3f0224ab23b047d7cff8eb91e11f80faeae53d Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 7 Mar 2019 13:53:06 +0100 Subject: [PATCH 19/45] recovered sql --- db/install/changes/8-clientAfterUpdate.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/install/changes/8-clientAfterUpdate.sql b/db/install/changes/8-clientAfterUpdate.sql index cfbd145da..385db8739 100644 --- a/db/install/changes/8-clientAfterUpdate.sql +++ b/db/install/changes/8-clientAfterUpdate.sql @@ -12,7 +12,8 @@ BEGIN UPDATE Consignatarios SET predeterminada = FALSE WHERE Id_cliente = NEW.Id_cliente; - + UPDATE Consignatarios SET predeterminada = TRUE + WHERE Id_consigna = NEW.default_address; END IF; END$$ DELIMITER ; From 7f0d3279d1c55c4d9a18d989a7abe58f2dd152d6 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Mar 2019 08:14:22 +0100 Subject: [PATCH 20/45] #1189 ticket.index mostrar mas informacion --- db/install/changes/12-ticketGetProblems.sql | 165 +++++++++++++++++++ modules/ticket/back/methods/ticket/filter.js | 4 +- modules/ticket/front/index/index.html | 24 ++- 3 files changed, 188 insertions(+), 5 deletions(-) create mode 100644 db/install/changes/12-ticketGetProblems.sql diff --git a/db/install/changes/12-ticketGetProblems.sql b/db/install/changes/12-ticketGetProblems.sql new file mode 100644 index 000000000..29bd3e93a --- /dev/null +++ b/db/install/changes/12-ticketGetProblems.sql @@ -0,0 +1,165 @@ +USE `vn`; +DROP procedure IF EXISTS `ticketGetProblems`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` PROCEDURE `ticketGetProblems`() +BEGIN +/* + * Obtiene los problemas de uno o varios tickets + * + * @table tmp.ticketGetProblems(ticketFk, clientFk, warehouseFk, shipped) + * @return tmp.ticketProblems + */ + DECLARE vWarehouse INT; + DECLARE vDate DATE; + DECLARE vAvailableCache INT; + DECLARE vVisibleCache INT; + DECLARE vDone INT DEFAULT 0; + + DECLARE vCursor CURSOR FOR + SELECT DISTINCT tt.warehouseFk, date(tt.shipped) + FROM tmp.ticketGetProblems tt + WHERE DATE(tt.shipped) BETWEEN CURDATE() + AND TIMESTAMPADD(DAY, 1.9, CURDATE()); + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = 1; + + DROP TEMPORARY TABLE IF EXISTS tmp.ticketProblems; + CREATE TEMPORARY TABLE tmp.ticketProblems ( + ticketFk INT(11) PRIMARY KEY, + isFreezed INTEGER(1) DEFAULT 0, + risk DECIMAL(10,2) DEFAULT 0, + hasTicketRequest INTEGER(1) DEFAULT 0, + isAvailable INTEGER(1) DEFAULT 1 + ) ENGINE = MEMORY; + + DROP TEMPORARY TABLE IF EXISTS tmp.ticketList; + CREATE TEMPORARY TABLE tmp.ticketList + (PRIMARY KEY (ticketFk)) + ENGINE = MEMORY + SELECT tp.ticketFk, c.id clientFk + FROM tmp.ticketGetProblems tp + JOIN vn.client c ON c.id = tp.clientFk; + + -- Inserta tickets de clientes congelados + INSERT INTO tmp.ticketProblems(ticketFk, isFreezed) + SELECT DISTINCT tl.ticketFk, 1 + FROM tmp.ticketList tl + JOIN vn.client c ON c.id = tl.clientFk + WHERE c.isFreezed; + + DELETE tl FROM tmp.ticketList tl + JOIN tmp.ticketProblems tp ON tl.ticketFk = tp.ticketFk; + + DROP TEMPORARY TABLE IF EXISTS tmp.clientGetDebt; + CREATE TEMPORARY TABLE tmp.clientGetDebt + (PRIMARY KEY (clientFk)) + ENGINE = MEMORY + SELECT DISTINCT clientFk + FROM tmp.ticketList; + + CALL clientGetDebt(CURDATE()); + + -- Inserta tickets de clientes con riesgo + INSERT INTO tmp.ticketProblems(ticketFk, risk) + SELECT DISTINCT tl.ticketFk, r.risk + FROM tmp.ticketList tl + JOIN vn.ticket t ON t.id = tl.ticketFk + JOIN vn.agencyMode a ON t.agencyModeFk = a.id + JOIN tmp.risk r ON r.clientFk = t.clientFk + JOIN vn.client c ON c.id = t.clientFk + WHERE r.risk > c.credit + 10 + AND a.deliveryMethodFk != 3 + ON DUPLICATE KEY UPDATE + risk = r.risk; + + DELETE tl FROM tmp.ticketList tl + JOIN tmp.ticketProblems tp ON tl.ticketFk = tp.ticketFk; + + -- Inserta tickets que tengan codigos 100 + INSERT INTO tmp.ticketProblems(ticketFk, hasTicketRequest) + SELECT DISTINCT tl.ticketFk, 'Code 100' + FROM tmp.ticketList tl + JOIN vn.ticketRequest tr ON tr.ticketFk = tl.ticketFk + WHERE tr.isOK IS NULL + ON DUPLICATE KEY UPDATE + hasTicketRequest = 1; + + DELETE tl FROM tmp.ticketList tl + JOIN tmp.ticketProblems tp ON tl.ticketFk = tp.ticketFk; + + OPEN vCursor; + + WHILE NOT vDone + DO + FETCH vCursor INTO vWarehouse, vDate; + + CALL cache.visible_refresh(vVisibleCache, FALSE, vWarehouse); + CALL cache.available_refresh(vAvailableCache, FALSE, vWarehouse, vDate); + + -- Inserta tickets con articulos que no tegan disponible + INSERT INTO tmp.ticketProblems(ticketFk, isAvailable) + SELECT tl.ticketFk, 0 + FROM tmp.ticketList tl + JOIN vn.ticket t ON t.id = tl.ticketFk + LEFT JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it on it.id = i.typeFk + LEFT JOIN cache.visible v ON i.id = v.item_id + AND v.calc_id = vVisibleCache + LEFT JOIN cache.available av ON av.item_id = i.id + AND av.calc_id = vAvailableCache + WHERE date(t.shipped) = vDate + AND categoryFk != 6 + AND s.quantity > IFNULL(v.visible, 0) + AND IFNULL(av.available, 0) < 0 + AND s.isPicked = FALSE + AND NOT i.generic + AND vWarehouse = t.warehouseFk + GROUP BY tl.ticketFk + ON DUPLICATE KEY UPDATE + isAvailable = 0; + + + DELETE tl FROM tmp.ticketList tl + JOIN tmp.ticketProblems tp ON tl.ticketFk = tp.ticketFk; + + + INSERT INTO tmp.ticketProblems(ticketFk, isAvailable) + SELECT tl.ticketFk, 0 + FROM tmp.ticketList tl + JOIN vn.ticket t ON t.id = tl.ticketFk + LEFT JOIN vn.sale s ON s.ticketFk = t.id + JOIN vn.item i ON i.id = s.itemFk + JOIN vn.itemType it on it.id = i.typeFk + LEFT JOIN cache.visible v ON i.id = v.item_id AND v.calc_id = vVisibleCache + LEFT JOIN cache.available av ON av.item_id = i.id AND av.calc_id = vAvailableCache + WHERE IFNULL(av.available, 0) >= 0 + AND s.quantity > IFNULL(v.visible, 0) + AND s.isPicked = FALSE + AND s.reserved = FALSE + AND it.categoryFk != 6 + AND date(t.shipped) = vDate + AND NOT i.generic + AND CURDATE() = vDate + AND t.warehouseFk = vWarehouse + GROUP BY tl.ticketFk + ON DUPLICATE KEY UPDATE + isAvailable = 0; + + DELETE tl FROM tmp.ticketList tl + JOIN tmp.ticketProblems tp ON tl.ticketFk = tp.ticketFk; + + END WHILE; + + CLOSE vCursor; + + SELECT * FROM tmp.ticketProblems; + + DROP TEMPORARY TABLE + tmp.clientGetDebt, + tmp.ticketList; +END$$ + +DELIMITER ; diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index f05101d75..259fe5820 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -220,12 +220,12 @@ module.exports = Self => { SELECT f.*, tt.total, - tp.problem + tp.* FROM tmp.filter f LEFT JOIN tmp.ticketProblems tp ON tp.ticketFk = f.id LEFT JOIN tmp.ticketTotal tt ON tt.ticketFk = f.id`); stmt.merge(conn.makeOrderBy(filter.order)); - let ticketsIndex = stmts.push(stmt) - 1; + let ticketsIndex = stmts.push(stmt); stmts.push( `DROP TEMPORARY TABLE diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 700fd9e87..3835ba6b2 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -52,10 +52,28 @@ ui-sref="ticket.card.summary({id: {{::ticket.id}}})"> + vn-tooltip="{{ticket.hasTicketRequest}}" + icon="icon-100"> + + + + + + {{::ticket.id}} From aceecd9c7a5396592a70bf4436bd21b0ff13186a Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 8 Mar 2019 09:41:53 +0100 Subject: [PATCH 21/45] Tarea #1197 worker.centralita --- modules/worker/front/card/index.js | 4 +++- modules/worker/front/index.js | 1 + modules/worker/front/locale/es.yml | 3 ++- modules/worker/front/pbx/index.html | 28 ++++++++++++++++++++++++++++ modules/worker/front/pbx/index.js | 8 ++++++++ modules/worker/front/routes.json | 12 +++++++++++- 6 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 modules/worker/front/pbx/index.html create mode 100644 modules/worker/front/pbx/index.js diff --git a/modules/worker/front/card/index.js b/modules/worker/front/card/index.js index 9b4f6f93f..fe8a57fb9 100644 --- a/modules/worker/front/card/index.js +++ b/modules/worker/front/card/index.js @@ -22,7 +22,9 @@ class Controller { }, { relation: 'sip', - scope: {fields: ['extension']} + scope: { + fields: ['extension', 'secret'] + } }, { relation: 'department', scope: { diff --git a/modules/worker/front/index.js b/modules/worker/front/index.js index 79f374f30..e9aa1424c 100644 --- a/modules/worker/front/index.js +++ b/modules/worker/front/index.js @@ -7,3 +7,4 @@ import './descriptor'; import './descriptor-popover'; import './search-panel'; import './basic-data'; +import './pbx'; diff --git a/modules/worker/front/locale/es.yml b/modules/worker/front/locale/es.yml index 7caf36e0b..674d13ea0 100644 --- a/modules/worker/front/locale/es.yml +++ b/modules/worker/front/locale/es.yml @@ -7,4 +7,5 @@ Department: Departamento User id: Id de usuario Role: Rol Extension: Extensión -Go to client: Ir al cliente \ No newline at end of file +Go to client: Ir al cliente +Private Branch Exchange: Centralita \ No newline at end of file diff --git a/modules/worker/front/pbx/index.html b/modules/worker/front/pbx/index.html new file mode 100644 index 000000000..ed29e4450 --- /dev/null +++ b/modules/worker/front/pbx/index.html @@ -0,0 +1,28 @@ + + + +
+ + + + + + + + + + + + + +
diff --git a/modules/worker/front/pbx/index.js b/modules/worker/front/pbx/index.js new file mode 100644 index 000000000..70dcc9aef --- /dev/null +++ b/modules/worker/front/pbx/index.js @@ -0,0 +1,8 @@ +import ngModule from '../module'; + +ngModule.component('vnWorkerPbx', { + template: require('./index.html'), + bindings: { + worker: '<' + } +}); diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json index cb2823484..7ef1237e0 100644 --- a/modules/worker/front/routes.json +++ b/modules/worker/front/routes.json @@ -4,7 +4,8 @@ "icon" : "icon-worker", "validations" : true, "menu": [ - {"state": "worker.card.basicData", "icon": "settings"} + {"state": "worker.card.basicData", "icon": "settings"}, + {"state": "worker.card.pbx", "icon": ""} ], "routes": [ { @@ -41,6 +42,15 @@ "worker": "$ctrl.worker" }, "acl": ["developer"] + }, { + "url": "/pbx", + "state": "worker.card.pbx", + "component": "vn-worker-pbx", + "description": "Private Branch Exchange", + "params": { + "worker": "$ctrl.worker" + }, + "acl": ["hr"] } ] } \ No newline at end of file From 479ca86196a27dbb825d3eed72952e0291ed6d84 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 8 Mar 2019 11:00:47 +0100 Subject: [PATCH 22/45] e2e repairs --- e2e/paths/client-module/04_edit_pay_method.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/paths/client-module/04_edit_pay_method.spec.js b/e2e/paths/client-module/04_edit_pay_method.spec.js index ef8c514d8..c315371e0 100644 --- a/e2e/paths/client-module/04_edit_pay_method.spec.js +++ b/e2e/paths/client-module/04_edit_pay_method.spec.js @@ -44,7 +44,7 @@ describe('Client Edit pay method path', () => { const newcode = await nightmare .waitToClick(selectors.clientPayMethod.newBankEntityButton) .write(selectors.clientPayMethod.newBankEntityName, 'Gotham City Bank') - .write(selectors.clientPayMethod.newBankEntityCode, 999) + .write(selectors.clientPayMethod.newBankEntityCode, 9999) .write(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT') .waitToClick(selectors.clientPayMethod.acceptBankEntityButton) .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value'); From f6c725d0074dd6e7b96a85ac4c6c09cc6713e36d Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 8 Mar 2019 11:01:10 +0100 Subject: [PATCH 23/45] more e2e repairs --- e2e/helpers/selectors.js | 1 + e2e/paths/item-module/10_item_index.spec.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 9c7f71770..d67aa5722 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -172,6 +172,7 @@ export default { firstPaymentConfirmed: 'vn-client-web-payment vn-tr:nth-child(1) vn-icon[icon="check"][aria-hidden="false"]' }, itemsIndex: { + searchIcon: `vn-item-index vn-searchbar vn-icon[icon="search"]`, goBackToModuleIndexButton: `vn-item-descriptor a[href="#!/item/index"]`, createItemButton: `${components.vnFloatButton}`, searchResult: `vn-item-index a.vn-tr`, diff --git a/e2e/paths/item-module/10_item_index.spec.js b/e2e/paths/item-module/10_item_index.spec.js index 36d8d07d8..9c9dc1dce 100644 --- a/e2e/paths/item-module/10_item_index.spec.js +++ b/e2e/paths/item-module/10_item_index.spec.js @@ -6,7 +6,8 @@ describe('Item index path', () => { beforeAll(() => { nightmare - .loginAndModule('salesPerson', 'item'); + .loginAndModule('salesPerson', 'item') + .waitToClick(selectors.itemsIndex.searchIcon); }); it('should click on the fields to show button to open the list of columns to show', async() => { @@ -40,6 +41,7 @@ describe('Item index path', () => { const imageVisible = await nightmare .waitToClick(selectors.itemsIndex.searchResult) .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) + .waitToClick(selectors.itemsIndex.searchIcon) .wait(selectors.itemsIndex.searchResult) .isVisible(selectors.itemsIndex.firstItemImage); @@ -77,7 +79,8 @@ describe('Item index path', () => { const idVisible = await nightmare .waitToClick(selectors.itemsIndex.searchResult) .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) - .wait(1999) + .waitToClick(selectors.itemsIndex.searchIcon) + .wait(selectors.itemsIndex.searchResult) .isVisible(selectors.itemsIndex.firstItemId); expect(idVisible).toBeTruthy(); From 99ef9d71fe3fbc8d0f2400b8eb0f6d7333e12b3d Mon Sep 17 00:00:00 2001 From: Bernat Date: Fri, 8 Mar 2019 13:45:38 +0100 Subject: [PATCH 24/45] new acl --- db/install/changes/0-ACL.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 db/install/changes/0-ACL.sql diff --git a/db/install/changes/0-ACL.sql b/db/install/changes/0-ACL.sql new file mode 100644 index 000000000..099e3c5a9 --- /dev/null +++ b/db/install/changes/0-ACL.sql @@ -0,0 +1,2 @@ +INSERT INTO `salix`.`ACL` (`id`,`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (149, 'Sip', '*', 'WRITE', 'ALLOW', 'ROLE', 'hr'); +INSERT INTO `salix`.`ACL` (`id`,`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (150, 'Sip', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); \ No newline at end of file From f47a44813108950f6c23be3cc5194e69d0613a3a Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Mar 2019 14:12:16 +0100 Subject: [PATCH 25/45] e2e fixes --- e2e/helpers/selectors.js | 2 +- e2e/paths/item-module/10_item_index.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d67aa5722..e2312c3ea 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -197,7 +197,7 @@ export default { buyerCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(10) > vn-check > md-checkbox', destinyCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(11) > vn-check > md-checkbox', taxClassCheckbox: 'vn-item-index vn-dialog form vn-horizontal:nth-child(12) > vn-check > md-checkbox', - saveFieldsButton: 'vn-item-index vn-dialog vn-horizontal:nth-child(17) > vn-button > button' + saveFieldsButton: 'vn-item-index vn-dialog vn-horizontal:nth-child(16) > vn-button > button' }, itemCreateView: { temporalName: `${components.vnTextfield}[name="provisionalName"]`, diff --git a/e2e/paths/item-module/10_item_index.spec.js b/e2e/paths/item-module/10_item_index.spec.js index 9c9dc1dce..850a9273c 100644 --- a/e2e/paths/item-module/10_item_index.spec.js +++ b/e2e/paths/item-module/10_item_index.spec.js @@ -30,7 +30,7 @@ describe('Item index path', () => { .waitToClick(selectors.itemsIndex.originCheckbox) .waitToClick(selectors.itemsIndex.buyerCheckbox) .waitToClick(selectors.itemsIndex.destinyCheckbox) - .waitToClick(selectors.itemsIndex.taxClassCheckbox) + // .waitToClick(selectors.itemsIndex.taxClassCheckbox) .waitToClick(selectors.itemsIndex.saveFieldsButton) .waitForLastSnackbar(); @@ -68,7 +68,7 @@ describe('Item index path', () => { .waitToClick(selectors.itemsIndex.originCheckbox) .waitToClick(selectors.itemsIndex.buyerCheckbox) .waitToClick(selectors.itemsIndex.destinyCheckbox) - .waitToClick(selectors.itemsIndex.taxClassCheckbox) + // .waitToClick(selectors.itemsIndex.taxClassCheckbox) .waitToClick(selectors.itemsIndex.saveFieldsButton) .waitForLastSnackbar(); From 78103137bbae1e46151962f717445d019ea70743 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Fri, 8 Mar 2019 14:46:01 +0100 Subject: [PATCH 26/45] Test #1221 e2e worker.pbx --- e2e/helpers/selectors.js | 5 ++++ e2e/paths/worker-module/01_pbx.spec.js | 35 ++++++++++++++++++++++++++ modules/worker/front/index/index.html | 5 ++-- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 e2e/paths/worker-module/01_pbx.spec.js diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index d67aa5722..a89298790 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -533,4 +533,9 @@ export default { confirmOrder: 'vn-order-line > vn-vertical > vn-button-bar > vn-button > button', confirmButton: 'vn-order-line > vn-confirm button[response="ACCEPT"]', }, + workerPbx: { + extensionInput: 'vn-worker-pbx vn-textfield[model="$ctrl.worker.sip.extension"] input', + passwordInput: 'vn-worker-pbx vn-textfield[model="$ctrl.worker.sip.secret"] input', + saveButton: 'vn-worker-pbx vn-submit[label="Save"] input' + } }; diff --git a/e2e/paths/worker-module/01_pbx.spec.js b/e2e/paths/worker-module/01_pbx.spec.js new file mode 100644 index 000000000..e7e97f9b1 --- /dev/null +++ b/e2e/paths/worker-module/01_pbx.spec.js @@ -0,0 +1,35 @@ +import selectors from '../../helpers/selectors.js'; +import createNightmare from '../../helpers/nightmare'; + +describe('pbx path', () => { + const nightmare = createNightmare(); + + beforeAll(() => { + nightmare + .loginAndModule('hr', 'worker') + .accessToSearchResult('employee') + .accessToSection('worker.card.pbx'); + }); + + it('should receive an error when the extension exceeds 4 characters', async() => { + const result = await nightmare + .write(selectors.workerPbx.extensionInput, 55555) + + .waitToClick(selectors.workerPbx.saveButton) + .waitForLastSnackbar(); + + expect(result).toEqual('EXTENSION_INVALID_FORMAT'); + }); + + it('should sucessfully save the changes', async() => { + const result = await nightmare + .clearInput(selectors.workerPbx.extensionInput) + .write(selectors.workerPbx.extensionInput, 4444) + .clearInput(selectors.workerPbx.passwordInput) + .write(selectors.workerPbx.passwordInput, 666666) + .waitToClick(selectors.workerPbx.saveButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); +}); diff --git a/modules/worker/front/index/index.html b/modules/worker/front/index/index.html index 7debfc728..0da3d89c9 100644 --- a/modules/worker/front/index/index.html +++ b/modules/worker/front/index/index.html @@ -16,10 +16,11 @@ - + class="vn-list-item searchResult">
{{::worker.user.nickname}}
From 2269565dc2fd82811bcfe65a1e5c20c436b9c9d8 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Sun, 10 Mar 2019 13:14:13 +0100 Subject: [PATCH 27/45] #1124 E2E item descriptor icono no activo --- e2e/helpers/selectors.js | 4 +- e2e/paths/item-module/11_inactive.spec.js | 48 +++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 e2e/paths/item-module/11_inactive.spec.js diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 901c7f57f..330d2f0b0 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -213,7 +213,9 @@ export default { regularizeQuantityInput: `vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input`, regularizeWarehouseAutocomplete: 'vn-item-descriptor vn-dialog vn-autocomplete[field="$ctrl.warehouseFk"]', editButton: 'vn-item-card vn-item-descriptor vn-float-button[icon="edit"]', - regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button` + regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button`, + inactiveIcon: 'vn-item-descriptor vn-icon[icon="icon-unavailable"]', + navigateBackToIndex: 'vn-item-descriptor vn-icon[icon="chevron_left"]' }, itemBasicData: { basicDataButton: `vn-left-menu a[ui-sref="item.card.data"]`, diff --git a/e2e/paths/item-module/11_inactive.spec.js b/e2e/paths/item-module/11_inactive.spec.js new file mode 100644 index 000000000..cdc9d7e65 --- /dev/null +++ b/e2e/paths/item-module/11_inactive.spec.js @@ -0,0 +1,48 @@ +import selectors from '../../helpers/selectors.js'; +import createNightmare from '../../helpers/nightmare'; + +describe('Item regularize path', () => { + const nightmare = createNightmare(); + beforeAll(() => { + nightmare + .loginAndModule('developer', 'item') + .accessToSearchResult(1) + .accessToSection('item.card.data'); + }); + + it('should check the descriptor inactive icon is dark as the item is active', async() => { + let darkIcon = await nightmare + .wait(selectors.itemDescriptor.inactiveIcon) + .waitForClassNotPresent(selectors.itemDescriptor.inactiveIcon, 'bright') + .isVisible(selectors.itemDescriptor.inactiveIcon); + + expect(darkIcon).toBeTruthy(); + }); + + it('should set the item to inactive', async() => { + let result = await nightmare + .waitToClick(selectors.itemBasicData.isActiveCheckbox) + .waitToClick(selectors.itemBasicData.submitBasicDataButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); + + it('should reload the section and check the inactive icon is bright', async() => { + let brightIcon = await nightmare + .reloadSection('item.card.data') + .waitForClassPresent(selectors.itemDescriptor.inactiveIcon, 'bright') + .isVisible(selectors.itemDescriptor.inactiveIcon); + + expect(brightIcon).toBeTruthy(); + }); + + it('should set the item back to active', async() => { + let result = await nightmare + .waitToClick(selectors.itemBasicData.isActiveCheckbox) + .waitToClick(selectors.itemBasicData.submitBasicDataButton) + .waitForLastSnackbar(); + + expect(result).toEqual('Data saved!'); + }); +}); From 41a34421dfc1ee3b2537188a492cd27042c2570b Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 11 Mar 2019 11:29:31 +0100 Subject: [PATCH 28/45] ship menu now open the stowaways in new tabs --- modules/ticket/front/descriptor/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index a236b0d5a..fdee19bec 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -57,7 +57,8 @@ class Controller { } goToTicket(ticketID) { - this.$state.go('ticket.card.sale', {id: ticketID}); + let url = this.$state.href('ticket.card.sale', {id: ticketID}, {absolute: true}); + window.open(url, '_blank'); } onMoreOpen() { From fb75ff0eae177029b181b4982318955381f5be4a Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 12 Mar 2019 11:47:53 +0100 Subject: [PATCH 29/45] =?UTF-8?q?#1222=20Activar=20log=20en=20el=20modulo?= =?UTF-8?q?=20=C3=ADtem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/install/changes/13-itemLog.sql | 4 ++ .../item/back/methods/item/specs/new.spec.js | 7 ++- modules/item/back/methods/item/updateTaxes.js | 2 +- modules/item/back/models/item-barcode.json | 7 ++- modules/item/back/models/item-botanical.json | 7 ++- modules/item/back/models/item-log.json | 54 +++++++++++-------- modules/item/back/models/item-niche.json | 7 ++- modules/item/back/models/item-tag.json | 7 ++- modules/item/back/models/item.json | 5 +- modules/item/front/history/index.html | 33 ------------ modules/item/front/history/index.js | 25 --------- modules/item/front/index.js | 2 +- modules/item/front/log/index.html | 9 ++++ modules/item/front/log/index.js | 53 ++++++++++++++++++ modules/item/front/routes.json | 8 ++- 15 files changed, 141 insertions(+), 89 deletions(-) create mode 100644 db/install/changes/13-itemLog.sql delete mode 100644 modules/item/front/history/index.html delete mode 100644 modules/item/front/history/index.js create mode 100644 modules/item/front/log/index.html create mode 100644 modules/item/front/log/index.js diff --git a/db/install/changes/13-itemLog.sql b/db/install/changes/13-itemLog.sql new file mode 100644 index 000000000..43a1fcca2 --- /dev/null +++ b/db/install/changes/13-itemLog.sql @@ -0,0 +1,4 @@ +USE `vn`; + +ALTER TABLE vn.itemLog MODIFY COLUMN userFk int(10) unsigned NULL; +ALTER TABLE vn.itemLog MODIFY COLUMN id int(11) NOT NULL AUTO_INCREMENT; \ No newline at end of file diff --git a/modules/item/back/methods/item/specs/new.spec.js b/modules/item/back/methods/item/specs/new.spec.js index 793120514..007178c97 100644 --- a/modules/item/back/methods/item/specs/new.spec.js +++ b/modules/item/back/methods/item/specs/new.spec.js @@ -4,7 +4,12 @@ describe('item new()', () => { let item; afterAll(async done => { - await app.models.Item.destroyById(item.id); + let sql = 'DELETE FROM vn.itemLog WHERE originFk = ?'; + await app.models.Item.rawSql(sql, [item.id]); + + sql = 'DELETE FROM vn.item WHERE id = ?'; + await app.models.Item.rawSql(sql, [item.id]); + done(); }); diff --git a/modules/item/back/methods/item/updateTaxes.js b/modules/item/back/methods/item/updateTaxes.js index bbf4dc0f1..9b7ffd372 100644 --- a/modules/item/back/methods/item/updateTaxes.js +++ b/modules/item/back/methods/item/updateTaxes.js @@ -27,7 +27,7 @@ module.exports = Self => { if (!tax.taxClassFk) throw new UserError('Tax class cannot be blank'); - promises.push(Self.app.models.ItemTaxCountry.updateAll( + promises.push(Self.app.models.ItemTaxCountry.update( {id: tax.id}, {taxClassFk: tax.taxClassFk} )); diff --git a/modules/item/back/models/item-barcode.json b/modules/item/back/models/item-barcode.json index 324f23a6c..c2fa166e1 100644 --- a/modules/item/back/models/item-barcode.json +++ b/modules/item/back/models/item-barcode.json @@ -1,6 +1,11 @@ { "name": "ItemBarcode", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "ItemLog", + "relation": "item", + "changedModelValue": "code" + }, "options": { "mysql": { "table": "itemBarcode" diff --git a/modules/item/back/models/item-botanical.json b/modules/item/back/models/item-botanical.json index 655f0d48c..2a1234e36 100644 --- a/modules/item/back/models/item-botanical.json +++ b/modules/item/back/models/item-botanical.json @@ -1,6 +1,11 @@ { "name": "ItemBotanical", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "ItemLog", + "relation": "item", + "changedModelValue": "botanical" + }, "options": { "mysql": { "table": "itemBotanical" diff --git a/modules/item/back/models/item-log.json b/modules/item/back/models/item-log.json index 76fcc4104..b8e6f79a6 100644 --- a/modules/item/back/models/item-log.json +++ b/modules/item/back/models/item-log.json @@ -2,44 +2,54 @@ "name": "ItemLog", "base": "VnModel", "options": { - "mysql": { - "table": "itemLog" - } + "mysql": { + "table": "itemLog" + } }, "properties": { "id": { - "type": "Number", "id": true, - "description": "Identifier" + "type": "Number", + "forceId": false + }, + "originFk": { + "type": "Number", + "required": true + }, + "userFk": { + "type": "Number" + }, + "action": { + "type": "String", + "required": true + }, + "changedModel": { + "type": "String" + }, + "oldInstance": { + "type": "Object" + }, + "newInstance": { + "type": "Object" }, "creationDate": { "type": "Date" }, - "description": { + "changedModelId": { + "type": "Number" + }, + "changedModelValue": { "type": "String" }, - "action": { + "description": { "type": "String" } }, "relations": { - "item": { - "type": "belongsTo", - "model": "Item", - "foreignKey": "originFk" - }, "user": { "type": "belongsTo", "model": "Account", "foreignKey": "userFk" - } - }, - "acls": [ - { - "accessType": "READ", - "principalType": "ROLE", - "principalId": "$everyone", - "permission": "ALLOW" - } - ] + } + } } diff --git a/modules/item/back/models/item-niche.json b/modules/item/back/models/item-niche.json index 74fae2faa..aadcab28e 100644 --- a/modules/item/back/models/item-niche.json +++ b/modules/item/back/models/item-niche.json @@ -1,6 +1,11 @@ { "name": "ItemNiche", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "ItemLog", + "relation": "item", + "changedModelValue": "code" + }, "options": { "mysql": { "table": "itemPlacement" diff --git a/modules/item/back/models/item-tag.json b/modules/item/back/models/item-tag.json index 2dae3b174..d68e1a299 100644 --- a/modules/item/back/models/item-tag.json +++ b/modules/item/back/models/item-tag.json @@ -1,6 +1,11 @@ { "name": "ItemTag", - "base": "VnModel", + "base": "Loggable", + "log": { + "model": "ItemLog", + "relation": "item", + "changedModelValue": "value" + }, "options": { "mysql": { "table": "itemTag" diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 1ca2619e7..4496633e8 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -1,6 +1,9 @@ { "name": "Item", - "base": "VnModel", + "base": "Loggable", + "log": { + "model":"ItemLog" + }, "options": { "mysql": { "table": "item" diff --git a/modules/item/front/history/index.html b/modules/item/front/history/index.html deleted file mode 100644 index 83585f2b7..000000000 --- a/modules/item/front/history/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - Description - Action - Changed by - Date - - - - - {{::itemLog.description}} - {{::itemLog.action}} - {{::itemLog.user.name}} - {{::itemLog.creationDate | dateTime:'dd/MM/yyyy HH:mm'}} - - - - - - - diff --git a/modules/item/front/history/index.js b/modules/item/front/history/index.js deleted file mode 100644 index 910a4f488..000000000 --- a/modules/item/front/history/index.js +++ /dev/null @@ -1,25 +0,0 @@ -import ngModule from '../module'; - -class Controller { - constructor($stateParams) { - this.$stateParams = $stateParams; - this.filter = { - include: [{ - relation: "item" - }, - { - relation: "user", - scope: { - fields: ["name"] - } - }] - }; - } -} - -Controller.$inject = ['$stateParams']; - -ngModule.component('vnItemHistory', { - template: require('./index.html'), - controller: Controller -}); diff --git a/modules/item/front/index.js b/modules/item/front/index.js index aacaffe85..d6b3e5703 100644 --- a/modules/item/front/index.js +++ b/modules/item/front/index.js @@ -11,7 +11,7 @@ import './data'; import './fetched-tags'; import './tags'; import './tax'; -// import './history'; +import './log'; import './last-entries'; import './niche'; import './botanical'; diff --git a/modules/item/front/log/index.html b/modules/item/front/log/index.html new file mode 100644 index 000000000..3734ba056 --- /dev/null +++ b/modules/item/front/log/index.html @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/modules/item/front/log/index.js b/modules/item/front/log/index.js new file mode 100644 index 000000000..edb540760 --- /dev/null +++ b/modules/item/front/log/index.js @@ -0,0 +1,53 @@ +import ngModule from '../module'; + +class Controller { + constructor($scope, $stateParams) { + this.$scope = $scope; + this.$stateParams = $stateParams; + this.filter = { + include: [{ + relation: 'user', + scope: { + fields: ['name'], + }, + }], + }; + } + + get logs() { + return this._logs; + } + + set logs(value) { + this._logs = value; + + if (this.logs) { + this.logs.forEach(log => { + log.oldProperties = this.getInstance(log.oldInstance); + log.newProperties = this.getInstance(log.newInstance); + }); + } + } + + getInstance(instance) { + let validDate = /^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?(Z)?$/; + const properties = []; + if (typeof instance == 'object' && instance != null) { + Object.keys(instance).forEach(property => { + if (validDate.test(instance[property])) + instance[property] = new Date(instance[property]).toLocaleString('es-ES'); + + properties.push({key: property, value: instance[property]}); + }); + return properties; + } + return null; + } +} + +Controller.$inject = ['$scope', '$stateParams']; + +ngModule.component('vnItemLog', { + template: require('./index.html'), + controller: Controller, +}); diff --git a/modules/item/front/routes.json b/modules/item/front/routes.json index 485bd2760..ec90aa2ba 100644 --- a/modules/item/front/routes.json +++ b/modules/item/front/routes.json @@ -12,7 +12,8 @@ {"state": "item.card.botanical", "icon": "local_florist"}, {"state": "item.card.itemBarcode", "icon": "icon-barcode"}, {"state": "item.card.diary", "icon": "icon-transaction"}, - {"state": "item.card.last-entries", "icon": "icon-regentry"} + {"state": "item.card.last-entries", "icon": "icon-regentry"}, + {"state": "item.card.log", "icon": "history"} ], "keybindings": [ {"key": "a", "state": "item.index"} @@ -116,6 +117,11 @@ "item": "$ctrl.item" }, "acl": ["employee"] + }, { + "url" : "/log", + "state": "item.card.log", + "component": "vn-item-log", + "description": "Log" } ] } \ No newline at end of file From 55fd1c233e8d3f334d9def48ead407c314dc2a8b Mon Sep 17 00:00:00 2001 From: Bernat Date: Tue, 12 Mar 2019 12:20:14 +0100 Subject: [PATCH 30/45] import-changes --- db/.gitignore | 3 +- db/{connect.tpl.ini => config.ini} | 2 +- db/import-changes.js | 66 ------------------------------ db/import-changes.sh | 42 +++++++++++++++++++ db/import-fixtures.js | 19 --------- db/install/boot.sh | 2 - db/install/dump/truncateAll.sql | 37 ----------------- 7 files changed, 45 insertions(+), 126 deletions(-) rename db/{connect.tpl.ini => config.ini} (100%) delete mode 100644 db/import-changes.js create mode 100755 db/import-changes.sh delete mode 100644 db/import-fixtures.js delete mode 100644 db/install/dump/truncateAll.sql diff --git a/db/.gitignore b/db/.gitignore index f26f7a0a6..162fe6938 100644 --- a/db/.gitignore +++ b/db/.gitignore @@ -1 +1,2 @@ -connect.ini +config.production.ini +config.test.ini \ No newline at end of file diff --git a/db/connect.tpl.ini b/db/config.ini similarity index 100% rename from db/connect.tpl.ini rename to db/config.ini index 2db13e969..cf1f36d7c 100644 --- a/db/connect.tpl.ini +++ b/db/config.ini @@ -1,7 +1,7 @@ [client] -enable_cleartext_plugin = ON host = localhost port = 3306 user = root password = password ssl-mode = DISABLED +enable_cleartext_plugin = ON diff --git a/db/import-changes.js b/db/import-changes.js deleted file mode 100644 index b72efaa3c..000000000 --- a/db/import-changes.js +++ /dev/null @@ -1,66 +0,0 @@ -const mysql = require('mysql2/promise'); -const fs = require('fs-extra'); - -(async () => { - try { - const connection = await mysql.createConnection({ - host: 'localhost', - user: 'root', - multipleStatements: true - }); - let changesDir = './install/changes'; - let results = await connection.query("SELECT dbVersion FROM util.config"); - if (results[0].length != 1) - throw new Error('There must be exactly one row in the configuration table'); - let version = results[0][0].dbVersion; - if (!version) - throw new Error('Database version not defined'); - let dirs = await fs.readdir(changesDir); - dirs.sort(compareVersions); - let lastVersion; - - for (let dir of dirs) { - if (compareVersions(dir, version) <= 0) continue; - if (/^\./.test(dir)) continue; - let path = `${changesDir}/${dir}`; - let files = await fs.readdir(path); - files.sort(); - console.log(dir); - for (let file of files) { - let sql = await fs.readFile(`${path}/${file}`, 'utf8'); - if (/^\s*$/.test(sql)) continue; - await connection.query(sql); - console.log(` - ${file}`); - } - lastVersion = dir; - } - if (lastVersion) { - await connection.query("UPDATE util.config SET dbVersion = ?", [lastVersion]); - console.log(`Database upgraded successfully to version ${lastVersion}`); - } else { - console.log("Database is alredy in the last version"); - } - await connection.end(); - process.exit(); - } catch (err) { - console.error(err); - process.exit(1); - } -})(); - -function compareVersions(ver1, ver2) { - let diff; - ver1 = ver1.split('.'); - ver2 = ver2.split('.'); - - diff = parseInt(ver1[0]) - parseInt(ver2[0]); - if (diff !== 0) return diff; - - diff = parseInt(ver1[1]) - parseInt(ver2[1]); - if (diff !== 0) return diff; - - diff = parseInt(ver1[2]) - parseInt(ver2[2]); - if (diff !== 0) return diff; - - return 0; -} diff --git a/db/import-changes.sh b/db/import-changes.sh new file mode 100755 index 000000000..d9042cf3c --- /dev/null +++ b/db/import-changes.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +ENV=$1 + +if [ "$ENV" == "production" ]; then + echo "" + echo " ( ( ) ( ( ) ) " + echo " )\ ))\ ) ( /( )\ ) ( * ))\ ) ( /( ( /( " + echo "(()/(()/( )\()|()/( ( )\ ) /(()/( )\()) )\())" + echo " /(_))(_)|(_)\ /(_)) )\ (((_) ( )(_))(_)|(_)\ ((_)\ " + echo "(_))(_)) ((_|_))_ _ ((_))\___(_(_()|_)) ((_) _((_)" + echo "| _ \ _ \ / _ \| \| | | ((/ __|_ _|_ _| / _ \| \| |" + echo "| _/ /| (_) | |) | |_| || (__ | | | | | (_) | . |" + echo "|_| |_|_\ \___/|___/ \___/ \___| |_| |___| \___/|_|\_|" + echo "" + + read -p "Are you sure? (Default: no) [yes|no]: " ANSWER + + if [ "$ANSWER" != "yes" ]; then + echo "Aborting" + exit; + fi +fi +if [ -z "$ENV" ]; then + ENV="test" +fi + +INI_FILE="config.$ENV.ini" + +if [ ! -f "$INI_FILE" ]; then + echo "File $INI_FILE doesn't exists" + exit 1 +fi + +echo "[INFO] Config file: $INI_FILE" +echo "[INFO] Importing changes." + +# Import changes +for file in install/changes/*.sql; do + echo "[INFO] -> Applying $file" + mysql --defaults-file="$INI_FILE" < $file +done diff --git a/db/import-fixtures.js b/db/import-fixtures.js deleted file mode 100644 index 8cd38a750..000000000 --- a/db/import-fixtures.js +++ /dev/null @@ -1,19 +0,0 @@ -const mysql = require('mysql2/promise'); -const fs = require('fs-extra'); - -(async () => { - try { - const connection = await mysql.createConnection({ - host: 'localhost', - user: 'root', - multipleStatements: true - }); - sql = await fs.readFile(`install/dump/fixtures.sql`, 'utf8'); - await connection.query(sql); - await connection.end(); - process.exit(); - } catch (err) { - console.error(err); - process.exit(1); - } -})(); diff --git a/db/install/boot.sh b/db/install/boot.sh index 02727e089..ebfdae87f 100755 --- a/db/install/boot.sh +++ b/db/install/boot.sh @@ -2,8 +2,6 @@ export MYSQL_PWD=root # Dump structure -echo "[INFO] -> Imported ./dump/truncateAll.sql" - mysql -u root -f < ./dump/truncateAll.sql echo "[INFO] -> Imported ./dump/structure.sql" mysql -u root -f < ./dump/structure.sql echo "[INFO] -> Imported ./dump/mysqlPlugins.sql" diff --git a/db/install/dump/truncateAll.sql b/db/install/dump/truncateAll.sql deleted file mode 100644 index 9135f7860..000000000 --- a/db/install/dump/truncateAll.sql +++ /dev/null @@ -1,37 +0,0 @@ -DROP PROCEDURE IF EXISTS mysql.truncateAll; -DELIMITER $$ -CREATE PROCEDURE mysql.truncateAll() -BEGIN - DECLARE vSchema VARCHAR(255); - DECLARE vTable VARCHAR(255); - DECLARE vDone BOOL; - - DECLARE cTables CURSOR FOR - SELECT `TABLE_SCHEMA`, `TABLE_NAME` - FROM `information_schema`.`TABLES` - WHERE `TABLE_TYPE` = 'BASE TABLE' - AND `TABLE_SCHEMA` NOT IN ('information_schema', 'mysql', 'performance_schema'); - - DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; - - SET FOREIGN_KEY_CHECKS = FALSE; - OPEN cTables; - - l: LOOP - SET vDone = FALSE; - FETCH cTables INTO vSchema, vTable; - - IF vDone THEN - LEAVE l; - END IF; - - SET @stmt = CONCAT('TRUNCATE TABLE `', vSchema, '`.`', vTable, '`'); - PREPARE stmt FROM @stmt; - EXECUTE stmt; - DEALLOCATE PREPARE stmt; - END LOOP; - - CLOSE cTables; - SET FOREIGN_KEY_CHECKS = TRUE; -END$$ -DELIMITER ; \ No newline at end of file From b8ea54dfc4dc8359f1a258c5b9dafec98fafb4ce Mon Sep 17 00:00:00 2001 From: Bernat Date: Tue, 12 Mar 2019 13:48:25 +0100 Subject: [PATCH 31/45] update structure db --- db/install/changes/13-itemLog.sql | 4 ---- db/install/changes/14-basketGetTax.sql | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) delete mode 100644 db/install/changes/13-itemLog.sql create mode 100644 db/install/changes/14-basketGetTax.sql diff --git a/db/install/changes/13-itemLog.sql b/db/install/changes/13-itemLog.sql deleted file mode 100644 index 43a1fcca2..000000000 --- a/db/install/changes/13-itemLog.sql +++ /dev/null @@ -1,4 +0,0 @@ -USE `vn`; - -ALTER TABLE vn.itemLog MODIFY COLUMN userFk int(10) unsigned NULL; -ALTER TABLE vn.itemLog MODIFY COLUMN id int(11) NOT NULL AUTO_INCREMENT; \ No newline at end of file diff --git a/db/install/changes/14-basketGetTax.sql b/db/install/changes/14-basketGetTax.sql new file mode 100644 index 000000000..f74623275 --- /dev/null +++ b/db/install/changes/14-basketGetTax.sql @@ -0,0 +1,21 @@ +DROP procedure IF EXISTS `hedera`.`basketGetTax`; +DELIMITER $$ +CREATE DEFINER=`root`@`%` PROCEDURE `hedera`.`basketGetTax`() + READS SQL DATA +BEGIN +/** + * Returns the taxes for the current client basket. + * + * @treturn tmp.orderTax + */ + DROP TEMPORARY TABLE IF EXISTS tmp.order; + CREATE TEMPORARY TABLE tmp.order + ENGINE = MEMORY + SELECT myBasketGetId() orderFk; + + CALL orderGetTax(); + + DROP TEMPORARY TABLE IF EXISTS tmp.order; +END$$ + +DELIMITER ; From 92170c34d506a8d9e2b236eafacd225783c11080 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Tue, 12 Mar 2019 15:04:09 +0100 Subject: [PATCH 32/45] worker department #1133 --- db/install/changes/0-ACL.sql | 4 +- db/install/changes/12-department.sql | 21 +++++ db/install/changes/13-nodeAdd.sql | 83 ++++++++++++++++++ db/install/changes/14-nodeRecalc.sql | 28 ++++++ db/install/changes/15-zoneGeo.sql | 4 + front/core/components/treeview/child.html | 51 ++++++++--- front/core/components/treeview/child.js | 23 ++++- front/core/components/treeview/index.html | 10 ++- front/core/components/treeview/index.js | 24 +++-- front/core/components/treeview/style.scss | 6 +- front/core/directives/acl.js | 10 ++- front/core/locale/es.yml | 4 +- loopback/common/models/vn-model.js | 63 ++++++-------- loopback/locale/en.json | 3 +- loopback/locale/es.json | 3 +- .../agency/back/methods/zone-geo/getLeaves.js | 20 +++-- modules/agency/front/location/index.html | 2 +- .../back/methods/department/getLeaves.js | 87 +++++++++++++++++++ .../worker/back/methods/department/nodeAdd.js | 43 +++++++++ .../back/methods/department/nodeDelete.js | 29 +++++++ modules/worker/back/models/department.js | 19 ++++ modules/worker/front/department/index.html | 45 ++++++++++ modules/worker/front/department/index.js | 78 +++++++++++++++++ modules/worker/front/department/locale/es.yml | 3 + modules/worker/front/index.js | 1 + modules/worker/front/index/index.html | 22 +++-- modules/worker/front/index/index.js | 13 ++- modules/worker/front/index/style.scss | 11 +++ modules/worker/front/locale/es.yml | 1 + modules/worker/front/routes.json | 9 +- 30 files changed, 639 insertions(+), 81 deletions(-) create mode 100644 db/install/changes/12-department.sql create mode 100644 db/install/changes/13-nodeAdd.sql create mode 100644 db/install/changes/14-nodeRecalc.sql create mode 100644 db/install/changes/15-zoneGeo.sql create mode 100644 modules/worker/back/methods/department/getLeaves.js create mode 100644 modules/worker/back/methods/department/nodeAdd.js create mode 100644 modules/worker/back/methods/department/nodeDelete.js create mode 100644 modules/worker/back/models/department.js create mode 100644 modules/worker/front/department/index.html create mode 100644 modules/worker/front/department/index.js create mode 100644 modules/worker/front/department/locale/es.yml create mode 100644 modules/worker/front/index/style.scss diff --git a/db/install/changes/0-ACL.sql b/db/install/changes/0-ACL.sql index 099e3c5a9..a2f3991f1 100644 --- a/db/install/changes/0-ACL.sql +++ b/db/install/changes/0-ACL.sql @@ -1,2 +1,4 @@ INSERT INTO `salix`.`ACL` (`id`,`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (149, 'Sip', '*', 'WRITE', 'ALLOW', 'ROLE', 'hr'); -INSERT INTO `salix`.`ACL` (`id`,`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (150, 'Sip', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); \ No newline at end of file +INSERT INTO `salix`.`ACL` (`id`,`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (150, 'Sip', '*', 'READ', 'ALLOW', 'ROLE', 'employee'); +INSERT INTO `salix`.`ACL` (`id`,`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (151, 'Department','*','READ','ALLOW','ROLE','employee'); +INSERT INTO `salix`.`ACL` (`id`,`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (152, 'Department','*','WRITE','ALLOW','ROLE','hr'); diff --git a/db/install/changes/12-department.sql b/db/install/changes/12-department.sql new file mode 100644 index 000000000..38c68a45c --- /dev/null +++ b/db/install/changes/12-department.sql @@ -0,0 +1,21 @@ +USE `vn2008`; + +ALTER TABLE vn2008.department ADD `depth` int DEFAULT 0 NOT NULL; +ALTER TABLE vn2008.department ADD sons int DEFAULT 0 NOT NULL; + +USE `vn`; + +CREATE +OR REPLACE +VIEW `vn`.`department` AS select + `b`.`department_id` AS `id`, + `b`.`name` AS `name`, + `b`.`father_id` AS `fatherFk`, + `b`.`production` AS `isProduction`, + `b`.`lft` AS `lft`, + `b`.`rgt` AS `rgt`, + `b`.`isSelected` AS `isSelected`, + `b`.`depth` AS `depth`, + `b`.`sons` AS `sons` +from + `vn2008`.`department` `b`; \ No newline at end of file diff --git a/db/install/changes/13-nodeAdd.sql b/db/install/changes/13-nodeAdd.sql new file mode 100644 index 000000000..b3c537548 --- /dev/null +++ b/db/install/changes/13-nodeAdd.sql @@ -0,0 +1,83 @@ +DROP PROCEDURE IF EXISTS nst.NodeAdd; + +DELIMITER $$ +$$ +CREATE DEFINER=`root`@`%` PROCEDURE `nst`.`nodeAdd`(IN `vScheme` VARCHAR(45), IN `vTable` VARCHAR(45), IN `vParentFk` INT, IN `vChild` VARCHAR(100)) +BEGIN + DECLARE vSql TEXT; + DECLARE vTableClone VARCHAR(45); + + SET vTableClone = CONCAT(vTable, 'Clone'); + + CALL util.exec(CONCAT('DROP TEMPORARY TABLE IF EXISTS tmp.', vTableClone)); + CALL util.exec(CONCAT( + 'CREATE TEMPORARY TABLE tmp.', vTableClone, + ' ENGINE = MEMORY' + ' SELECT * FROM ', vScheme, '.', vTable + )); + + -- Check parent childs + SET vSql = sql_printf(' + SELECT COUNT(c.id) INTO @childs + FROM %t.%t p + LEFT JOIN %t.%t c ON c.lft BETWEEN p.lft AND p.rgt AND c.id != %v + WHERE p.id = %v', + vScheme, vTable, 'tmp', vTableClone, vParentFk, vParentFk); + SET @qrySql := vSql; + + PREPARE stmt FROM @qrySql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + + -- Select left from last child + IF @childs = 0 THEN + SET vSql = sql_printf('SELECT lft INTO @vLeft FROM %t.%t WHERE id = %v', vScheme, vTable, vParentFk); + SET @qrySql := vSql; + ELSE + SET vSql = sql_printf(' + SELECT c.rgt INTO @vLeft + FROM %t.%t p + JOIN %t.%t c ON c.lft BETWEEN p.lft AND p.rgt + WHERE p.id = %v + ORDER BY c.lft + DESC LIMIT 1', + vScheme, vTable, 'tmp', vTableClone, vParentFk); + SET @qrySql := vSql; + END IF; + + PREPARE stmt FROM @qrySql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + + -- Update right + SET vSql = sql_printf('UPDATE %t.%t SET rgt = rgt + 2 WHERE rgt > %v ORDER BY rgt DESC', vScheme, vTable, @vLeft); + SET @qrySql := vSql; + + PREPARE stmt FROM @qrySql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + + SET vSql = sql_printf('UPDATE %t.%t SET lft = lft + 2 WHERE lft > %v ORDER BY lft DESC', vScheme, vTable, @vLeft); + SET @qrySql := vSql; + + PREPARE stmt FROM @qrySql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + + -- Escape character + SET vChild = REPLACE(vChild, "'", "\\'"); + + -- Add child + SET vSql = sql_printf('INSERT INTO %t.%t (name, lft, rgt) VALUES (%v, %v, %v)', vScheme, vTable, vChild, @vLeft + 1, @vLeft + 2); + SET @qrySql := vSql; + + PREPARE stmt FROM @qrySql; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + + SELECT id, name, lft, rgt, depth, sons FROM vn.department + WHERE id = LAST_INSERT_ID(); + + CALL util.exec(CONCAT('DROP TEMPORARY TABLE tmp.', vTableClone)); +END$$ +DELIMITER ; diff --git a/db/install/changes/14-nodeRecalc.sql b/db/install/changes/14-nodeRecalc.sql new file mode 100644 index 000000000..a8f4d932c --- /dev/null +++ b/db/install/changes/14-nodeRecalc.sql @@ -0,0 +1,28 @@ +DROP PROCEDURE IF EXISTS nst.nodeRecalc; + +DELIMITER $$ +$$ +CREATE DEFINER=`root`@`%` PROCEDURE `nst`.`nodeRecalc`(IN `vScheme` VARCHAR(45), IN `vTable` VARCHAR(45)) +BEGIN + CALL util.exec (sql_printf ( + 'UPDATE %t.%t d + JOIN (SELECT + node.id, + COUNT(parent.id) - 1 as depth, + cast((node.rgt - node.lft - 1) / 2 as DECIMAL) as sons + FROM + %t.%t AS node, + %t.%t AS parent + WHERE node.lft BETWEEN parent.lft AND parent.rgt + GROUP BY node.id + ORDER BY node.lft) n ON n.id = d.id + SET d.`depth` = n.depth, d.sons = n.sons', + vScheme, + vTable, + vScheme, + vTable, + vScheme, + vTable + )); +END$$ +DELIMITER ; diff --git a/db/install/changes/15-zoneGeo.sql b/db/install/changes/15-zoneGeo.sql new file mode 100644 index 000000000..1037fe089 --- /dev/null +++ b/db/install/changes/15-zoneGeo.sql @@ -0,0 +1,4 @@ +USE `vn`; + +CREATE UNIQUE INDEX zoneGeo_lft_IDX USING BTREE ON vn.zoneGeo (lft); +CREATE UNIQUE INDEX zoneGeo_rgt_IDX USING BTREE ON vn.zoneGeo (rgt); \ No newline at end of file diff --git a/front/core/components/treeview/child.html b/front/core/components/treeview/child.html index 8589790ec..a079d8f40 100644 --- a/front/core/components/treeview/child.html +++ b/front/core/components/treeview/child.html @@ -1,25 +1,54 @@ -