Purchase Price Hints (#767)

* productcard update last price with per qu purchase name

* Purchase price hints

* purchase set default to 2999-12-31 if not best before date tracking

* purchase- move amount above best buy date and focus amount after product selection
This commit is contained in:
kriddles
2020-04-22 10:38:24 -05:00
committed by GitHub
parent 5e6a9dd443
commit 9a921cfc86
3 changed files with 76 additions and 27 deletions

View File

@@ -30,9 +30,17 @@
@include('components.productpicker', array(
'products' => $products,
'nextInputSelector' => '#best_before_date .datetimepicker-input'
'nextInputSelector' => '#amount'
))
@include('components.numberpicker', array(
'id' => 'amount',
'label' => 'Amount',
'hintId' => 'amount_qu_unit',
'min' => 1,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@php
$additionalGroupCssClasses = '';
@@ -49,7 +57,7 @@
'limitEndToNow' => false,
'limitStartToNow' => false,
'invalidFeedback' => $__t('A best before date is required'),
'nextInputSelector' => '#amount',
'nextInputSelector' => '#price',
'additionalCssClasses' => 'date-only-datetimepicker',
'shortcutValue' => '2999-12-31',
'shortcutLabel' => 'Never expires',
@@ -60,15 +68,6 @@
))
@php $additionalGroupCssClasses = ''; @endphp
@include('components.numberpicker', array(
'id' => 'amount',
'label' => 'Amount',
'hintId' => 'amount_qu_unit',
'min' => 1,
'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'),
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
))
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@include('components.numberpicker', array(
'id' => 'price',
@@ -76,14 +75,14 @@
'min' => 0,
'step' => 0.01,
'value' => '',
'hint' => $__t('in %s and based on the purchase quantity unit', GROCY_CURRENCY),
'hintId' => 'price-hint',
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
'isRequired' => false,
'additionalGroupCssClasses' => 'mb-1'
))
<div class="form-check form-check-inline mb-3">
<input class="form-check-input" type="radio" name="price-type" id="price-type-unit-price" value="unit-price" checked>
<label class="form-check-label" for="price-type-unit-price">{{ $__t('Unit price') }}</label>
<label class="form-check-label" for="price-type-unit-price">{{ $__t('Price') }}</label>
</div>
<div class="form-check form-check-inline mb-3">
<input class="form-check-input" type="radio" name="price-type" id="price-type-total-price" value="total-price">