From 78097df7ff18ed4b04dfe34beb319bc2df0576a1 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 21 Jul 2022 21:45:25 -0700 Subject: [PATCH] Aplpies current time to checkin date Signed-off-by: snipe --- app/Http/Controllers/Api/AssetsController.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index ebb19159dd..9d6c3f1168 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -885,11 +885,9 @@ class AssetsController extends Controller if ($request->has('status_id')) { $asset->status_id = $request->input('status_id'); } + + $checkin_at = $request->filled('checkin_at') ? $request->input('checkin_at').' '. date('H:i:s') : date('Y-m-d H:i:s'); - $checkin_at = null; - if ($request->filled('checkin_at')) { - $checkin_at = $request->input('checkin_at'); - } if ($asset->save()) { event(new CheckoutableCheckedIn($asset, $target, Auth::user(), $request->input('note'), $checkin_at)); @@ -912,7 +910,7 @@ class AssetsController extends Controller $this->authorize('checkin', Asset::class); $asset = Asset::where('asset_tag', $request->input('asset_tag'))->first(); - if($asset) { + if ($asset) { return $this->checkin($request, $asset->id); }