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