mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
purchase- move amount above best buy date and focus amount after product selection
This commit is contained in:
parent
1be868ebd8
commit
3925912f48
|
|
@ -222,20 +222,10 @@ if (Grocy.Components.ProductPicker !== undefined)
|
||||||
{
|
{
|
||||||
Grocy.Components.DateTimePicker.SetValue(moment().add(productDetails.product.default_best_before_days, 'days').format('YYYY-MM-DD'));
|
Grocy.Components.DateTimePicker.SetValue(moment().add(productDetails.product.default_best_before_days, 'days').format('YYYY-MM-DD'));
|
||||||
}
|
}
|
||||||
$('#amount').focus();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
|
|
||||||
{
|
|
||||||
Grocy.Components.DateTimePicker.GetInputElement().focus();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$('#amount').focus();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#amount").focus();
|
||||||
|
|
||||||
Grocy.FrontendHelpers.ValidateForm('purchase-form');
|
Grocy.FrontendHelpers.ValidateForm('purchase-form');
|
||||||
if (GetUriParam("flow") === "shoppinglistitemtostock" && BoolVal(Grocy.UserSettings.shopping_list_to_stock_workflow_auto_submit_when_prefilled) && document.getElementById("purchase-form").checkValidity() === true)
|
if (GetUriParam("flow") === "shoppinglistitemtostock" && BoolVal(Grocy.UserSettings.shopping_list_to_stock_workflow_auto_submit_when_prefilled) && document.getElementById("purchase-form").checkValidity() === true)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,17 @@
|
||||||
|
|
||||||
@include('components.productpicker', array(
|
@include('components.productpicker', array(
|
||||||
'products' => $products,
|
'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
|
@php
|
||||||
$additionalGroupCssClasses = '';
|
$additionalGroupCssClasses = '';
|
||||||
|
|
@ -49,7 +57,7 @@
|
||||||
'limitEndToNow' => false,
|
'limitEndToNow' => false,
|
||||||
'limitStartToNow' => false,
|
'limitStartToNow' => false,
|
||||||
'invalidFeedback' => $__t('A best before date is required'),
|
'invalidFeedback' => $__t('A best before date is required'),
|
||||||
'nextInputSelector' => '#amount',
|
'nextInputSelector' => '#price',
|
||||||
'additionalCssClasses' => 'date-only-datetimepicker',
|
'additionalCssClasses' => 'date-only-datetimepicker',
|
||||||
'shortcutValue' => '2999-12-31',
|
'shortcutValue' => '2999-12-31',
|
||||||
'shortcutLabel' => 'Never expires',
|
'shortcutLabel' => 'Never expires',
|
||||||
|
|
@ -60,15 +68,6 @@
|
||||||
))
|
))
|
||||||
@php $additionalGroupCssClasses = ''; @endphp
|
@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)
|
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
|
||||||
@include('components.numberpicker', array(
|
@include('components.numberpicker', array(
|
||||||
'id' => 'price',
|
'id' => 'price',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user