mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Added #2562 - print view of all assigned inventory
This commit is contained in:
parent
c9e6a75ea8
commit
a8cc29f062
|
@ -1157,10 +1157,12 @@ class UsersController extends Controller
|
||||||
*/
|
*/
|
||||||
public function print($id)
|
public function print($id)
|
||||||
{
|
{
|
||||||
|
|
||||||
$user = User::where('id',$id)->withTrashed()->first();
|
$user = User::where('id',$id)->withTrashed()->first();
|
||||||
$assets = Asset::where('assigned_to', $id)->where('assigned_type', User::class)->with('model')->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();
|
||||||
return view('users/print')->with('assets', $assets)->with('licenses',$licenses);
|
$accessories = $user->accessories()->get();
|
||||||
|
return view('users/print')->with('assets', $assets)->with('licenses',$licenses)->with('accessories', $accessories);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,20 +7,20 @@
|
||||||
body {
|
body {
|
||||||
font-family: "Arial, Helvetica", sans-serif;
|
font-family: "Arial, Helvetica", sans-serif;
|
||||||
}
|
}
|
||||||
table {
|
table.inventory {
|
||||||
border: solid #000;
|
border: solid #000;
|
||||||
border-width: 1px 0 0 1px;
|
border-width: 1px 1px 1px 1px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@page {
|
@page {
|
||||||
size: A4;
|
size: A4;
|
||||||
}
|
}
|
||||||
th, td {
|
table.inventory th, table.inventory td {
|
||||||
border: solid #000;
|
border: solid #000;
|
||||||
border-width: 0 1px 1px 0;
|
border-width: 0 1px 1px 0;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
font-size: 14px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -31,14 +31,24 @@
|
||||||
@php
|
@php
|
||||||
$counter = 1;
|
$counter = 1;
|
||||||
@endphp
|
@endphp
|
||||||
<h4>Assets</h4>
|
<table class="inventory">
|
||||||
<table>
|
<thead>
|
||||||
<th></th>
|
<tr>
|
||||||
<th>Asset Tag</th>
|
<th colspan="7">{{ trans('general.assets') }}</th>
|
||||||
<th>Name</th>
|
</tr>
|
||||||
<th>Category</th>
|
</thead>
|
||||||
<th>Model</th>
|
<thead>
|
||||||
<th>Checked Out</th>
|
<tr>
|
||||||
|
<th style="width: 20px;"></th>
|
||||||
|
<th style="width: 20%;">Asset Tag</th>
|
||||||
|
<th style="width: 20%;">Name</th>
|
||||||
|
<th style="width: 10%;">Category</th>
|
||||||
|
<th style="width: 20%;">Model</th>
|
||||||
|
<th style="width: 20%;">Serial</th>
|
||||||
|
<th style="width: 10%;">Checked Out</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
@foreach ($assets as $asset)
|
@foreach ($assets as $asset)
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -47,6 +57,7 @@
|
||||||
<td>{{ $asset->name }}</td>
|
<td>{{ $asset->name }}</td>
|
||||||
<td>{{ $asset->model->category->name }}</td>
|
<td>{{ $asset->model->category->name }}</td>
|
||||||
<td>{{ $asset->model->name }}</td>
|
<td>{{ $asset->model->name }}</td>
|
||||||
|
<td>{{ $asset->serial }}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ $asset->last_checkout }}</td>
|
{{ $asset->last_checkout }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -58,11 +69,21 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if ($licenses->count() > 0)
|
@if ($licenses->count() > 0)
|
||||||
<h4>Licenses</h4>
|
<br><br>
|
||||||
<table>
|
<table class="inventory">
|
||||||
<th></th>
|
<thead>
|
||||||
<th>Name</th>
|
<tr>
|
||||||
<th>Checked Out</th>
|
<th colspan="4">{{ trans('general.licenses') }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 20px;"></th>
|
||||||
|
<th style="width: 40%;">Name</th>
|
||||||
|
<th style="width: 50%;">Serial/Product Key</th>
|
||||||
|
<th style="width: 10%;">Checked Out</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
@php
|
@php
|
||||||
$lcounter = 1;
|
$lcounter = 1;
|
||||||
@endphp
|
@endphp
|
||||||
|
@ -72,7 +93,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $lcounter }}</td>
|
<td>{{ $lcounter }}</td>
|
||||||
<td>{{ $license->name }}</td>
|
<td>{{ $license->name }}</td>
|
||||||
<td>{{ $license->created_at }}</td>
|
<td>{{ $license->serial }}</td>
|
||||||
|
<td>{{ $license->assetlog->first()->created_at }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@php
|
@php
|
||||||
$lcounter++
|
$lcounter++
|
||||||
|
@ -82,5 +104,53 @@
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
@if ($accessories->count() > 0)
|
||||||
|
<br><br>
|
||||||
|
<table class="inventory">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="4">{{ trans('general.accessories') }}</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
|
||||||
|
$acounter = 1;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@foreach ($accessories as $accessory)
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>{{ $acounter }}</td>
|
||||||
|
<td>{{ $accessory->manufacturer->name }} {{ $accessory->name }} {{ $accessory->model_number }}</td>
|
||||||
|
<td>{{ $accessory->category->name }}</td>
|
||||||
|
<td>{{ $accessory->assetlog->first()->created_at }}</td>
|
||||||
|
</tr>
|
||||||
|
@php
|
||||||
|
$acounter++
|
||||||
|
@endphp
|
||||||
|
@endforeach
|
||||||
|
</table>
|
||||||
|
@endif
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Signed Off By:</td>
|
||||||
|
<td>________________________________________________________</td>
|
||||||
|
<td></td>
|
||||||
|
<td>Date:</td>
|
||||||
|
<td>________________________________________________________</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -217,7 +217,7 @@
|
||||||
<a href="{{ route('clone/user', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-default hidden-print">{{ trans('admin/users/general.clone') }}</a>
|
<a href="{{ route('clone/user', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-default hidden-print">{{ trans('admin/users/general.clone') }}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-12" style="padding-top: 5px;">
|
<div class="col-md-12" style="padding-top: 5px;">
|
||||||
<a href="{{ route('users.print', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-default hidden-print">Print Inventory</a>
|
<a href="{{ route('users.print', $user->id) }}" style="width: 100%;" class="btn btn-sm btn-default hidden-print">Print All Assigned</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@can('delete', $user)
|
@can('delete', $user)
|
||||||
|
|
Loading…
Reference in a new issue