From 6c4b1cd522ddafa1521af1daea938831695b0a7b Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 18 Sep 2024 11:37:47 +0200 Subject: [PATCH 1/2] fix(shelving_clean): less time por shelving removal --- db/routines/vn/procedures/shelving_clean.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/shelving_clean.sql b/db/routines/vn/procedures/shelving_clean.sql index d2cb7caad..2e913f19c 100644 --- a/db/routines/vn/procedures/shelving_clean.sql +++ b/db/routines/vn/procedures/shelving_clean.sql @@ -25,7 +25,7 @@ UPDATE shelving sh AND ( sh.parked IS NULL OR - sh.parked < TIMESTAMPADD(MONTH,-1,util.VN_CURDATE()) + sh.parked < TIMESTAMPADD(WEEK,-2,util.VN_CURDATE()) ) AND IF(code REGEXP '^[A-Za-z]{2}[0-9]', LEFT (code, 2) NOT IN ( SELECT DISTINCT LEFT(its.shelvingFk, 2) -- 2.40.1 From eb22a77e259b17bb9810e9dd4c4e4586d770503c Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 18 Sep 2024 11:48:50 +0200 Subject: [PATCH 2/2] fix: timesstampadd to interval --- db/routines/vn/procedures/shelving_clean.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/shelving_clean.sql b/db/routines/vn/procedures/shelving_clean.sql index 2e913f19c..0b29968bc 100644 --- a/db/routines/vn/procedures/shelving_clean.sql +++ b/db/routines/vn/procedures/shelving_clean.sql @@ -25,8 +25,9 @@ UPDATE shelving sh AND ( sh.parked IS NULL OR - sh.parked < TIMESTAMPADD(WEEK,-2,util.VN_CURDATE()) - ) + sh.parked < util.VN_CURDATE() - INTERVAL 2 WEEK + ) + AND IF(code REGEXP '^[A-Za-z]{2}[0-9]', LEFT (code, 2) NOT IN ( SELECT DISTINCT LEFT(its.shelvingFk, 2) FROM itemShelving its -- 2.40.1