Show optionally an icon on the stock overview page if the product is already on the shopping list (closes #708)

This commit is contained in:
Bernd Bestel
2020-04-13 18:47:41 +02:00
parent 840b35b30d
commit 1390c65864
7 changed files with 28 additions and 1 deletions

View File

@@ -195,6 +195,14 @@
@if($currentStockEntry->amount_opened_aggregated > 0)<span id="product-{{ $currentStockEntry->product_id }}-opened-amount-aggregated" class="small font-italic">{{ $__t('%s opened', $currentStockEntry->amount_opened_aggregated) }}</span>@endif
</span>
@endif
@if(boolval($userSettings['show_icon_on_stock_overview_page_when_product_is_on_shopping_list']))
@php $currentStockEntryShoppingListItems = FindAllObjectsInArrayByPropertyValue($shoppingListItems, 'product_id', $currentStockEntry->product_id) @endphp
@if(count($currentStockEntryShoppingListItems) > 0)
<span class="btn btn-link btn-sm text-muted">
<i class="fas fa-shopping-cart"></i>
</span>
@endif
@endif
</td>
@if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
<td>