Updated closure queries
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
d626a69175
commit
4db6ddba54
|
@ -14,7 +14,6 @@ module.exports = async function(request, response, next) {
|
|||
const tickets = await db.rawSql(`
|
||||
SELECT
|
||||
t.id,
|
||||
|
||||
t.clientFk,
|
||||
c.name clientName,
|
||||
c.email recipient,
|
||||
|
@ -28,14 +27,11 @@ module.exports = async function(request, response, next) {
|
|||
JOIN warehouse wh ON wh.id = t.warehouseFk AND wh.hasComission
|
||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN alertLevel al ON al.id = ts.alertLevel
|
||||
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
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'
|
||||
AND DATE(t.shipped) BETWEEN DATE_ADD(?, INTERVAL -2 DAY)
|
||||
AND util.dayEnd(?)
|
||||
AND t.refFk IS NULL
|
||||
|
|
|
@ -21,11 +21,23 @@ module.exports = async function(request, response, next) {
|
|||
const agencyIds = reqArgs.agencyModeId.split(',');
|
||||
const tickets = await db.rawSql(`
|
||||
SELECT
|
||||
t.id
|
||||
t.id,
|
||||
t.clientFk,
|
||||
c.name clientName,
|
||||
c.email recipient,
|
||||
c.salesPersonFk,
|
||||
c.isToBeMailed,
|
||||
c.hasToInvoice,
|
||||
co.hasDailyInvoice,
|
||||
eu.email salesPersonEmail
|
||||
FROM expedition e
|
||||
JOIN ticket t ON t.id = e.ticketFk
|
||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN alertLevel al ON al.id = ts.alertLevel
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
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'
|
||||
AND t.agencyModeFk IN(?)
|
||||
AND t.warehouseFk = ?
|
||||
|
|
|
@ -15,11 +15,23 @@ module.exports = async function(request, response, next) {
|
|||
|
||||
const tickets = await db.rawSql(`
|
||||
SELECT
|
||||
t.id
|
||||
t.id,
|
||||
t.clientFk,
|
||||
c.name clientName,
|
||||
c.email recipient,
|
||||
c.salesPersonFk,
|
||||
c.isToBeMailed,
|
||||
c.hasToInvoice,
|
||||
co.hasDailyInvoice,
|
||||
eu.email salesPersonEmail
|
||||
FROM expedition e
|
||||
JOIN ticket t ON t.id = e.ticketFk
|
||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN alertLevel al ON al.id = ts.alertLevel
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
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'
|
||||
AND t.routeFk = ?
|
||||
AND t.refFk IS NULL
|
||||
|
|
|
@ -14,11 +14,23 @@ module.exports = async function(request, response, next) {
|
|||
|
||||
const tickets = await db.rawSql(`
|
||||
SELECT
|
||||
t.id
|
||||
t.id,
|
||||
t.clientFk,
|
||||
c.name clientName,
|
||||
c.email recipient,
|
||||
c.salesPersonFk,
|
||||
c.isToBeMailed,
|
||||
c.hasToInvoice,
|
||||
co.hasDailyInvoice,
|
||||
eu.email salesPersonEmail
|
||||
FROM expedition e
|
||||
JOIN ticket t ON t.id = e.ticketFk
|
||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN alertLevel al ON al.id = ts.alertLevel
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
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'
|
||||
AND t.id = ?
|
||||
AND t.refFk IS NULL
|
||||
|
|
Loading…
Reference in New Issue