Fixed that best before dates were displayed on the stock overview and stock entries page even with disabled GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING (fixes #673)

This commit is contained in:
Bernd Bestel
2020-04-12 14:17:52 +02:00
parent 390af436ab
commit 0f3a3887a2
3 changed files with 9 additions and 0 deletions

View File

@@ -83,7 +83,9 @@
<th class="border-right"></th>
<th>{{ $__t('Product') }}</th>
<th>{{ $__t('Amount') }}</th>
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
<th>{{ $__t('Next best before date') }}</th>
@endif
<th class="d-none">Hidden location</th>
<th class="d-none">Hidden status</th>
<th class="d-none">Hidden product group</th>
@@ -193,10 +195,12 @@
</span>
@endif
</td>
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
<td>
<span id="product-{{ $currentStockEntry->product_id }}-next-best-before-date">{{ $currentStockEntry->best_before_date }}</span>
<time id="product-{{ $currentStockEntry->product_id }}-next-best-before-date-timeago" class="timeago timeago-contextual" datetime="{{ $currentStockEntry->best_before_date }} 23:59:59"></time>
</td>
@endif
<td class="d-none">
@foreach(FindAllObjectsInArrayByPropertyValue($currentStockLocations, 'product_id', $currentStockEntry->product_id) as $locationsForProduct)
{{ FindObjectInArrayByPropertyValue($locations, 'id', $locationsForProduct->location_id)->name }}