Skip to content

A free open source IT asset/license management system

Default to using the current date if last check in end date is not provided

Marcus Moore4e2ef4f05661
diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php
index ed67c6e625..68ca88a2eb 100644
--- a/app/Http/Controllers/ReportsController.php
+++ b/app/Http/Controllers/ReportsController.php
@@ -655,10 +655,11 @@ class ReportsController extends Controller
$assets->whereBetween('assets.last_checkout', [$checkout_start, $checkout_end]);
}
- if (($request->filled('checkin_date_start')) && ($request->filled('checkin_date_end'))) {
+ if (($request->filled('checkin_date_start'))) {
$assets->whereBetween('last_checkin', [
Carbon::parse($request->input('checkin_date_start'))->startOfDay(),
- Carbon::parse($request->input('checkin_date_end'))->endOfDay(),
+ // use today's date is `checkin_date_end` is not provided
+ Carbon::parse($request->input('checkin_date_end', now()))->endOfDay(),
]);
}