diff --git a/app/Http/Controllers/Api/ComponentsController.php b/app/Http/Controllers/Api/ComponentsController.php index e72e17eb28..473fbf1482 100644 --- a/app/Http/Controllers/Api/ComponentsController.php +++ b/app/Http/Controllers/Api/ComponentsController.php @@ -246,7 +246,8 @@ class ComponentsController extends Controller 'created_at' => \Carbon::now(), 'assigned_qty' => $request->get('assigned_qty', 1), 'user_id' => \Auth::id(), - 'asset_id' => $request->get('assigned_to') + 'asset_id' => $request->get('assigned_to'), + 'note' => $request->get('note'), ]); $component->logCheckout($request->input('note'), $asset); diff --git a/app/Http/Controllers/Api/ConsumablesController.php b/app/Http/Controllers/Api/ConsumablesController.php index a3aa09736f..be0a0ec922 100644 --- a/app/Http/Controllers/Api/ConsumablesController.php +++ b/app/Http/Controllers/Api/ConsumablesController.php @@ -230,7 +230,8 @@ class ConsumablesController extends Controller $rows[] = [ 'name' => ($consumable_assignment->user) ? $consumable_assignment->user->present()->nameUrl() : 'Deleted User', 'created_at' => Helper::getFormattedDateObject($consumable_assignment->created_at, 'datetime'), - 'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : '', + 'note' => ($consumable_assignment->note) ? $consumable_assignment->note : null, + 'admin' => ($consumable_assignment->admin) ? $consumable_assignment->admin->present()->nameUrl() : null, ]; } @@ -273,6 +274,7 @@ class ConsumablesController extends Controller 'consumable_id' => $consumable->id, 'user_id' => $user->id, 'assigned_to' => $assigned_to, + 'note' => $request->input('note'), ]); // Log checkout event diff --git a/app/Http/Controllers/Components/ComponentCheckoutController.php b/app/Http/Controllers/Components/ComponentCheckoutController.php index ffeaf1b829..b2be07c661 100644 --- a/app/Http/Controllers/Components/ComponentCheckoutController.php +++ b/app/Http/Controllers/Components/ComponentCheckoutController.php @@ -87,6 +87,7 @@ class ComponentCheckoutController extends Controller 'created_at' => date('Y-m-d H:i:s'), 'assigned_qty' => $request->input('assigned_qty'), 'asset_id' => $asset_id, + 'note' => $request->input('note'), ]); event(new CheckoutableCheckedOut($component, $asset, Auth::user(), $request->input('note'))); diff --git a/app/Http/Controllers/Consumables/ConsumableCheckoutController.php b/app/Http/Controllers/Consumables/ConsumableCheckoutController.php index 48cb6ac76a..620676dcbe 100644 --- a/app/Http/Controllers/Consumables/ConsumableCheckoutController.php +++ b/app/Http/Controllers/Consumables/ConsumableCheckoutController.php @@ -66,6 +66,7 @@ class ConsumableCheckoutController extends Controller 'consumable_id' => $consumable->id, 'user_id' => $admin_user->id, 'assigned_to' => e($request->input('assigned_to')), + 'note' => $request->input('note'), ]); event(new CheckoutableCheckedOut($consumable, $user, Auth::user(), $request->input('note'))); diff --git a/app/Http/Transformers/ComponentsAssetsTransformer.php b/app/Http/Transformers/ComponentsAssetsTransformer.php index d7d66cf884..c2c7784fe4 100644 --- a/app/Http/Transformers/ComponentsAssetsTransformer.php +++ b/app/Http/Transformers/ComponentsAssetsTransformer.php @@ -26,6 +26,7 @@ class ComponentsAssetsTransformer 'created_at' => $asset->created_at->format('Y-m-d'), 'qty' => $asset->components()->count(), 'user_can_checkout' => $asset->availableForCheckout(), + 'note' => e($asset->note), ]; $permissions_array['available_actions'] = [