diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 3466cbffe7..0bbb06aa13 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -1187,7 +1187,9 @@ class Asset extends Depreciable public function scopeRequestableAssets($query) { - return Company::scopeCompanyables($query->where('requestable', '=', 1)) + $table = $query->getModel()->getTable(); + + return Company::scopeCompanyables($query->where($table.'.requestable', '=', 1)) ->whereHas('assetstatus', function ($query) { $query->where(function ($query) { $query->where('deployable', '=', 1) diff --git a/resources/views/account/requestable-assets.blade.php b/resources/views/account/requestable-assets.blade.php index b17fd98e82..18b9232898 100644 --- a/resources/views/account/requestable-assets.blade.php +++ b/resources/views/account/requestable-assets.blade.php @@ -109,8 +109,14 @@ + + @can('view', \App\Models\AssetModel::class) + {{ $requestableModel->name }} + @else + {{ $requestableModel->name }} + @endcan + - {{$requestableModel->name}} {{$requestableModel->assets->where('requestable', '1')->count()}} diff --git a/resources/views/hardware/requested.blade.php b/resources/views/hardware/requested.blade.php index a84e347e3d..5a38d89ce5 100644 --- a/resources/views/hardware/requested.blade.php +++ b/resources/views/hardware/requested.blade.php @@ -51,8 +51,7 @@ {{ trans('admin/hardware/form.expected_checkin') }} {{ trans('admin/hardware/table.requesting_user') }} {{ trans('admin/hardware/table.requested_date') }} - - + {{ trans('general.checkin').'/'.trans('general.checkout') }}