diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 1b56d87f7..cec8026ff 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -196,7 +196,6 @@ module.exports = Self => { t.id, t.shipped, CAST(DATE(t.shipped) AS CHAR) AS shippedDate, - HOUR(t.shipped) AS shippedHour, t.nickname, t.refFk, t.routeFk, @@ -218,11 +217,10 @@ module.exports = Self => { u.name AS userName, c.salesPersonFk, z.hour AS zoneLanding, - HOUR(z.hour) AS zoneHour, - MINUTE(z.hour) AS zoneMinute, z.name AS zoneName, z.id AS zoneFk, - CAST(z.hour AS CHAR) AS hour, + th.preparationHour, + TIME_FORMAT(z.hour, '%H:%i') AS theoreticalhour, TIME_FORMAT(zed.etc, '%H:%i') AS practicalHour FROM ticket t LEFT JOIN invoiceOut io ON t.refFk = io.ref @@ -236,7 +234,11 @@ module.exports = Self => { LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN worker wk ON wk.id = c.salesPersonFk LEFT JOIN account.user u ON u.id = wk.userFk - LEFT JOIN zoneEstimatedDelivery zed ON zed.zoneFk = t.zoneFk`); + LEFT JOIN zoneEstimatedDelivery zed ON zed.zoneFk = t.zoneFk + JOIN ( + SELECT t.id, TIME_FORMAT(t.shipped, '%H:%i') AS preparationHour + FROM ticket AS t + ) AS th ON th.id = t.id`); if (args.orderFk) { stmt.merge({ diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index 82adf2765..76127d4f2 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -3,7 +3,7 @@ params="::$ctrl.filterParams" url="SalesMonitors/salesFilter" limit="20" - order="shippedDate DESC, shippedHour ASC, zoneLanding ASC, id"> + order="shippedDate DESC, preparationHour ASC, zoneLanding ASC, id"> Client Salesperson Date - Prep. - Theoretical + Prep. + Theoretical Practical Province State diff --git a/modules/monitor/front/index/tickets/index.js b/modules/monitor/front/index/tickets/index.js index d8832d1b5..a224ecac6 100644 --- a/modules/monitor/front/index/tickets/index.js +++ b/modules/monitor/front/index/tickets/index.js @@ -68,8 +68,12 @@ export default class Controller extends Section { return {'c.salesPersonFk': value}; case 'provinceFk': return {'a.provinceFk': value}; - case 'hour': + case 'theoreticalHour': return {'z.hour': value}; + case 'practicalHour': + return {'zed.etc': value}; + case 'preparationHour': + return {'th.preparationHour': value}; case 'shipped': return {'t.shipped': { between: this.dateRange(value)}