diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index f5168a5914..3c1059374c 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -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); diff --git a/app/Http/Controllers/Assets/AssetCheckinController.php b/app/Http/Controllers/Assets/AssetCheckinController.php index 4fe10e895f..a8ed32deb1 100644 --- a/app/Http/Controllers/Assets/AssetCheckinController.php +++ b/app/Http/Controllers/Assets/AssetCheckinController.php @@ -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); diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index f5d5ae12b5..eeb0b60451 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -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, diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index de7c2c7709..c3b78ddb0f 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -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, diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index d856427bd3..01e3abdf04 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -775,6 +775,18 @@ @endif + @if ($asset->last_checkin!='') +
+
+ + {{ trans('admin/hardware/table.last_checkin_date') }} + +
+
+ {{ Helper::getFormattedDateObject($asset->last_checkin, 'datetime', false) }} +
+
+ @endif