feat: Avisar cuando no hay posibilidad de fichar refs #7669
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Carlos Andrés 2024-07-03 18:00:28 +02:00
parent 5500a6f085
commit d65af6aaaa
1 changed files with 15 additions and 0 deletions

View File

@ -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 ;