From bca22e8ad3ce93392f5701cb347bdf9a772fed90 Mon Sep 17 00:00:00 2001 From: carlossa Date: Sun, 20 Oct 2024 15:17:17 +0200 Subject: [PATCH 1/4] fix: refs #6389 saleMonitor filter --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 927f49999..0fa2e60e5 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -194,6 +194,7 @@ module.exports = Self => { u.name userName, c.salesPersonFk, c.credit, + pm.name payMethod, z.hour zoneLanding, z.name zoneName, z.id zoneFk, @@ -211,6 +212,7 @@ module.exports = Self => { LEFT JOIN ticketState ts ON ts.ticketFk = t.id LEFT JOIN state st ON st.id = ts.stateFk LEFT JOIN client c ON c.id = t.clientFk + LEFT JOIN payMethod pm ON pm.id = c.payMethodFk LEFT JOIN worker wk ON wk.id = c.salesPersonFk LEFT JOIN account.user u ON u.id = wk.id LEFT JOIN ( -- 2.40.1 From dfdd8f28d41783e399123c60c6a1e9cbf8d268bd Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 23 Oct 2024 12:23:31 +0200 Subject: [PATCH 2/4] fix: refs #6389 filter --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 0fa2e60e5..9bfb69b65 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -199,6 +199,8 @@ module.exports = Self => { z.name zoneName, z.id zoneFk, st.classColor, + d.id departmentFk, + d.name department, TIME_FORMAT(t.shipped, '%H:%i') preparationHour, TIME_FORMAT(z.hour, '%H:%i') theoreticalhour, TIME_FORMAT(zed.etc, '%H:%i') practicalHour @@ -214,6 +216,8 @@ module.exports = Self => { LEFT JOIN client c ON c.id = t.clientFk LEFT JOIN payMethod pm ON pm.id = c.payMethodFk LEFT JOIN worker wk ON wk.id = c.salesPersonFk + LEFT JOIN workerDepartment wd ON wd.workerFk = wk.id + LEFT JOIN department d ON d.id = wd.departmentFk LEFT JOIN account.user u ON u.id = wk.id LEFT JOIN ( SELECT zoneFk, -- 2.40.1 From 99bec3e7fe8d5179d5f8ba8ca8d61c2b0f9435cb Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 23 Oct 2024 14:58:20 +0200 Subject: [PATCH 3/4] fix: refs #6389 salesFilter --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 9bfb69b65..5a0ea8d9d 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -169,7 +169,7 @@ module.exports = Self => { stmt = new ParameterizedSQL(` CREATE OR REPLACE TEMPORARY TABLE tmp.filter (PRIMARY KEY (id)) - ENGINE = MEMORY + ENGINE = InnoDB SELECT t.id, t.shipped, CAST(DATE(t.shipped) AS CHAR) shippedDate, @@ -201,6 +201,11 @@ module.exports = Self => { st.classColor, d.id departmentFk, d.name department, + (SELECT GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk SEPARATOR ',') + FROM sale s + JOIN item i ON i.id = s.itemFk + WHERE s.ticketFk = t.id + ) AS packing, TIME_FORMAT(t.shipped, '%H:%i') preparationHour, TIME_FORMAT(z.hour, '%H:%i') theoreticalhour, TIME_FORMAT(zed.etc, '%H:%i') practicalHour -- 2.40.1 From 55483f8e6ba8ef2293ecd59ab3ae370a0243c5ba Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 28 Oct 2024 09:01:10 +0100 Subject: [PATCH 4/4] fix: refs #6389 packing --- modules/monitor/back/methods/sales-monitor/salesFilter.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 5a0ea8d9d..30df9c0cc 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -88,6 +88,11 @@ module.exports = Self => { arg: 'alertLevel', type: 'number', description: `The alert level of the tickets` + }, + { + arg: 'packing', + type: 'string', + description: `The packing of the items` } ], returns: { @@ -155,6 +160,9 @@ module.exports = Self => { case 'clientFk': param = `t.${param}`; return {[param]: value}; + case 'packing': + param = `i.${param}`; + return {[param]: value}; } }); -- 2.40.1