@extends('layout.default') @section('title', $__t('Recipes')) @section('activeNav', 'recipes') @section('viewJsName', 'recipes') @section('content')

@yield('title') {{ $__t('Add') }}

@include('components.userfields_thead', array( 'userfields' => $userfields )) @foreach($recipes as $recipe) @include('components.userfields_tbody', array( 'userfields' => $userfields, 'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $recipe->id) )) @endforeach
{{ $__t('Name') }} {{ $__t('Desired servings') }} {{ $__t('Requirements fulfilled') }} Hidden status for sorting of "Requirements fulfilled" column Hidden status for filtering by status Hidden recipe ingredient product names
{{ $recipe->name }} {{ $recipe->desired_servings }} @if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled == 1)@elseif(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1)@else@endif @if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled == 1){{ $__t('Enough in stock') }}@elseif(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1){{ $__n(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->missing_products_count, 'Not enough in stock, %s ingredient missing but already on the shopping list', 'Not enough in stock, %s ingredients missing but already on the shopping list') }}@else{{ $__n(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->missing_products_count, 'Not enough in stock, %s ingredient missing', 'Not enough in stock, %s ingredients missing') }}@endif {{ FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->missing_products_count }} @if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled == 1) enoughtinstock @elseif(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) enoughinstockwithshoppinglist @else notenoughinstock @endif @foreach(FindAllObjectsInArrayByPropertyValue($recipePositionsResolved, 'recipe_id', $recipe->id) as $recipePos) {{ FindObjectInArrayByPropertyValue($products, 'id', $recipePos->product_id)->name . ' ' }} @endforeach
@if($selectedRecipe !== null)
{{ $selectedRecipe->name }}     
@include('components.numberpicker', array( 'id' => 'servings-scale', 'label' => 'Desired servings', 'min' => 1, 'value' => $selectedRecipe->desired_servings, 'invalidFeedback' => $__t('This cannot be lower than %s', '1'), 'additionalAttributes' => 'data-recipe-id="' . $selectedRecipe->id . '"', 'hint' => $__t('Base: %s', $selectedRecipe->base_servings) ))
@if(!empty($selectedRecipeTotalCalories) && intval($selectedRecipeTotalCalories) > 0)

{{ $selectedRecipeTotalCalories }}

@endif @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)

{{ $selectedRecipeTotalCosts }}

@endif
@foreach($selectedRecipeSubRecipes as $selectedRecipeSubRecipe)

{{ $selectedRecipeSubRecipe->name }}

@if(!empty($selectedRecipeSubRecipe->picture_file_name))

