Merge pull request #17730 from Godmartinz/update-asset-accepance-with-category

Adds #9000 Item type to Account Asset Acceptance index
This commit is contained in:
snipe
2025-08-28 05:22:54 +01:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -32,7 +32,19 @@ class CheckoutAcceptance extends Model
return array_filter($recipients);
}
public function getCheckoutableItemTypeAttribute(): 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
*

View File

@@ -31,6 +31,7 @@
<thead>
<tr>
<th>{{ trans('general.name')}}</th>
<th>{{ trans('general.type')}}</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_item_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