@extends('layouts.app') @section('title', 'Food Cost') @section('content')

Food cost analysis

Planned meal cost against learner headcount for the selected period.
Recipes
@include('kitchen._nav')

Daily food cost

{{ $from }} to {{ $to }}
@if($daily->count()) {!! \App\Support\Chart::line($daily->mapWithKeys(fn ($row) => [\Carbon\Carbon::parse($row->date)->format('d M') => (float) $row->cost])->all(), 190) !!} @else @endif

Recipe cost per portion

Cheapest and most expensive dishes
@forelse($recipes->sortByDesc(fn ($recipe) => $recipe->costing['per_portion'])->take(10) as $recipe)
{{ $recipe->name }}
{{ (int) $recipe->portions }} portions
{{ money($recipe->costing['per_portion']) }}
@empty @endforelse

Planned meals

{{ $plans->count() }} latest plan rows in the period.
@forelse($plans as $plan) @empty @endforelse @if($plans->count()) @endif
DateMealRecipeHeadcountCostPer learnerStatus
{{ \Carbon\Carbon::parse($plan->date)->format('D, d M Y') }} {{ ucfirst($plan->meal) }} {{ $plan->recipe ?: '—' }} {{ num($plan->headcount) }} {{ money($plan->cost) }} {{ money($plan->headcount > 0 ? $plan->cost / $plan->headcount : 0) }}
Total{{ money($plans->sum('cost')) }}
@endsection