feat: refs #6702 updatePrice message
This commit is contained in:
parent
46c4f4786a
commit
0652d11112
|
@ -123,7 +123,7 @@
|
||||||
"Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
|
"Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
|
||||||
"Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
"Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
||||||
"Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
"Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
||||||
"Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) {{ticketClone}} ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
"Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) {{ticketWeekly}} ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
||||||
"Changed sale quantity": "He cambiado {{changes}} del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
"Changed sale quantity": "He cambiado {{changes}} del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
||||||
"Changes in sales": "la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}*",
|
"Changes in sales": "la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}*",
|
||||||
"State": "Estado",
|
"State": "Estado",
|
||||||
|
@ -393,5 +393,7 @@
|
||||||
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero",
|
"There are tickets to be invoiced": "Hay tickets para esta zona, borralos primero",
|
||||||
"Price cannot be blank": "Price cannot be blank",
|
"Price cannot be blank": "Price cannot be blank",
|
||||||
"An item type with the same code already exists": "Un tipo con el mismo código ya existe",
|
"An item type with the same code already exists": "Un tipo con el mismo código ya existe",
|
||||||
"Holidays to past days not available": "Las vacaciones a días pasados no están disponibles"
|
"Holidays to past days not available": "Las vacaciones a días pasados no están disponibles",
|
||||||
|
"Is cloned": "Is cloned",
|
||||||
|
"Is cloned from": "Is cloned from"
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,8 @@ module.exports = Self => {
|
||||||
const salesPerson = sale.ticket().client().salesPersonUser();
|
const salesPerson = sale.ticket().client().salesPersonUser();
|
||||||
if (salesPerson) {
|
if (salesPerson) {
|
||||||
const url = await Self.app.models.Url.getUrl();
|
const url = await Self.app.models.Url.getUrl();
|
||||||
const ticketWeekly = await models.Sale.ticketClone(sale.id);
|
const ticketWeekly = await models.Sale.ticketWeekly(sale.id);
|
||||||
|
|
||||||
const message = $t('Changed sale price', {
|
const message = $t('Changed sale price', {
|
||||||
ticketId: sale.ticket().id,
|
ticketId: sale.ticket().id,
|
||||||
itemId: sale.itemFk,
|
itemId: sale.itemFk,
|
||||||
|
@ -123,7 +124,7 @@ module.exports = Self => {
|
||||||
newPrice: newPrice,
|
newPrice: newPrice,
|
||||||
ticketUrl: `${url}ticket/${sale.ticket().id}/sale`,
|
ticketUrl: `${url}ticket/${sale.ticket().id}/sale`,
|
||||||
itemUrl: `${url}item/${sale.itemFk}/summary`,
|
itemUrl: `${url}item/${sale.itemFk}/summary`,
|
||||||
ticketCloned: ticketWeekly && $t('Is cloned', ticketWeekly)
|
ticketWeekly: ticketWeekly ? `Is cloned from ticket ${ticketWeekly} de ` : null
|
||||||
});
|
});
|
||||||
await models.Chat.sendCheckingPresence(ctx, salesPerson.id, message, myOptions);
|
await models.Chat.sendCheckingPresence(ctx, salesPerson.id, message, myOptions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,11 +137,19 @@ module.exports = Self => {
|
||||||
throw new UserError('The price of the item changed');
|
throw new UserError('The price of the item changed');
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.isCloned = async function(saleId) {
|
Self.ticketWeekly = async function(saleId) {
|
||||||
// let userId = ctx.req.accessToken.userId;
|
const SaleCloned = Self.app.models.SaleCloned;
|
||||||
// return await Self.findById(userId, {
|
|
||||||
// fields: ['id', 'name', 'nickname']
|
const saleCloned2 = await SaleCloned.findOne({
|
||||||
// });
|
where: {
|
||||||
// return ticketId
|
saleClonedFk: saleId
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
relation: 'saleOriginal'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return saleCloned2.saleOriginal()?.ticketFk;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue