mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Merge pull request #12874 from Godmartinz/feature/sc-23130
Adds a checkout range for custom asset reports
This commit is contained in:
commit
fe710efb40
|
@ -641,6 +641,9 @@ class ReportsController extends Controller
|
|||
if (($request->filled('created_start')) && ($request->filled('created_end'))) {
|
||||
$assets->whereBetween('assets.created_at', [$request->input('created_start'), $request->input('created_end')]);
|
||||
}
|
||||
if (($request->filled('checkout_date_start')) && ($request->filled('checkout_date_end'))) {
|
||||
$assets->whereBetween('assets.last_checkout', [$request->input('checkout_date_start'), $request->input('checkout_date_end')]);
|
||||
}
|
||||
|
||||
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')]);
|
||||
|
|
|
@ -283,6 +283,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Checkout Date -->
|
||||
<div class="form-group checkout-range">
|
||||
<label for="checkout_date" class="col-md-3 control-label">{{ trans('general.checkout') }} {{ trans('general.range') }}</label>
|
||||
<div class="input-daterange input-group col-md-6" id="datepicker">
|
||||
<input type="text" class="form-control" name="checkout_date_start" aria-label="checkout_date_start">
|
||||
<span class="input-group-addon">to</span>
|
||||
<input type="text" class="form-control" name="checkout_date_end" aria-label="checkout_date_end">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Expected Checkin Date -->
|
||||
<div class="form-group expected_checkin-range">
|
||||
<label for="expected_checkin_start" class="col-md-3 control-label">{{ trans('admin/hardware/form.expected_checkin') }}</label>
|
||||
|
@ -368,6 +378,12 @@
|
|||
endDate: '0d',
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
$('.checkout-range .input-daterange').datepicker({
|
||||
clearBtn: true,
|
||||
todayHighlight: true,
|
||||
endDate: '0d',
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
|
||||
$('.expected_checkin-range .input-daterange').datepicker({
|
||||
clearBtn: true,
|
||||
|
|
Loading…
Reference in a new issue