231801_test_to_master #1519

Merged
alexm merged 490 commits from 231801_test_to_master into master 2023-05-12 06:29:59 +00:00
2 changed files with 17 additions and 12 deletions
Showing only changes of commit d066c4ea0b - Show all commits

View File

@ -131,20 +131,10 @@ module.exports = Self => {
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 worker w ON w.id = u.id
JOIN (SELECT tb.userFk,
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
WHERE IFNULL(?, u.id) = u.id
AND b.companyCodeFk = 'VNL'
AND w.businessFk
AND d.isTeleworking
ORDER BY u.id, tb.dated
`, [args.workerId]);
const index = stmts.push(stmt) - 1;

View File

@ -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) {
this.state = state;
this.reason = reason;
@ -412,6 +426,7 @@ class Controller extends Section {
};
this.$http.post(`WorkerTimeControls/weekly-hour-hecord-email`, params)
.then(() => {
this.isSended();
this.vnApp.showSuccess(this.$t('Email sended'));
});
}