39 lines
1.5 KiB
PHP
39 lines
1.5 KiB
PHP
<?php
|
|
|
|
class WarehouseRevenueAccountController extends TTCrud {
|
|
protected string $headerTitle = 'Erlöskontos';
|
|
protected string $createText = 'Erlöskonto erstellen';
|
|
|
|
// @formatter:off
|
|
protected array $columns = [
|
|
['key' => 'title', 'text' => 'Titel', 'required' => true],
|
|
['key' => 'revenueAccountNumber', 'text' => 'Erlöskonto Nummer', 'required' => true, 'modal' => ['type' => 'number']],
|
|
['key' => 'actions', 'text' => 'Aktionen', 'required' => false, 'modal' => false, 'table' => ['filter' => false, 'sortable' => false, 'class' => 'text-center', 'priority' => 10]],
|
|
];
|
|
// @formatter:on
|
|
|
|
protected array $infoMessages = ['create' => 'Erlöskonto wurde erstellt',
|
|
'update' => 'Erlöskonto wurde aktualisiert',
|
|
'delete' => 'Erlöskonto wurde gelöscht',
|
|
'noChanges' => 'Keine Änderungen'];
|
|
|
|
protected function beforeUpdate($postData): bool {
|
|
(new WarehouseHistoryController)->create($postData, $this->mod);
|
|
|
|
return true;
|
|
}
|
|
|
|
protected function getHistoryAction() {
|
|
$history = WarehouseHistoryModel::getByRowId($this->request->id, $this->mod);
|
|
|
|
$history = array_map(function ($item) {
|
|
$item = (array) $item;
|
|
|
|
$item['columnHeader'] = $this->columns[array_search($item['key'], array_column($this->columns, 'key'))]['text'];
|
|
return $item;
|
|
}, $history);
|
|
|
|
self::returnJson($history);
|
|
}
|
|
|
|
} |