fixed ticket list pagination

This commit is contained in:
Joan Sanchez 2018-08-31 12:39:57 +02:00
parent bc2554e6f9
commit 8879005854
3 changed files with 5 additions and 50 deletions

View File

@ -6,53 +6,7 @@ export default class Controller {
this.ticketSelected = null; this.ticketSelected = null;
this.filter = { this.filter = {
include: [ order: 'shipped DESC'
{
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'
}; };
} }

View File

@ -98,7 +98,7 @@ BEGIN
-- El disponible es menor que 0 -- El disponible es menor que 0
INSERT INTO tmp.ticketProblems(ticketFk, problem) INSERT INTO tmp.ticketProblems(ticketFk, problem)
SELECT tt.ticketFk, i.name SELECT tt.ticketFk, i.name
FROM tmp.ticketGetProblems tt FROM tmp.ticketListFiltered tt
JOIN vn.ticket t ON t.id = tt.ticketFk JOIN vn.ticket t ON t.id = tt.ticketFk
LEFT JOIN vn.sale s ON s.ticketFk = t.id LEFT JOIN vn.sale s ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk 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 -- Amarillo: El disponible es mayor que cero y la cantidad supera el visible, estando aun sin preparar
INSERT INTO tmp.ticketProblems(ticketFk, problem) INSERT INTO tmp.ticketProblems(ticketFk, problem)
SELECT tt.ticketFk, CONCAT('Delay', i.name) SELECT tt.ticketFk, CONCAT('Delay', i.name)
FROM tmp.ticketGetProblems tt FROM tmp.ticketListFiltered tt
JOIN vn.ticket t ON t.id = tt.ticketFk JOIN vn.ticket t ON t.id = tt.ticketFk
LEFT JOIN vn.sale s ON s.ticketFk = t.id LEFT JOIN vn.sale s ON s.ticketFk = t.id
JOIN vn.item i ON i.id = s.itemFk JOIN vn.item i ON i.id = s.itemFk
@ -148,3 +148,4 @@ BEGIN
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -89,7 +89,7 @@ module.exports = Self => {
tp.problem tp.problem
FROM tmp.filter f FROM tmp.filter f
LEFT JOIN tmp.ticketProblems tp ON tp.ticketFk = f.ticketFk`); 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; let ticketsIndex = stmts.push(stmt) - 1;
stmts.push( stmts.push(