From b6daab114c3628c8874dc5537282debbab0365be Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 09:39:35 +0200 Subject: [PATCH 1/5] test fixed to previous client.balance refactors --- e2e/paths/client-module/14_risk.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js index b6184e4ce..58cfb5b6e 100644 --- a/e2e/paths/client-module/14_risk.spec.js +++ b/e2e/paths/client-module/14_risk.spec.js @@ -118,7 +118,7 @@ describe('Client risk path', () => { let result = await nightmare .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); - expect(result).toContain('-€50.00'); + expect(result).toContain('€50.00'); }); it('should now click on the Clients button of the top bar menu', async() => { From 17f5e46497be140d68d3806a6a9d4a079328eee5 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 09:45:45 +0200 Subject: [PATCH 2/5] #1284 Print - Informe zona --- db/dump/fixtures.sql | 16 ++++----- print/config/routes.json | 1 + print/report/rpt-route/assets/css/index.js | 7 ++++ print/report/rpt-route/assets/css/style.css | 9 ++++++ print/report/rpt-route/index.html | 15 +++++++++ print/report/rpt-route/index.js | 36 +++++++++++++++++++++ print/report/rpt-route/locale.js | 0 7 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 print/report/rpt-route/assets/css/index.js create mode 100644 print/report/rpt-route/assets/css/style.css create mode 100644 print/report/rpt-route/index.html create mode 100755 print/report/rpt-route/index.js create mode 100644 print/report/rpt-route/locale.js diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index a96820c05..4461087f0 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -355,15 +355,15 @@ INSERT INTO `vn`.`creditInsurance`(`id`, `creditClassification`, `credit`, `crea (2, 2 , 6000, DATE_ADD(CURDATE(), INTERVAL -2 MONTH), NULL), (3, 3, 10000 , DATE_ADD(CURDATE(), INTERVAL -3 MONTH), NULL); -INSERT INTO `vn`.`route`(`id`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`) +INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agencyModeFk`, `description`, `m3`, `cost`, `started`, `finished`) VALUES - (1, 56, CURDATE(), 1, 1, 'first route', null, 10, CURDATE(), CURDATE()), - (2, 56, CURDATE(), 1, 1, 'second route', 4.2, 20, CURDATE(), CURDATE()), - (3, 56, CURDATE(), 2, 7, 'third route', 5.3, 30, CURDATE(), CURDATE()), - (4, 56, CURDATE(), 3, 7, 'fourth route', 6.4, 40, CURDATE(), CURDATE()), - (5, 56, CURDATE(), 4, 8, 'fifth route', 7.5, 50, CURDATE(), CURDATE()), - (6, 57, CURDATE(), 5, 8, 'sixth route', 8.6, 60, CURDATE(), CURDATE()), - (7, 57, CURDATE(), 6, null, 'seventh route', 9.7, 70, CURDATE(), CURDATE()); + (1, '1899-12-30 12:15:00', 56, CURDATE(), 1, 1, 'first route', null, 10, CURDATE(), CURDATE()), + (2, '1899-12-30 13:20:00', 56, CURDATE(), 1, 1, 'second route', 4.2, 20, CURDATE(), CURDATE()), + (3, '1899-12-30 14:30:00', 56, CURDATE(), 2, 7, 'third route', 5.3, 30, CURDATE(), CURDATE()), + (4, '1899-12-30 15:45:00', 56, CURDATE(), 3, 7, 'fourth route', 6.4, 40, CURDATE(), CURDATE()), + (5, '1899-12-30 16:00:00', 56, CURDATE(), 4, 8, 'fifth route', 7.5, 50, CURDATE(), CURDATE()), + (6, null, 57, CURDATE(), 5, 8, 'sixth route', 8.6, 60, CURDATE(), CURDATE()), + (7, null, 57, CURDATE(), 6, null, 'seventh route', 9.7, 70, CURDATE(), CURDATE()); INSERT INTO `vn2008`.`empresa_grupo`(`empresa_grupo_id`, `grupo`) VALUES diff --git a/print/config/routes.json b/print/config/routes.json index 88365b1d0..95e881f0a 100644 --- a/print/config/routes.json +++ b/print/config/routes.json @@ -12,6 +12,7 @@ {"type": "report", "name": "rpt-letter-debtor"}, {"type": "report", "name": "rpt-sepa-core"}, {"type": "report", "name": "rpt-receipt"}, + {"type": "report", "name": "rpt-route"}, {"type": "static", "name": "email-header"}, {"type": "static", "name": "email-footer"}, {"type": "static", "name": "report-header"}, diff --git a/print/report/rpt-route/assets/css/index.js b/print/report/rpt-route/assets/css/index.js new file mode 100644 index 000000000..06417fcee --- /dev/null +++ b/print/report/rpt-route/assets/css/index.js @@ -0,0 +1,7 @@ +const CssReader = require(`${appPath}/lib/cssReader`); + +module.exports = new CssReader([ + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/report.css`, + `${__dirname}/style.css`]) + .mergeStyles(); diff --git a/print/report/rpt-route/assets/css/style.css b/print/report/rpt-route/assets/css/style.css new file mode 100644 index 000000000..82e5c33f1 --- /dev/null +++ b/print/report/rpt-route/assets/css/style.css @@ -0,0 +1,9 @@ +section .text { + font-family: Tahoma; + font-weight: bold; + color: white; + font-size: 7.5em; + text-align: center; + background-color: black; + margin-bottom: 0.2em +} \ No newline at end of file diff --git a/print/report/rpt-route/index.html b/print/report/rpt-route/index.html new file mode 100644 index 000000000..727088c82 --- /dev/null +++ b/print/report/rpt-route/index.html @@ -0,0 +1,15 @@ + + + +
+
+ +
{{route.agencyName}}
+
{{route.id}}
+
{{route.plateNumber}} {{routeTime(route.time)}}
+
+ +
+
+ + \ No newline at end of file diff --git a/print/report/rpt-route/index.js b/print/report/rpt-route/index.js new file mode 100755 index 000000000..7048acc2a --- /dev/null +++ b/print/report/rpt-route/index.js @@ -0,0 +1,36 @@ +const strftime = require('strftime'); +const database = require(`${appPath}/lib/database`); +const UserException = require(`${appPath}/lib/exceptions/userException`); + +module.exports = { + name: 'rpt-route', + async asyncData(ctx, params) { + if (!params.routeFk) + throw new UserException('No route id specified'); + + let [[route]] = await this.methods.fetchRoute(params.routeFk); + + if (!route) + throw new UserException('Route not ready'); + + return {route}; + }, + methods: { + fetchRoute(routeFk) { + return database.pool.query( + `SELECT + r.id, + r.time, + am.name agencyName, + v.numberPlate plateNumber + FROM route r + JOIN agencyMode am ON am.id = r.agencyModeFk + JOIN vehicle v ON v.id = r.vehicleFk + WHERE r.id = ?`, [routeFk]); + }, + routeTime: routeTime => { + if (routeTime) + return strftime('%H:%M', routeTime); + }, + }, +}; diff --git a/print/report/rpt-route/locale.js b/print/report/rpt-route/locale.js new file mode 100644 index 000000000..e69de29bb From 98e704adf8dc8d46b62c4daf512fd4201d51a83d Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 10:43:11 +0200 Subject: [PATCH 3/5] #1326 enlazar en ticket.descriptor tres puntos --- modules/ticket/front/descriptor/index.js | 8 +++++++- modules/ticket/front/descriptor/locale/es.yml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/ticket/front/descriptor/index.js b/modules/ticket/front/descriptor/index.js index 30f3390d4..5c7d81ab9 100644 --- a/modules/ticket/front/descriptor/index.js +++ b/modules/ticket/front/descriptor/index.js @@ -14,7 +14,8 @@ class Controller { {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}, - {callback: this.showSMSDialog, name: 'Send SMS', show: true} + {callback: this.showSMSDialog, name: 'Send SMS', show: true}, + {callback: this.openRptRoute, name: 'Show pallet report', show: true} ]; } @@ -109,6 +110,11 @@ class Controller { } } + openRptRoute() { + let url = `/api/report/rpt-route?routeFk=${this.ticket.routeFk}`; + window.open(url); + } + showAddStowaway() { this.$scope.addStowaway.show(); } diff --git a/modules/ticket/front/descriptor/locale/es.yml b/modules/ticket/front/descriptor/locale/es.yml index bf2a121eb..3ce9905cb 100644 --- a/modules/ticket/front/descriptor/locale/es.yml +++ b/modules/ticket/front/descriptor/locale/es.yml @@ -8,6 +8,7 @@ Add stowaway: Añadir polizón Remove stowaway: Borrar polizón Are you sure you want to delete this stowaway?: ¿Estas seguro de que quieres borrar este polizón? Show Delivery Note: Ver albarán +Show pallet report: Mostrar hoja de pallet Change shipped hour: Cambiar hora de envío Shipped hour: Hora de envío SMSPayment: >- From 9db389329d14661dbe765031df9a5804a9a0b14d Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 10:53:00 +0200 Subject: [PATCH 4/5] renamed the it statement --- back/methods/message/specs/send.spec.js | 2 +- modules/client/back/methods/sms/specs/send.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/back/methods/message/specs/send.spec.js b/back/methods/message/specs/send.spec.js index 079595b12..6749bd7cd 100644 --- a/back/methods/message/specs/send.spec.js +++ b/back/methods/message/specs/send.spec.js @@ -1,7 +1,7 @@ const app = require('vn-loopback/server/server'); describe('message send()', () => { - it('should call the send method and return the response', async() => { + it('should return a response containing the same message in params', async() => { let ctx = {req: {accessToken: {userId: 1}}}; let params = { recipientFk: 1, diff --git a/modules/client/back/methods/sms/specs/send.spec.js b/modules/client/back/methods/sms/specs/send.spec.js index 88251aba0..0045b148a 100644 --- a/modules/client/back/methods/sms/specs/send.spec.js +++ b/modules/client/back/methods/sms/specs/send.spec.js @@ -6,7 +6,7 @@ const app = require('vn-loopback/server/server'); * por destinatario inválido, pero puede llegar a fallar. */ describe('sms send()', () => { - it('should call the send method', async() => { + it('should should return the expected message and status code', async() => { let ctx = {req: {accessToken: {userId: 1}}}; let result = await app.models.Sms.send(ctx, null, 'Invalid', 'My SMS Body'); From e9102249be216f3f89c5f604a9c0b3d9c29b4983 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 10 Apr 2019 11:49:39 +0200 Subject: [PATCH 5/5] #1328 module home refactor --- front/salix/components/home/home.html | 36 +++++++++++++------------- front/salix/components/home/style.scss | 10 +++---- modules/invoiceOut/front/routes.json | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/front/salix/components/home/home.html b/front/salix/components/home/home.html index cfc59bdc4..fa9cd9d67 100644 --- a/front/salix/components/home/home.html +++ b/front/salix/components/home/home.html @@ -1,22 +1,22 @@ diff --git a/front/salix/components/home/style.scss b/front/salix/components/home/style.scss index 72322d0e0..cab44ea73 100644 --- a/front/salix/components/home/style.scss +++ b/front/salix/components/home/style.scss @@ -16,7 +16,7 @@ vn-home { flex-direction: row; justify-content: center; flex-wrap: wrap; - max-width: 40em; + max-width: 44em; margin: 0 auto; & > a { @@ -28,7 +28,7 @@ vn-home { display: flex; flex-direction: column; height: 8em; - width: 7em; + width: 8em; margin: .5em; padding: 1em; justify-content: center; @@ -49,13 +49,13 @@ vn-home { text-align: center; } & > h4 { + max-width: 7em; text-align: center; - font-size: 16pt; - text-overflow: ellipsis; - white-space: nowrap; + font-size: 13pt; overflow: hidden; color: inherit; margin: 0; + line-height: 1.5em; /* & > .bind-letter { color: #FD0; diff --git a/modules/invoiceOut/front/routes.json b/modules/invoiceOut/front/routes.json index dbaa4be29..eb278ebd8 100644 --- a/modules/invoiceOut/front/routes.json +++ b/modules/invoiceOut/front/routes.json @@ -1,7 +1,7 @@ { "module": "invoiceOut", "name": "Invoices out", - "icon": "icon-invoices1", + "icon": "icon-invoices", "validations" : true, "dependencies": ["worker", "client", "ticket"], "routes": [