fixes #4632 Llamar al nuevo método back de guardar firmas de salix #1346
|
@ -114,12 +114,17 @@ module.exports = Self => {
|
||||||
fields: ['alertLevel']
|
fields: ['alertLevel']
|
||||||
}, myOptions);
|
}, 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]);
|
if (args.location) setLocation(args.tickets[i]);
|
||||||
await createGestDoc(args.tickets[i]);
|
await createGestDoc(args.tickets[i]);
|
||||||
await Self.rawSql(`CALL vn.ticket_setState(?, ?)`, [args.tickets[i], 'DELIVERED'], myOptions);
|
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();
|
if (tx) await tx.commit();
|
||||||
|
|
Loading…
Reference in New Issue