Skip to content

A free open source IT asset/license management system

fixes action_date for check-in not including H:i:s

Godfrey M3eb7a87a666b
diff --git a/app/Http/Controllers/Assets/AssetCheckinController.php b/app/Http/Controllers/Assets/AssetCheckinController.php
index ec0ef1c365..913bf4bcf6 100644
--- a/app/Http/Controllers/Assets/AssetCheckinController.php
+++ b/app/Http/Controllers/Assets/AssetCheckinController.php
@@ -105,9 +105,9 @@ class AssetCheckinController extends Controller
$asset->location_id = e($request->get('location_id'));
}
- $checkin_at = date('Y-m-d');
- if($request->filled('checkin_at')){
- $checkin_at = $request->input('checkin_at');
+ $checkin_at = date('Y-m-d H:i:s');
+ if (($request->filled('checkin_at')) && ($request->get('checkin_at') != date('Y-m-d'))) {
+ $checkin_at = $request->get('checkin_at');
}
// Was the asset updated?
diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php
index d8b3e7f9a0..4d1eb1fd64 100644
--- a/app/Models/Loggable.php
+++ b/app/Models/Loggable.php
@@ -116,6 +116,9 @@ trait Loggable
$log->location_id = null;
$log->note = $note;
$log->action_date = $action_date;
+ if (! $log->action_date) {
+ $log->action_date = date('Y-m-d H:i:s');
+ }
if (Auth::user()) {
$log->user_id = Auth::user()->id;