3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-05-05 14:15:29 +00:00

Make available_assets_count sortable

This commit is contained in:
snipe
2025-09-30 10:51:25 +01:00
parent bec88a0441
commit eeea69d8f2
3 changed files with 4 additions and 3 deletions

View File

@ -46,6 +46,7 @@ class AssetModelsController extends Controller
'manufacturer',
'requestable',
'assets_count',
'available_assets_count',
'category',
'fieldset',
'deleted_at',

View File

@ -48,7 +48,7 @@ class AssetModelsTransformer
'image' => ($assetmodel->image != '') ? Storage::disk('public')->url('models/'.e($assetmodel->image)) : null,
'model_number' => ($assetmodel->model_number ? e($assetmodel->model_number): null),
'min_amt' => ($assetmodel->min_amt) ? (int) $assetmodel->min_amt : null,
'remaining' => (int) $assetmodel->available_assets_count,
'available_assets_count' => (int) $assetmodel->available_assets_count,
'depreciation' => ($assetmodel->depreciation) ? [
'id' => (int) $assetmodel->depreciation->id,
'name'=> e($assetmodel->depreciation->name),

View File

@ -91,9 +91,9 @@ class AssetModelPresenter extends Presenter
],
[
'field' => 'remaining',
'field' => 'available_assets_count',
'searchable' => false,
'sortable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('general.remaining'),
'visible' => true,