From f3612c7ee393150313e84d050cb84659e7919de3 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 12 Jul 2024 09:42:10 +0200 Subject: [PATCH] fix: refs #7580 --- db/routines/vn/procedures/setParking.sql | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/db/routines/vn/procedures/setParking.sql b/db/routines/vn/procedures/setParking.sql index 7d0c52919..1aa4f920a 100644 --- a/db/routines/vn/procedures/setParking.sql +++ b/db/routines/vn/procedures/setParking.sql @@ -31,19 +31,17 @@ BEGIN START TRANSACTION; - IF vParam REGEXP '^[0-9]+$' THEN - SET vLastWeek = util.VN_CURDATE() - INTERVAL 1 WEEK; + SET vLastWeek = util.VN_CURDATE() - INTERVAL 1 WEEK; - -- Comprobamos si es una prep. previa, ticket, colección o shelving - IF (SELECT TRUE FROM saleGroup WHERE id = vParam) THEN - CALL saleGroup_setParking(vParam, vParkingFk); - ELSEIF (SELECT TRUE FROM ticket WHERE id = vParam AND shipped >= vLastWeek) THEN - CALL ticket_setParking(vParam, vParkingFk); - ELSEIF (SELECT TRUE FROM `collection` WHERE id = vParam AND created >= vLastWeek) THEN - CALL collection_setParking(vParam, vParkingFk); - ELSEIF (SELECT TRUE FROM shelving WHERE code = vParam COLLATE utf8_unicode_ci) THEN - CALL shelving_setParking(vParam, vParkingFk); - END IF; + -- Comprobamos si es una prep. previa, ticket, colección o shelving + IF (SELECT TRUE FROM saleGroup WHERE id = vParam) THEN + CALL saleGroup_setParking(vParam, vParkingFk); + ELSEIF (SELECT TRUE FROM ticket WHERE id = vParam AND shipped >= vLastWeek) THEN + CALL ticket_setParking(vParam, vParkingFk); + ELSEIF (SELECT TRUE FROM `collection` WHERE id = vParam AND created >= vLastWeek) THEN + CALL collection_setParking(vParam, vParkingFk); + ELSEIF (SELECT TRUE FROM shelving WHERE code = vParam COLLATE utf8_unicode_ci) THEN + CALL shelving_setParking(vParam, vParkingFk); ELSE CALL util.throw('paramNotExist'); END IF;