@extends('layout') @section('content') @if (Session::has('success'))

{{ Session::get('success') }}


@elseif(Session::has('error'))

{{ Session::get('error') }}


@endif
@csrf
recipe_type == 'semilavorato') {{'checked'}} @endif value="semilavorato" name="recipe_type"/> recipe_type=='prodotto_finito') {{'checked'}} @endif value="prodotto_finito" name="recipe_type"/>


@foreach($recipeTypes as $i=>$type)
type) && in_array( $type->name, $recipe->type )) {{ 'checked' }}@endif id="inlineCheckbox{{$i}}" value="{{$type->name}}" name="typeRecipe[]"/>
@endforeach
{{--TABELLA INGREDIENTI--}}

Ingredienti

@php $totQuantity = 0 @endphp @if(is_array($recipe['ingredients'])) @php $numsIngredients = 0; $totCostoStandard = 0; $priceIngredienteIva = 0; $totCiva = 0; setlocale(LC_MONETARY, 'it_IT'); $row=0; $priceRecipe = 0; @endphp @foreach($recipe['ingredients'] as $ingrediente) @php $nameIngrediente = $ingrediente['name'] ?? ''; $idIngrediente = $ingrediente['id'] ?? ''; $type = $ingrediente['type'] ?? ''; $quantityIngrediente = $ingrediente['quantity'] ?? ''; $umIngrediente = isset($ingrediente['um2']) && $ingrediente['um2'] ? $ingrediente['um2'] : (isset($ingrediente['um1']) ? $ingrediente['um1'] : ''); $cumIngrediente = $ingrediente['cum'] ?? 1; $coefficienteUmIngrediente = $ingrediente['cum'] ?? 1; $costoStandardIngrediente = isset($ingrediente['costostandard']) && $ingrediente['costostandard'] ? $ingrediente['costostandard'] : 0.0; $noteIngrediente = $ingrediente['note'] ?? ''; //fix iva //$iva = str_replace(",",".", $ingrediente['iva']); $iva = $ingrediente['iva']; $iva = (float)$iva ?? ''; $relativePrimary = $ingrediente['relativePrimary'] ?? ''; $percentPrimary = $ingrediente['percentPrimary'] ?? ''; $isPrimary = $ingrediente['primary'] ?? 0; if(!empty($costoStandardIngrediente)){ $costoStandardIngrediente = str_replace(",",".", $costoStandardIngrediente); if($type){ $costoStandardIngrediente = (float)($costoStandardIngrediente - ($costoStandardIngrediente*$iva)); } $costoIngrediente = (float)$costoStandardIngrediente * ($quantityIngrediente * $coefficienteUmIngrediente); $costoCiva = number_format($costoIngrediente + ($costoIngrediente * $iva), 3, ',', '.'); $priceIngredienteIva = $costoIngrediente + ($costoIngrediente * $iva); $totCiva += ($costoIngrediente + ($costoIngrediente * $iva)); $priceRecipe += $costoIngrediente; } $totCiva = (float)$totCiva; if($quantityIngrediente){ $totQuantity += $quantityIngrediente; } $numsIngredients++; @endphp @php $row++; @endphp @endforeach @endif
Order Primario Ingrediente Quantità (Kg) % Massa % Primario Costo Std (€) Costo (€) % IVA Costo Ricetta CIVA(€)
@if(isset($primaryIngredients))
@endif
{{ number_format($costoStandardIngrediente, 3, ',', '.') }} €/{{$umIngrediente}} {!! isset($costoIngrediente) && !empty($costoIngrediente) ? number_format($costoIngrediente, 3, ',', '.') . ' €' : 0 !!} {!! $iva ? $iva * 100 : '' !!} {{ $costoCiva ?? 0 }} delete
Massa: {{$totQuantity}} @if(isset($totCiva)){{ number_format($totCiva, 3, ',', '.') }}@endif
Aggiungi ingrediente
{{--TABELLA MODALITA--}}

Modalità

@if(is_array($recipe['modes'])) @foreach($recipe['modes'] as $mode) @endforeach @endif
Order Fase Descrizione Tempo (min.)
delete
Aggiungi modalità
{{--RIEPILOGO--}} @endif @endif
@endsection