feat newState refs #7642
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
573f5c8d28
commit
8dbdbdf23b
|
@ -140,7 +140,7 @@ module.exports = Self => {
|
|||
await models.TicketDms.create({ticketFk: ticket.id, dmsFk: dms[0].id}, myOptions);
|
||||
await ticket.updateAttribute('isSigned', true, myOptions);
|
||||
|
||||
const [{stateForTicket}] = await Self.rawSql(`
|
||||
const [{stateCode}] = await Self.rawSql(`
|
||||
SELECT
|
||||
IF((SUM(CASE WHEN est.code = 'DELIVERED' THEN 1 ELSE 0 END) = COUNT(*)),
|
||||
'DELIVERED','PARTIAL_DELIVERED') stateForTicket
|
||||
|
@ -149,7 +149,7 @@ module.exports = Self => {
|
|||
WHERE e.ticketFk = ?;
|
||||
`, [ticketId], myOptions);
|
||||
|
||||
await Self.rawSql(`CALL vn.ticket_setState(?, ?)`, [ticketId, stateForTicket], myOptions);
|
||||
await Self.rawSql(`CALL vn.ticket_setState(?, ?)`, [ticketId, stateCode], myOptions);
|
||||
|
||||
if (ticket?.address()?.province()?.country()?.code != 'ES' && ticket.cmrFk) {
|
||||
await models.Ticket.saveCmr(ctx, [ticketId], myOptions);
|
||||
|
|
Loading…
Reference in New Issue