mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Add 'Last Audit Date/Next Audit Date' filter to custom report (#8989)
* Add 'Last Audit Date/Next Audit Date' filter to custom report * Added a constraint: cannot require a report with a Last Audit Date in the future.
This commit is contained in:
parent
79549dbfb9
commit
2da6f9136f
|
@ -632,6 +632,14 @@ class ReportsController extends Controller
|
|||
if (($request->filled('expected_checkin_start')) && ($request->filled('expected_checkin_end'))) {
|
||||
$assets->whereBetween('assets.expected_checkin', [$request->input('expected_checkin_start'), $request->input('expected_checkin_end')]);
|
||||
}
|
||||
|
||||
if (($request->filled('last_audit_start')) && ($request->filled('last_audit_end'))) {
|
||||
$assets->whereBetween('assets.last_audit_date', [$request->input('last_audit_start'), $request->input('last_audit_end')]);
|
||||
}
|
||||
|
||||
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')]);
|
||||
}
|
||||
|
||||
$assets->orderBy('assets.created_at', 'ASC')->chunk(20, function($assets) use($handle, $customfields, $request) {
|
||||
|
||||
|
|
|
@ -316,7 +316,25 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Last Audit Date -->
|
||||
<div class="form-group last_audit-range">
|
||||
<label for="last_audit_start" class="col-md-3 control-label">{{ trans('general.last_audit') }}</label>
|
||||
<div class="input-daterange input-group col-md-6" id="datepicker">
|
||||
<input type="text" class="input-sm form-control" name="last_audit_start" aria-label="last_audit_start">
|
||||
<span class="input-group-addon">to</span>
|
||||
<input type="text" class="input-sm form-control" name="last_audit_end" aria-label="last_audit_end">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Next Audit Date -->
|
||||
<div class="form-group next_audit-range">
|
||||
<label for="next_audit_start" class="col-md-3 control-label">{{ trans('general.next_audit_date') }}</label>
|
||||
<div class="input-daterange input-group col-md-6" id="datepicker">
|
||||
<input type="text" class="input-sm form-control" name="next_audit_start" aria-label="nex_audit_start">
|
||||
<span class="input-group-addon">to</span>
|
||||
<input type="text" class="input-sm form-control" name="next_audit_end" aria-label="next_audit_end">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label>
|
||||
|
@ -356,6 +374,19 @@
|
|||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
|
||||
$('.last_audit-range .input-daterange').datepicker({
|
||||
clearBtn: true,
|
||||
todayHighlight: true,
|
||||
endDate:'0d',
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
|
||||
$('.next_audit-range .input-daterange').datepicker({
|
||||
clearBtn: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
|
||||
// Check-all / Uncheck all
|
||||
$(function () {
|
||||
var checkAll = $('input.all');
|
||||
|
|
Loading…
Reference in a new issue