This commit is contained in:
parent
9299d8f86c
commit
340a8c119e
|
@ -140,14 +140,7 @@ module.exports = Self => {
|
||||||
await models.TicketDms.create({ticketFk: ticket.id, dmsFk: dms[0].id}, myOptions);
|
await models.TicketDms.create({ticketFk: ticket.id, dmsFk: dms[0].id}, myOptions);
|
||||||
await ticket.updateAttribute('isSigned', true, myOptions);
|
await ticket.updateAttribute('isSigned', true, myOptions);
|
||||||
|
|
||||||
const deliveryState = await models.State.findOne({
|
await Self.rawSql(`CALL vn.ticket_setState(?, ?)`, [params.ticketFk, params.code], myOptions);
|
||||||
where: {code: 'DELIVERED'}
|
|
||||||
}, myOptions);
|
|
||||||
|
|
||||||
await models.Ticket.state(ctx, {
|
|
||||||
ticketFk: ticketId,
|
|
||||||
stateFk: deliveryState.id
|
|
||||||
}, myOptions);
|
|
||||||
|
|
||||||
if (ticket?.address()?.province()?.country()?.code != 'ES' && ticket.cmrFk) {
|
if (ticket?.address()?.province()?.country()?.code != 'ES' && ticket.cmrFk) {
|
||||||
await models.Ticket.saveCmr(ctx, [ticketId], myOptions);
|
await models.Ticket.saveCmr(ctx, [ticketId], myOptions);
|
||||||
|
|
Loading…
Reference in New Issue