From 88790058545734b2bbedfa0dd507b6d279ffcc7c Mon Sep 17 00:00:00 2001 From: Joan Date: Fri, 31 Aug 2018 12:39:57 +0200 Subject: [PATCH] fixed ticket list pagination --- client/ticket/src/index/index.js | 48 +------------------ .../changes/1.1.0/05-ticketGetProblems.sql | 5 +- .../loopback/common/methods/ticket/filter.js | 2 +- 3 files changed, 5 insertions(+), 50 deletions(-) diff --git a/client/ticket/src/index/index.js b/client/ticket/src/index/index.js index d7b12db8e..1fa53b5ce 100644 --- a/client/ticket/src/index/index.js +++ b/client/ticket/src/index/index.js @@ -6,53 +6,7 @@ export default class Controller { this.ticketSelected = null; this.filter = { - include: [ - { - relation: 'address', - scope: { - fields: ['provinceFk'], - include: { - relation: 'province', - scope: { - fields: ['name'] - } - } - } - }, { - relation: 'warehouse', - scope: { - fields: ['name'] - } - }, { - relation: 'agencyMode', - scope: { - fields: ['name'] - } - }, { - relation: 'tracking', - scope: { - fields: ['stateFk'], - include: { - relation: 'state', - scope: { - fields: ['name'] - } - } - } - }, { - relation: 'client', - scope: { - fields: ['salesPersonFk'], - include: { - relation: 'salesPerson', - scope: { - fields: ['name'] - } - } - } - } - ], - order: 'shipped DESC, ticketFk' + order: 'shipped DESC' }; } diff --git a/services/db/install/changes/1.1.0/05-ticketGetProblems.sql b/services/db/install/changes/1.1.0/05-ticketGetProblems.sql index ec5ff5651..169ee6ff2 100644 --- a/services/db/install/changes/1.1.0/05-ticketGetProblems.sql +++ b/services/db/install/changes/1.1.0/05-ticketGetProblems.sql @@ -98,7 +98,7 @@ BEGIN -- El disponible es menor que 0 INSERT INTO tmp.ticketProblems(ticketFk, problem) SELECT tt.ticketFk, i.name - FROM tmp.ticketGetProblems tt + FROM tmp.ticketListFiltered tt JOIN vn.ticket t ON t.id = tt.ticketFk LEFT JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk @@ -122,7 +122,7 @@ BEGIN -- Amarillo: El disponible es mayor que cero y la cantidad supera el visible, estando aun sin preparar INSERT INTO tmp.ticketProblems(ticketFk, problem) SELECT tt.ticketFk, CONCAT('Delay', i.name) - FROM tmp.ticketGetProblems tt + FROM tmp.ticketListFiltered tt JOIN vn.ticket t ON t.id = tt.ticketFk LEFT JOIN vn.sale s ON s.ticketFk = t.id JOIN vn.item i ON i.id = s.itemFk @@ -148,3 +148,4 @@ BEGIN END$$ DELIMITER ; + diff --git a/services/loopback/common/methods/ticket/filter.js b/services/loopback/common/methods/ticket/filter.js index c4f903741..7a94b60b8 100644 --- a/services/loopback/common/methods/ticket/filter.js +++ b/services/loopback/common/methods/ticket/filter.js @@ -89,7 +89,7 @@ module.exports = Self => { tp.problem FROM tmp.filter f LEFT JOIN tmp.ticketProblems tp ON tp.ticketFk = f.ticketFk`); - stmt.merge(Self.buildSuffix(filter, 'f')); + stmt.merge(Self.buildOrderBy(filter, 'f')); let ticketsIndex = stmts.push(stmt) - 1; stmts.push(