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,21 +40,23 @@ module.exports = Self => {
try { try {
for (let ticket of tickets) { for (let ticket of tickets) {
const originFullPath = `${url}ticket/${ticket.originId}/summary`;
const destinationFullPath = `${url}ticket/${ticket.destinationId}/summary`;
const message = $t('Ticket merged', {
originDated: dateUtil.toString(new Date(ticket.originShipped)),
destinationDated: dateUtil.toString(new Date(ticket.destinationShipped)),
originId: ticket.originId,
destinationId: ticket.destinationId,
originFullPath,
destinationFullPath
});
if (!ticket.originId || !ticket.destinationId) continue; if (!ticket.originId || !ticket.destinationId) continue;
await models.Sale.updateAll({ticketFk: ticket.originId}, {ticketFk: ticket.destinationId}, myOptions); await models.Sale.updateAll({ticketFk: ticket.originId}, {ticketFk: ticket.destinationId}, myOptions);
if (await models.Ticket.setDeleted(ctx, ticket.originId, myOptions)) if (await models.Ticket.setDeleted(ctx, ticket.originId, myOptions)) {
await models.Chat.sendCheckingPresence(ctx, ticket.workerFk, message); if (!ticket.salesPersonFk) continue;
const originFullPath = `${url}ticket/${ticket.originId}/summary`;
const destinationFullPath = `${url}ticket/${ticket.destinationId}/summary`;
const message = $t('Ticket merged', {
originDated: dateUtil.toString(new Date(ticket.originShipped)),
destinationDated: dateUtil.toString(new Date(ticket.destinationShipped)),
originId: ticket.originId,
destinationId: ticket.destinationId,
originFullPath,
destinationFullPath
});
await models.Chat.sendCheckingPresence(ctx, ticket.salesPersonFk, message);
}
} }
if (tx) if (tx)
await tx.commit(); await tx.commit();