refs #4632 removed alert level id from code
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a99bd2577a
commit
6e2269b428
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue