Skip to content

Commit 7de25a1

Browse files
authored
Merge pull request #18056 from grokability/add-expected-checkin-to-view-assets
Added expected_checkin to user’s View Assigned page
2 parents 57b49fc + 78da893 commit 7de25a1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/Models/Asset.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ protected function eolDiffForHumans(): Attribute
399399

400400
}
401401

402+
protected function expectedCheckinFormattedDate(): Attribute
403+
{
404+
return Attribute:: make(
405+
get: fn(mixed $value, array $attributes) => array_key_exists('expected_checkin', $attributes) ? Helper::getFormattedDateObject($attributes['expected_checkin'], 'date', false) : null,
406+
);
407+
}
402408

403409
/**
404410
* Establishes the asset -> company relationship

resources/views/account/view-assets.blade.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ class="table table-striped snipe-table"
464464
<th class="col-md-2" data-switchable="true" data-visible="false">
465465
{{ trans('general.location') }}
466466
</th>
467+
<th class="col-md-2" data-switchable="true" data-visible="true">
468+
{{ trans('admin/hardware/form.expected_checkin') }}
469+
</th>
467470
@can('self.view_purchase_cost')
468471
<th class="col-md-6" data-footer-formatter="sumFormatter" data-fieldname="purchase_cost">
469472
{{ trans('general.purchase_cost') }}
@@ -530,6 +533,9 @@ class="table table-striped snipe-table"
530533
<td>
531534
{{ ($asset->location) ? $asset->location->name : '' }}
532535
</td>
536+
<td>
537+
{{ ($asset->expected_checkin) ? $asset->expected_checkin_formatted_date : '' }}
538+
</td>
533539
@can('self.view_purchase_cost')
534540
<td>
535541
{!! Helper::formatCurrencyOutput($asset->purchase_cost) !!}

0 commit comments

Comments
 (0)