Added consumables tio printable output

This commit is contained in:
snipe 2017-12-05 12:37:42 -08:00
parent a8cc29f062
commit deba4d2b81
2 changed files with 38 additions and 1 deletions

View file

@ -1162,7 +1162,8 @@ class UsersController extends Controller
$assets = Asset::where('assigned_to', $id)->where('assigned_type', User::class)->with('model', 'model.category')->get(); $assets = Asset::where('assigned_to', $id)->where('assigned_type', User::class)->with('model', 'model.category')->get();
$licenses = $user->licenses()->get(); $licenses = $user->licenses()->get();
$accessories = $user->accessories()->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);
} }

View file

@ -138,6 +138,42 @@
@endforeach @endforeach
</table> </table>
@endif @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> <br>
<br> <br>