Update WarehouseShippingNoteController.php
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user