{{-- ══ TAB 1 — OVERVIEW ══ --}}
🛒
Total Orders
{{ number_format((int)$totalOrders ?? 0) }}
Completed
📦
Units Sold
{{ number_format((int)$totalUnits ?? 0) }}
All time
💰
Total Revenue
₹{{ number_format((float)$revAllTime ?? 0, 0) }}
Since Jan 2021
👤
Users Ordered
{{ number_format((int)$usersOrdered ?? 0) }}
of {{ number_format((int)$totalUsers ?? 0) }} registered
📅
Today's Orders
{{ number_format((int)$todaysOrders ?? 0) }}
{{ now()->format('d M Y') }}
🔖
Pre-Orders
{{ number_format((int)$preOrders ?? 0) }}
{{ ($totalOrders > 0) ? number_format(($preOrders ?? 0) / $totalOrders * 100, 1) : '0.0' }}% of all
Today
₹{{ number_format((float)$revToday ?? 0, 0) }}
Yesterday
₹{{ number_format((float)$revYesterday ?? 0, 0) }}
Last 7 Days
₹{{ number_format((float)$revWeek ?? 0, 0) }}
This Month
₹{{ number_format((float)$revMonth ?? 0, 0) }}
All Time
₹{{ number_format((float)$revAllTime ?? 0, 0) }}
Monthly Sales Volume Books sold per month — last 30 months
{{-- ══ TAB 2 — RETENTION ══ --}}
🎯
Repeat Purchase Rate
{{ $repeatPurchaseRate ?? 0 }}%
Last 90 days
{{ number_format($repeatCustomers ?? 0) }} of {{ number_format($firstTimeUsers ?? 0) }} users
💚
Avg Order Value
₹{{ number_format((float)$avgOrderValue ?? 0, 0) }}
Per transaction
💎
Customer LTV
₹{{ number_format((float)$avgCustomerLTV ?? 0, 0) }}
Lifetime value
😴
Dormant Users
{{ number_format((int)$dormantUsers ?? 0) }}
No orders in 90 days
🔥
Active (30d)
{{ number_format((int)$activeUsers30 ?? 0) }}
Last month
📊
Active (90d)
{{ number_format((int)$activeUsers90 ?? 0) }}
3-month cohort
User Activity Cohort 30/60/90 day active users
Purchase Frequency Order distribution
Purchase Frequency Distribution Customer segmentation
| Segment | User Count | Avg LTV | % of Customers |
@php $totalFreqUsers = ($purchaseFrequency ?? collect())->sum('user_count'); @endphp
@forelse($purchaseFrequency ?? [] as $freq)
| {{ $freq->frequency ?? 'N/A' }} |
{{ number_format((int)($freq->user_count ?? 0)) }} |
₹{{ number_format((float)($freq->avg_ltv ?? 0), 0) }} |
{{ ($totalFreqUsers > 0) ? number_format((($freq->user_count ?? 0) / $totalFreqUsers) * 100, 1) : '0' }}% |
@empty
| No data available |
@endforelse
{{-- ══ TAB 3 — INVENTORY AGING ══ --}}
⏰
Stale Stock (30d)
{{ number_format((int)$stalStock30days ?? 0) }}
Not sold in 30 days
🚨
Stale Stock (90d)
{{ number_format((int)$stalStock90days ?? 0) }}
No sales in 90 days
📉
Overstock Risk
{{ number_format(($overstockRisk ?? collect())->count()) }}
Low velocity items
🔥
Restock Alerts
{{ number_format(($understockAlert ?? collect())->count()) }}
Fast-moving items
Top 15 Sales Velocity All-time units per title
Category Health Score Avg velocity by category
🚨 Overstock Risk {{ count($overstockRisk ?? []) }} items need attention
| # | Title | 90-Day Sales | Status | Action |
@forelse($overstockRisk ?? [] as $i => $item)
| {{ $i + 1 }} |
{{ $item->title ?? 'N/A' }} |
{{ (int)($item->units_sold_90d ?? 0) }} units |
@if(($item->movement_status ?? null) === 'STALE')
🔴 STALE
@else
🟡 SLOW
@endif
|
Discount / Archive |
@empty
| ✓ All inventory healthy |
@endforelse
🔥 Restock Urgency {{ count($understockAlert ?? []) }} fast-movers to reorder
| # | Title | 30-Day Sales | Urgency | Recommendation |
@forelse($understockAlert ?? [] as $i => $item)
| {{ $i + 1 }} |
{{ $item->title ?? 'N/A' }} |
{{ (int)($item->units_sold_30d ?? 0) }} units |
@if(($item->restock_urgency ?? null) === 'CRITICAL')
🔴 CRITICAL
@else
🟠 HIGH
@endif
|
Place order now |
@empty
| ✓ All fast-movers well-stocked |
@endforelse
📊 Category Health Report 90-day inventory status by category
| Category | Total SKU | Stale Items | Slow Moving | Avg Velocity |
@forelse($categoryHealth ?? [] as $cat)
| {{ $cat->category ?? 'Unknown' }} |
{{ (int)($cat->total_sku ?? 0) }} |
{{ (int)($cat->stale_count ?? 0) }} |
{{ (int)($cat->slow_moving_count ?? 0) }} |
{{ number_format((float)($cat->avg_velocity ?? 0), 2) }} units/item |
@empty
| No data |
@endforelse
{{-- ══ TAB 4 — CATEGORIES ══ --}}
Top 10 Categories — Units Sold
Orders vs Units efficiency
Category Breakdown Top 15 by units
| # | Category | Units Sold | Orders | Units / Order |
@forelse($categoryStats ?? [] as $i => $row)
| {{ $i + 1 }} |
{{ $row->category ?? 'N/A' }} |
{{ number_format((int)($row->units ?? 0)) }} |
{{ number_format((int)($row->orders_count ?? 0)) }} |
{{ (($row->orders_count ?? 0) > 0) ? number_format(($row->units ?? 0) / $row->orders_count, 2) : '-' }} |
@empty
| No data available |
@endforelse
{{-- ══ TAB 5 — TOP TITLES ══ --}}
Best-Selling Titles Top 30 by units sold
| # | Title | Category | Units Sold |
@forelse($topTitles ?? [] as $i => $row)
| {{ $i + 1 }} |
{{ $row->title ?? 'N/A' }} |
{{ $row->category ?? 'N/A' }} |
{{ number_format((int)($row->units ?? 0)) }} |
@empty
| No data available |
@endforelse
{{-- ══ TAB 6 — PRE-ORDERS ══ --}}
🔖
Pre-Orders
{{ number_format((int)$preOrders ?? 0) }}
Unique orders
📦
Pre-Order Units
{{ number_format((int)$preUnits ?? 0) }}
{{ ($totalUnits > 0) ? number_format(($preUnits ?? 0) / $totalUnits * 100, 1) : '0.0' }}% of total
💰
Pre-Order Revenue
₹{{ number_format((float)$preRevenue ?? 0, 0) }}
Matched to orders
📊
% of All Orders
{{ ($totalOrders > 0) ? number_format(($preOrders ?? 0) / $totalOrders * 100, 1) : '0.0' }}%
Nearly 1 in 5
Pre-Order Volume — Monthly units per month
Top Pre-Order Titles Best sellers via pre-order
| # | Title | Category | Pre-Order Units |
@forelse($topPreOrderTitles ?? [] as $i => $row)
| {{ $i + 1 }} |
{{ $row->title ?? 'N/A' }} |
{{ $row->category ?? 'N/A' }} |
{{ number_format((int)($row->units ?? 0)) }} |
@empty
| No data available |
@endforelse
{{-- ══ TAB 7 — INVENTORY & LINKS ══ --}}
{{-- ══ TAB 8 — ALERTS & RECOMMENDATIONS ══ --}}
{{-- ── Low Stock ── --}}
⚠️ LOW STOCK ALERTS
Top {{ $inventoryHealth['low_total'] ?? 0 }} items with ≤ 5 units remaining
|
See Full Report →
@if(isset($inventoryHealth['low_stock']) && $inventoryHealth['low_stock']->count() > 0)
| # |
Product |
Initial Stock |
Sold |
Current Stock |
Reorder Qty |
@foreach($inventoryHealth['low_stock'] as $i => $item)
| {{ $i + 1 }} |
{{ $item->product_name ?? 'N/A' }} |
{{ (int)($item->initial_stock ?? 0) }} |
{{ (int)($item->sold_quantity ?? 0) }} |
{{ (int)($item->current_stock ?? 0) }} units
|
{{ max(10, (int)($item->sold_quantity ?? 0) * 2) }} units
|
@endforeach
@else
✅ All products are well-stocked! No low stock alerts.
@endif
{{-- ── Out of Stock ── --}}
🔴 OUT OF STOCK
Top {{ $inventoryHealth['out_total'] ?? 0 }} items with zero stock
|
See Full Report →
@if(isset($inventoryHealth['out_of_stock']) && $inventoryHealth['out_of_stock']->count() > 0)
| # |
Product |
Initial Stock |
Total Sold |
Status |
Action |
@foreach($inventoryHealth['out_of_stock'] as $i => $item)
| {{ $i + 1 }} |
{{ $item->product_name ?? 'N/A' }} |
{{ (int)($item->initial_stock ?? 0) }} |
{{ (int)($item->sold_quantity ?? 0) }} |
🔴 OUT OF STOCK
|
Restock immediately
|
@endforeach
@else
✅ All products currently in stock.
@endif
{{-- ── Inventory Aging ── --}}
@if(isset($inventoryHealth['aging_report']) && $inventoryHealth['aging_report']->count() > 0)
📊 INVENTORY AGING ANALYSIS
Stale & slow-moving stock — top 15
| Product |
Category |
Current Stock |
Sales (30d) |
Sales (90d) |
Days Since Last Sale |
Status |
Action |
@foreach($inventoryHealth['aging_report']->take(15) as $item)
@php $status = $item->stock_status ?? ''; @endphp
| {{ $item->product_name ?? 'N/A' }} |
{{ $item->category ?? 'Uncategorized' }} |
{{ (int)($item->current_stock ?? 0) }} units |
{{ (int)($item->sales_last_30d ?? 0) }} |
{{ (int)($item->sales_last_90d ?? 0) }} |
{{ (int)($item->days_since_last_sale ?? 0) }} days |
@if($status === 'STALE')
🔴 STALE
@elseif($status === 'SLOW_MOVING')
🟡 SLOW MOVING
@elseif($status === 'OVERSTOCK')
📦 OVERSTOCK
@elseif($status === 'UNDERSTOCK')
⚠️ UNDERSTOCK
@else
HEALTHY
@endif
|
{{ $item->recommended_action ?? 'Monitor normally' }}
|
@endforeach
@endif
{{-- ── Product Recommendations ── --}}
@if(isset($userRecommendations) && count($userRecommendations) > 0)
🎯 PERSONALIZED FOR YOU
Based on purchase history
@foreach($userRecommendations as $rec)
{{ $rec->product_name ?? 'N/A' }}
{{ $rec->category ?? 'Popular' }}
Recommended for you
@endforeach
@endif
{{-- ── Inventory Health Summary Cards ── --}}
@if(isset($inventoryHealth) && is_array($inventoryHealth))
@php
$summary = $inventoryHealth['summary'] ?? [];
$issueCount = (int)($summary['stale_items'] ?? 0)
+ (int)($summary['slow_moving_items'] ?? 0)
+ (int)($summary['overstock_items'] ?? 0)
+ (int)($summary['understock_items'] ?? 0);
@endphp
🔴
Out of Stock
{{ (int)($summary['out_of_stock_count'] ?? 0) }}
Click → full report
⚠️
Low Stock (≤ 5 units)
{{ (int)($summary['low_stock_count'] ?? 0) }}
Click → full report
📦
Stale Stock
{{ (int)($summary['stale_items'] ?? 0) }}
No sales in 90+ days
🐢
Slow Moving
{{ (int)($summary['slow_moving_items'] ?? 0) }}
No sales this month
📈
Overstock
{{ (int)($summary['overstock_items'] ?? 0) }}
Excess vs velocity
🔥
Understock
{{ (int)($summary['understock_items'] ?? 0) }}
Fast movers running low
🔄
Total Issues
{{ $issueCount }}
Items needing attention
💰
Revenue at Risk
₹{{ number_format((float)($summary['estimated_revenue_at_risk'] ?? 0), 0) }}
From understocked fast-movers
@endif
@endsection
@section('script')
@endsection