mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Enforce stock QU on /purchase for tare weight handling enabled products (fixes #1795)
This commit is contained in:
parent
5bfdddd52b
commit
a027077211
@ -253,7 +253,15 @@ if (Grocy.Components.ProductPicker !== undefined)
|
||||
CurrentProductDetails = productDetails;
|
||||
|
||||
Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id);
|
||||
if (productDetails.product.enable_tare_weight_handling == 1)
|
||||
{
|
||||
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_stock.id);
|
||||
$("#qu_id").attr("disabled", "");
|
||||
}
|
||||
else
|
||||
{
|
||||
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.default_quantity_unit_purchase.id);
|
||||
}
|
||||
$('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_purchase_amount));
|
||||
$(".input-group-productamountpicker").trigger("change");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user