refs #4856 feat: se envia el registro a todos los teletrabajadores. Tmb se pone estado 'SENDED' cuando se da a 'Reenviar'
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
8f2735e126
commit
d066c4ea0b
|
@ -131,20 +131,10 @@ module.exports = Self => {
|
||||||
JOIN business b ON b.id = tb.businessFk
|
JOIN business b ON b.id = tb.businessFk
|
||||||
LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk AND tc.dated = tb.dated
|
LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk AND tc.dated = tb.dated
|
||||||
LEFT JOIN worker w ON w.id = u.id
|
LEFT JOIN worker w ON w.id = u.id
|
||||||
JOIN (SELECT tb.userFk,
|
WHERE IFNULL(?, u.id) = u.id
|
||||||
SUM(IF(tb.type IS NULL,
|
|
||||||
IF(tc.timeWorkDecimal > 0, FALSE, IF(tb.timeWorkDecimal > 0, TRUE, FALSE)),
|
|
||||||
TRUE))isTeleworkingWeek
|
|
||||||
FROM tmp.timeBusinessCalculate tb
|
|
||||||
LEFT JOIN tmp.timeControlCalculate tc ON tc.userFk = tb.userFk
|
|
||||||
AND tc.dated = tb.dated
|
|
||||||
GROUP BY tb.userFk
|
|
||||||
HAVING isTeleworkingWeek > 0
|
|
||||||
)sub ON sub.userFk = u.id
|
|
||||||
WHERE d.hasToRefill
|
|
||||||
AND IFNULL(?, u.id) = u.id
|
|
||||||
AND b.companyCodeFk = 'VNL'
|
AND b.companyCodeFk = 'VNL'
|
||||||
AND w.businessFk
|
AND w.businessFk
|
||||||
|
AND d.isTeleworking
|
||||||
ORDER BY u.id, tb.dated
|
ORDER BY u.id, tb.dated
|
||||||
`, [args.workerId]);
|
`, [args.workerId]);
|
||||||
const index = stmts.push(stmt) - 1;
|
const index = stmts.push(stmt) - 1;
|
||||||
|
|
|
@ -379,6 +379,20 @@ class Controller extends Section {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isSended() {
|
||||||
|
const params = {
|
||||||
|
workerId: this.worker.id,
|
||||||
|
year: this.date.getFullYear(),
|
||||||
|
week: this.weekNumber,
|
||||||
|
state: 'SENDED'
|
||||||
|
};
|
||||||
|
const query = `WorkerTimeControls/updateWorkerTimeControlMail`;
|
||||||
|
this.$http.post(query, params).then(() => {
|
||||||
|
this.getMailStates(this.date);
|
||||||
|
this.getWeekData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
changeState(state, reason) {
|
changeState(state, reason) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
|
@ -412,6 +426,7 @@ class Controller extends Section {
|
||||||
};
|
};
|
||||||
this.$http.post(`WorkerTimeControls/weekly-hour-hecord-email`, params)
|
this.$http.post(`WorkerTimeControls/weekly-hour-hecord-email`, params)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
this.isSended();
|
||||||
this.vnApp.showSuccess(this.$t('Email sended'));
|
this.vnApp.showSuccess(this.$t('Email sended'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue