feat: Avisar cuando no hay posibilidad de fichar refs #7669 #2676

Merged
carlosap merged 2 commits from 7669-Avisor-cuando-no-se-puede-fichar into dev 2024-07-04 11:30:13 +00:00
1 changed files with 15 additions and 0 deletions

View File

@ -9,6 +9,8 @@ BEGIN
*/ */
DECLARE vLastIn DATETIME ; DECLARE vLastIn DATETIME ;
DECLARE vIsMiddleOdd BOOLEAN ; DECLARE vIsMiddleOdd BOOLEAN ;
DECLARE vMailTo VARCHAR(50) DEFAULT NULL;
DECLARE vUserName VARCHAR(50) DEFAULT NULL;
IF (vTimed IS NULL) THEN IF (vTimed IS NULL) THEN
SET vTimed = util.VN_NOW(); SET vTimed = util.VN_NOW();
@ -57,5 +59,18 @@ BEGIN
VALUES('in', NULL); VALUES('in', NULL);
END IF; 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$$ END$$
DELIMITER ; DELIMITER ;