diff --git a/db/routines/vn/procedures/available_traslate.sql b/db/routines/vn/procedures/available_traslate.sql index 44b76d0c2..ad442a724 100644 --- a/db/routines/vn/procedures/available_traslate.sql +++ b/db/routines/vn/procedures/available_traslate.sql @@ -103,7 +103,7 @@ proc: BEGIN CALL item_getAtp(vDated); - CREATE OR REPLACE TEMPORARY TABLE availableTraslate + CREATE OR REPLACE TEMPORARY TABLE tmp.availableTraslate (PRIMARY KEY (item_id)) ENGINE = MEMORY SELECT t.item_id, SUM(stock) available diff --git a/db/routines/vn/procedures/entry_getTransfer.sql b/db/routines/vn/procedures/entry_getTransfer.sql index e7ddcea31..165c87dc7 100644 --- a/db/routines/vn/procedures/entry_getTransfer.sql +++ b/db/routines/vn/procedures/entry_getTransfer.sql @@ -68,19 +68,19 @@ BEGIN AND v.`visible` ON DUPLICATE KEY UPDATE visibleLanding = v.`visible`; - CALL vn.available_traslate(vWarehouseOut, vDateShipped, NULL); + CALL available_traslate(vWarehouseOut, vDateShipped, NULL); INSERT INTO tItem(itemFk, available) SELECT a.item_id, a.available - FROM availableTraslate a + FROM tmp.availableTraslate a WHERE a.available ON DUPLICATE KEY UPDATE available = a.available; - CALL vn.available_traslate(vWarehouseIn, vDateLanded, vWarehouseOut); + CALL available_traslate(vWarehouseIn, vDateLanded, vWarehouseOut); INSERT INTO tItem(itemFk, availableLanding) SELECT a.item_id, a.available - FROM availableTraslate a + FROM tmp.availableTraslate a WHERE a.available ON DUPLICATE KEY UPDATE availableLanding = a.available; ELSE