Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: "Only check if any amount is in stock" recipe ingredients: Wrong costs/calories when using deviating QU #2529

Open
kevinholtkamp opened this issue May 1, 2024 · 3 comments
Labels
Milestone

Comments

@kevinholtkamp
Copy link

kevinholtkamp commented May 1, 2024

https://test-qxe83wxuz8mg8ytsp596xi.demo-prerelease.grocy.info/recipes

The calorie calculation in the recipe page depends on wether the "Only check if any amount is in stock" checkbox is checked for the ingredient. For the test, I created a Test Product for which one piece weighs 100 grams, and one piece has 100 calories. Thus 10 grams should have 10 calories. For the test example, for the first ingredients entry it is not checked while for the second one it is, this is the result:
image

When I set the default unit to gram and change the calories accordingly, it shows the correct calories:
image

So, when the checkbox is checked, the calorie calculation will always use the default stock unit, even when the entered unit is available.

@berrnd
Copy link
Member

berrnd commented May 1, 2024

Also affects costs in the same way.

Partly depends on definition (not everything you personally expect to behave differently is per se a bug), but was an accepted problem before (ref #1338) and therefore a regression - so could be fixed, if someone out there feels the need to work on that.

@berrnd berrnd changed the title Bug: Recipe page showing wrong number of calories when "Only check if any amount is in stock" is checked Bug: "Only check if any amount is in stock" recipe ingredients: Wrong costs/calories when using deviating QU May 1, 2024
@berrnd berrnd added this to the vNEXT milestone May 1, 2024
@kevinholtkamp

This comment has been minimized.

@berrnd

This comment has been minimized.

@grocy grocy locked and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants