Use new location method for hardware view

This commit is contained in:
snipe 2017-10-28 02:37:59 -07:00
parent 0a114c7daf
commit 3991f79115
2 changed files with 10 additions and 10 deletions

View file

@ -594,8 +594,8 @@ class AssetsController extends Controller
if (isset($asset)) {
if (!is_null($asset->assetloc)) {
$use_currency = $asset->assetloc->currency;
if ($asset->location) {
$use_currency = $asset->location->currency;
} else {
if ($settings->default_currency!='') {
$use_currency = $settings->default_currency;

View file

@ -224,10 +224,10 @@
<tr>
<td>{{ trans('admin/hardware/form.cost') }}</td>
<td>
@if (($asset->id) && ($asset->userloc))
{{ $asset->userloc->currency }}
@elseif (($asset->id) && ($asset->assetloc))
{{ $asset->assetloc->currency }}
@if (($asset->id) && ($asset->location))
{{ $asset->location->currency }}
@elseif (($asset->id) && ($asset->location))
{{ $asset->location->currency }}
@else
{{ $snipeSettings->default_currency }}
@endif
@ -335,16 +335,16 @@
<td> {!! nl2br(e($asset->notes)) !!}</td>
</tr>
@if ($asset->assetloc)
@if ($asset->location)
<tr>
<td>{{ trans('general.location') }}</td>
<td>
@can('superuser')
<a href="{{ route('locations.show', ['location' => $asset->assetloc->id]) }}">
{{ $asset->assetloc->name }}
<a href="{{ route('locations.show', ['location' => $asset->location->id]) }}">
{{ $asset->location->name }}
</a>
@else
{{ $asset->assetloc->name }}
{{ $asset->location->name }}
@endcan
</td>
</tr>