mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Implement "Free products" (closes #426)
This commit is contained in:
@@ -32,6 +32,20 @@
|
||||
<textarea class="form-control" rows="2" id="description" name="description">@if($mode == 'edit'){{ $location->description }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_FREEZING)
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input type="hidden" name="is_freezer" value="0">
|
||||
<input @if($mode == 'edit' && $location->is_freezer == 1) checked @endif class="form-check-input" type="checkbox" id="is_freezer" name="is_freezer" value="1">
|
||||
<label class="form-check-label" for="is_freezer">{{ $__t('Is freezer') }}
|
||||
<span class="text-muted small">{{ $__t('When moving products from/to a freezer location, the products best before date is automatically adjusted according to the product settings') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<input type="hidden" name="is_freezer" value="0">
|
||||
@endif
|
||||
|
||||
@include('components.userfieldsform', array(
|
||||
'userfields' => $userfields,
|
||||
'entity' => 'locations'
|
||||
|
@@ -227,6 +227,31 @@
|
||||
))
|
||||
@endif
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_FREEZING)
|
||||
@php if($mode == 'edit') { $value = $product->default_best_before_days_after_freezing; } else { $value = 0; } @endphp
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'default_best_before_days_after_freezing',
|
||||
'label' => 'Default best before days after freezing',
|
||||
'min' => -1,
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
|
||||
'hint' => $__t('On moving this product to a freezer location, the best before date will be replaced by today + this amount of days')
|
||||
))
|
||||
|
||||
@php if($mode == 'edit') { $value = $product->default_best_before_days_after_thawing; } else { $value = 0; } @endphp
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'default_best_before_days_after_thawing',
|
||||
'label' => 'Default best before days after thawing',
|
||||
'min' => -1,
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
|
||||
'hint' => $__t('On moving this product from a freezer location, the best before date will be replaced by today + this amount of days')
|
||||
))
|
||||
@else
|
||||
<input type="hidden" name="default_best_before_days_after_freezing" value="0">
|
||||
<input type="hidden" name="default_best_before_days_after_thawing" value="0">
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<label for="product-picture">{{ $__t('Product picture') }}
|
||||
<span class="text-muted small">{{ $__t('If you don\'t select a file, the current picture will not be altered') }}</span>
|
||||
|
@@ -29,7 +29,7 @@
|
||||
<select required class="form-control location-combobox" id="location_id_from" name="location_id_from">
|
||||
<option></option>
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
<option value="{{ $location->id }}" data-is-freezer="{{ $location->is_freezer }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="invalid-feedback">{{ $__t('A location is required') }}</div>
|
||||
@@ -66,7 +66,7 @@
|
||||
<select required class="form-control location-combobox" id="location_id_to" name="location_id_to">
|
||||
<option></option>
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
<option value="{{ $location->id }}" data-is-freezer="{{ $location->is_freezer }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="invalid-feedback">{{ $__t('A location is required') }}</div>
|
||||
|
Reference in New Issue
Block a user