mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 02:04:38 +00:00
Fixed the "Shopping list to stock workflow" with disabled FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING (fixes #537)
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
### Shopping list improvements/fixes
|
### Shopping list improvements/fixes
|
||||||
- Added an option to hide the month-calendar (in the shopping list settings / top right corner settings menu) (defaults to disabled, so please enable this option if you still want to have the month-calendar on the shopping list)
|
- Added an option to hide the month-calendar (in the shopping list settings / top right corner settings menu) (defaults to disabled, so please enable this option if you still want to have the month-calendar on the shopping list)
|
||||||
- Optimized the new compact view (there was a little too much white space at the sides of the page)
|
- Optimized the new compact view (there was a little too much white space at the sides of the page)
|
||||||
|
- Fixed that the "Shopping list to stock workflow" did not work when `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` was set to `false`
|
||||||
|
|
||||||
### Recipe improvements/fixes
|
### Recipe improvements/fixes
|
||||||
- Optimized the ordering of the inputs on the recipe ingredient edit page (moved "Only check if a single unit is in stock" before the amount)
|
- Optimized the ordering of the inputs on the recipe ingredient edit page (moved "Only check if a single unit is in stock" before the amount)
|
||||||
|
@@ -163,7 +163,7 @@ function animateCSS(selector, animationName, callback, speed = "faster")
|
|||||||
{
|
{
|
||||||
nodes.removeClass('animated').removeClass(speed).removeClass(animationName);
|
nodes.removeClass('animated').removeClass(speed).removeClass(animationName);
|
||||||
nodes.unbind('animationend', handleAnimationEnd);
|
nodes.unbind('animationend', handleAnimationEnd);
|
||||||
|
|
||||||
if (typeof callback === 'function')
|
if (typeof callback === 'function')
|
||||||
{
|
{
|
||||||
callback();
|
callback();
|
||||||
|
@@ -178,6 +178,11 @@ if (Grocy.Components.ProductPicker !== undefined)
|
|||||||
$("#tare-weight-handling-info").addClass("d-none");
|
$("#tare-weight-handling-info").addClass("d-none");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
|
||||||
|
{
|
||||||
|
Grocy.Components.DateTimePicker.SetValue(moment().format('YYYY-MM-DD'));
|
||||||
|
}
|
||||||
|
|
||||||
if (productDetails.product.default_best_before_days.toString() !== '0')
|
if (productDetails.product.default_best_before_days.toString() !== '0')
|
||||||
{
|
{
|
||||||
if (productDetails.product.default_best_before_days == -1)
|
if (productDetails.product.default_best_before_days == -1)
|
||||||
@@ -192,12 +197,6 @@ 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();
|
$('#amount').focus();
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
$("#save-purchase-button").click();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -207,11 +206,16 @@ if (Grocy.Components.ProductPicker !== undefined)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Grocy.Components.DateTimePicker.SetValue(moment().format('YYYY-MM-DD'));
|
|
||||||
$('#amount').focus();
|
$('#amount').focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
$("#save-purchase-button").click();
|
||||||
|
}
|
||||||
|
|
||||||
if (BoolVal(Grocy.UserSettings.scan_mode_purchase_enabled))
|
if (BoolVal(Grocy.UserSettings.scan_mode_purchase_enabled))
|
||||||
{
|
{
|
||||||
$("#amount").val(1);
|
$("#amount").val(1);
|
||||||
|
@@ -95,7 +95,7 @@ $(document).on('click', '.shoppinglist-delete-button', function(e)
|
|||||||
var shoppingListItemId = $(e.currentTarget).attr('data-shoppinglist-id');
|
var shoppingListItemId = $(e.currentTarget).attr('data-shoppinglist-id');
|
||||||
Grocy.FrontendHelpers.BeginUiBusy();
|
Grocy.FrontendHelpers.BeginUiBusy();
|
||||||
|
|
||||||
Grocy.Api.Delete('objects/shopping_list/' + shoppingListItemId, {},
|
Grocy.Api.Delete('objects/shopping_list/' + shoppingListItemId, { },
|
||||||
function(result)
|
function(result)
|
||||||
{
|
{
|
||||||
animateCSS("#shoppinglistitem-" + shoppingListItemId + "-row", "fadeOut", function()
|
animateCSS("#shoppinglistitem-" + shoppingListItemId + "-row", "fadeOut", function()
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
@section('viewJsName', 'barcodescannertesting')
|
@section('viewJsName', 'barcodescannertesting')
|
||||||
|
|
||||||
@push('pageScripts')
|
@push('pageScripts')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
@section('viewJsName', 'batteriesoverview')
|
@section('viewJsName', 'batteriesoverview')
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
@section('viewJsName', 'choresoverview')
|
@section('viewJsName', 'choresoverview')
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
@section('viewJsName', 'manageapikeys')
|
@section('viewJsName', 'manageapikeys')
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
@section('viewJsName', 'quantityunitpluraltesting')
|
@section('viewJsName', 'quantityunitpluraltesting')
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
@section('viewJsName', 'stockentries')
|
@section('viewJsName', 'stockentries')
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('pageScripts')
|
@push('pageScripts')
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
@section('viewJsName', 'stockoverview')
|
@section('viewJsName', 'stockoverview')
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('pageScripts')
|
@push('pageScripts')
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@push('pageStyles')
|
@push('pageStyles')
|
||||||
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user