Implemented a price factor option for recipe ingredients (closes #295)

This commit is contained in:
Bernd Bestel
2019-09-19 21:30:24 +02:00
parent 35a409f462
commit 7c114cfec3
4 changed files with 115 additions and 0 deletions

View File

@@ -74,6 +74,23 @@
<textarea class="form-control" rows="2" id="note" name="note">@if($mode == 'edit'){{ $recipePos->note }}@endif</textarea>
</div>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@php if($mode == 'edit') { $value = $recipePos->price_factor; } else { $value = 1; } @endphp
@include('components.numberpicker', array(
'id' => 'price_factor',
'label' => 'Price factor',
'min' => 0,
'step' => 0.0001,
'value' => '',
'hint' => $__t('The resulting price of this ingredient will be multiplied by this factor'),
'invalidFeedback' => $__t('This cannot be lower than %s', '0'),
'isRequired' => true,
'value' => $value
))
@else
<input type="hidden" name="price" id="price" value="0">
@endif
<button id="save-recipe-pos-button" class="btn btn-success">{{ $__t('Save') }}</button>
</form>