8524-devToTest #3415

Merged
alexm merged 343 commits from 8524-devToTest into test 2025-02-04 13:42:16 +00:00
1 changed files with 14 additions and 12 deletions
Showing only changes of commit 6ab0515f8e - Show all commits

View File

@ -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();