mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Added consumables tio printable output
This commit is contained in:
parent
a8cc29f062
commit
deba4d2b81
|
@ -1162,7 +1162,8 @@ class UsersController extends Controller
|
|||
$assets = Asset::where('assigned_to', $id)->where('assigned_type', User::class)->with('model', 'model.category')->get();
|
||||
$licenses = $user->licenses()->get();
|
||||
$accessories = $user->accessories()->get();
|
||||
return view('users/print')->with('assets', $assets)->with('licenses',$licenses)->with('accessories', $accessories);
|
||||
$consumables = $user->consumables()->get();
|
||||
return view('users/print')->with('assets', $assets)->with('licenses',$licenses)->with('accessories', $accessories)->with('consumables', $consumables);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -138,6 +138,42 @@
|
|||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
||||
@if ($consumables->count() > 0)
|
||||
<br><br>
|
||||
<table class="inventory">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">{{ trans('general.consumables') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 20px;"></th>
|
||||
<th style="width: 40%;">Name</th>
|
||||
<th style="width: 50%;">Category</th>
|
||||
<th style="width: 10%;">Checked Out</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php
|
||||
$ccounter = 1;
|
||||
@endphp
|
||||
|
||||
@foreach ($consumables as $consumable)
|
||||
|
||||
<tr>
|
||||
<td>{{ $ccounter }}</td>
|
||||
<td>{{ $consumable->manufacturer->name }} {{ $consumable->name }} {{ $consumable->model_number }}</td>
|
||||
<td>{{ $consumable->category->name }}</td>
|
||||
<td>{{ $consumable->assetlog->first()->created_at }}</td>
|
||||
</tr>
|
||||
@php
|
||||
$ccounter++
|
||||
@endphp
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
|
Loading…
Reference in a new issue