current value added to asset index page. translations for this in reports

This commit is contained in:
akemidx 2023-06-22 17:00:42 -04:00
parent 0f76eda4af
commit 8725d40f8d
3 changed files with 19 additions and 11 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');
@ -531,16 +530,6 @@ class ReportsController extends Controller
$header[] = trans('general.status');
}
if ($request->filled('warranty')) {
$header[] = 'Warranty';
$header[] = 'Warranty Expires';
}
if ($request->filled('depreciation')) {
$header[] = 'Value';
$header[] = 'Diff';
$header[] = 'Fully Depreciated';
}
if ($request->filled('checkout_date')) {
$header[] = trans('admin/hardware/table.checkout_date');
}
@ -549,6 +538,17 @@ class ReportsController extends Controller
$header[] = trans('admin/hardware/form.expected_checkin');
}
if ($request->filled('depreciation')) {
$header[] = trans('admin/hardware/table.book_value');
$header[] = trans('admin/hardware/table.diff');
$header[] = trans('admin/hardware/form.fully_depreciated');
}
if ($request->filled('warranty')) {
$header[] = trans('admin/hardware/form.warranty');
$header[] = trans('admin/hardware/form.warranty_expires');
}
if ($request->filled('created_at')) {
$header[] = trans('general.created_at');
}

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" => true,
"sortable" => true,
"title" => trans('admin/hardware/table.book_value'),
"footerFormatter" => 'sumFormatter',
"class" => "text-right",
],[
'field' => 'order_number',
'searchable' => true,
'sortable' => true,