diff --git a/db/routines/vn/triggers/entry_beforeUpdate.sql b/db/routines/vn/triggers/entry_beforeUpdate.sql index 66b36a861..059548789 100644 --- a/db/routines/vn/triggers/entry_beforeUpdate.sql +++ b/db/routines/vn/triggers/entry_beforeUpdate.sql @@ -41,7 +41,7 @@ BEGIN SELECT isRaid INTO vIsRaid FROM travel t JOIN entry e ON e.travelFk = t.id - WHERE t.entryFk = NEW.id; + WHERE e.id = NEW.id; SELECT NOT (o.warehouseInFk <=> n.warehouseInFk) OR NOT (o.warehouseOutFk <=> n.warehouseOutFk)