From 0b4c53a6550ffc767e1de8e9c0c364c4fd4c9cd4 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 14 Sep 2020 13:11:53 +0200 Subject: [PATCH 1/4] added invoiceOut descriptor --- modules/ticket/back/methods/ticket/filter.js | 2 ++ modules/ticket/front/index/index.html | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket/filter.js b/modules/ticket/back/methods/ticket/filter.js index 878b4278e..60b57064f 100644 --- a/modules/ticket/back/methods/ticket/filter.js +++ b/modules/ticket/back/methods/ticket/filter.js @@ -197,6 +197,7 @@ module.exports = Self => { t.routeFk, t.warehouseFk, t.clientFk, + io.id AS invoiceOutId, a.provinceFk, p.name AS province, w.name AS warehouse, @@ -216,6 +217,7 @@ module.exports = Self => { z.id AS zoneFk, CAST(z.hour AS CHAR) AS hour FROM ticket t + LEFT JOIN invoiceOut io ON t.refFk = io.ref LEFT JOIN zone z ON z.id = t.zoneFk LEFT JOIN address a ON a.id = t.addressFk LEFT JOIN province p ON p.id = a.provinceFk diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 2c598ca03..6a724e9cc 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -103,7 +103,14 @@ {{::ticket.warehouse}} - {{::ticket.refFk | dashIfEmpty}} + + + {{::ticket.refFk | dashIfEmpty}} + + {{::ticket.zoneLanding | date: 'HH:mm'}} @@ -169,6 +176,9 @@ + + -- 2.40.1 From 13a5c4c4c92838d21b0d5ee81e9451aec492facb Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 14 Sep 2020 13:58:42 +0200 Subject: [PATCH 2/4] test enhanced --- .../ticket/back/methods/ticket/specs/filter.spec.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/ticket/back/methods/ticket/specs/filter.spec.js b/modules/ticket/back/methods/ticket/specs/filter.spec.js index c03a41975..524354646 100644 --- a/modules/ticket/back/methods/ticket/specs/filter.spec.js +++ b/modules/ticket/back/methods/ticket/specs/filter.spec.js @@ -67,14 +67,12 @@ describe('ticket filter()', () => { const ctx = {req: {accessToken: {userId: 9}}, args: {pending: true}}; const filter = {}; const result = await app.models.Ticket.filter(ctx, filter); - const firstRow = result[0]; - const secondRow = result[1]; - const thirdRow = result[2]; + + const length = result.length; + const anyResult = result[Math.floor(Math.random() * Math.floor(length))]; expect(result.length).toEqual(7); - expect(firstRow.state).toEqual('Libre'); - expect(secondRow.state).toEqual('Libre'); - expect(thirdRow.state).toEqual('Libre'); + expect(anyResult.state).toMatch(/(Libre|Arreglar)/); }); it('should return the tickets that are not pending', async() => { -- 2.40.1 From 1eb088521c593a2cb7c10784ca4eea84a57d7d0a Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 14 Sep 2020 16:08:37 +0200 Subject: [PATCH 3/4] ticket.index ref and state columns merged --- modules/ticket/front/index/index.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index 6a724e9cc..cf4375fc8 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -23,7 +23,6 @@ State Zone Warehouse - Invoice Closure Total @@ -89,8 +88,17 @@ {{::ticket.province}} - - + + + {{::ticket.refFk | dashIfEmpty}} + + {{ticket.state}} @@ -103,14 +111,6 @@ {{::ticket.warehouse}} - - - {{::ticket.refFk | dashIfEmpty}} - - {{::ticket.zoneLanding | date: 'HH:mm'}} -- 2.40.1 From 031e40df51c6995d53a317654ea88a4441197fc9 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Mon, 14 Sep 2020 16:34:11 +0200 Subject: [PATCH 4/4] removed unused dash if empty --- modules/ticket/front/index/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/front/index/index.html b/modules/ticket/front/index/index.html index cf4375fc8..3e9809952 100644 --- a/modules/ticket/front/index/index.html +++ b/modules/ticket/front/index/index.html @@ -94,7 +94,7 @@ title="{{::ticket.refFk}}" vn-click-stop="invoiceOutDescriptor.show($event, ticket.invoiceOutId)" class="link"> - {{::ticket.refFk | dashIfEmpty}} + {{::ticket.refFk}}