This commit is contained in:
parent
b6c95f262f
commit
aec46bb855
|
@ -70,14 +70,16 @@ module.exports = Self => {
|
|||
discount: 100
|
||||
}, {transaction: transaction});
|
||||
|
||||
await sendMessage(ctx, {
|
||||
itemFk: sale.itemFk,
|
||||
ticketFk: sale.ticketFk,
|
||||
recipientFk: sale.item().itemType().worker().userFk,
|
||||
quantity: sale.quantity,
|
||||
concept: sale.concept,
|
||||
nickname: address.nickname
|
||||
}, transaction);
|
||||
if (sale.ticket().client().salesPerson()) {
|
||||
await sendMessage(ctx, {
|
||||
itemFk: sale.itemFk,
|
||||
ticketFk: sale.ticketFk,
|
||||
recipientFk: sale.ticket().client().salesPerson().userFk,
|
||||
quantity: sale.quantity,
|
||||
concept: sale.concept,
|
||||
nickname: address.nickname
|
||||
}, transaction);
|
||||
}
|
||||
}
|
||||
|
||||
let claim = await Self.findById(params.claimFk);
|
||||
|
@ -99,23 +101,14 @@ module.exports = Self => {
|
|||
include: [
|
||||
{
|
||||
relation: 'ticket',
|
||||
scope: {fields: ['warehouseFk', 'companyFk']}
|
||||
},
|
||||
{
|
||||
relation: 'item',
|
||||
scope: {
|
||||
fields: ['typeFk'],
|
||||
fields: ['clientFk', 'warehouseFk', 'companyFk'],
|
||||
include: {
|
||||
relation: 'itemType',
|
||||
relation: 'client',
|
||||
scope: {
|
||||
fields: ['workerFk'],
|
||||
include: {
|
||||
relation: 'worker',
|
||||
scope: {
|
||||
fields: ['id', 'userFk'],
|
||||
}
|
||||
relation: 'salesPerson'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue