Set last_checkin in ui and api controllers

This commit is contained in:
Marcus Moore 2023-08-21 11:57:33 -07:00
parent 8b2716d2b7
commit 489d30c685
3 changed files with 3 additions and 0 deletions

View file

@ -905,6 +905,7 @@ class AssetsController extends Controller
$asset->expected_checkin = null;
$asset->last_checkout = null;
$asset->last_checkin = now();
$asset->assigned_to = null;
$asset->assignedTo()->disassociate($asset);
$asset->accepted = null;

View file

@ -68,6 +68,7 @@ class AssetCheckinController extends Controller
$asset->expected_checkin = null;
$asset->last_checkout = null;
$asset->last_checkin = now();
$asset->assigned_to = null;
$asset->assignedTo()->disassociate($asset);
$asset->assigned_type = null;

View file

@ -73,6 +73,7 @@ class Asset extends Depreciable
protected $casts = [
'purchase_date' => 'date',
'last_checkout' => 'datetime',
'last_checkin' => 'datetime',
'expected_checkin' => 'date',
'last_audit_date' => 'datetime',
'next_audit_date' => 'date',