adds a checkbox to exclude archived assets from custom reports

This commit is contained in:
Godfrey M 2022-07-11 09:56:58 -07:00
parent 78d5c37267
commit 75844c5942
3 changed files with 8 additions and 1 deletions

View file

@ -642,6 +642,9 @@ class ReportsController extends Controller
if (($request->filled('next_audit_start')) && ($request->filled('next_audit_end'))) {
$assets->whereBetween('assets.next_audit_date', [$request->input('next_audit_start'), $request->input('next_audit_end')]);
}
if($request->filled('exclude_archived')){
$assets->where('archived', '=', 0);
}
$assets->orderBy('assets.id', 'ASC')->chunk(20, function ($assets) use ($handle, $customfields, $request) {
$executionTime = microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];

View file

@ -101,6 +101,7 @@ return [
'employee_number' => 'Employee Number',
'email_domain_help' => 'This is used to generate email addresses when importing',
'error' => 'Error',
'exclude_archived' => 'Exclude Archived Assets',
'example' => 'Example: ',
'filastname_format' => 'First Initial Last Name (jsmith@example.com)',
'firstname_lastname_format' => 'First Name Last Name (jane.smith@example.com)',

View file

@ -340,11 +340,14 @@
</div>
<div class="col-md-9 col-md-offset-3">
<label>
{{ Form::checkbox('exclude_archived', '1') }}
{{ trans('general.exclude_archived') }}
</label>
<label>
{{ Form::checkbox('use_bom', '1') }}
{{ trans('general.bom_remark') }}
</label>
</div>
</div>