{{ __('messages.analytics') }}

{{ __('messages.dashboard') }}

{{ __('messages.scope') }}: @if ($selectedBranchId > 0) {{ optional($allBranches->firstWhere('id', $selectedBranchId))->name }} @else {{ __('messages.all_branches') }} @endif

{{ __('messages.reports') }}
@php $formatSeconds = static function ($seconds) { $seconds = max(0, (int) $seconds); $minutes = intdiv($seconds, 60); $remainingSeconds = $seconds % 60; if ($minutes >= 60) { $hours = intdiv($minutes, 60); $minutes = $minutes % 60; return $hours.'h '.$minutes.'m'; } return $minutes.'m '.$remainingSeconds.'s'; }; $deviceOrderTotal = (int) ($totals['epos_orders'] ?? 0) + (int) ($totals['kiosk_orders'] ?? 0); $eposSharePct = $deviceOrderTotal > 0 ? (((int) ($totals['epos_orders'] ?? 0) / $deviceOrderTotal) * 100) : 0; $kioskSharePct = $deviceOrderTotal > 0 ? (((int) ($totals['kiosk_orders'] ?? 0) / $deviceOrderTotal) * 100) : 0; @endphp

{{ __('messages.total_sales') }}

£{{ number_format($totals['gross_sales'], 2) }}

{{ __('messages.till') }}£{{ number_format($totals['sales_till'], 2) }}

{{ __('messages.kiosk') }}£{{ number_format($totals['sales_kiosk'], 2) }}

{{ __('messages.total_orders') }}

{{ number_format($totals['orders']) }}

{{ __('messages.till') }}{{ number_format($totals['orders_till']) }}

{{ __('messages.kiosk') }}{{ number_format($totals['orders_kiosk']) }}

{{ __('messages.average_order_value') }}

£{{ number_format($totals['avg_order'], 2) }}

{{ __('messages.till') }}£{{ number_format($totals['avg_till_order'], 2) }}

{{ __('messages.kiosk') }}£{{ number_format($totals['avg_kiosk_order'], 2) }}

{{ __('messages.average_order_time') }}

{{ $formatSeconds($totals['avg_order_time_seconds']) }}

{{ __('messages.card') }}

£{{ number_format($totals['card_total'], 2) }}

{{ __('messages.cash') }}

£{{ number_format($totals['cash_total'], 2) }}

@if ((int) $totals['orders'] === 0)
{{ __('messages.no_orders_message') }}
@endif @if ((int) $totals['connected_branches'] === 0)
{{ __('messages.no_branches_online_message') }}
@endif

Gross Profit

£{{ number_format($totals['gross_profit'], 2) }}

{{ __('messages.stock_value') }}

£{{ number_format($totals['stock_value'], 2) }}

Live Branch Stats

Open Reports
@forelse ($branches as $branch) @empty @endforelse
Branch Till Orders Kiosk Orders Total Orders Total Sales
{{ $branch->name }} {{ number_format($eposOrdersByBranch[$branch->id] ?? 0) }} {{ number_format($kioskOrdersByBranch[$branch->id] ?? 0) }} {{ number_format($ordersByBranch[$branch->id] ?? 0) }} £{{ number_format($grossSalesByBranch[$branch->id] ?? 0, 2) }}
No branches configured yet.

Fixed Totals

Type Orders Value
Gross Sales {{ number_format($totals['orders']) }} £{{ number_format($totals['gross_sales'], 2) }}
All Cash {{ number_format($totals['all_cash_orders']) }} £{{ number_format($totals['cash_total'], 2) }}
All Card {{ number_format($totals['all_card_orders']) }} £{{ number_format($totals['card_total'], 2) }}
Cash - Till {{ number_format($totals['cash_till_orders']) }} £{{ number_format($totals['cash_till_total'], 2) }}
Card - Till {{ number_format($totals['card_till_orders']) }} £{{ number_format($totals['card_till_total'], 2) }}
Kiosks {{ number_format($totals['orders_kiosk']) }} £{{ number_format($totals['sales_kiosk'], 2) }}
Refunds {{ number_format($totals['refund_orders']) }} £{{ number_format($totals['refund_total'], 2) }}

