Merge pull request '232201_test_to_dev' (!1560) from 232201_test_to_dev into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1560
Reviewed-by: Alexandre Riera <alexandre@verdnatura.es>
This commit is contained in:
Alex Moreno 2023-05-25 07:17:09 +00:00
commit c5a9eeed44
2 changed files with 5 additions and 2 deletions

View File

@ -58,7 +58,10 @@ module.exports = Self => {
for (const param in args) for (const param in args)
params[param] = args[param]; 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); const email = new Email('delivery-note', params);

View File

@ -52,7 +52,7 @@ module.exports = Self => {
JOIN province p ON p.id = c.provinceFk JOIN province p ON p.id = c.provinceFk
JOIN country co ON co.id = p.countryFk JOIN country co ON co.id = p.countryFk
LEFT JOIN account.emailUser eu ON eu.userFk = c.salesPersonFk 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 DATE(t.shipped) BETWEEN DATE_ADD(?, INTERVAL -2 DAY)
AND util.dayEnd(?) AND util.dayEnd(?)
AND t.refFk IS NULL AND t.refFk IS NULL