adding in Last Checkin Date to Hardware view and index

This commit is contained in:
akemidx 2024-02-13 16:52:12 -05:00
parent 65e20282b6
commit 4093327b7f
5 changed files with 22 additions and 2 deletions

View file

@ -879,7 +879,7 @@ class AssetsController extends Controller
}
$asset->expected_checkin = null;
$asset->last_checkout = null;
//$asset->last_checkout = null;
$asset->last_checkin = now();
$asset->assigned_to = null;
$asset->assignedTo()->disassociate($asset);

View file

@ -67,7 +67,7 @@ class AssetCheckinController extends Controller
}
$asset->expected_checkin = null;
$asset->last_checkout = null;
//$asset->last_checkout = null;
$asset->last_checkin = now();
$asset->assigned_to = null;
$asset->assignedTo()->disassociate($asset);

View file

@ -87,6 +87,7 @@ class AssetsTransformer
'purchase_date' => Helper::getFormattedDateObject($asset->purchase_date, 'date'),
'age' => $asset->purchase_date ? $asset->purchase_date->diffForHumans() : '',
'last_checkout' => Helper::getFormattedDateObject($asset->last_checkout, 'datetime'),
'last_checkin' => Helper::getFormattedDateObject($asset->last_checkin, 'datetime'),
'expected_checkin' => Helper::getFormattedDateObject($asset->expected_checkin, 'date'),
'purchase_cost' => Helper::formatCurrencyOutput($asset->purchase_cost),
'checkin_counter' => (int) $asset->checkin_counter,

View file

@ -244,6 +244,13 @@ class AssetPresenter extends Presenter
'visible' => false,
'title' => trans('admin/hardware/table.checkout_date'),
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'last_checkin',
'searchable' => false,
'sortable' => true,
'visible' => false,
'title' => trans('admin/hardware/table.last_checkin_date'),
'formatter' => 'dateDisplayFormatter',
], [
'field' => 'expected_checkin',
'searchable' => false,

View file

@ -775,6 +775,18 @@
</div>
</div>
@endif
@if ($asset->last_checkin!='')
<div class="row">
<div class="col-md-2">
<strong>
{{ trans('admin/hardware/table.last_checkin_date') }}
</strong>
</div>
<div class="col-md-6">
{{ Helper::getFormattedDateObject($asset->last_checkin, 'datetime', false) }}
</div>
</div>
@endif