diff --git a/changelog/58_UNRELEASED_2020-xx-xx.md b/changelog/58_UNRELEASED_2020-xx-xx.md index e01314f9..a75c08bc 100644 --- a/changelog/58_UNRELEASED_2020-xx-xx.md +++ b/changelog/58_UNRELEASED_2020-xx-xx.md @@ -14,6 +14,7 @@ - Fixed that best before dates were displayed on the stock overview and stock entries page even with disabled `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` - Fixed that when editing a stock entry and setting a decimal amount, the decimal part was ignored (only possible when the product option "Allow partial units in stock" is enabled) - Fixed that "Default best before days" and "Default best before days after opened" on the product edit page were always shown regardless of the feature flags `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` and `FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING` +- Fixed that the form validation limits for the amount input and products with enabled tare weight handling were wrong ### Shopping list fixes - Fixed that the "shopping list to stock workflow"-dialog was not visible in compact view diff --git a/public/viewjs/consume.js b/public/viewjs/consume.js index f06bb44f..1661b955 100644 --- a/public/viewjs/consume.js +++ b/public/viewjs/consume.js @@ -200,49 +200,82 @@ $("#location_id").on('change', function(e) } if (locationId) - { - Grocy.Api.Get("stock/products/" + Grocy.Components.ProductPicker.GetValue() + '/entries', - function(stockEntries) + { + Grocy.Api.Get("stock/products/" + Grocy.Components.ProductPicker.GetValue() + '/entries', + function(stockEntries) + { + stockEntries.forEach(stockEntry => { - stockEntries.forEach(stockEntry => + var openTxt = __t("Not opened"); + if (stockEntry.open == 1) { - var openTxt = __t("Not opened"); - if (stockEntry.open == 1) + openTxt = __t("Opened"); + } + + if (stockEntry.location_id == locationId) + { + $("#specific_stock_entry").append($("