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