mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Merge pull request #14262 from akemidx/bug/sc-24812
Last Checkin Date added to Hardware View and Index
This commit is contained in:
commit
545a185614
|
@ -700,12 +700,13 @@ class ReportsController extends Controller
|
|||
}
|
||||
|
||||
if (($request->filled('checkin_date_start'))) {
|
||||
$assets->whereBetween('last_checkin', [
|
||||
Carbon::parse($request->input('checkin_date_start'))->startOfDay(),
|
||||
// use today's date if `checkin_date_end` is not provided
|
||||
Carbon::parse($request->input('checkin_date_end', now()))->endOfDay(),
|
||||
]);
|
||||
$checkin_start = \Carbon::parse($request->input('checkin_date_start'))->startOfDay();
|
||||
// use today's date is `checkin_date_end` is not provided
|
||||
$checkin_end = \Carbon::parse($request->input('checkin_date_end', now()))->endOfDay();
|
||||
|
||||
$assets->whereBetween('assets.last_checkin', [$checkin_start, $checkin_end ]);
|
||||
}
|
||||
//last checkin is exporting, but currently is a date and not a datetime in the custom report ONLY.
|
||||
|
||||
if (($request->filled('expected_checkin_start')) && ($request->filled('expected_checkin_end'))) {
|
||||
$assets->whereBetween('assets.expected_checkin', [$request->input('expected_checkin_start'), $request->input('expected_checkin_end')]);
|
||||
|
|
|
@ -88,6 +88,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,
|
||||
|
|
|
@ -253,6 +253,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,
|
||||
|
|
|
@ -781,6 +781,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
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue