mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Fix unit conversion handling (factor of destination qu is always 1) (fixes #382)
This commit is contained in:
parent
2eb3d8fe47
commit
53f0893f55
@ -4,6 +4,7 @@
|
|||||||
- The calendar now also contains all planned recipes from the meal plan on the corresponding day
|
- The calendar now also contains all planned recipes from the meal plan on the corresponding day
|
||||||
- When adding a product to the shopping list from the new context/more menu from the stock overview page and if the product is already on the shopping list, the amount of that entry will be updated acccordingly instead of adding a new (double) shopping list item
|
- When adding a product to the shopping list from the new context/more menu from the stock overview page and if the product is already on the shopping list, the amount of that entry will be updated acccordingly instead of adding a new (double) shopping list item
|
||||||
- Fixed that the browser barcode scanner button was not clickable on iOS Safari (thanks @DeeeeLAN)
|
- Fixed that the browser barcode scanner button was not clickable on iOS Safari (thanks @DeeeeLAN)
|
||||||
|
- Fixed a problem regarding quantity unit conversion handling for recipe ingredients of products with no unit relations, but only a different purchase/stock quantity unit
|
||||||
- The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times
|
- The API Endpoint `GET /files/{group}/{fileName}` now also returns a `Cache-Control` header (defaults fixed to 30 days) to further increase page load times
|
||||||
- Fixed that the API endpoint `/stock/shoppinglist/add-product` failed when a product should be added which was not already on the shopping list (thanks @Forceu)
|
- Fixed that the API endpoint `/stock/shoppinglist/add-product` failed when a product should be added which was not already on the shopping list (thanks @Forceu)
|
||||||
- Some style/CSS detail-refinements
|
- Some style/CSS detail-refinements
|
||||||
|
@ -11,7 +11,13 @@ Grocy.Components.ProductAmountPicker.Reload = function(productId, destinationQuI
|
|||||||
$("#qu_id").attr("data-destination-qu-name", FindObjectInArrayByPropertyValue(Grocy.QuantityUnits, 'id', destinationQuId).name);
|
$("#qu_id").attr("data-destination-qu-name", FindObjectInArrayByPropertyValue(Grocy.QuantityUnits, 'id', destinationQuId).name);
|
||||||
conversionsForProduct.forEach(conversion =>
|
conversionsForProduct.forEach(conversion =>
|
||||||
{
|
{
|
||||||
$("#qu_id").append('<option value="' + conversion.to_qu_id + '" data-qu-factor="' + conversion.factor + '">' + conversion.to_qu_name + '</option>');
|
var factor = conversion.factor;
|
||||||
|
if (conversion.to_qu_id == destinationQuId)
|
||||||
|
{
|
||||||
|
factor = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#qu_id").append('<option value="' + conversion.to_qu_id + '" data-qu-factor="' + factor + '">' + conversion.to_qu_name + '</option>');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user