diff --git a/changelog/58_UNRELEASED_2020-xx-xx.md b/changelog/58_UNRELEASED_2020-xx-xx.md index 9c160e0b..4286bc0b 100644 --- a/changelog/58_UNRELEASED_2020-xx-xx.md +++ b/changelog/58_UNRELEASED_2020-xx-xx.md @@ -14,6 +14,7 @@ - Fixed a PHP notice on the recipes page when there are no recipes (thanks @mrunkel) - Fixed the conversion factor hint to display also decimal places on the purchase page (only displayed when the product has a different purchase/stock quantity unit) - Fixed that the stock entries page was broken when there were product userfields defined with enabled "Show as column in tables" +- 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` ### Calendar fixes - Fixed that the "Share/Integrate calendar (iCal)" button did not work (thanks @tsia) diff --git a/views/stockentries.blade.php b/views/stockentries.blade.php index 970bbf00..f9693289 100644 --- a/views/stockentries.blade.php +++ b/views/stockentries.blade.php @@ -33,7 +33,9 @@ product_id {{ $__t('Product') }} {{ $__t('Amount') }} + @if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) {{ $__t('Best before date') }} + @endif @if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING){{ $__t('Location') }}@endif @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) {{ $__t('Store') }} @@ -135,10 +137,12 @@ {{ $stockEntry->amount }} {{ $__n($stockEntry->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name_plural) }} @if($stockEntry->open == 1){{ $__t('Opened') }}@endif + @if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) {{ $stockEntry->best_before_date }} + @endif @if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) {{ FindObjectInArrayByPropertyValue($locations, 'id', $stockEntry->location_id)->name }} diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php index fab96a69..cbe628ce 100644 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -83,7 +83,9 @@ {{ $__t('Product') }} {{ $__t('Amount') }} + @if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) {{ $__t('Next best before date') }} + @endif Hidden location Hidden status Hidden product group @@ -193,10 +195,12 @@ @endif + @if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) {{ $currentStockEntry->best_before_date }} + @endif @foreach(FindAllObjectsInArrayByPropertyValue($currentStockLocations, 'product_id', $currentStockEntry->product_id) as $locationsForProduct) {{ FindObjectInArrayByPropertyValue($locations, 'id', $locationsForProduct->location_id)->name }}