Skip to content

A free open source IT asset/license management system

Add employee number option to custom report

snipe45c789021e51
diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php
index faad723fe0..7f5b97f180 100644
--- a/app/Http/Controllers/ReportsController.php
+++ b/app/Http/Controllers/ReportsController.php
@@ -561,6 +561,9 @@ class ReportsController extends Controller
if (e(Input::get('username')) == '1') {
$header[] = 'Username';
}
+ if (e(Input::get('employee_num')) == '1') {
+ $header[] = 'Employee No.';
+ }
if (e(Input::get('status')) == '1') {
$header[] = 'Status';
}
@@ -679,6 +682,14 @@ class ReportsController extends Controller
}
}
+ if (e(Input::get('employee_num')) == '1') {
+ if ($asset->assigneduser) {
+ $row[] = '"' .e($asset->assigneduser->employee_num). '"';
+ } else {
+ $row[] = ''; // Empty string if unassigned
+ }
+ }
+
if (e(Input::get('status')) == '1') {
if (( $asset->status_id == '0' ) && ( $asset->assigned_to == '0' )) {
$row[] = trans('general.ready_to_deploy');
diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php
index 2a25450603..756ea16f77 100644
--- a/resources/views/reports/custom.blade.php
+++ b/resources/views/reports/custom.blade.php
@@ -128,6 +128,13 @@
</label>
</div>
+ <div class="checkbox col-md-12">
+ <label>
+ {{ Form::checkbox('employee_num', '1') }}
+ {{ trans('admin/users/table.employee_num') }}
+ </label>
+ </div>
+
<div class="checkbox col-md-12">
<label>
{{ Form::checkbox('status', '1') }}
@@ -168,7 +175,7 @@
<div class="col-md-7">
- <p>Select the fields you'd like to include in your custom report, and click Generate. The file (report.csv) will download automatically, and you can open it in Excel.</p>
+ <p>Select the fields you'd like to include in your custom report, and click Generate. The file (YYYY-mm-dd-his-custom-asset-report.csv) will download automatically, and you can open it in Excel.</p>
</div>
</div>