fix: refs #7028 requesterId fix salesPerson
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-12-16 11:58:21 +01:00
parent 576641d09d
commit 5f43c0440c
2 changed files with 6 additions and 6 deletions

View File

@ -97,8 +97,8 @@ module.exports = Self => {
const query = `CALL vn.sale_calculateComponent(?, NULL)`; const query = `CALL vn.sale_calculateComponent(?, NULL)`;
await Self.rawSql(query, [sale.id], myOptions); await Self.rawSql(query, [sale.id], myOptions);
const requesterId = request.ticket().client().salesPersonFk; const salesPerson = request.ticket().client().salesPersonFk;
if (requesterId) { if (salesPerson) {
const url = await Self.app.models.Url.getUrl(); const url = await Self.app.models.Url.getUrl();
const message = $t('Bought units from buy request', { const message = $t('Bought units from buy request', {
quantity: sale.quantity, quantity: sale.quantity,
@ -108,7 +108,7 @@ module.exports = Self => {
url: `${url}ticket/${sale.ticketFk}/summary`, url: `${url}ticket/${sale.ticketFk}/summary`,
urlItem: `${url}item/${sale.itemFk}/summary` urlItem: `${url}item/${sale.itemFk}/summary`
}); });
await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions); await models.Chat.sendCheckingPresence(ctx, salesPerson, message, myOptions);
} }
if (tx) await tx.commit(); if (tx) await tx.commit();

View File

@ -65,8 +65,8 @@ module.exports = Self => {
} }
}, myOptions); }, myOptions);
const requesterId = request.ticket().client().salesPersonFk; const salesPerson = request.ticket().client().salesPersonFk;
if (requesterId) { if (salesPerson) {
const url = await models.Url.getUrl(); const url = await models.Url.getUrl();
const message = $t('Deny buy request', { const message = $t('Deny buy request', {
ticketId: request.ticketFk, ticketId: request.ticketFk,
@ -74,7 +74,7 @@ module.exports = Self => {
observation: params.response observation: params.response
}); });
await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions); await models.Chat.sendCheckingPresence(ctx, salesPerson, message, myOptions);
await request.updateAttributes(params, myOptions); await request.updateAttributes(params, myOptions);
} }