From 00353186e65c2371318fb2ab19b1e2f9ee2eb6cc Mon Sep 17 00:00:00 2001 From: robert Date: Tue, 26 Nov 2024 09:03:22 +0100 Subject: [PATCH 1/2] fix: refs #8124 workCenterFk por commissionWorkCenterFk --- db/routines/vn/procedures/route_calcCommission.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/routines/vn/procedures/route_calcCommission.sql b/db/routines/vn/procedures/route_calcCommission.sql index afca4564d..ab47e8281 100644 --- a/db/routines/vn/procedures/route_calcCommission.sql +++ b/db/routines/vn/procedures/route_calcCommission.sql @@ -68,7 +68,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.commissionWorkCenterFk WHERE r.id = vSelf AND r.workerFk AND r.commissionWorkCenterFk; @@ -100,7 +100,7 @@ BEGIN FROM route r JOIN vehicle v ON v.id = r.vehicleFk JOIN routeConfig rc - LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.workCenterFk + LEFT JOIN workCenterCommission wc ON wc.workCenterFk = r.commissionWorkCenterFk WHERE r.id = vSelf AND r.kmStart AND r.kmEnd From 0cbaac91c2e8dc8e8de936d852531144bd26efad Mon Sep 17 00:00:00 2001 From: pablone Date: Tue, 26 Nov 2024 09:06:25 +0100 Subject: [PATCH 2/2] fix: refs #8087 correct SQL join condition in entry_beforeUpdate trigger --- db/routines/vn/triggers/entry_beforeUpdate.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/triggers/entry_beforeUpdate.sql b/db/routines/vn/triggers/entry_beforeUpdate.sql index 1d0c26fc1..66b36a861 100644 --- a/db/routines/vn/triggers/entry_beforeUpdate.sql +++ b/db/routines/vn/triggers/entry_beforeUpdate.sql @@ -41,7 +41,7 @@ BEGIN SELECT isRaid INTO vIsRaid FROM travel t JOIN entry e ON e.travelFk = t.id - WHERE entryFk = NEW.id; + WHERE t.entryFk = NEW.id; SELECT NOT (o.warehouseInFk <=> n.warehouseInFk) OR NOT (o.warehouseOutFk <=> n.warehouseOutFk)