Merge pull request 'feat: Avisar cuando no hay posibilidad de fichar refs #7669' (!2676) from 7669-Avisor-cuando-no-se-puede-fichar into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2676
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Carlos Andrés 2024-07-04 11:30:11 +00:00
commit d6f6df48f2
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 ;