dev #1731

Merged
jgallego merged 105 commits from dev into test 2023-08-31 09:13:29 +00:00
1 changed files with 3 additions and 9 deletions
Showing only changes of commit beeebbdf9c - Show all commits

View File

@ -180,10 +180,8 @@ module.exports = Self => {
const workerTimeControlConfig = await models.WorkerTimeControlConfig.findOne(null, myOptions);
for (let day of days[index]) {
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
try {
workerFk = day.workerFk;
if (day.timeWorkDecimal > 0 && day.timeWorkedDecimal == null
@ -368,10 +366,7 @@ module.exports = Self => {
previousReceiver = day.receiver;
}
if (tx) {
await tx.commit();
delete myOptions.transaction;
}
if (tx) await tx.commit();
} catch (e) {
const stmts = [];
let stmt;
@ -394,7 +389,6 @@ module.exports = Self => {
previousReceiver = day.receiver;
if (tx) await tx.rollback();
delete myOptions.transaction;
continue;
}