refactor: refs #7640 multipleInventoryFix #2689

Merged
guillermo merged 4 commits from 7640-multipleInventoryFix into master 2024-07-08 05:52:52 +00:00
1 changed files with 2 additions and 3 deletions
Showing only changes of commit 3a2acfb7f8 - Show all commits

View File

@ -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;