From 2e15b35fd1ad0f827aa3859ebd54c463377442a4 Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 10 Apr 2024 14:01:03 +0200 Subject: [PATCH 1/3] fix: refs #7024 create exception for inventory --- db/routines/vn/procedures/entry_checkBooked.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/entry_checkBooked.sql b/db/routines/vn/procedures/entry_checkBooked.sql index 50990cd43..124614b1b 100644 --- a/db/routines/vn/procedures/entry_checkBooked.sql +++ b/db/routines/vn/procedures/entry_checkBooked.sql @@ -15,7 +15,7 @@ BEGIN FROM `entry` WHERE id = vSelf; - IF vIsBooked THEN + IF vIsBooked AND !@isModeInventory THEN CALL util.throw('Entry is already booked'); END IF; END$$ From 2c5c2ca5a74c43c0f4e34944531f38619859dc81 Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 10 Apr 2024 14:17:08 +0200 Subject: [PATCH 2/3] fix: refs #7024 fix condition sintax --- db/routines/vn/procedures/entry_checkBooked.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/entry_checkBooked.sql b/db/routines/vn/procedures/entry_checkBooked.sql index 124614b1b..3ca8c9642 100644 --- a/db/routines/vn/procedures/entry_checkBooked.sql +++ b/db/routines/vn/procedures/entry_checkBooked.sql @@ -15,7 +15,7 @@ BEGIN FROM `entry` WHERE id = vSelf; - IF vIsBooked AND !@isModeInventory THEN + IF vIsBooked AND NOT @isModeInventory THEN CALL util.throw('Entry is already booked'); END IF; END$$ From 68ca5d369c9c641785e523fd1be66943e134e988 Mon Sep 17 00:00:00 2001 From: pablone Date: Thu, 11 Apr 2024 07:33:31 +0200 Subject: [PATCH 3/3] fix: refs #7024 fix error on setting local variable --- db/routines/vn/procedures/inventoryMake.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/inventoryMake.sql b/db/routines/vn/procedures/inventoryMake.sql index a40093679..c50d75b05 100644 --- a/db/routines/vn/procedures/inventoryMake.sql +++ b/db/routines/vn/procedures/inventoryMake.sql @@ -232,8 +232,6 @@ BEGIN CLOSE cWarehouses; UPDATE config SET inventoried = vInventoryDate; - - SET @isModeInventory := FALSE; CREATE OR REPLACE TEMPORARY TABLE tEntryToDelete (INDEX(entryId)) ENGINE = MEMORY @@ -262,6 +260,8 @@ BEGIN FROM travel t JOIN tEntryToDelete tmp ON tmp.travelId = t.id; + SET @isModeInventory := FALSE; + DROP TEMPORARY TABLE IF EXISTS tEntryToDelete; COMMIT;