mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Fixes #2622 - add depreciation to license report
This commit is contained in:
parent
998624ad68
commit
aa92b93bd1
|
@ -329,7 +329,7 @@ class ReportsController extends Controller
|
|||
}
|
||||
|
||||
|
||||
$allowed_columns = ['name','min_amt','order_number','purchase_date','purchase_cost','companyName','category'];
|
||||
$allowed_columns = ['created_at'];
|
||||
$order = Input::get('order') === 'asc' ? 'asc' : 'desc';
|
||||
$sort = in_array(Input::get('sort'), $allowed_columns) ? e(Input::get('sort')) : 'created_at';
|
||||
|
||||
|
@ -406,7 +406,7 @@ class ReportsController extends Controller
|
|||
public function getLicenseReport()
|
||||
{
|
||||
|
||||
$licenses = License::orderBy('created_at', 'DESC')
|
||||
$licenses = License::with('depreciation')->orderBy('created_at', 'DESC')
|
||||
->with('company')
|
||||
->get();
|
||||
|
||||
|
@ -433,6 +433,7 @@ class ReportsController extends Controller
|
|||
trans('admin/licenses/form.remaining_seats'),
|
||||
trans('admin/licenses/form.expiration'),
|
||||
trans('admin/licenses/form.date'),
|
||||
trans('admin/licenses/form.depreciation'),
|
||||
trans('admin/licenses/form.cost')
|
||||
];
|
||||
|
||||
|
@ -448,6 +449,7 @@ class ReportsController extends Controller
|
|||
$row[] = $license->remaincount();
|
||||
$row[] = $license->expiration_date;
|
||||
$row[] = $license->purchase_date;
|
||||
$row[] = ($license->depreciation!='') ? '' : e($license->depreciation->name);
|
||||
$row[] = '"' . Helper::formatCurrencyOutput($license->purchase_cost) . '"';
|
||||
|
||||
$rows[] = implode($row, ',');
|
||||
|
|
|
@ -33,7 +33,10 @@
|
|||
<th class="col-sm-1">{{ trans('admin/licenses/form.remaining_seats') }}</th>
|
||||
<th class="col-sm-1">{{ trans('admin/licenses/form.expiration') }}</th>
|
||||
<th class="col-sm-1">{{ trans('admin/licenses/form.date') }}</th>
|
||||
<th class="col-sm-1">{{ trans('admin/licenses/form.cost') }}</th>
|
||||
<th class="col-sm-1 text-right" class="col-sm-1">{{ trans('admin/licenses/form.cost') }}</th>
|
||||
<th class="col-sm-1">{{ trans('admin/licenses/form.depreciation') }}</th>
|
||||
<th class="col-sm-1 text-right">{{ trans('admin/hardware/table.book_value') }}</th>
|
||||
<th class="col-sm-1 text-right">{{ trans('admin/hardware/table.diff') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -47,9 +50,11 @@
|
|||
<td>{{ $license->remaincount() }}</td>
|
||||
<td>{{ $license->expiration_date }}</td>
|
||||
<td>{{ $license->purchase_date }}</td>
|
||||
<td>
|
||||
{{ \App\Models\Setting::first()->default_currency }}
|
||||
{{ number_format($license->purchase_cost) }}</td>
|
||||
<td class="text-right">
|
||||
{{ \App\Models\Setting::getSettings()->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput($license->purchase_cost) }}</td>
|
||||
<td>{{ ($license->depreciation) ? e($license->depreciation->name).' ('.$license->depreciation->months.' '.trans('general.months').')' : '' }}</td>
|
||||
<td class="text-right">{{ \App\Models\Setting::getSettings()->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput($license->getDepreciatedValue()) }}</td>
|
||||
<td class="text-right">-{{ \App\Models\Setting::getSettings()->default_currency }}{{ \App\Helpers\Helper::formatCurrencyOutput(($license->purchase_cost - $license->getDepreciatedValue())) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue