mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-14 01:24:06 -08:00
Filter items from the report if null returned
This commit is contained in:
parent
b7a5467f8b
commit
eb67d1b064
|
@ -1110,13 +1110,19 @@ class ReportsController extends Controller
|
||||||
$rows[] = implode(',', $header);
|
$rows[] = implode(',', $header);
|
||||||
|
|
||||||
foreach ($assetsForReport as $item) {
|
foreach ($assetsForReport as $item) {
|
||||||
$row = [ ];
|
|
||||||
$row[] = str_replace(',', '', e($item['assetItem']->model->category->name));
|
if ($item['assetItem'] != null){
|
||||||
$row[] = str_replace(',', '', e($item['assetItem']->model->name));
|
|
||||||
$row[] = str_replace(',', '', e($item['assetItem']->name));
|
$row = [ ];
|
||||||
$row[] = str_replace(',', '', e($item['assetItem']->asset_tag));
|
$row[] = str_replace(',', '', e($item['assetItem']->model->category->name));
|
||||||
$row[] = str_replace(',', '', e(($item['acceptance']->assignedTo) ? $item['acceptance']->assignedTo->present()->name() : trans('admin/reports/general.deleted_user')));
|
$row[] = str_replace(',', '', e($item['assetItem']->model->name));
|
||||||
$rows[] = implode(',', $row);
|
$row[] = str_replace(',', '', e($item['assetItem']->name));
|
||||||
|
$row[] = str_replace(',', '', e($item['assetItem']->asset_tag));
|
||||||
|
$row[] = str_replace(',', '', e(($item['acceptance']->assignedTo) ? $item['acceptance']->assignedTo->present()->name() : trans('admin/reports/general.deleted_user')));
|
||||||
|
$rows[] = implode(',', $row);
|
||||||
|
} else {
|
||||||
|
// Log the error maybe?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// spit out a csv
|
// spit out a csv
|
||||||
|
|
Loading…
Reference in a new issue