Fixes #3491 - adds supplier info to assets listing

This commit is contained in:
snipe 2017-04-22 19:14:28 -05:00
parent a7132fcdd7
commit 54a2c46101
3 changed files with 17 additions and 2 deletions

View file

@ -43,6 +43,10 @@ class AssetsTransformer
'id' => (int) $asset->model->manufacturer->id,
'name'=> e($asset->model->manufacturer->name)
] : null,
'supplier' => ($asset->supplier) ? [
'id' => (int) $asset->supplier->id,
'name'=> e($asset->supplier->name)
] : null,
'notes' => e($asset->notes),
'order_number' => e($asset->order_number),
'company' => ($asset->company) ? [

View file

@ -113,6 +113,13 @@ class AssetPresenter extends Presenter
"title" => trans('general.manufacturer'),
"visible" => false,
"formatter" => "manufacturersLinkObjFormatter"
],[
"field" => "supplier",
"searchable" => true,
"sortable" => true,
"title" => trans('general.supplier'),
"visible" => false,
"formatter" => "suppliersLinkObjFormatter"
], [
"field" => "purchase_date",
"searchable" => true,

View file

@ -49,10 +49,14 @@
@foreach ($supplier->assets as $supplierassets)
<tr>
<td>
{!! $supplierassets->present()->assetTagUrl() !!}
<a href="{{ route('suppliers.show', $supplierassets->id) }}">
{{ $supplierassets->asset_tag }}
</a>
</td>
<td>
{!! $supplierassets->present()->nameUrl() !!}
<a href="{{ route('suppliers.show', $supplierassets->id) }}">
{{ $supplierassets->name }}
</a>
</td>
<td>
@if ($supplierassets->assigneduser)