Skip to content

A free open source IT asset/license management system

Allow qty parameter in partial

snipee8b637b9006f
diff --git a/resources/views/accessories/edit.blade.php b/resources/views/accessories/edit.blade.php
index a327df5fa9..5c2963485f 100644
--- a/resources/views/accessories/edit.blade.php
+++ b/resources/views/accessories/edit.blade.php
@@ -25,7 +25,7 @@
@include ('partials.forms.edit.order_number')
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.purchase_date'),'fieldname' => 'purchase_date'])
@include ('partials.forms.edit.purchase_cost', ['currency_type' => $item->location->currency ?? null, 'unit_cost' => trans('general.unit_cost')])
-@include ('partials.forms.edit.quantity')
+@include ('partials.forms.edit.quantity', ['min' => 0])
@include ('partials.forms.edit.minimum_quantity')
@include ('partials.forms.edit.notes')
@include ('partials.forms.edit.image-upload', ['image_path' => app('accessories_upload_path')])
diff --git a/resources/views/partials/forms/edit/quantity.blade.php b/resources/views/partials/forms/edit/quantity.blade.php
index 403e0f5343..11f4470a4a 100644
--- a/resources/views/partials/forms/edit/quantity.blade.php
+++ b/resources/views/partials/forms/edit/quantity.blade.php
@@ -4,7 +4,7 @@
<label for="qty" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
<div class="col-md-9">
<div class="col-md-3" style="padding-left:0">
- <input class="form-control" maxlength="5" min="1" type="number" name="qty" aria-label="qty" id="qty" value="{{ old('qty', $item->qty) }}" {!! (Helper::checkIfRequired($item, 'qty')) ? ' required ' : '' !!}/>
+ <input class="form-control" maxlength="5" min="{{ (isset($qty)) ? $qty : '0' }}" type="number" name="qty" aria-label="qty" id="qty" value="{{ old('qty', $item->qty) }}" {!! (Helper::checkIfRequired($item, 'qty')) ? ' required ' : '' !!}/>
</div>
<div class="col-md-12" style="padding-left:0">
{!! $errors->first('qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}