@extends('layouts.app') @section('title','Sales Report')@section('page-title','Sales Report') @section('content')
@if(auth()->user()->isAdmin())
@endif
@foreach([['$'.number_format($summary['total_revenue_usd'],2),'Total Revenue (USD)','stat-card-1','bi-currency-dollar'],[number_format($summary['total_transactions']),'Transactions','stat-card-2','bi-receipt'],['$'.number_format($summary['avg_order_usd'],2),'Avg Order (USD)','stat-card-3','bi-calculator'],[number_format($summary['total_items_sold']),'Units Sold','stat-card-4','bi-box-seam']] as [$val,$label,$cls,$icon])
{{ $val }}
{{ $label }}
@endforeach
Daily Revenue
{{-- Top 3 Trending Products --}}
Top Trending
This period{{ $selectedBranch ? ' · '.$selectedBranch->code : '' }}
@forelse($topTrendingProducts as $i => $item) @php $colors=['#FF6B35','#2EC4B6','#4361EE']; @endphp
{{ $i+1 }}
{{ $item->product?->name }}
{{ number_format($item->total_qty) }} units sold
${{ number_format($item->total_revenue,2) }}
@empty

No sales this period.

@endforelse
Payment Methods
@if($branchBreakdown && $branchBreakdown->count())
Branch Performance Breakdown
@foreach($branchBreakdown as $row) @endforeach
BranchTransactionsRevenue (USD)Revenue (LRD)
{{ $row['branch']->name }}
{{ $row['branch']->code }}
{{ number_format($row['count']) }} ${{ number_format($row['revenue_usd'],2) }} LRD {{ number_format($row['revenue_local'],2) }}
@endif
All Transactions
@if(auth()->user()->isAdmin())@endif @forelse($sales as $sale) @if(auth()->user()->isAdmin())@endif @empty @endforelse
InvoiceBranchCustomerItemsTotal (USD)StatusDate
{{ $sale->invoice_number }}{{ $sale->branch?->code ?? '—' }}{{ $sale->customer?->name ?? 'Walk-in' }} {{ $sale->items->sum('quantity') }} ${{ number_format($sale->total_usd,2) }} {{ ucfirst($sale->status) }} {{ $sale->sale_date->format('M j, Y') }}
No sales in this period.
@endsection @push('scripts') @endpush