mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Indicate incomplete recipe costs information (closes #1941)
This commit is contained in:
parent
c05181aa53
commit
f9c7c67dc7
@ -39,6 +39,7 @@
|
||||
|
||||
- For in-stock ingredients, the amount actually in-stock is now displayed next to the hint "Enough in stock"
|
||||
- Optimized that when adding missing recipe ingredients with the option "Only check if any amount is in stock" enabled to the shopping list and when no corresponding unit conversion exists, the amount/unit is now taken "as is" (as defined in the recipe ingredient) into the created shopping list item
|
||||
- When no price information is available for at least one ingredient, a red exclamation mark is now displayed next to the recipe total cost information
|
||||
- Fixed that calories/costs of recipe ingredients were wrong when the ingredient option "Only check if any amount is in stock" was set and the on the ingredient used quantity unit was different from the product's QU stock
|
||||
- Fixed that multi-nested recipes (at least 3 levels of "included recipes") resulted in wrong amounts/costs/calories calculated for the ingredients orginating in those nested recipes (also affected the meal plan)
|
||||
|
||||
|
@ -2452,3 +2452,6 @@ msgstr ""
|
||||
|
||||
msgid "By default the stock overview page lists all products which are currently in-stock or below their min. stock amount - when this is enabled, all (active) products are always shown"
|
||||
msgstr ""
|
||||
|
||||
msgid "No price information is available for at least one ingredient"
|
||||
msgstr ""
|
||||
|
21
migrations/0247.sql
Normal file
21
migrations/0247.sql
Normal file
@ -0,0 +1,21 @@
|
||||
DROP VIEW recipes_resolved;
|
||||
CREATE VIEW recipes_resolved
|
||||
AS
|
||||
SELECT
|
||||
1 AS id, -- Dummy, LessQL needs an id column
|
||||
r.id AS recipe_id,
|
||||
IFNULL(MIN(rpr.need_fulfilled), 1) AS need_fulfilled,
|
||||
IFNULL(MIN(rpr.need_fulfilled_with_shopping_list), 1) AS need_fulfilled_with_shopping_list,
|
||||
IFNULL(rmpc.missing_products_count, 0) AS missing_products_count,
|
||||
IFNULL(SUM(rpr.costs), 0) AS costs,
|
||||
IFNULL(SUM(rpr.costs) / CASE WHEN IFNULL(r.desired_servings, 0) = 0 THEN 1 ELSE r.desired_servings END, 0) AS costs_per_serving,
|
||||
IFNULL(SUM(rpr.calories), 0) AS calories,
|
||||
IFNULL(SUM(rpr.due_score), 0) AS due_score,
|
||||
GROUP_CONCAT(rpr.product_name) AS product_names_comma_separated,
|
||||
CASE WHEN MIN(IFNULL(rpr.costs, 0)) = 0 THEN 1 ELSE 0 END AS prices_incomplete
|
||||
FROM recipes r
|
||||
LEFT JOIN recipes_pos_resolved rpr
|
||||
ON r.id = rpr.recipe_id
|
||||
LEFT JOIN recipes_missing_product_counts rmpc
|
||||
ON r.id = rmpc.recipe_id
|
||||
GROUP BY r.id;
|
@ -424,7 +424,15 @@
|
||||
data-trigger="hover click"
|
||||
title="{{ $__t('Based on the prices of the default consume rule (Opened first, then first due first, then first in first out) for in-stock ingredients and on the last price for missing ones') }}"></i>
|
||||
</label>
|
||||
<h3 class="locale-number locale-number-currency pt-0">{{ $costs }}</h3>
|
||||
<h3>
|
||||
<span class="locale-number locale-number-currency pt-0">{{ $costs }}</span>
|
||||
@if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->prices_incomplete)
|
||||
<i class="fa-solid fa-exclamation text-danger"
|
||||
data-toggle="tooltip"
|
||||
data-trigger="hover click"
|
||||
title="{{ $__t('No price information is available for at least one ingredient') }}"></i>
|
||||
@endif
|
||||
</h3>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user