refactor: refs #7640 multipleInventoryFix #2689
|
@ -40,8 +40,7 @@ proc: BEGIN
|
||||||
(PRIMARY KEY (itemFk))
|
(PRIMARY KEY (itemFk))
|
||||||
ENGINE = MEMORY
|
ENGINE = MEMORY
|
||||||
SELECT itemFk,
|
SELECT itemFk,
|
||||||
SUM(quantity) quantity,
|
SUM(quantity) quantity
|
||||||
SUM(quantity) visible
|
|
||||||
FROM (
|
FROM (
|
||||||
SELECT s.itemFk, - s.quantity quantity
|
SELECT s.itemFk, - s.quantity quantity
|
||||||
FROM sale s
|
FROM sale s
|
||||||
|
@ -78,7 +77,7 @@ proc: BEGIN
|
||||||
UPDATE tmp.itemInventory ai
|
UPDATE tmp.itemInventory ai
|
||||||
JOIN tItemInventoryCalc iic ON iic.itemFk = ai.id
|
JOIN tItemInventoryCalc iic ON iic.itemFk = ai.id
|
||||||
SET ai.inventory = iic.quantity,
|
SET ai.inventory = iic.quantity,
|
||||||
ai.visible = iic.visible,
|
ai.visible = iic.quantity,
|
||||||
ai.avalaible = iic.quantity,
|
ai.avalaible = iic.quantity,
|
||||||
ai.sd = iic.quantity;
|
ai.sd = iic.quantity;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue