diff --git a/application/WarehouseShippingNote/WarehouseShippingNoteController.php b/application/WarehouseShippingNote/WarehouseShippingNoteController.php index c4c09947f..82ead21b3 100644 --- a/application/WarehouseShippingNote/WarehouseShippingNoteController.php +++ b/application/WarehouseShippingNote/WarehouseShippingNoteController.php @@ -50,11 +50,13 @@ class WarehouseShippingNoteController extends TTCrud { } protected function beforeUpdate($postData): bool { + if (!$this->user->can('WarehouseAdmin')) { $this->validate($postData, [ fn($p) => !in_array(WarehouseShippingNoteModel::get($p['id'])->status, ['accepted', 'invoiced']) ?: 'Änderungen nicht mehr möglich', fn($p) => $this->validateHours($p['hoursEntries']) ]); + } $postData['positions'] = json_encode($postData['positions']); (new WarehouseHistoryController)->create($postData, $this->mod); return true;