Set rtd_location if a location is given at checkin

This commit is contained in:
Ivan Nieto Vivanco 2023-06-29 03:16:59 -06:00
parent f7f2d799f2
commit 011726154c

View file

@ -94,14 +94,15 @@ class AssetCheckinController extends Controller
\Log::debug('Manually override the location IDs'); \Log::debug('Manually override the location IDs');
\Log::debug('Original Location ID: '.$asset->location_id); \Log::debug('Original Location ID: '.$asset->location_id);
$asset->location_id = ''; $asset->location_id = '';
\Log::debug('New RTD Location ID: '.$asset->location_id); \Log::debug('New Location ID: '.$asset->location_id);
} }
$asset->location_id = $asset->rtd_location_id; $asset->location_id = $asset->rtd_location_id;
if ($request->filled('location_id')) { if ($request->filled('location_id')) {
\Log::debug('NEW Location ID: '.$request->get('location_id')); \Log::debug('NEW Location ID: '.$request->get('location_id'));
$asset->location_id = e($request->get('location_id')); $asset->location_id = $request->get('location_id');
$asset->rtd_location_id = $request->get('location_id');
} }
$checkin_at = date('Y-m-d H:i:s'); $checkin_at = date('Y-m-d H:i:s');