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