From 358609720a071160586af1a20d9195f47713d39c Mon Sep 17 00:00:00 2001 From: Daniel Meltzer Date: Wed, 29 Apr 2020 12:50:09 -0400 Subject: [PATCH] Component checkout/checkin fixes. - Provide proper translated messages for checkin vs checkout - Pass appropriate methods to the Checkout event, fixes an error on checkin. - Default to a value of 1 on checkin in UI to save a click sometimes. --- .../Controllers/Components/ComponentCheckinController.php | 7 ++++--- resources/views/components/checkout.blade.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Components/ComponentCheckinController.php b/app/Http/Controllers/Components/ComponentCheckinController.php index b42cdca9eb..eee0f15827 100644 --- a/app/Http/Controllers/Components/ComponentCheckinController.php +++ b/app/Http/Controllers/Components/ComponentCheckinController.php @@ -8,6 +8,7 @@ use App\Http\Controllers\Controller; use App\Models\Asset; use App\Models\Component; use Illuminate\Http\Request; +use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Validator; @@ -96,12 +97,12 @@ class ComponentCheckinController extends Controller $asset = Asset::find($component_assets->asset_id); - event(new CheckoutableCheckedIn($component, $asset, Auth::user(), $request->input('note'))); + event(new CheckoutableCheckedIn($component, $asset, Auth::user(), $request->input('note'), Carbon::now())); return redirect()->route('components.index')->with('success', - trans('admin/components/message.checkout.success')); + trans('admin/components/message.checkin.success')); } - return redirect()->route('components.index')->with('error', trans('admin/components/message.not_found')); + return redirect()->route('components.index')->with('error', trans('admin/components/message.does_not_exist')); } } diff --git a/resources/views/components/checkout.blade.php b/resources/views/components/checkout.blade.php index d1338f4f8c..2bebc06d6a 100644 --- a/resources/views/components/checkout.blade.php +++ b/resources/views/components/checkout.blade.php @@ -42,7 +42,7 @@
- + {!! $errors->first('assigned_qty', '
') !!}