Depreciation view
This commit is contained in:
parent
02db0f9f9d
commit
e7fe91c9d4
4 changed files with 95 additions and 0 deletions
|
@ -125,6 +125,10 @@ class AssetsController extends Controller
|
||||||
$assets->ByManufacturer($request->input('manufacturer_id'));
|
$assets->ByManufacturer($request->input('manufacturer_id'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->has('depreciation_id')) {
|
||||||
|
$assets->ByDepreciationId($request->input('depreciation_id'));
|
||||||
|
}
|
||||||
|
|
||||||
$request->has('order_number') ? $assets = $assets->where('assets.order_number', '=', e($request->get('order_number'))) : '';
|
$request->has('order_number') ? $assets = $assets->where('assets.order_number', '=', e($request->get('order_number'))) : '';
|
||||||
|
|
||||||
$offset = request('offset', 0);
|
$offset = request('offset', 0);
|
||||||
|
@ -155,6 +159,8 @@ class AssetsController extends Controller
|
||||||
case 'Deployed':
|
case 'Deployed':
|
||||||
$assets->Deployed();
|
$assets->Deployed();
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
$assets->NotArchived();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -155,5 +155,24 @@ class DepreciationsController extends Controller
|
||||||
return redirect()->route('depreciations.index')->with('success', trans('admin/depreciations/message.delete.success'));
|
return redirect()->route('depreciations.index')->with('success', trans('admin/depreciations/message.delete.success'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a view that displays a form to display depreciation listing
|
||||||
|
*
|
||||||
|
* @author [A. Gianotto] [<snipe@snipe.net]
|
||||||
|
* @see DepreciationsController::postEdit()
|
||||||
|
* @param int $depreciationId
|
||||||
|
* @since [v1.0]
|
||||||
|
* @return \Illuminate\Contracts\View\View
|
||||||
|
*/
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
if (is_null($depreciation = Depreciation::find($id))) {
|
||||||
|
// Redirect to the blogs management page
|
||||||
|
return redirect()->route('depreciations.index')->with('error', trans('admin/depreciations/message.does_not_exist'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('depreciations/view', compact('depreciation'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1106,4 +1106,20 @@ class Asset extends Depreciable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query builder scope to search on location ID
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Query\Builder $query Query builder instance
|
||||||
|
* @param text $search Search term
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Database\Query\Builder Modified query builder
|
||||||
|
*/
|
||||||
|
public function scopeByDepreciationId($query, $search)
|
||||||
|
{
|
||||||
|
return $query->join('models', 'assets.model_id', '=', 'models.id')
|
||||||
|
->join('depreciations', 'models.depreciation_id', '=', 'depreciations.id')->where('models.depreciation_id', '=', $search);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
54
resources/views/depreciations/view.blade.php
Normal file
54
resources/views/depreciations/view.blade.php
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
@extends('layouts/default')
|
||||||
|
|
||||||
|
{{-- Page title --}}
|
||||||
|
@section('title')
|
||||||
|
|
||||||
|
{{ trans('general.depreciation') }}
|
||||||
|
: {{ $depreciation->name }}
|
||||||
|
|
||||||
|
@parent
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('header_right')
|
||||||
|
<a href="{{ route('depreciations.edit', ['depreciation' => $depreciation->id]) }}" class="btn btn-sm btn-primary pull-right">{{ trans('admin/depreciations/table.update') }} </a>
|
||||||
|
@stop
|
||||||
|
|
||||||
|
{{-- Page content --}}
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="box box-default">
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="table table-responsive">
|
||||||
|
<table
|
||||||
|
name="location_users"
|
||||||
|
id="table-users"
|
||||||
|
class="table table-striped snipe-table"
|
||||||
|
data-url="{{ route('api.assets.index',['depreciation'=> $depreciation->id]) }}"
|
||||||
|
data-cookie="true"
|
||||||
|
data-click-to-select="true"
|
||||||
|
data-cookie-id-table="department_usersDetailTable">
|
||||||
|
<thead>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('moar_scripts')
|
||||||
|
@include ('partials.bootstrap-table', [
|
||||||
|
'exportFile' => 'assets-export',
|
||||||
|
'search' => true,
|
||||||
|
'columns' => \App\Presenters\AssetPresenter::dataTableLayout()
|
||||||
|
])
|
||||||
|
|
||||||
|
@stop
|
Loading…
Add table
Reference in a new issue