Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-06-12 10:11:14 +02:00
commit b5ecf2e3b5
2 changed files with 38 additions and 32 deletions

View File

@ -72,16 +72,20 @@ 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 message = $t('Changed sale quantity', { const change = $t('Changes in sales', {
ticketId: sale.ticket().id,
itemId: sale.itemFk, itemId: sale.itemFk,
concept: sale.concept, concept: sale.concept,
oldQuantity: oldQuantity, oldQuantity: oldQuantity,
newQuantity: newQuantity, newQuantity: newQuantity,
ticketUrl: `${url}ticket/${sale.ticket().id}/sale`,
itemUrl: `${url}item/${sale.itemFk}/summary` itemUrl: `${url}item/${sale.itemFk}/summary`
}); });
const message = $t('Changed sale quantity', {
ticketId: sale.ticket().id,
changes: change,
ticketUrl: `${url}ticket/${sale.ticket().id}/sale`,
});
await models.Chat.sendCheckingPresence(ctx, salesPerson.id, message, myOptions); await models.Chat.sendCheckingPresence(ctx, salesPerson.id, message, myOptions);
} }

View File

@ -96,6 +96,7 @@ module.exports = Self => {
AND s.originalQuantity <> s.quantity AND s.originalQuantity <> s.quantity
`, [params.ticketFk], myOptions); `, [params.ticketFk], myOptions);
if (sales.length) {
let changes = ''; let changes = '';
const url = await models.Url.getUrl(); const url = await models.Url.getUrl();
const $t = ctx.req.__; const $t = ctx.req.__;
@ -120,6 +121,7 @@ module.exports = Self => {
}); });
await models.Chat.sendCheckingPresence(ctx, salesPersonFk, message, myOptions); await models.Chat.sendCheckingPresence(ctx, salesPersonFk, message, myOptions);
} }
}
await Self.rawSql(`CALL vn.ticket_setState(?, ?)`, [ticket.id, params.code], myOptions); await Self.rawSql(`CALL vn.ticket_setState(?, ?)`, [ticket.id, params.code], myOptions);
const ticketTracking = await models.TicketTracking.findOne({ const ticketTracking = await models.TicketTracking.findOne({