@extends('layouts.layout-admin') @section('title', 'Sales Report') @section('header_title', 'Sales Report') @section('header_subtitle', 'View sales report by date range') @section('content')
Total Orders

{{ $summary->total_orders ?? 0 }}

Total Revenue

Rp {{ number_format($summary->total_revenue ?? 0, 0, ',', '.') }}

Top 10 Products
@forelse($topProducts as $item) @empty @endforelse
Product Total Qty Sold Total Sales
{{ $item->product->name ?? 'Deleted' }} {{ $item->total_qty }} Rp {{ number_format($item->total_sales, 0, ',', '.') }}

No products sold in this period

Orders ({{ $startDate }} - {{ $endDate }})
@forelse($orders as $order) @empty @endforelse
Order Code Customer Items Total Payment Status Date
{{ $order->order_code }} {{ $order->user->name }} @foreach ($order->items as $item)
{{ $item->product->name }} x {{ $item->quantity }}
@endforeach
Rp {{ number_format($order->total_amount, 0, ',', '.') }} {{ $order->payment_method ?? '-' }} {{ $order->status }} {{ $order->created_at->format('d/m/Y H:i') }}

No orders found in this period

{{ $orders->links() }}
@endsection