mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 01:55:47 +00:00
Fixed QU conversion form from_qu_id initialisation (fixes #1843)
This commit is contained in:
parent
03bba4b9e5
commit
5df81a74c6
@ -56,10 +56,32 @@
|
|||||||
name="from_qu_id">
|
name="from_qu_id">
|
||||||
<option></option>
|
<option></option>
|
||||||
@foreach($quantityunits as $quantityunit)
|
@foreach($quantityunits as $quantityunit)
|
||||||
<option @if(($product
|
@php
|
||||||
!=null
|
$selected = false;
|
||||||
&&
|
if ($mode == 'edit' && $quantityunit->id == $quConversion->from_qu_id)
|
||||||
$quantityunit->id == $product->qu_id_stock) || ($defaultQuUnit != null && $quantityunit->id == $defaultQuUnit->id))) selected="selected" @endif value="{{ $quantityunit->id }}" data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
|
{
|
||||||
|
$selected = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($product != null && $quantityunit->id == $product->qu_id_stock)
|
||||||
|
{
|
||||||
|
$selected = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($quantityunit->id == $defaultQuUnit->id)
|
||||||
|
{
|
||||||
|
$selected = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
<option @if($selected)
|
||||||
|
selected="selected"
|
||||||
|
@endif
|
||||||
|
value="{{ $quantityunit->id }}"
|
||||||
|
data-plural-form="{{ $quantityunit->name_plural }}">{{ $quantityunit->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
<div class="invalid-feedback">{{ $__t('A quantity unit is required') }}</div>
|
<div class="invalid-feedback">{{ $__t('A quantity unit is required') }}</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user