8524-devToTest #3415
|
@ -40,6 +40,11 @@ module.exports = Self => {
|
|||
|
||||
try {
|
||||
for (let ticket of tickets) {
|
||||
if (!ticket.originId || !ticket.destinationId) continue;
|
||||
|
||||
await models.Sale.updateAll({ticketFk: ticket.originId}, {ticketFk: ticket.destinationId}, myOptions);
|
||||
if (await models.Ticket.setDeleted(ctx, ticket.originId, myOptions)) {
|
||||
if (!ticket.salesPersonFk) continue;
|
||||
const originFullPath = `${url}ticket/${ticket.originId}/summary`;
|
||||
const destinationFullPath = `${url}ticket/${ticket.destinationId}/summary`;
|
||||
const message = $t('Ticket merged', {
|
||||
|
@ -50,11 +55,8 @@ module.exports = Self => {
|
|||
originFullPath,
|
||||
destinationFullPath
|
||||
});
|
||||
if (!ticket.originId || !ticket.destinationId) continue;
|
||||
|
||||
await models.Sale.updateAll({ticketFk: ticket.originId}, {ticketFk: ticket.destinationId}, myOptions);
|
||||
if (await models.Ticket.setDeleted(ctx, ticket.originId, myOptions))
|
||||
await models.Chat.sendCheckingPresence(ctx, ticket.workerFk, message);
|
||||
await models.Chat.sendCheckingPresence(ctx, ticket.salesPersonFk, message);
|
||||
}
|
||||
}
|
||||
if (tx)
|
||||
await tx.commit();
|
||||
|
|
Loading…
Reference in New Issue