From 31e160559b613ea8e967e915d86def7a49edbab2 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 13 Oct 2021 14:17:45 +0200 Subject: [PATCH 1/4] fix(salesMonitor): now sorts correctly by practical and theorical hour Refs: 3219 --- .../back/methods/sales-monitor/salesFilter.js | 12 +- .../monitor/front/index/tickets/index.html | 152 ++++++------------ modules/monitor/front/index/tickets/index.js | 6 +- 3 files changed, 60 insertions(+), 110 deletions(-) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 6483a906a..1bf4451ca 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -197,7 +197,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, @@ -219,11 +218,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 @@ -237,7 +235,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..4e8bf0e47 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -1,31 +1,28 @@ - + order="shippedDate DESC, preparationHour ASC, zoneLanding ASC, id"> - Tickets monitor - + - + @@ -37,8 +34,8 @@ Client Salesperson Date - Prep. - Theoretical + Prep. + Theoretical Practical Province State @@ -48,61 +45,37 @@ - - + - + - + - - + - + - {{::ticket.nickname}} - + {{::ticket.userName | dashIfEmpty}} @@ -116,23 +89,16 @@ {{::ticket.practicalHour | date: 'HH:mm'}} {{::ticket.province}} - + {{::ticket.refFk}} - + {{::ticket.state}} - {{::ticket.zoneName | dashIfEmpty}} @@ -143,70 +109,48 @@ - + }" vn-tooltip="Go to lines" icon="icon-lines"> - + - + - + - + - + - + - + Filter by selection - + Exclude selection - + Remove filter - + Remove all filters - + Copy value - + \ No newline at end of file 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)} From b2cdfd9785a922f94caf2da04fc85b6d9f60a33d Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 13 Oct 2021 14:19:29 +0200 Subject: [PATCH 2/4] Removed empty spaces --- .../monitor/front/index/tickets/index.html | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index 4e8bf0e47..f5f9339fc 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -1,19 +1,19 @@ - - From 1b9b918812c115459ffda119e616405c4c9f7bd2 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 13 Oct 2021 14:21:42 +0200 Subject: [PATCH 3/4] Fixed format --- .../monitor/front/index/tickets/index.html | 134 +++++++++++++----- 1 file changed, 95 insertions(+), 39 deletions(-) diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index f5f9339fc..76127d4f2 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -1,13 +1,13 @@ - - Tickets monitor - + - + @@ -45,37 +48,61 @@ - - + - + - + - - + - + - {{::ticket.nickname}} - + {{::ticket.userName | dashIfEmpty}} @@ -89,16 +116,23 @@ {{::ticket.practicalHour | date: 'HH:mm'}} {{::ticket.province}} - + {{::ticket.refFk}} - + {{::ticket.state}} - {{::ticket.zoneName | dashIfEmpty}} @@ -109,48 +143,70 @@ - + }" + vn-tooltip="Go to lines" + icon="icon-lines"> - + - + - + - + - + - + - + Filter by selection - + Exclude selection - + Remove filter - + Remove all filters - + Copy value - \ No newline at end of file + From c0e1f2f0dc2e45d197193d71fa25aa100bd47243 Mon Sep 17 00:00:00 2001 From: joan Date: Wed, 13 Oct 2021 14:55:53 +0200 Subject: [PATCH 4/4] Changed column order --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 8 ++------ modules/monitor/front/index/tickets/index.html | 2 +- modules/monitor/front/index/tickets/index.js | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 1bf4451ca..5d49f07df 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -220,7 +220,7 @@ module.exports = Self => { z.hour AS zoneLanding, z.name AS zoneName, z.id AS zoneFk, - th.preparationHour, + TIME_FORMAT(t.shipped, '%H:%i') AS preparationHour, TIME_FORMAT(z.hour, '%H:%i') AS theoreticalhour, TIME_FORMAT(zed.etc, '%H:%i') AS practicalHour FROM ticket t @@ -235,11 +235,7 @@ 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 - JOIN ( - SELECT t.id, TIME_FORMAT(t.shipped, '%H:%i') AS preparationHour - FROM ticket AS t - ) AS th ON th.id = t.id`); + LEFT JOIN zoneEstimatedDelivery zed ON zed.zoneFk = t.zoneFk`); if (args.orderFk) { stmt.merge({ diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index 76127d4f2..45db04ca0 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -37,7 +37,7 @@ Client Salesperson Date - Prep. + Prep. Theoretical Practical Province diff --git a/modules/monitor/front/index/tickets/index.js b/modules/monitor/front/index/tickets/index.js index a224ecac6..9d8a911e8 100644 --- a/modules/monitor/front/index/tickets/index.js +++ b/modules/monitor/front/index/tickets/index.js @@ -72,8 +72,6 @@ export default class Controller extends Section { 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)}