From 3a2acfb7f8e5e012704c9e3496375521416d06c8 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 8 Jul 2024 07:21:53 +0200 Subject: [PATCH] feat: refs #7640 Optimization --- db/routines/vn/procedures/multipleInventory.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/db/routines/vn/procedures/multipleInventory.sql b/db/routines/vn/procedures/multipleInventory.sql index 662aa2d63..941ac6c3d 100644 --- a/db/routines/vn/procedures/multipleInventory.sql +++ b/db/routines/vn/procedures/multipleInventory.sql @@ -40,8 +40,7 @@ proc: BEGIN (PRIMARY KEY (itemFk)) ENGINE = MEMORY SELECT itemFk, - SUM(quantity) quantity, - SUM(quantity) visible + SUM(quantity) quantity FROM ( SELECT s.itemFk, - s.quantity quantity FROM sale s @@ -78,7 +77,7 @@ proc: BEGIN UPDATE tmp.itemInventory ai JOIN tItemInventoryCalc iic ON iic.itemFk = ai.id SET ai.inventory = iic.quantity, - ai.visible = iic.visible, + ai.visible = iic.quantity, ai.avalaible = iic.quantity, ai.sd = iic.quantity;