feat: refs #7686 Changes in procs
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
070613de64
commit
28c94b5f32
|
@ -65,15 +65,14 @@ BEGIN
|
|||
JOIN vn.ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN vn.alertLevel al ON al.id = ts.alertLevel
|
||||
WHERE t.shipped BETWEEN util.VN_CURDATE() AND util.dayend(util.VN_CURDATE())
|
||||
AND s.isPicked = FALSE
|
||||
AND al.code = 'FREE'
|
||||
AND NOT s.isPicked
|
||||
AND al.code IN ('FREE', 'APPROVED')
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
GROUP BY s.itemFk
|
||||
HAVING notPicked
|
||||
) s ON s.itemFk = v.item_id
|
||||
WHERE v.calc_id = vCalc
|
||||
AND NOT v.visible <=> tv.totalVisible;
|
||||
|
||||
END LOOP;
|
||||
CLOSE cWarehouses;
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ BEGIN
|
|||
)
|
||||
SELECT t.id INTO vTicketFk
|
||||
FROM vn.ticket t
|
||||
JOIN vn.alertLevel al ON al.code = 'FREE'
|
||||
JOIN vn.alertLevel al ON al.code IN ('FREE', 'APPROVED')
|
||||
LEFT JOIN tPrevia tp ON tp.ticketFk = t.id
|
||||
LEFT JOIN vn.ticketState tls ON tls.ticketFk = t.id
|
||||
JOIN hedera.`order` o ON o.address_id = t.addressFk
|
||||
|
|
|
@ -106,7 +106,7 @@ BEGIN
|
|||
JOIN alertLevel al ON al.id = tst.alertLevel
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
WHERE t.warehouseFk = vWarehouseFk
|
||||
AND al.code = 'FREE'
|
||||
AND al.code IN ('FREE', 'APPROVED')
|
||||
GROUP BY s.itemFk
|
||||
) sub ON sub.itemFk = ishr.itemFk
|
||||
ORDER BY i.typeFk, i.longName;
|
||||
|
|
|
@ -82,7 +82,7 @@ proc: BEGIN
|
|||
rm.bufferFk
|
||||
FROM tmp.productionTicket tt
|
||||
JOIN ticket t ON tt.ticketFk = t.id
|
||||
JOIN alertLevel al ON al.code = 'FREE'
|
||||
JOIN alertLevel al ON al.code = 'APPROVED'
|
||||
LEFT JOIN ticketStateToday tst ON tst.ticketFk = t.id
|
||||
LEFT JOIN `state` st ON st.id = tst.state
|
||||
LEFT JOIN client c ON c.id = t.clientFk
|
||||
|
|
|
@ -13,7 +13,7 @@ BEGIN
|
|||
JOIN vn.parking p ON p.id = sh.parkingFk
|
||||
WHERE p.sectorFk = vSectorFk
|
||||
) sub ON sub.id = td.ticketFk
|
||||
JOIN vn.ticketDown_SelectionType tdst ON tdst.description = 'FREE'
|
||||
JOIN vn.ticketDown_SelectionType tdst ON tdst.description IN ('FREE', 'APPROVED')
|
||||
JOIN vn.ticketDown_SelectionType tdst2 ON tdst2.description = 'SELECTED'
|
||||
SET td.selected = tdst2.id
|
||||
WHERE td.selected = tdst.id;
|
||||
|
|
|
@ -12,7 +12,7 @@ BEGIN
|
|||
SELECT t.warehouseFk, t.shipped, ts.alertLevel, al.id
|
||||
INTO vWarehouse, vShipped, vAlertLevel, vAlertLevelFree
|
||||
FROM ticket t
|
||||
JOIN alertLevel al ON al.code = 'FREE'
|
||||
JOIN alertLevel al ON al.code IN ('FREE', 'APPROVED')
|
||||
LEFT JOIN ticketState ts ON ts.ticketFk = vTicket
|
||||
WHERE t.id = vTicket;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ BEGIN
|
|||
CREATE TEMPORARY TABLE tTicket
|
||||
SELECT ticketFk
|
||||
FROM tmp.productionBuffer
|
||||
JOIN alertLevel al ON al.code = 'FREE'
|
||||
JOIN alertLevel al ON al.code IN ('FREE', 'APPROVED')
|
||||
WHERE shipped = util.VN_CURDATE()
|
||||
AND problem LIKE '%I:%'
|
||||
AND (HH <= vHour OR HH = vHour AND mm < vMinute)
|
||||
|
|
|
@ -48,14 +48,14 @@ BEGIN
|
|||
WHERE t.shipped BETWEEN TIMESTAMPADD(DAY, vScopeDays,vDated)
|
||||
AND util.dayend(TIMESTAMPADD(DAY, vScopeDays,vDated))
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
AND al.code = 'FREE'
|
||||
AND al.code IN ('FREE', 'APPROVED')
|
||||
GROUP BY t.id
|
||||
) sub
|
||||
GROUP BY sub.addressFk
|
||||
) sub2 ON sub2.addressFk = t.addressFk AND t.id != sub2.id
|
||||
WHERE t.shipped BETWEEN vDated AND util.dayend(vDated)
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
AND al.code = 'FREE'
|
||||
AND al.code IN ('FREE', 'APPROVED')
|
||||
AND tp.ticketFk IS NULL
|
||||
GROUP BY sv.ticketFk
|
||||
HAVING liters <= vLitersMax
|
||||
|
|
|
@ -65,7 +65,7 @@ BEGIN
|
|||
) sub2 ON sub2.addressFk = t.addressFk AND t.id != sub2.id
|
||||
WHERE t.shipped BETWEEN vOriginDated AND util.dayend(vOriginDated)
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
AND al.code = 'FREE'
|
||||
AND al.code IN ('FREE', 'APPROVED')
|
||||
AND tp.ticketFk IS NULL
|
||||
GROUP BY sv.ticketFk
|
||||
HAVING futureId;
|
||||
|
|
|
@ -288,7 +288,7 @@ module.exports = Self => {
|
|||
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped
|
||||
FROM tmp.filter f
|
||||
LEFT JOIN alertLevel al ON al.id = f.alertLevel
|
||||
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
|
||||
WHERE (al.code IN ('FREE', 'APPROVED') OR f.alertLevel IS NULL)
|
||||
AND f.shipped >= ?`, [date]);
|
||||
stmts.push(stmt);
|
||||
|
||||
|
|
|
@ -299,7 +299,7 @@ module.exports = Self => {
|
|||
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped
|
||||
FROM tmp.filter f
|
||||
LEFT JOIN alertLevel al ON al.id = f.alertLevel
|
||||
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
|
||||
WHERE (al.code IN ('FREE', 'APPROVED') OR f.alertLevel IS NULL)
|
||||
AND f.shipped >= ?
|
||||
`, [date]);
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ module.exports = Self => {
|
|||
SELECT f.id ticketFk, f.clientFk, f.warehouseFk, f.shipped, f.lines, f.liters
|
||||
FROM tmp.filter f
|
||||
LEFT JOIN alertLevel al ON al.id = f.alertLevel
|
||||
WHERE (al.code = 'FREE' OR f.alertLevel IS NULL)
|
||||
WHERE (al.code IN ('FREE', 'APPROVED') OR f.alertLevel IS NULL)
|
||||
`);
|
||||
|
||||
stmts.push(stmt);
|
||||
|
|
Loading…
Reference in New Issue