From c819b921412792baee8b53a165bad10bb81c0f62 Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 26 Apr 2024 09:09:22 +0200 Subject: [PATCH] fix: refs #177968 restore restriction --- db/routines/vn/procedures/sale_replaceItem.sql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/sale_replaceItem.sql b/db/routines/vn/procedures/sale_replaceItem.sql index 9a431020b..e50f83b7f 100644 --- a/db/routines/vn/procedures/sale_replaceItem.sql +++ b/db/routines/vn/procedures/sale_replaceItem.sql @@ -81,6 +81,10 @@ BEGIN ORDER BY (vQuantity % `grouping`) ASC LIMIT 1; + IF vNewPrice IS NULL THEN + CALL util.throw('price retrieval failed'); + END IF; + IF vNewPrice > vOldPrice THEN SET vFinalPrice = vOldPrice; SET vOption = 'substitution'; @@ -103,7 +107,8 @@ BEGIN price) SELECT vTicketFk, vNewItemFk, - CEIL(vQuantity / vRoundQuantity) * vRoundQuantity, CONCAT('+ ', i.name), + CEIL(vQuantity / vRoundQuantity) * vRoundQuantity, + CONCAT('+ ', i.name), vFinalPrice FROM vn.item i WHERE id = vNewItemFk; -- 2.40.1