diff --git a/changelog/58_UNRELEASED_2020-xx-xx.md b/changelog/58_UNRELEASED_2020-xx-xx.md index dbcfe2ff..59d31c19 100644 --- a/changelog/58_UNRELEASED_2020-xx-xx.md +++ b/changelog/58_UNRELEASED_2020-xx-xx.md @@ -10,8 +10,9 @@ - Clarified the row-button colors and toolips on the stock entries page - 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` +- Fixed that best before dates were displayed on the stock overview and stock entries page even with disabled `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` - Fixed that when editing a stock entry and setting a decimal amount, the decimal part was ignored (only possible when the product option "Allow partial units in stock" is enabled) +- Fixed that "Default best before days" and "Default best before days after opened" on the product edit page were always shown regardless of the feature flags `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` and `FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING` ### Shopping list fixes - Fixed that the "shopping list to stock workflow"-dialog was not visible in compact view diff --git a/views/productform.blade.php b/views/productform.blade.php index 097ec69b..71f6867f 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -117,6 +117,7 @@ + @if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) @php if($mode == 'edit') { $value = $product->default_best_before_days; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'default_best_before_days', @@ -127,6 +128,7 @@ 'hint' => $__t('For purchases this amount of days will be added to today for the best before date suggestion') . ' (' . $__t('-1 means that this product never expires') . ')' )) + @if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING) @php if($mode == 'edit') { $value = $product->default_best_before_days_after_open; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'default_best_before_days_after_open', @@ -136,6 +138,8 @@ 'invalidFeedback' => $__t('The amount cannot be lower than %s', '-1'), 'hint' => $__t('When this product was marked as opened, the best before date will be replaced by today + this amount of days (a value of 0 disables this)') )) + @endif + @endif