Don't display QU conversions for other products on the product edit page (fixes #400)

This commit is contained in:
Bernd Bestel 2019-10-02 15:53:36 +02:00
parent 901b345714
commit 420e4b933f
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 33 additions and 28 deletions

View File

@ -0,0 +1,5 @@
### Stock fixes
- Fixed that product specific quantity unit conversions (product overrides) were also displayed on the product edit page of other products with the same stock quantity unit
### Recipe fixes
- Fixed that recipes were displayed without ingredients if the total recipe count was > 100

View File

@ -1,2 +0,0 @@
### Recipe fixes
- Fixed that recipes were displayed without ingredients if the total recipe count was > 100

View File

@ -268,32 +268,34 @@
<tbody class="d-none">
@if($mode == "edit")
@foreach($quConversions as $quConversion)
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info qu-conversion-edit-button @if($quConversion->product_id == null) disabled @endif" href="#" data-qu-conversion-id="{{ $quConversion->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger qu-conversion-delete-button @if($quConversion->product_id == null) disabled @endif" href="#" data-qu-conversion-id="{{ $quConversion->id }}">
<i class="fas fa-trash"></i>
</a>
</td>
<td>
<span class="locale-number locale-number-quantity-amount">{{ $quConversion->factor }}</span>
</td>
<td>
{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name }}
</td>
<td class="d-none">
@if($quConversion->product_id != null)
{{ $__t('Product overrides') }}
@else
{{ $__t('Default conversions') }}
@endif
</td>
<td class="d-none">
from_qu_id xx{{ $quConversion->from_qu_id }}xx
</td>
</tr>
@if($quConversion->product_id == $product->id || $quConversion->product_id == null)
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info qu-conversion-edit-button @if($quConversion->product_id == null) disabled @endif" href="#" data-qu-conversion-id="{{ $quConversion->id }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger qu-conversion-delete-button @if($quConversion->product_id == null) disabled @endif" href="#" data-qu-conversion-id="{{ $quConversion->id }}">
<i class="fas fa-trash"></i>
</a>
</td>
<td>
<span class="locale-number locale-number-quantity-amount">{{ $quConversion->factor }}</span>
</td>
<td>
{{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name }}
</td>
<td class="d-none">
@if($quConversion->product_id != null)
{{ $__t('Product overrides') }}
@else
{{ $__t('Default conversions') }}
@endif
</td>
<td class="d-none">
from_qu_id xx{{ $quConversion->from_qu_id }}xx
</td>
</tr>
@endif
@endforeach
@endif
</tbody>