fix rocket message and order table
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alexandre Riera 2022-11-15 13:03:55 +01:00
parent 7dd87b1ea8
commit 01607c71b6
4 changed files with 10 additions and 6 deletions

View File

@ -136,5 +136,5 @@
"Not enough privileges to edit a client": "Not enough privileges to edit a client", "Not enough privileges to edit a client": "Not enough privileges to edit a client",
"You don't have grant privilege": "You don't have grant privilege", "You don't have grant privilege": "You don't have grant privilege",
"You don't own the role and you can't assign it to another user": "You don't own the role and you can't assign it to another user", "You don't own the role and you can't assign it to another user": "You don't own the role and you can't assign it to another user",
"MOVE_TICKET_CONFIRMATION": "Ticket {{id}} ({{originDated}}) merged with {{tfId}} ({{futureDated}}) [{{fullPath}}]" "MOVE_TICKET_CONFIRMATION": "Ticket [{{id}}]({{{fullPath}}}) ({{{originDated}}}) merged with [{{tfId}}]({{{fullPathFuture}}}) ({{{futureDated}}})"
} }

View File

@ -238,5 +238,5 @@
"Not enough privileges to edit a client": "No tienes suficientes privilegios para editar un cliente", "Not enough privileges to edit a client": "No tienes suficientes privilegios para editar un cliente",
"You don't have grant privilege": "No tienes privilegios para dar privilegios", "You don't have grant privilege": "No tienes privilegios para dar privilegios",
"You don't own the role and you can't assign it to another user": "No eres el propietario del rol y no puedes asignarlo a otro usuario", "You don't own the role and you can't assign it to another user": "No eres el propietario del rol y no puedes asignarlo a otro usuario",
"MOVE_TICKET_CONFIRMATION": "Ticket {{id}} ({{originDated}}) fusionado con {{tfId}} ({{futureDated}}) [{{fullPath}}]" "MOVE_TICKET_CONFIRMATION": "Ticket [{{id}}]({{{fullPath}}}) ({{{originDated}}}) fusionado con [{{tfId}}]({{{fullPathFuture}}}) ({{{futureDated}}})"
} }

View File

@ -203,8 +203,10 @@ module.exports = Self => {
if (hasWhere) { if (hasWhere) {
filter = mergeFilters(filter, { where: problems }); filter = mergeFilters(filter, { where: problems });
} }
stmt.merge(conn.makeWhere(filter.where));
stmt.merge(conn.makeWhere(filter.where));
stmt.merge(conn.makeOrderBy(filter.order));
stmt.merge(conn.makeLimit(filter));
const ticketsIndex = stmts.push(stmt) - 1; const ticketsIndex = stmts.push(stmt) - 1;

View File

@ -38,18 +38,20 @@ module.exports = Self => {
try { try {
for (let ticket of tickets) { for (let ticket of tickets) {
const fullPath = `${origin}/#!/ticket/${ticket.ticketFuture}/summary`; const fullPath = `${origin}/#!/ticket/${ticket.id}/summary`;
const fullPathFuture = `${origin}/#!/ticket/${ticket.ticketFuture}/summary`;
const message = $t('MOVE_TICKET_CONFIRMATION', { const message = $t('MOVE_TICKET_CONFIRMATION', {
originDated: new Date(ticket.originETD).toLocaleDateString('es-ES'), originDated: new Date(ticket.originETD).toLocaleDateString('es-ES'),
futureDated: new Date(ticket.destETD).toLocaleDateString('es-ES'), futureDated: new Date(ticket.destETD).toLocaleDateString('es-ES'),
id: ticket.id, id: ticket.id,
tfId: ticket.ticketFuture, tfId: ticket.ticketFuture,
fullPath fullPath,
fullPathFuture
}); });
if (!ticket.id || !ticket.ticketFuture) continue; if (!ticket.id || !ticket.ticketFuture) continue;
await models.Sale.updateAll({ ticketFk: ticket.id }, { ticketFk: ticket.ticketFuture }, myOptions); await models.Sale.updateAll({ ticketFk: ticket.id }, { ticketFk: ticket.ticketFuture }, myOptions);
await models.Ticket.setDeleted(ctx, ticket.id, myOptions); await models.Ticket.setDeleted(ctx, ticket.id, myOptions);
await models.Chat.sendCheckingPresence(ctx, ticket.workerFk, message); await models.Chat.sendCheckingPresence(ctx, 1, message);
}; };
if (tx) { if (tx) {
await tx.commit(); await tx.commit();