mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 23:54:12 -08:00
Merge branch 'develop'
This commit is contained in:
commit
f06852f48d
|
@ -7,6 +7,7 @@ use App\Models\Actionlog;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use App\Models\AssetMaintenance;
|
use App\Models\AssetMaintenance;
|
||||||
use App\Models\CustomField;
|
use App\Models\CustomField;
|
||||||
|
use App\Models\Depreciation;
|
||||||
use App\Models\License;
|
use App\Models\License;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
@ -221,11 +222,12 @@ class ReportsController extends Controller
|
||||||
public function getDeprecationReport()
|
public function getDeprecationReport()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$depreciations = Depreciation::get();
|
||||||
// Grab all the assets
|
// Grab all the assets
|
||||||
$assets = Asset::with( 'assignedTo', 'assetstatus', 'defaultLoc', 'location', 'assetlog', 'company', 'model.category', 'model.depreciation')
|
$assets = Asset::with( 'assignedTo', 'assetstatus', 'defaultLoc', 'location', 'assetlog', 'company', 'model.category', 'model.depreciation')
|
||||||
->orderBy('created_at', 'DESC')->get();
|
->orderBy('created_at', 'DESC')->get();
|
||||||
|
|
||||||
return view('reports/depreciation', compact('assets'));
|
return view('reports/depreciation', compact('assets'))->with('depreciations',$depreciations);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="box box-default">
|
<div class="box box-default">
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
|
||||||
|
|
||||||
|
@if (($depreciations) && ($depreciations->count() > 0))
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table
|
<table
|
||||||
class="table table-striped table-bordered table-compact"
|
class="table table-striped table-bordered table-compact"
|
||||||
|
@ -134,6 +137,16 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div> <!-- /.table-responsive-->
|
</div> <!-- /.table-responsive-->
|
||||||
|
@else
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="alert alert-warning fade in">
|
||||||
|
<i class="fa fa-warning faa-pulse animated"></i>
|
||||||
|
<strong>Warning: </strong>
|
||||||
|
You do not currently have any depreciations set up.
|
||||||
|
Please set up at least one depreciation to view the depreciation report.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
</div> <!-- /.box-body-->
|
</div> <!-- /.box-body-->
|
||||||
</div> <!--/box.box-default-->
|
</div> <!--/box.box-default-->
|
||||||
</div> <!-- /.col-md-12-->
|
</div> <!-- /.col-md-12-->
|
||||||
|
|
Loading…
Reference in a new issue