This commit is contained in:
parent
fb58ab5bd2
commit
4a74015fc5
|
@ -16,11 +16,11 @@ BEGIN
|
|||
DECLARE vBuyFk INT;
|
||||
|
||||
SELECT b.id INTO vBuyFk
|
||||
FROM vn.buy b
|
||||
JOIN vn.entry e ON e.id = b.entryFk
|
||||
JOIN vn.travel t ON t.id = e.travelFk
|
||||
WHERE e.id <> (SELECT defaultEntry FROM vn.entryConfig)
|
||||
AND e.supplierFk <> (SELECT supplierFk FROM vn.inventoryConfig)
|
||||
FROM buy b
|
||||
JOIN entry e ON e.id = b.entryFk
|
||||
JOIN travel t ON t.id = e.travelFk
|
||||
WHERE e.id <> (SELECT defaultEntry FROM entryConfig)
|
||||
AND e.supplierFk <> (SELECT supplierFk FROM inventoryConfig)
|
||||
AND e.typeFk <> 'inventory'
|
||||
AND b.itemFk = vItemFk
|
||||
AND (t.warehouseInFk = vWarehouseFk OR t.warehouseInFk IS NULL)
|
||||
|
|
Loading…
Reference in New Issue