Merge pull request #11488 from Godmartinz/feature/sc-19107/add-box-to-custom-reports-to-not-include

adds a checkbox to exclude archived assets from custom reports
This commit is contained in:
snipe 2022-07-12 12:59:18 -07:00 committed by GitHub
commit 0ccd7e09de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -642,6 +642,10 @@ 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->notArchived();
}
$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>