Server error on change paymethod #1687
gitea/salix/master This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-09-10 14:12:03 +02:00
parent 9db989d191
commit b36846994d
1 changed files with 2 additions and 2 deletions

View File

@ -198,9 +198,9 @@ 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 (salesPerson) {
if (salesPersonFk) {
const salesPerson = await Self.app.models.Worker.findById(salesPersonFk);
await Self.app.models.Message.send(ctx, {
recipientFk: salesPerson.userFk,
message: message