@extends('layouts.app') @section('title', 'Cafรฉ Analytics') @section('content')

๐Ÿ“Š Analytics

Deep dive into transaction history and brewing velocity.

Date Range
โ†’
{{-- ๐Ÿ”ฅ Top Velocity Products --}}

๐Ÿ”ฅ Top Used Ingredients

@forelse($topProducts as $p)
{{ $p->name }} {{ $p->total_out ?? 0 }} units
@empty

No consumption data found.

@endforelse
{{-- ๐Ÿ—‘๏ธ Waste Analysis Card --}}

๐Ÿ—‘๏ธ Waste & Loss Summary

@forelse($wasteSummary as $w) {{-- Flex container ensures the quantity stays aligned with the product info --}}

{{ $w->reason }}

{{ $w->product->name }}

-{{ $w->quantity }}

Units Lost

@empty

Perfect efficiencyโ€”no waste.

@endforelse
{{-- ๐Ÿ“‘ Transaction Ledger --}}

Full Transaction Ledger

AUDIT READY
@forelse($transactions as $t) @empty @endforelse
Timestamp Product Operation Quantity Executor Notes
{{ $t->created_at->format('d M Y') }} {{ $t->created_at->format('g:i A') }} {{ $t->product->name }} @if($t->type === 'check_in') INBOUND @else OUTBOUND @endif {{ $t->type === 'check_in' ? 'โ†‘' : 'โ†“' }} {{ $t->quantity }}
{{ strtoupper(substr($t->user->name, 0, 1)) }}
{{ $t->user->name }}
{{ $t->notes ?? 'โ€”' }}

No activity recorded for this timeline.

{{ $transactions->withQueryString()->links() }}
@endsection