fixes #4632 Llamar al nuevo método back de guardar firmas de salix #1346

Merged
juan merged 15 commits from 4632-guardarFirmas-salix into dev 2023-03-16 09:53:51 +00:00
1 changed files with 8 additions and 3 deletions
Showing only changes of commit 6e2269b428 - Show all commits

View File

@ -114,12 +114,17 @@ module.exports = Self => {
fields: ['alertLevel']
}, myOptions);
if (ticketState.alertLevel >= 2 && !await gestDocExists(args.tickets[i])) {
const boxedAlertLevel = await models.AlertLevel.findOne({where: {code: 'PACKED'},
fields: ['id']
}, myOptions);
if (ticketState.alertLevel < boxedAlertLevel.id)
throw new UserError('This ticket cannot be signed because it has not been boxed');
else if (!await gestDocExists(args.tickets[i])) {
if (args.location) setLocation(args.tickets[i]);
await createGestDoc(args.tickets[i]);
await Self.rawSql(`CALL vn.ticket_setState(?, ?)`, [args.tickets[i], 'DELIVERED'], myOptions);
} else if (ticketState.alertLevel < 2)
throw new UserError('This ticket cannot be signed because it has not been boxed');
}
}
if (tx) await tx.commit();