Food Cost

@if(request('branch_id')) Back to Branch @endif
@forelse($foodCosts as $key => $cost) @php $percentage = $cost->food_cost_percentage; // Auto-assign color based on percentage if no custom color exists $color = $cost->color; $statusLabel = ''; if (!$color) { if ($percentage < 30) { $color = '#28a745'; $statusLabel = '✅ Good'; } elseif ($percentage >= 31 && $percentage <= 40) { $color = '#ffc107'; $statusLabel = '⚠️ Warning'; } elseif ($percentage > 40) { $color = '#dc3545'; $statusLabel = '🔴 High'; } } else { // If custom color exists, show appropriate label if ($color == '#28a745') { $statusLabel = '✅ Good'; } elseif ($color == '#ffc107') { $statusLabel = '⚠️ Warning'; } elseif ($color == '#dc3545') { $statusLabel = '🔴 High'; } } // Determine text color for contrast $textColor = '#fff'; if ($color == '#ffc107') { $textColor = '#000'; } @endphp @empty @endforelse
S.No Branch Month/Year Food Cost Actions
{{ $foodCosts->firstItem() + $key }} {{ $cost->branch->branch_name ?? 'N/A' }} {{ \Carbon\Carbon::createFromFormat('Y-m', $cost->month_year)->format('F Y') }} {{ number_format($cost->food_cost_percentage, 2) }} % @if($statusLabel) @endif

No food cost entries found.

@if($foodCosts instanceof \Illuminate\Pagination\LengthAwarePaginator) {{ $foodCosts->withQueryString()->links() }} @endif