From 5207f07c8031c46a5ad9215d819bbd7883a83f2a Mon Sep 17 00:00:00 2001 From: Sergio De la torre Date: Wed, 8 May 2024 10:03:11 +0200 Subject: [PATCH] refs #6276 hotFix:itemShelving_add --- db/routines/vn/procedures/itemShelving_add.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/itemShelving_add.sql b/db/routines/vn/procedures/itemShelving_add.sql index d4c31f09e..0bec9fb45 100644 --- a/db/routines/vn/procedures/itemShelving_add.sql +++ b/db/routines/vn/procedures/itemShelving_add.sql @@ -20,8 +20,11 @@ BEGIN SELECT barcodeToItem(vBarcode) INTO vItemFk; - SET vPacking = COALESCE(vPacking, GREATEST(vn.itemPacking(vBarcode,vWarehouseFk), 1)); - SET vQuantity = vQuantity * vPacking; + IF vPacking IS NULL + THEN + SET vPacking = itemPacking(vBarcode, vWarehouseFk); + SET vQuantity = vQuantity * vPacking; + END IF; IF (SELECT COUNT(*) FROM shelving WHERE code = vShelvingFk COLLATE utf8_unicode_ci) = 0 THEN