mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Use exact matches for product barcode lookups (closes #366)
This commit is contained in:
parent
53c56cc1cb
commit
099ac7e75a
@ -1,3 +1,4 @@
|
|||||||
|
- Fixed that barcode lookups now compare the whole barcode, not parts of it (e. g. when you have two products with the barcodes "$1" and "$10" and scan "$1" maybe the product of "$10" was found till now)
|
||||||
- It's now possible to display a recipe directly from the meal plan (new "eye button") (thanks @kriddles)
|
- It's now possible to display a recipe directly from the meal plan (new "eye button") (thanks @kriddles)
|
||||||
- Improved the responsiveness of the meal plan and calendar page by automatically switching to a day calendar view on smaller screens (thanks for the idea @kriddles)
|
- Improved the responsiveness of the meal plan and calendar page by automatically switching to a day calendar view on smaller screens (thanks for the idea @kriddles)
|
||||||
- The calendar now also contains all planned recipes from the meal plan on the corresponding day
|
- The calendar now also contains all planned recipes from the meal plan on the corresponding day
|
||||||
|
@ -134,7 +134,7 @@ $('#product_id_text_input').on('blur', function(e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
var input = $('#product_id_text_input').val().toString();
|
var input = $('#product_id_text_input').val().toString();
|
||||||
var possibleOptionElement = $("#product_id option[data-additional-searchdata*=\"" + input + "\"]").first();
|
var possibleOptionElement = $("#product_id option[data-additional-searchdata*=\"" + input + ",\"]").first();
|
||||||
|
|
||||||
if (GetUriParam('addbarcodetoselection') === undefined && possibleOptionElement.length > 0)
|
if (GetUriParam('addbarcodetoselection') === undefined && possibleOptionElement.length > 0)
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<select class="form-control product-combobox barcodescanner-input" id="product_id" name="product_id" @if($isRequired) required @endif @if($disabled) disabled @endif>
|
<select class="form-control product-combobox barcodescanner-input" id="product_id" name="product_id" @if($isRequired) required @endif @if($disabled) disabled @endif>
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
@foreach($products as $product)
|
@foreach($products as $product)
|
||||||
<option data-additional-searchdata="{{ $product->barcode }}" value="{{ $product->id }}">{{ $product->name }}</option>
|
<option data-additional-searchdata="{{ $product->barcode }}@if(!empty($product->barcode)),@endif" value="{{ $product->id }}">{{ $product->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<div class="invalid-feedback">{{ $__t('You have to select a product') }}</div>
|
<div class="invalid-feedback">{{ $__t('You have to select a product') }}</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user