diff --git a/public/viewjs/components/productamountpicker.js b/public/viewjs/components/productamountpicker.js index 652ab34e..cce11e88 100644 --- a/public/viewjs/components/productamountpicker.js +++ b/public/viewjs/components/productamountpicker.js @@ -73,7 +73,7 @@ $(".input-group-productamountpicker").on("change", function() var amount = $("#display_amount").val(); var destinationAmount = amount / quFactor; - if (destinationQuName == selectedQuName || Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled) + if (destinationQuName == selectedQuName || Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled || amount.toString().isEmpty() || selectedQuName.toString().isEmpty()) { $("#qu-conversion-info").addClass("d-none"); } diff --git a/public/viewjs/recipeposform.js b/public/viewjs/recipeposform.js index b7f1dc9e..46a3a1a6 100644 --- a/public/viewjs/recipeposform.js +++ b/public/viewjs/recipeposform.js @@ -79,6 +79,8 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e) $("#not_check_stock_fulfillment").prop("checked", productDetails.product.not_check_stock_fulfillment_for_recipes == 1); + Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_stock.id); + $('#display_amount').focus(); Grocy.FrontendHelpers.ValidateForm('recipe-pos-form'); },