8062-testToMaster_2 #3059
|
@ -52,13 +52,13 @@ BEGIN
|
||||||
FROM vn.sale s
|
FROM vn.sale s
|
||||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||||
LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id
|
LEFT JOIN vn.itemShelvingSale iss ON iss.saleFk = s.id
|
||||||
WHERE t.shipped BETWEEN CURDATE() AND CURDATE() + INTERVAL vDaysInForward DAY
|
WHERE t.shipped >= CURDATE() + INTERVAL vDaysInForward DAY
|
||||||
AND iss.saleFk IS NULL
|
AND iss.saleFk IS NULL
|
||||||
AND t.warehouseFk = vWarehouseFk
|
AND t.warehouseFk = vWarehouseFk
|
||||||
GROUP BY s.itemFk
|
GROUP BY s.itemFk
|
||||||
)
|
)
|
||||||
SELECT i.id itemFk,
|
SELECT i.id itemFk,
|
||||||
CAST(sd.quantity AS INT) advanceable,
|
LEAST(CAST(sd.quantity AS INT), sk.stock) advanceable,
|
||||||
i.longName,
|
i.longName,
|
||||||
i.subName,
|
i.subName,
|
||||||
i.tag5,
|
i.tag5,
|
||||||
|
|
Loading…
Reference in New Issue