From 2d5c4e86905167e10500a06e068221f548f16255 Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Mon, 24 Mar 2025 13:53:06 +0000 Subject: [PATCH] Update WarehouseShippingNoteController.php --- .../WarehouseShippingNote/WarehouseShippingNoteController.php | 2 ++ 1 file changed, 2 insertions(+) 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;