corrections
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alexandre Riera 2022-11-21 11:41:17 +01:00
parent edb495c744
commit 463e56b631
6 changed files with 14 additions and 9 deletions

View File

@ -7,3 +7,8 @@ BEGIN
CALL vn.ticket_canbePostponed(vDated,TIMESTAMPADD(DAY, vScopeDays, vDated),vLitersMax,vLinesMax,vWarehouseFk);
END $$
DELIMITER ;
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('Ticket', 'getTicketsFuture', 'READ', 'ALLOW', 'ROLE', 'employee'),
('Ticket', 'merge', 'WRITE', 'ALLOW', 'ROLE', 'employee');

View File

@ -76,3 +76,4 @@ BEGIN
HAVING liters <= IFNULL(vLitersMax, 9999) AND `lines` <= IFNULL(vLinesMax, 9999) AND ticketFuture;
END$$
DELIMITER ;

View File

@ -136,5 +136,5 @@
"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 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}}]({{{fullPath}}}) ({{{originDated}}}) merged with [{{tfId}}]({{{fullPathFuture}}}) ({{{futureDated}}})"
"Ticket merged": "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",
"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",
"MOVE_TICKET_CONFIRMATION": "Ticket [{{id}}]({{{fullPath}}}) ({{{originDated}}}) fusionado con [{{tfId}}]({{{fullPathFuture}}}) ({{{futureDated}}})"
"Ticket merged": "Ticket [{{id}}]({{{fullPath}}}) ({{{originDated}}}) fusionado con [{{tfId}}]({{{fullPathFuture}}}) ({{{futureDated}}})"
}

View File

@ -22,7 +22,7 @@ module.exports = Self => {
}
});
Self.merge = async (ctx, tickets, options) => {
Self.merge = async(ctx, tickets, options) => {
const httpRequest = ctx.req;
const $t = httpRequest.__;
const origin = httpRequest.headers.origin;
@ -42,7 +42,7 @@ module.exports = Self => {
for (let ticket of tickets) {
const fullPath = `${origin}/#!/ticket/${ticket.id}/summary`;
const fullPathFuture = `${origin}/#!/ticket/${ticket.ticketFuture}/summary`;
const message = $t('MOVE_TICKET_CONFIRMATION', {
const message = $t('Ticket merged', {
originDated: dateUtil.toString(new Date(ticket.originETD)),
futureDated: dateUtil.toString(new Date(ticket.destETD)),
id: ticket.id,
@ -51,13 +51,12 @@ module.exports = Self => {
fullPathFuture
});
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.Chat.sendCheckingPresence(ctx, ticket.workerFk, message);
};
if (tx) {
await tx.commit();
}
if (tx)
await tx.commit();
} catch (e) {
if (tx) await tx.rollback();
throw e;

View File

@ -5,7 +5,7 @@
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$authenticated",
"principalId": "employee",
"permission": "ALLOW"
}
]