Update WarehouseShippingNoteController.php

This commit is contained in:
Luca Haid
2025-03-24 13:53:06 +00:00
parent cccdede1de
commit 2d5c4e8690

View File

@@ -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;