From 980127937094b5d7b53e45acc5e6bb812b93b9a6 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 4 Apr 2024 13:28:29 +0200 Subject: [PATCH] refs #169673 item_getSimilar --- db/routines/vn/procedures/item_getSimilar.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/item_getSimilar.sql b/db/routines/vn/procedures/item_getSimilar.sql index a61898756..f79bed375 100644 --- a/db/routines/vn/procedures/item_getSimilar.sql +++ b/db/routines/vn/procedures/item_getSimilar.sql @@ -60,7 +60,11 @@ BEGIN (i.value8 <=> its.value8) match8, a.available, IFNULL(ip.counter, 0) `counter`, - IF(b.groupingMode = 1, b.grouping, b.packing) minQuantity, + CASE + WHEN b.groupingMode = 1 THEN b.grouping + WHEN b.groupingMode = 2 THEN b.packing + ELSE 1 + END AS minQuantity, iss.visible located FROM vn.item i JOIN cache.available a ON a.item_id = i.id