From 0045edb6982573592dda1c2215beeeaa3ccab6e1 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 23 May 2023 07:39:43 +0200 Subject: [PATCH 1/2] refs #5094 fix get email --- back/methods/docuware/deliveryNoteEmail.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/back/methods/docuware/deliveryNoteEmail.js b/back/methods/docuware/deliveryNoteEmail.js index 1497dcdf9..1557a3a87 100644 --- a/back/methods/docuware/deliveryNoteEmail.js +++ b/back/methods/docuware/deliveryNoteEmail.js @@ -58,7 +58,10 @@ module.exports = Self => { for (const param in args) params[param] = args[param]; - if (!recipient) params.recipient = models.Client.findById(recipientId, {fields: ['email']}); + if (!recipient) { + client = await models.Client.findById(recipientId, {fields: ['email']}); + params.recipient = client.email; + } const email = new Email('delivery-note', params); From 42a39b6778186945a16db13350412e4a3f31e06d Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 25 May 2023 07:22:56 +0200 Subject: [PATCH 2/2] refs #5706 master to test --- modules/ticket/back/methods/ticket/closeAll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket/closeAll.js b/modules/ticket/back/methods/ticket/closeAll.js index 3726d85b7..6690126b9 100644 --- a/modules/ticket/back/methods/ticket/closeAll.js +++ b/modules/ticket/back/methods/ticket/closeAll.js @@ -52,7 +52,7 @@ module.exports = Self => { JOIN province p ON p.id = c.provinceFk JOIN country co ON co.id = p.countryFk LEFT JOIN account.emailUser eu ON eu.userFk = c.salesPersonFk - WHERE al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered') + WHERE (al.code = 'PACKED' OR (am.code = 'refund' AND al.code != 'delivered')) AND DATE(t.shipped) BETWEEN DATE_ADD(?, INTERVAL -2 DAY) AND util.dayEnd(?) AND t.refFk IS NULL