mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 05:36:15 +02:00
Edit product qu_stock is unavailable after first purchase
This commit is contained in:
parent
6ff84c6457
commit
6a3456d522
|
|
@ -186,6 +186,20 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Grocy.Api.Get('stock/products/' + Grocy.EditObjectId,
|
||||||
|
function(productDetails)
|
||||||
|
{
|
||||||
|
if (productDetails.last_purchased == null)
|
||||||
|
{
|
||||||
|
$('#qu_id_stock').removeAttr("disabled");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(xhr)
|
||||||
|
{
|
||||||
|
console.error(xhr);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
var prefillName = GetUriParam('prefillname');
|
var prefillName = GetUriParam('prefillname');
|
||||||
if (prefillName !== undefined)
|
if (prefillName !== undefined)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,8 @@
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="qu_id_stock">{{ $__t('Quantity unit stock') }}</label>
|
<label for="qu_id_stock">{{ $__t('Quantity unit stock') }}</label>
|
||||||
<select required class="form-control input-group-qu" id="qu_id_stock" name="qu_id_stock">
|
<i class="fas fa-question-circle" data-toggle="tooltip" title="Quantity unit stock cannot be changed after first purchase"></i>
|
||||||
|
<select required class="form-control input-group-qu" id="qu_id_stock" name="qu_id_stock" @if($mode == 'edit') disabled @endif>
|
||||||
<option></option>
|
<option></option>
|
||||||
@foreach($quantityunits as $quantityunit)
|
@foreach($quantityunits as $quantityunit)
|
||||||
<option @if($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
|
<option @if($mode == 'edit' && $quantityunit->id == $product->qu_id_stock) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user