From 3ddf49da0afdbd00b7f4c8466668149b439cacc1 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 5 Jul 2024 13:21:07 +0200 Subject: [PATCH] feat: refs #7640 Fix --- db/routines/vn/procedures/multipleInventory.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/multipleInventory.sql b/db/routines/vn/procedures/multipleInventory.sql index 704a93152..8eb4dae71 100644 --- a/db/routines/vn/procedures/multipleInventory.sql +++ b/db/routines/vn/procedures/multipleInventory.sql @@ -119,9 +119,9 @@ proc: BEGIN UPDATE tmp.itemInventory ai JOIN tItemInventoryCalc iic ON iic.itemFk = ai.id - JOIN tItemVisibleCalc ivc ON ivc.itemFk = ai.id + LEFT JOIN tItemVisibleCalc ivc ON ivc.itemFk = iic.itemFk SET ai.inventory = iic.quantity, - ai.visible = iic.quantity + ivc.visible, + ai.visible = iic.visible + IFNULL(ivc.visible, 0), ai.avalaible = iic.quantity, ai.sd = iic.quantity;