Simplified product specific QU display/edit and added more demo QU conversions

This commit is contained in:
Bernd Bestel
2022-12-04 20:25:33 +01:00
parent c1dea5c254
commit 8175b1bcfe
6 changed files with 16 additions and 26 deletions

View File

@@ -706,7 +706,7 @@
<div class="col">
<div class="title-related-links">
<h4>
{{ $__t('QU conversions') }}
{{ $__t('Product specifc QU conversions') }}
</h4>
<button class="btn btn-outline-dark d-md-none mt-2 float-right order-1 order-md-3"
type="button"
@@ -731,9 +731,6 @@
@endif
</div>
<h5 id="qu-conversion-headline-info"
class="text-muted font-italic"></h5>
<table id="qu-conversions-table-products"
class="table table-sm table-striped nowrap w-100">
<thead>
@@ -747,14 +744,12 @@
<th class="allow-grouping">{{ $__t('Quantity unit from') }}</th>
<th class="allow-grouping">{{ $__t('Quantity unit to') }}</th>
<th>{{ $__t('Factor') }}</th>
<th class="allow-grouping">{{ $__t('Group')}}</th>
<th></th>
</tr>
</thead>
<tbody class="d-none">
@if($mode == "edit")
@foreach($quConversions as $quConversion)
@if($quConversion->product_id == $product->id || $quConversion->product_id == null && ($quConversion->product_id != null || $quConversion->from_qu_id == $product->qu_id_purchase || $quConversion->from_qu_id == $product->qu_id_stock || $quConversion->to_qu_id == $product->qu_id_purchase || $quConversion->to_qu_id == $product->qu_id_stock))
<tr>
<td class="fit-content border-right">
<a class="btn btn-sm btn-info show-as-dialog-link @if($quConversion->product_id == null) disabled @endif"
@@ -776,18 +771,10 @@
<td>
<span class="locale-number locale-number-quantity-amount">{{ $quConversion->factor }}</span>
</td>
<td class="d-none">
@if($quConversion->product_id != null)
{{ $__t('Product overrides') }}
@else
{{ $__t('Default conversions') }}
@endif
</td>
<td class="font-italic">
{!! $__t('This means 1 %1$s is the same as %2$s %3$s', FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->from_qu_id)->name, '<span class="locale-number locale-number-quantity-amount">' . $quConversion->factor . '</span>', $__n($quConversion->factor, FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name_plural, true)) !!}
</td>
</tr>
@endif
@endforeach
@endif
</tbody>