mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Merge pull request #10817 from dampfklon/fix-10810-unaccepted-assets
Fix #10810 unaccepted assets
This commit is contained in:
commit
7941a88623
|
@ -933,12 +933,17 @@ class ReportsController extends Controller
|
|||
/**
|
||||
* Get all assets with pending checkout acceptances
|
||||
*/
|
||||
|
||||
$acceptances = CheckoutAcceptance::pending()->with('assignedTo')->get();
|
||||
if($showDeleted) {
|
||||
$acceptances = CheckoutAcceptance::pending()->withTrashed()->with(['assignedTo' , 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
||||
} else {
|
||||
$acceptances = CheckoutAcceptance::pending()->with(['assignedTo' => function ($query) {
|
||||
$query->withTrashed();
|
||||
}, 'checkoutable.assignedTo', 'checkoutable.model'])->get();
|
||||
}
|
||||
|
||||
$assetsForReport = $acceptances
|
||||
->filter(function($acceptance) {
|
||||
return $acceptance->checkoutable_type == 'App\Models\Asset' && !is_null($acceptance->assignedTo);
|
||||
->filter(function ($acceptance) {
|
||||
return $acceptance->checkoutable_type == 'App\Models\Asset';
|
||||
})
|
||||
->map(function($acceptance) {
|
||||
return ['assetItem' => $acceptance->checkoutable, 'acceptance' => $acceptance];
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
@if ($item['assetItem'])
|
||||
<tr @if($item['acceptance']->trashed()) style="text-decoration: line-through" @endif>
|
||||
<td>{{ $item['acceptance']->created_at }}</td>
|
||||
<td>{{ ($item['assetItem']->company) ? $assetItem->company->name : '' }}</td>
|
||||
<td>{{ ($item['assetItem']->company) ? $item['assetItem']->company->name : '' }}</td>
|
||||
<td>{!! $item['assetItem']->model->category->present()->nameUrl() !!}</td>
|
||||
<td>{!! $item['assetItem']->present()->modelUrl() !!}</td>
|
||||
<td>{!! $item['assetItem']->present()->nameUrl() !!}</td>
|
||||
|
|
Loading…
Reference in a new issue