Server error on change paymethod #1687
gitea/salix/dev There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2019-09-10 14:12:03 +02:00
parent 7ecb67052d
commit 0ed240df0b
1 changed files with 2 additions and 2 deletions

View File

@ -209,9 +209,9 @@ module.exports = Self => {
if (payMethodChanged || ibanChanged || dueDayChanged) { if (payMethodChanged || ibanChanged || dueDayChanged) {
const message = `La forma de pago del cliente con id ${instance.id} ha cambiado`; const message = `La forma de pago del cliente con id ${instance.id} ha cambiado`;
const salesPersonFk = instance.salesPersonFk; const salesPersonFk = instance.salesPersonFk;
const salesPerson = await Self.app.models.Worker.findById(salesPersonFk);
if (salesPerson) { if (salesPersonFk) {
const salesPerson = await Self.app.models.Worker.findById(salesPersonFk);
await Self.app.models.Message.send(ctx, { await Self.app.models.Message.send(ctx, {
recipientFk: salesPerson.userFk, recipientFk: salesPerson.userFk,
message: message message: message