@endif @php $selectedRecipeSubRecipePositionsFiltered = FindAllObjectsInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'child_recipe_id', $selectedRecipeSubRecipe->id); @endphp @if(count($selectedRecipeSubRecipePositionsFiltered) > 0)
{{ $__t('Ingredients') }}
    @php $lastIngredientGroup = 'undefined'; $lastProductGroup = 'undefined'; $hasIngredientGroups = false; $hasProductGroups = false; @endphp @foreach($selectedRecipeSubRecipePositionsFiltered as $selectedRecipePosition) @if($lastIngredientGroup != $selectedRecipePosition->ingredient_group && !empty($selectedRecipePosition->ingredient_group)) @php $hasIngredientGroups = true; @endphp
    {{ $selectedRecipePosition->ingredient_group }}
    @endif @if(boolval($userSettings['recipe_ingredients_group_by_product_group']) && $lastProductGroup != $selectedRecipePosition->product_group && !empty($selectedRecipePosition->product_group)) @php $hasProductGroups = true; @endphp
    {{ $selectedRecipePosition->product_group }}
    @endif
  • @php $product = FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id); $productQuConversions = FindAllObjectsInArrayByPropertyValue($quantityUnitConversionsResolved, 'product_id', $product->id); $productQuConversions = FindAllObjectsInArrayByPropertyValue($productQuConversions, 'from_qu_id', $product->qu_id_stock); $productQuConversion = FindObjectInArrayByPropertyValue($productQuConversions, 'to_qu_id', $selectedRecipePosition->qu_id); if ($productQuConversion) { $selectedRecipePosition->recipe_amount = $selectedRecipePosition->recipe_amount * $productQuConversion->factor; } @endphp @if(!empty($selectedRecipePosition->recipe_variable_amount)) {{ $selectedRecipePosition->recipe_variable_amount }} @else @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif @endif {{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }} @if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif @if(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %1$s missing, %2$s already on shopping list', round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($selectedRecipeSubRecipesPositions, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif @if(!empty($selectedRecipePosition->recipe_variable_amount))
    {{ $__t('Variable amount') }}
    @endif @if(!empty($selectedRecipePosition->note))
    {!! nl2br($selectedRecipePosition->note) !!}
    @endif
  • @php $lastProductGroup = $selectedRecipePosition->product_group; @endphp @php $lastIngredientGroup = $selectedRecipePosition->ingredient_group; @endphp @endforeach
@endif @if(!empty($selectedRecipeSubRecipe->description))
{{ $__t('Preparation') }}
{!! $selectedRecipeSubRecipe->description !!} @endif @endforeach @if(!empty($selectedRecipe->picture_file_name))

@endif @if($selectedRecipePositionsResolved->count() > 0)
{{ $__t('Ingredients') }}
    @php $lastIngredientGroup = 'undefined'; $lastProductGroup = 'undefined'; $hasIngredientGroups = false; $hasProductGroups = false; @endphp @foreach($selectedRecipePositionsResolved as $selectedRecipePosition) @if($lastIngredientGroup != $selectedRecipePosition->ingredient_group && !empty($selectedRecipePosition->ingredient_group)) @php $hasIngredientGroups = true; @endphp
    {{ $selectedRecipePosition->ingredient_group }}
    @endif @if(boolval($userSettings['recipe_ingredients_group_by_product_group']) && $lastProductGroup != $selectedRecipePosition->product_group && !empty($selectedRecipePosition->product_group)) @php $hasProductGroups = true; @endphp
    {{ $selectedRecipePosition->product_group }}
    @endif
  • @php $product = FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id); $productQuConversions = FindAllObjectsInArrayByPropertyValue($quantityUnitConversionsResolved, 'product_id', $product->id); $productQuConversions = FindAllObjectsInArrayByPropertyValue($productQuConversions, 'from_qu_id', $product->qu_id_stock); $productQuConversion = FindObjectInArrayByPropertyValue($productQuConversions, 'to_qu_id', $selectedRecipePosition->qu_id); if ($productQuConversion) { $selectedRecipePosition->recipe_amount = $selectedRecipePosition->recipe_amount * $productQuConversion->factor; } @endphp @if(!empty($selectedRecipePosition->recipe_variable_amount)) {{ $selectedRecipePosition->recipe_variable_amount }} @else @if($selectedRecipePosition->recipe_amount == round($selectedRecipePosition->recipe_amount, 2)){{ round($selectedRecipePosition->recipe_amount, 2) }}@else{{ $selectedRecipePosition->recipe_amount }}@endif @endif {{ $__n($selectedRecipePosition->recipe_amount, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name, FindObjectInArrayByPropertyValue($quantityUnits, 'id', $selectedRecipePosition->qu_id)->name_plural) }} {{ FindObjectInArrayByPropertyValue($products, 'id', $selectedRecipePosition->product_id)->name }} @if($selectedRecipePosition->need_fulfilled == 1)@elseif($selectedRecipePosition->need_fulfilled_with_shopping_list == 1)@else@endif @if(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->need_fulfilled == 1) {{ $__t('Enough in stock') }} @else {{ $__t('Not enough in stock, %1$s missing, %2$s already on shopping list', round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->missing_amount, 2), round(FindObjectInArrayByPropertyValue($recipePositionsResolved, 'recipe_pos_id', $selectedRecipePosition->id)->amount_on_shopping_list, 2)) }} @endif @if(!empty($selectedRecipePosition->recipe_variable_amount))
    {{ $__t('Variable amount') }}
    @endif @if(!empty($selectedRecipePosition->note))
    {!! nl2br($selectedRecipePosition->note) !!}
    @endif
  • @php $lastProductGroup = $selectedRecipePosition->product_group; @endphp @php $lastIngredientGroup = $selectedRecipePosition->ingredient_group; @endphp @endforeach
@endif @if(!empty($selectedRecipe->description))
{{ $__t('Preparation') }}
{!! $selectedRecipe->description !!} @endif
@endif
@foreach($recipePositionsResolved as $recipePos) @if(in_array($recipePos->recipe_id, $includedRecipeIdsAbsolute) && $recipePos->missing_amount > 0)
{{ FindObjectInArrayByPropertyValue($products, 'id', $recipePos->product_id)->name }}
@endif @endforeach
@stop