fix: getSimilar daysInForward
This commit is contained in:
parent
3ccc0c9b32
commit
fe741fa7e1
|
@ -52,13 +52,13 @@ BEGIN
|
|||
FROM vn.sale s
|
||||
JOIN vn.ticket t ON t.id = s.ticketFk
|
||||
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 t.warehouseFk = vWarehouseFk
|
||||
GROUP BY s.itemFk
|
||||
)
|
||||
SELECT i.id itemFk,
|
||||
CAST(sd.quantity AS INT) advanceable,
|
||||
LEAST(CAST(sd.quantity AS INT), sk.stock) advanceable,
|
||||
i.longName,
|
||||
i.subName,
|
||||
i.tag5,
|
||||
|
|
Loading…
Reference in New Issue