Skip to content

A free open source IT asset/license management system

Component checkout/checkin fixes.

Daniel Meltzer358609720a07
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 @@
<label for="assigned_qty" class="col-md-3 control-label">{{ trans('general.qty') }}
<i class='icon-asterisk'></i></label>
<div class="col-md-9">
- <input class="form-control" type="text" name="assigned_qty" id="assigned_qty" style="width: 70px;" value="{{ old('assigned_qty') }}" />
+ <input class="form-control" type="text" name="assigned_qty" id="assigned_qty" style="width: 70px;" value="{{ old('assigned_qty') ?? 1 }}" />
{!! $errors->first('assigned_qty', '<br><span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>