insert timeControl from procedure
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-10-17 14:01:23 +02:00
parent 8ce804a099
commit e1cea99cc0
1 changed files with 5 additions and 7 deletions

View File

@ -32,14 +32,12 @@ module.exports = Self => {
throw new UserError(`You don't have enough privileges`);
const subordinate = await Worker.findById(data.workerFk);
const timed = new Date(data.timed);
return Self.create({
userFk: subordinate.userFk,
timed: data.timed,
manual: 1
});
let offset = timed.getTimezoneOffset() * 60000;
timed.setTime(timed.getTime() - offset);
/* return Self.rawSql('CALL vn.workerTimeControl_add(?, ?, ?, ?)', [
subordinate.userFk, null, data.timed, true]); */
return Self.rawSql('CALL vn.workerTimeControl_add(?, ?, ?, ?)', [
subordinate.userFk, null, timed, true]);
};
};