mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
uses numRemaining now
This commit is contained in:
parent
b038fe8f2e
commit
55943d8897
|
@ -78,9 +78,11 @@ class AccessoryCheckoutController extends Controller
|
|||
]);
|
||||
|
||||
$checkedout=DB::table('accessories_users')->where('accessory_id', '=', $accessory->id)->count();
|
||||
$available=DB::table('accessories')->where('id', '=', $accessory->id)->first('qty');
|
||||
$available= new Accessory();
|
||||
|
||||
if($checkedout >= $available->qty){
|
||||
|
||||
|
||||
if($checkedout >= $available->numRemaining()){
|
||||
|
||||
return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.checkout.unavailable'));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue