mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
adding in Last Checkin Date to Hardware view and index
This commit is contained in:
parent
65e20282b6
commit
4093327b7f
|
@ -879,7 +879,7 @@ class AssetsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$asset->expected_checkin = null;
|
$asset->expected_checkin = null;
|
||||||
$asset->last_checkout = null;
|
//$asset->last_checkout = null;
|
||||||
$asset->last_checkin = now();
|
$asset->last_checkin = now();
|
||||||
$asset->assigned_to = null;
|
$asset->assigned_to = null;
|
||||||
$asset->assignedTo()->disassociate($asset);
|
$asset->assignedTo()->disassociate($asset);
|
||||||
|
|
|
@ -67,7 +67,7 @@ class AssetCheckinController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$asset->expected_checkin = null;
|
$asset->expected_checkin = null;
|
||||||
$asset->last_checkout = null;
|
//$asset->last_checkout = null;
|
||||||
$asset->last_checkin = now();
|
$asset->last_checkin = now();
|
||||||
$asset->assigned_to = null;
|
$asset->assigned_to = null;
|
||||||
$asset->assignedTo()->disassociate($asset);
|
$asset->assignedTo()->disassociate($asset);
|
||||||
|
|
|
@ -87,6 +87,7 @@ class AssetsTransformer
|
||||||
'purchase_date' => Helper::getFormattedDateObject($asset->purchase_date, 'date'),
|
'purchase_date' => Helper::getFormattedDateObject($asset->purchase_date, 'date'),
|
||||||
'age' => $asset->purchase_date ? $asset->purchase_date->diffForHumans() : '',
|
'age' => $asset->purchase_date ? $asset->purchase_date->diffForHumans() : '',
|
||||||
'last_checkout' => Helper::getFormattedDateObject($asset->last_checkout, 'datetime'),
|
'last_checkout' => Helper::getFormattedDateObject($asset->last_checkout, 'datetime'),
|
||||||
|
'last_checkin' => Helper::getFormattedDateObject($asset->last_checkin, 'datetime'),
|
||||||
'expected_checkin' => Helper::getFormattedDateObject($asset->expected_checkin, 'date'),
|
'expected_checkin' => Helper::getFormattedDateObject($asset->expected_checkin, 'date'),
|
||||||
'purchase_cost' => Helper::formatCurrencyOutput($asset->purchase_cost),
|
'purchase_cost' => Helper::formatCurrencyOutput($asset->purchase_cost),
|
||||||
'checkin_counter' => (int) $asset->checkin_counter,
|
'checkin_counter' => (int) $asset->checkin_counter,
|
||||||
|
|
|
@ -244,6 +244,13 @@ class AssetPresenter extends Presenter
|
||||||
'visible' => false,
|
'visible' => false,
|
||||||
'title' => trans('admin/hardware/table.checkout_date'),
|
'title' => trans('admin/hardware/table.checkout_date'),
|
||||||
'formatter' => 'dateDisplayFormatter',
|
'formatter' => 'dateDisplayFormatter',
|
||||||
|
], [
|
||||||
|
'field' => 'last_checkin',
|
||||||
|
'searchable' => false,
|
||||||
|
'sortable' => true,
|
||||||
|
'visible' => false,
|
||||||
|
'title' => trans('admin/hardware/table.last_checkin_date'),
|
||||||
|
'formatter' => 'dateDisplayFormatter',
|
||||||
], [
|
], [
|
||||||
'field' => 'expected_checkin',
|
'field' => 'expected_checkin',
|
||||||
'searchable' => false,
|
'searchable' => false,
|
||||||
|
|
|
@ -775,6 +775,18 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue