Move FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT to per product option (closes #1753)

This commit is contained in:
Bernd Bestel
2022-02-07 19:12:31 +01:00
parent 12e5377c40
commit d1d52aea44
10 changed files with 204 additions and 25 deletions

View File

@@ -160,7 +160,7 @@
'additionalCssClasses' => 'locale-number-input locale-number-quantity-amount'
))
<div class="form-group">
<div class="form-group @if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING) mb-1 @endif">
<div class="custom-control custom-checkbox">
<input @if($mode=='edit'
&&
@@ -175,6 +175,22 @@
</div>
</div>
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING)
<div class="form-group">
<div class="custom-control custom-checkbox">
<input @if($mode=='edit'
&&
$product->treat_opened_as_out_of_stock == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="treat_opened_as_out_of_stock" name="treat_opened_as_out_of_stock" value="1">
<label class="form-check-label custom-control-label"
for="treat_opened_as_out_of_stock">{{ $__t('Treat opened as out of stock') }}&nbsp;<i class="fas fa-question-circle text-muted"
data-toggle="tooltip"
data-trigger="hover click"
title="{{ $__t('When enabled, opened items will be counted as missing for calculating if this product is below its minimum stock amount') }}"></i>
</label>
</div>
</div>
@endif
@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
<div class="form-group">
<label class="d-block my-0"

View File

@@ -63,6 +63,21 @@
'min' => -1,
'additionalCssClasses' => 'user-setting-control'
))
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING)
<div class="form-group">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="form-check-input custom-control-input user-setting-control"
id="product_presets_treat_opened_as_out_of_stock"
data-setting-key="product_presets_treat_opened_as_out_of_stock">
<label class="form-check-label custom-control-label"
for="product_presets_treat_opened_as_out_of_stock">
{{ $__t('Treat opened as out of stock') }}
</label>
</div>
</div>
@endif
</div>
<h4 class="mt-2">{{ $__t('Stock overview') }}</h4>