Top Branch Revenue

@php $featuredBranch = $reportPreview->first(); @endphp @if ($featuredBranch)
Top Branch

{{ $selectedBranchId > 0 ? 'Selected Branch Snapshot' : 'Top Performer (All Branches)' }}

{{ $featuredBranch['name'] }}

{{ number_format((int) ($featuredBranch['orders'] ?? 0)) }} Orders

Total Sales

£{{ number_format((float) ($featuredBranch['sales'] ?? 0), 2) }}

Avg Order Value

£{{ number_format((float) ($featuredBranch['avg_order_value'] ?? 0), 2) }}

Avg Order Time

{{ $formatSeconds((int) ($featuredBranch['avg_time_seconds'] ?? 0)) }}

@else

No branch data available for the selected filters.

@endif

Top Sellers

@forelse($topSellers as $seller)
{{ $loop->iteration }} {{ $seller['name'] }} {{ number_format((float) $seller['qty']) }}
@empty

No top sellers available.

@endforelse

Bottom Sellers

@forelse($bottomSellers as $seller)
{{ $loop->iteration }} {{ $seller['name'] }} {{ number_format((float) $seller['qty']) }}
@empty

No bottom sellers available.

@endforelse

{{ $showBusyDaysChart ? 'Busy Days & Hours' : 'Busy Hours' }}

@if($showBusyDaysChart)
@endif @if($showBusyDaysChart)
@else
@endif

Device Split

EPOS Share

{{ number_format($eposSharePct, 1) }}%

{{ number_format((int) ($totals['epos_orders'] ?? 0)) }} orders

Kiosk Share

{{ number_format($kioskSharePct, 1) }}%

{{ number_format((int) ($totals['kiosk_orders'] ?? 0)) }} orders

Sales Trend

Current 30 Days

£{{ number_format($currentThirtyDaySalesTotal ?? 0, 2) }}

Previous 30 Days

£{{ number_format($previousThirtyDaySalesTotal ?? 0, 2) }}

Entity Snapshot

Best Sold Product

{{ $bestProductName ? $bestProductName . ' (' . number_format($bestProductQty) . ')' : 'N/A' }}

Best Customer

{{ $bestCustomerName ? $bestCustomerName . ' (£' . number_format($bestCustomerValue, 2) . ')' : 'N/A' }}

Best Seller Category

{{ $bestCategoryName ?? 'N/A' }}

Available Reports

@php $dashboardReportList = [ ['fixed', 'Fixed Totals Summary'], ['payment', 'Payment Method Breakdown'], ['eatout', 'Eat In vs Take Away'], ['dept', 'Department Sales Total'], ['categ', 'Sales by Category'], ['hourly', 'Hourly Sales Breakdown'], ['device', 'Device Breakdown'], ['plu', 'Product Sales (PLU)'], ['cogs', 'COGS'], ['addon', 'Add-on Sales'], ['last100', 'Last 100 Transactions'], ['tax', 'VAT Summary'], ['salesgroup', 'Sales by Group'], ['topsellers', 'Top Sellers'], ['bottomsellers', 'Bottom Sellers'], ]; @endphp @foreach($dashboardReportList as [$rtype, $rlabel])

Report

{{ $rlabel }}

@endforeach
@php $topBranchLabels = $reportPreview->pluck('name')->values(); $topBranchSales = $reportPreview->pluck('sales')->map(function ($value) { return round((float) $value, 2); })->values(); @endphp @php $topBranchAvgValue = $reportPreview->pluck('avg_order_value')->values(); $topBranchAvgTime = $reportPreview->pluck('avg_time_seconds')->map(function ($s) { return round($s / 60, 2); // convert seconds → minutes })->values(); @endphp