error when sending to a salesPerson pay-method changes #1338
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
parent
b5fe7a6fae
commit
79f9dfb515
|
@ -197,10 +197,11 @@ module.exports = Self => {
|
|||
if (payMethodChanged || ibanChanged || dueDayChanged) {
|
||||
const message = `La forma de pago del cliente con id ${instance.id} ha cambiado`;
|
||||
const salesPersonFk = instance.salesPersonFk;
|
||||
const salesPerson = await Self.app.models.Worker.findById(salesPersonFk);
|
||||
|
||||
if (salesPersonFk) {
|
||||
if (salesPerson) {
|
||||
await Self.app.models.Message.send(ctx, {
|
||||
recipientFk: salesPersonFk,
|
||||
recipientFk: salesPerson.userFk,
|
||||
message: message
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue