@extends('admin.layouts.app') @section('title', 'Revenue - Admin') @section('page-title', 'Revenue & Sales Report') @section('content') {{-- Summary --}}
๐Ÿ’ฐ
Total Revenue
RM {{ number_format($totalRevenue, 2) }}
๐Ÿงพ
Total Orders
{{ $totalOrders }}
๐Ÿ“Š
Avg Order Value
RM {{ $totalOrders > 0 ? number_format($totalRevenue / $totalOrders, 2) : '0.00' }}
๐Ÿ“…
This Month
RM {{ number_format($monthlySales->firstWhere('month', now()->month)?->total ?? 0, 2) }}
{{-- Monthly Chart --}}
๐Ÿ“ˆ Monthly Sales ({{ now()->year }})
@php $months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; $maxSale = $monthlySales->max('total') ?: 1; @endphp
@foreach($months as $i => $month) @php $sale = $monthlySales->firstWhere('month', $i + 1); $height = $sale ? ($sale->total / $maxSale) * 140 : 0; @endphp
RM {{ number_format($sale->total ?? 0, 0) }}
{{ $month }}
@endforeach
{{-- Monthly Breakdown --}}
๐Ÿ“‹ Monthly Breakdown
@forelse($monthlySales as $sale) @empty @endforelse
Month Orders Revenue Avg per Order
{{ $months[$sale->month - 1] }} {{ now()->year }} {{ $sale->count }} RM {{ number_format($sale->total, 2) }} RM {{ number_format($sale->total / $sale->count, 2) }}
No sales data yet.
{{-- Order History --}}
๐Ÿงพ Order History
@forelse($orders as $order) @empty @endforelse
Order ID User Items Total Status Date
#{{ $order->id }} {{ $order->user->name }} {{ $order->items->count() }} items RM {{ number_format($order->total, 2) }} {{ $order->status }} {{ $order->created_at->format('d M Y H:i') }}
No orders yet.
@endsection