Merge pull request #13197 from akemidx/current_value_for_assets

Current value added to asset index page
This commit is contained in:
snipe 2023-07-19 19:06:15 +01:00 committed by GitHub
commit a19a508a80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View file

@ -501,7 +501,6 @@ class ReportsController extends Controller
$header[] = trans('general.zip');
}
if ($request->filled('assigned_to')) {
$header[] = trans('admin/hardware/table.checkoutto');
$header[] = trans('general.type');
@ -532,13 +531,14 @@ class ReportsController extends Controller
}
if ($request->filled('warranty')) {
$header[] = 'Warranty';
$header[] = 'Warranty Expires';
$header[] = trans('admin/hardware/form.warranty');
$header[] = trans('admin/hardware/form.warranty_expires');
}
if ($request->filled('depreciation')) {
$header[] = 'Value';
$header[] = 'Diff';
$header[] = 'Fully Depreciated';
$header[] = trans('admin/hardware/table.book_value');
$header[] = trans('admin/hardware/table.diff');
$header[] = trans('admin/hardware/form.fully_depreciated');
}
if ($request->filled('checkout_date')) {

View file

@ -92,6 +92,7 @@ class AssetsTransformer
'checkout_counter' => (int) $asset->checkout_counter,
'requests_counter' => (int) $asset->requests_counter,
'user_can_checkout' => (bool) $asset->availableForCheckout(),
'book_value' => Helper::formatCurrencyOutput($asset->getLinearDepreciatedValue()),
];

View file

@ -154,6 +154,13 @@ class AssetPresenter extends Presenter
'footerFormatter' => 'sumFormatter',
'class' => 'text-right',
], [
"field" => "book_value",
"searchable" => false,
"sortable" => false,
"title" => trans('admin/hardware/table.book_value'),
"footerFormatter" => 'sumFormatter',
"class" => "text-right",
],[
'field' => 'order_number',
'searchable' => true,
'sortable' => true,