diff --git a/modules/worker/back/methods/worker-time-control/sendMail.js b/modules/worker/back/methods/worker-time-control/sendMail.js index 793a8b4d9..51f6a7cf3 100644 --- a/modules/worker/back/methods/worker-time-control/sendMail.js +++ b/modules/worker/back/methods/worker-time-control/sendMail.js @@ -165,9 +165,8 @@ module.exports = Self => { for (let day of days[index]) { workerFk = day.workerFk; - console.log(day); if (day.timeWorkDecimal > 0 && day.timeWorkedDecimal == null - && (day.permissionRate ? day.permissionRate : true)) { + && (day.permissionRate == null ? true : day.permissionRate)) { if (day.timeTable == null) { const timed = new Date(day.dated); await models.WorkerTimeControl.create({ @@ -314,7 +313,7 @@ module.exports = Self => { }, myOptions); if (firstWorkerTimeControl) - firstWorkerTimeControl.updateAttribute('direction', 'in', myOptions); + await firstWorkerTimeControl.updateAttribute('direction', 'in', myOptions); const lastWorkerTimeControl = await models.WorkerTimeControl.findOne({ where: { @@ -325,7 +324,7 @@ module.exports = Self => { }, myOptions); if (lastWorkerTimeControl) - lastWorkerTimeControl.updateAttribute('direction', 'out', myOptions); + await lastWorkerTimeControl.updateAttribute('direction', 'out', myOptions); } } diff --git a/modules/worker/back/methods/worker-time-control/weeklyHourRecordEmail.js b/modules/worker/back/methods/worker-time-control/weeklyHourRecordEmail.js index 0cf614e57..6feadb936 100644 --- a/modules/worker/back/methods/worker-time-control/weeklyHourRecordEmail.js +++ b/modules/worker/back/methods/worker-time-control/weeklyHourRecordEmail.js @@ -2,7 +2,7 @@ const {Email} = require('vn-print'); module.exports = Self => { Self.remoteMethodCtx('weeklyHourRecordEmail', { - description: 'Sends the buyer waste email', + description: 'Sends the weekly hour record', accessType: 'WRITE', accepts: [ {