fix: refs #7028 requesterId fix
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
d620f722b5
commit
1e471ac20f
|
@ -97,18 +97,19 @@ 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 url = await Self.app.models.Url.getUrl();
|
|
||||||
const requesterId = request.ticket().client().salesPersonFk;
|
const requesterId = request.ticket().client().salesPersonFk;
|
||||||
const message = $t('Bought units from buy request', {
|
if (requesterId) {
|
||||||
quantity: sale.quantity,
|
const url = await Self.app.models.Url.getUrl();
|
||||||
concept: sale.concept,
|
const message = $t('Bought units from buy request', {
|
||||||
itemId: sale.itemFk,
|
quantity: sale.quantity,
|
||||||
ticketId: sale.ticketFk,
|
concept: sale.concept,
|
||||||
url: `${url}ticket/${sale.ticketFk}/summary`,
|
itemId: sale.itemFk,
|
||||||
urlItem: `${url}item/${sale.itemFk}/summary`
|
ticketId: sale.ticketFk,
|
||||||
});
|
url: `${url}ticket/${sale.ticketFk}/summary`,
|
||||||
await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions);
|
urlItem: `${url}item/${sale.itemFk}/summary`
|
||||||
|
});
|
||||||
|
await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions);
|
||||||
|
}
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return sale;
|
return sale;
|
||||||
|
|
|
@ -65,16 +65,18 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
const url = await models.Url.getUrl();
|
|
||||||
const requesterId = request.ticket().client().salesPersonFk;
|
const requesterId = request.ticket().client().salesPersonFk;
|
||||||
const message = $t('Deny buy request', {
|
if (requesterId) {
|
||||||
ticketId: request.ticketFk,
|
const url = await models.Url.getUrl();
|
||||||
url: `${url}ticket/${request.ticketFk}/request/index`,
|
const message = $t('Deny buy request', {
|
||||||
observation: params.response
|
ticketId: request.ticketFk,
|
||||||
});
|
url: `${url}ticket/${request.ticketFk}/request/index`,
|
||||||
|
observation: params.response
|
||||||
|
});
|
||||||
|
|
||||||
await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions);
|
await models.Chat.sendCheckingPresence(ctx, requesterId, message, myOptions);
|
||||||
await request.updateAttributes(params, myOptions);
|
await request.updateAttributes(params, myOptions);
|
||||||
|
}
|
||||||
|
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue