mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Update references to assetloc to location
This commit is contained in:
parent
3991f79115
commit
890012f6c4
|
@ -115,8 +115,8 @@ class AssetMaintenancesController extends Controller
|
|||
);
|
||||
}
|
||||
|
||||
if (($maintenance->cost) && (isset($maintenance->asset)) && ($maintenance->asset->assetloc) && ($maintenance->asset->assetloc->currency!='')) {
|
||||
$maintenance_cost = $maintenance->asset->assetloc->currency.$maintenance->cost;
|
||||
if (($maintenance->cost) && (isset($maintenance->asset)) && ($maintenance->asset->location) && ($maintenance->asset->location->currency!='')) {
|
||||
$maintenance_cost = $maintenance->asset->location->currency.$maintenance->cost;
|
||||
} else {
|
||||
$maintenance_cost = $settings->default_currency.$maintenance->cost;
|
||||
}
|
||||
|
|
|
@ -1022,7 +1022,7 @@ class AssetsController extends Controller
|
|||
->with('count', $count)
|
||||
->with('settings', Setting::getSettings());
|
||||
} elseif ($request->input('bulk_actions')=='delete') {
|
||||
$assets = Asset::with('assignedTo', 'assetloc')->find($asset_ids);
|
||||
$assets = Asset::with('assignedTo', 'location')->find($asset_ids);
|
||||
$assets->each(function ($asset) {
|
||||
$this->authorize('delete', $asset);
|
||||
});
|
||||
|
|
|
@ -114,7 +114,7 @@ class ReportsController extends Controller
|
|||
// Open output stream
|
||||
$handle = fopen('php://output', 'w');
|
||||
|
||||
$assets = Asset::with('assignedTo', 'assetLoc','defaultLoc','assignedTo','model','supplier','assetstatus','model.manufacturer');
|
||||
$assets = Asset::with('assignedTo', 'location','defaultLoc','assignedTo','model','supplier','assetstatus','model.manufacturer');
|
||||
|
||||
// This is used by the sidenav, mostly
|
||||
switch ($request->input('status')) {
|
||||
|
@ -182,7 +182,7 @@ class ReportsController extends Controller
|
|||
($asset->supplier) ? e($asset->supplier->name) : '',
|
||||
($asset->assignedTo) ? e($asset->assignedTo->present()->name()) : '',
|
||||
($asset->last_checkout!='') ? e($asset->last_checkout) : '',
|
||||
($asset->assetLoc) ? e($asset->assetLoc->present()->name()) : '',
|
||||
($asset->location) ? e($asset->location->present()->name()) : '',
|
||||
($asset->notes) ? e($asset->notes) : '',
|
||||
];
|
||||
foreach ($customfields as $field) {
|
||||
|
@ -215,7 +215,7 @@ class ReportsController extends Controller
|
|||
{
|
||||
|
||||
// Grab all the assets
|
||||
$assets = Asset::with( 'assignedTo', 'assetstatus', 'defaultLoc', 'assetloc', 'assetlog', 'company', 'model.category', 'model.depreciation')
|
||||
$assets = Asset::with( 'assignedTo', 'assetstatus', 'defaultLoc', 'location', 'assetlog', 'company', 'model.category', 'model.depreciation')
|
||||
->orderBy('created_at', 'DESC')->get();
|
||||
|
||||
return view('reports/depreciation', compact('assets'));
|
||||
|
@ -270,7 +270,7 @@ class ReportsController extends Controller
|
|||
$row[] = ''; // Empty string if unassigned
|
||||
}
|
||||
|
||||
if (( $asset->assigned_to > 0 ) && ( $location = $asset->assetLoc )) {
|
||||
if (( $asset->assigned_to > 0 ) && ( $location = $asset->location )) {
|
||||
if ($location->city) {
|
||||
$row[] = e($location->city) . ', ' . e($location->state);
|
||||
} elseif ($location->name) {
|
||||
|
@ -282,8 +282,8 @@ class ReportsController extends Controller
|
|||
$row[] = ''; // Empty string if location is not set
|
||||
}
|
||||
|
||||
if ($asset->assetloc) {
|
||||
$currency = e($asset->assetloc->currency);
|
||||
if ($asset->location) {
|
||||
$currency = e($asset->location->currency);
|
||||
} else {
|
||||
$currency = e(Setting::first()->default_currency);
|
||||
}
|
||||
|
@ -562,8 +562,8 @@ class ReportsController extends Controller
|
|||
}
|
||||
|
||||
if (e(Input::get('location')) == '1') {
|
||||
if($asset->assetLoc) {
|
||||
$show_loc = $asset->assetLoc->present()->name();
|
||||
if($asset->location) {
|
||||
$show_loc = $asset->location->present()->name();
|
||||
} else {
|
||||
$show_loc = 'Default location '.$asset->rtd_location_id.' is invalid';
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class ViewAssetsController extends Controller
|
|||
public function getRequestableIndex()
|
||||
{
|
||||
|
||||
$assets = Asset::with('model', 'defaultLoc', 'assetloc', 'assignedTo', 'requests')->Hardware()->RequestableAssets()->get();
|
||||
$assets = Asset::with('model', 'defaultLoc', 'location', 'assignedTo', 'requests')->Hardware()->RequestableAssets()->get();
|
||||
$models = AssetModel::with('category', 'requests', 'assets')->RequestableModels()->get();
|
||||
|
||||
return view('account/requestable-assets', compact('user', 'assets', 'models'));
|
||||
|
|
|
@ -37,12 +37,6 @@ class CheckoutRequest extends Model
|
|||
|
||||
public function location()
|
||||
{
|
||||
if ($this->itemType() == "asset") {
|
||||
$asset = $this->itemRequested();
|
||||
if ($asset->assignedTo) {
|
||||
return $asset->assetloc;
|
||||
}
|
||||
}
|
||||
return $this->itemRequested()->location;
|
||||
}
|
||||
|
||||
|
|
|
@ -345,15 +345,15 @@
|
|||
{{ $asset->assignedTo->present()->nameUrl() }}
|
||||
</li>
|
||||
|
||||
@if (isset($asset->assetloc->address))
|
||||
@if (isset($asset->location->address))
|
||||
<li>
|
||||
{{ $asset->assetloc->address }}
|
||||
@if (isset($asset->assetloc->address2))
|
||||
{{ $asset->assetloc->address2 }}
|
||||
{{ $asset->location->address }}
|
||||
@if (isset($asset->location->address2))
|
||||
{{ $asset->location->address2 }}
|
||||
@endif
|
||||
</li>
|
||||
@if (isset($asset->assetloc->city))
|
||||
<li>{{ $asset->assetloc->city }}, {{ $asset->assetloc->state }} {{ $asset->assetloc->zip }}</li>
|
||||
@if (isset($asset->location->city))
|
||||
<li>{{ $asset->location->city }}, {{ $asset->location->state }} {{ $asset->location->zip }}</li>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
|
|
|
@ -83,8 +83,8 @@
|
|||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($asset->assetloc)
|
||||
{{ $asset->assetloc->name }}
|
||||
@if ($asset->location)
|
||||
{{ $asset->location->name }}
|
||||
@elseif ($asset->defaultloc)
|
||||
{{ $asset->defaultloc->name }}
|
||||
@endif
|
||||
|
@ -98,16 +98,16 @@
|
|||
|
||||
@if ($asset->purchase_cost > 0)
|
||||
<td class="align-right">
|
||||
@if ($asset->assetloc )
|
||||
{{ $asset->assetloc->currency }}
|
||||
@if ($asset->location )
|
||||
{{ $asset->location->currency }}
|
||||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->purchase_cost) }}
|
||||
</td>
|
||||
<td class="align-right">
|
||||
@if ($asset->assetloc )
|
||||
{{ $asset->assetloc->currency }}
|
||||
@if ($asset->location )
|
||||
{{ $asset->location->currency }}
|
||||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
|
@ -115,8 +115,8 @@
|
|||
{{ \App\Helpers\Helper::formatCurrencyOutput($asset->getDepreciatedValue()) }}
|
||||
</td>
|
||||
<td class="align-right">
|
||||
@if ($asset->assetloc)
|
||||
{{ $asset->assetloc->currency }}
|
||||
@if ($asset->location)
|
||||
{{ $asset->location->currency }}
|
||||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
|
|
|
@ -66,9 +66,9 @@ class ApiAssetsCest
|
|||
'id' => (int) $asset->company->id,
|
||||
'name'=> e($asset->company->name)
|
||||
] : null,
|
||||
'location' => ($asset->assetLoc) ? [
|
||||
'id' => (int) $asset->assetLoc->id,
|
||||
'name'=> e($asset->assetLoc->name)
|
||||
'location' => ($asset->location) ? [
|
||||
'id' => (int) $asset->location->id,
|
||||
'name'=> e($asset->location->name)
|
||||
] : null,
|
||||
'rtd_location' => ($asset->defaultLoc) ? [
|
||||
'id' => (int) $asset->defaultLoc->id,
|
||||
|
@ -223,9 +223,9 @@ class ApiAssetsCest
|
|||
'id' => (int) $temp_asset->company->id,
|
||||
'name'=> e($temp_asset->company->name)
|
||||
] : null,
|
||||
'location' => ($temp_asset->assetLoc) ? [
|
||||
'id' => (int) $temp_asset->assetLoc->id,
|
||||
'name'=> e($temp_asset->assetLoc->name)
|
||||
'location' => ($temp_asset->location) ? [
|
||||
'id' => (int) $temp_asset->location->id,
|
||||
'name'=> e($temp_asset->location->name)
|
||||
] : null,
|
||||
'rtd_location' => ($temp_asset->defaultLoc) ? [
|
||||
'id' => (int) $temp_asset->defaultLoc->id,
|
||||
|
|
Loading…
Reference in a new issue