From d65af6aaaac6c5cb85856d2f44f97bf327b26a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Wed, 3 Jul 2024 18:00:28 +0200 Subject: [PATCH 1/2] feat: Avisar cuando no hay posibilidad de fichar refs #7669 --- .../vn/procedures/workerTimeControl_direction.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/db/routines/vn/procedures/workerTimeControl_direction.sql b/db/routines/vn/procedures/workerTimeControl_direction.sql index f7a68e1e4..807dc46c6 100644 --- a/db/routines/vn/procedures/workerTimeControl_direction.sql +++ b/db/routines/vn/procedures/workerTimeControl_direction.sql @@ -9,6 +9,8 @@ BEGIN */ DECLARE vLastIn DATETIME ; DECLARE vIsMiddleOdd BOOLEAN ; + DECLARE vMailTo VARCHAR(50) DEFAULT NULL; + DECLARE vUserName VARCHAR(50) DEFAULT NULL; IF (vTimed IS NULL) THEN SET vTimed = util.VN_NOW(); @@ -57,5 +59,18 @@ BEGIN VALUES('in', NULL); END IF; + IF (SELECT option1 IS NULL AND option2 IS NULL FROM tmp.workerTimeControlDirection) THEN + SELECT CONCAT(u.name, '@verdnatura.es'), CONCAT(w.firstName, ' ', w.lastName) + INTO vMailTo, vUserName + FROM account.user u + JOIN worker w ON w.bossFk = u.id + WHERE w.id = vWorkerFk; + + CALL mail_insert( + vMailTo, + vMailTo, + 'Error al fichar', + CONCAT(vUserName, ' tiene problemas para fichar'); + END IF; END$$ DELIMITER ; From 989fa5ac5a3f2b101a38b85413f1552be9c3111f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Wed, 3 Jul 2024 18:10:02 +0200 Subject: [PATCH 2/2] feat: Avisar cuando no hay posibilidad de fichar refs #7669 --- db/routines/vn/procedures/workerTimeControl_direction.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/procedures/workerTimeControl_direction.sql b/db/routines/vn/procedures/workerTimeControl_direction.sql index 807dc46c6..8e807084c 100644 --- a/db/routines/vn/procedures/workerTimeControl_direction.sql +++ b/db/routines/vn/procedures/workerTimeControl_direction.sql @@ -70,7 +70,7 @@ BEGIN vMailTo, vMailTo, 'Error al fichar', - CONCAT(vUserName, ' tiene problemas para fichar'); + CONCAT(vUserName, ' tiene problemas para fichar')); END IF; END$$ DELIMITER ;