Skip to content

A free open source IT asset/license management system

adds item type to Accept asset index

Godfrey M648c25a0a7e0
diff --git a/app/Models/CheckoutAcceptance.php b/app/Models/CheckoutAcceptance.php
index 0599286f85..1bd237ef60 100644
--- a/app/Models/CheckoutAcceptance.php
+++ b/app/Models/CheckoutAcceptance.php
@@ -32,7 +32,19 @@ class CheckoutAcceptance extends Model
return array_filter($recipients);
}
-
+ public function getCheckoutableCategoryTypeAttribute(): string
+ {
+ $type = $this->checkoutable_type;
+
+ return match ($type) {
+ Asset::class => trans('general.asset'),
+ LicenseSeat::class => trans('general.license'),
+ Accessory::class => trans('general.accessory'),
+ Component::class => trans('general.component'),
+ Consumable::class => trans('general.consumable'),
+ default => class_basename($type),
+ };
+ }
/**
* The resource that was is out
*
diff --git a/resources/views/account/accept/index.blade.php b/resources/views/account/accept/index.blade.php
index 0d36ef18ca..6d49ac74c2 100755
--- a/resources/views/account/accept/index.blade.php
+++ b/resources/views/account/accept/index.blade.php
@@ -31,6 +31,7 @@
<thead>
<tr>
<th>{{ trans('general.name')}}</th>
+ <th>{{ trans('general.category')}}</th>
<th>{{ trans('general.serial_number')}}</th>
<th>{{ trans('table.actions')}}</th>
</tr>
@@ -40,6 +41,7 @@
<tr>
@if ($acceptance->checkoutable)
<td>{{ ($acceptance->checkoutable) ? $acceptance->checkoutable->present()->name : '' }}</td>
+ <td>{{ $acceptance->checkoutable_category_type }}</td>
<td>{{ ($acceptance->checkoutable) ? $acceptance->checkoutable->serial : '' }}</td>
<td><a href="{{ route('account.accept.item', $acceptance) }}" class="btn btn-default btn-sm">{{ trans('general.accept_decline') }}</a></td>
@else