Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into 6900-dropInvoiceIn
gitea/salix/pipeline/pr-test This commit looks good
Details
gitea/salix/pipeline/pr-test This commit looks good
Details
This commit is contained in:
commit
b2f4b54654
|
@ -3,4 +3,5 @@ apps:
|
|||
name: salix-back
|
||||
instances: 1
|
||||
max_restarts: 0
|
||||
autorestart: false
|
||||
node_args: --tls-min-v1.0 --openssl-legacy-provider
|
||||
|
|
|
@ -21,6 +21,7 @@ BEGIN
|
|||
AND a.id IS NULL
|
||||
AND u.active
|
||||
AND c.created < util.VN_CURDATE() - INTERVAL vMonths MONTH
|
||||
AND NOT u.role = (SELECT id FROM `role` WHERE name = 'supplier')
|
||||
AND u.id NOT IN (
|
||||
SELECT DISTINCT c.id
|
||||
FROM client c
|
||||
|
|
|
@ -12,7 +12,7 @@ BEGIN
|
|||
DECLARE vSaleFk INT;
|
||||
DECLARE vSectorFk INT;
|
||||
DECLARE vSales CURSOR FOR
|
||||
SELECT s.id
|
||||
SELECT DISTINCT s.id
|
||||
FROM sectorCollectionSaleGroup sc
|
||||
JOIN saleGroupDetail sg ON sg.saleGroupFk = sc.saleGroupFk
|
||||
JOIN sale s ON sg.saleFk = s.id
|
||||
|
|
|
@ -83,9 +83,14 @@ module.exports = Self => {
|
|||
LEFT JOIN account.user u ON u.id = c.salesPersonFk
|
||||
LEFT JOIN account.user uw ON uw.id = co.workerFk
|
||||
LEFT JOIN (
|
||||
SELECT MAX(started), clientFk, finished
|
||||
FROM recovery
|
||||
GROUP BY clientFk
|
||||
SELECT r1.started, r1.clientFk, r1.finished
|
||||
FROM recovery r1
|
||||
JOIN (
|
||||
SELECT MAX(started) AS maxStarted, clientFk
|
||||
FROM recovery
|
||||
GROUP BY clientFk
|
||||
) r2 ON r1.clientFk = r2.clientFk
|
||||
AND r1.started = r2.maxStarted
|
||||
) r ON r.clientFk = c.id
|
||||
LEFT JOIN workerDepartment wd ON wd.workerFk = u.id
|
||||
JOIN department dp ON dp.id = wd.departmentFk
|
||||
|
|
Loading…
Reference in New Issue