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