@extends('backend.template.layouts.template-base') @section('title', 'Stock / Inventory Dashboard | ' . config('app.name')) @section('styles') @endsection @section('content') @php $routeUrl = fn ($name, $params = []) => \Illuminate\Support\Facades\Route::has($name) ? route($name, $params) : 'javascript:void(0);'; $imageUrl = fn ($path) => \App\Helpers\Helper::storage_url($path, asset('backend/template/svg-icon/product-img.svg')); $resetUrl = $routeUrl('backend.template.stock-dashboard.index'); $dashTabUrl = fn ($tab) => $routeUrl('backend.template.dashboard.index', array_filter( ['tab' => $tab === 'overview' ? null : $tab], fn ($v) => $v !== null && $v !== '' )); $tabs = [ ['label' => 'Overview', 'icon' => 'ri-dashboard-line', 'url' => $dashTabUrl('overview'), 'active' => false], ['label' => 'Orders', 'icon' => 'ri-shopping-bag-3-line', 'url' => $dashTabUrl('orders'), 'active' => false], ['label' => 'Sales', 'icon' => 'ri-line-chart-line', 'url' => $dashTabUrl('sales'), 'active' => false], ['label' => 'Customers', 'icon' => 'ri-group-line', 'url' => $dashTabUrl('customers'), 'active' => false], ['label' => 'Revenue', 'icon' => 'ri-wallet-3-line', 'url' => $routeUrl('backend.template.revenue.index'), 'active' => false], ['label' => 'Products', 'icon' => 'ri-box-3-line', 'url' => $routeUrl('backend.template.product-dashboard.index'),'active' => false], ['label' => 'Stocks', 'icon' => 'ri-archive-stack-line', 'url' => $routeUrl('backend.template.stock-dashboard.index'), 'active' => true], ['label' => 'Coupons', 'icon' => 'ri-coupon-3-line', 'url' => $routeUrl('backend.template.coupons.index'), 'active' => false], ['label' => 'Delivery', 'icon' => 'ri-truck-line', 'url' => $routeUrl('backend.template.delivery-dashboard.index'), 'active' => false], ['label' => 'Reports', 'icon' => 'ri-file-chart-line', 'url' => $routeUrl('backend.template.reports.SalesReport'), 'active' => false], ]; $toneColors = ['green' => '#0aa437','blue' => '#2f80ed','violet' => '#7c5cff','orange' => '#f97316','red' => '#ef4444','teal' => '#14b8a6']; @endphp
{{-- ── Header ── --}}

Stock / Inventory Dashboard

Overview of stock health, expiry, dead stock and wastage

–
{{-- ── Nav Tabs ── --}}
@foreach ($tabs as $tab) {{ $tab['label'] }} @endforeach
{{-- ── KPI Cards ── --}}
@php $noteClasses = ['red' => 'si-note-red','orange' => 'si-note-orange','violet' => 'si-note-violet','green' => 'si-note-green',null => 'si-note-muted','' => 'si-note-muted']; @endphp @foreach ($kpis as $kpi)

{{ $kpi['label'] }}

{{ $kpi['display'] }}

{{ $kpi['note'] }}

@if ($kpi['link_label'] && $kpi['link_route']) {{ $kpi['link_label'] }} → @endif
@endforeach
{{-- ── Stock Alerts Banner ── --}}
Stock
Alerts
@foreach ($stockAlerts as $alert)

{{ $alert['message'] }}

{{ $alert['sub'] }}

@endforeach
{{-- ── Four Column Tables ── --}}
{{-- Pre Order Items --}}
@if ($outOfStockItems->isEmpty())
No pre-order items found.
@else
@foreach ($outOfStockItems as $item) @endforeach
Product Category
{{ $item['name'] }} {{ $item['name'] }}
{{ $item['category'] }}
@endif
{{-- Expiring Soon --}}
@if ($expiringSoonItems->isEmpty())
@if ($expiringSoonTotal === 0) No expiry tracking available or no items expiring soon. @else No items expiring in next 7 days. @endif
@else
@foreach ($expiringSoonItems as $item) @endforeach
Product Expiry Date Stock
{{ $item['name'] }} {{ $item['name'] }}
{{ $item['expiry_date'] }} {{ number_format($item['stock_qty']) }}
@endif
{{-- Dead Stock --}}
@if ($deadStockItems->isEmpty())
No dead stock found.
@else
@foreach ($deadStockItems as $item) @endforeach
Product Days No Sale Stock Value
{{ $item['name'] }} {{ $item['name'] }}
{{ $item['days_no_sale_display'] }} {{ $item['stock_value_display'] }}
@endif
{{-- Wastage Summary --}}

Wastage Summary (This Month)

View Full Report →
Total Wastage Value {{ $wastageSummary['total_value_display'] }}
Wastage Quantity {{ $wastageSummary['quantity_display'] }}
Wastage Percentage {{ $wastageSummary['percentage'] }}
vs Last Month @if ($wastageSummary['vs_trend'] === 'up') @elseif ($wastageSummary['vs_trend'] === 'down') @endif {{ $wastageSummary['vs_last_month'] }}
@if (!$wastageSummary['available'])

Wastage tracking not configured.

@endif
{{-- ── Bottom Row: Status Donut | Value Donut | Quick Actions ── --}}
{{-- Stock Status Overview --}}

Stock Status Overview

Total Items: {{ $statusDistribution['total_display'] }}

@if (empty($statusDistribution['items']))
No stock data available.
@else
Total Items {{ $statusDistribution['total_display'] }}
@foreach ($statusDistribution['items'] as $item)
{{ $item['label'] }}
{{ $item['count_display'] }} ({{ $item['percentage_display'] }})
@endforeach
@endif
{{-- Stock Value Distribution --}}

Stock Value Distribution

Total Value: {{ $valueDistribution['total_display'] }}

@if (empty($valueDistribution['items']))
No stock value data. Ensure price is set.
@else
Total Value {{ $valueDistribution['total_display'] }}
@foreach ($valueDistribution['items'] as $item)
{{ $item['label'] }}
{{ $item['display'] }} {{ $item['pct_display'] }}
@endforeach
@endif
{{-- Quick Actions --}}

Quick Actions

Stock management shortcuts

@php $actions = [ ['icon' => 'ri-shopping-cart-add-line', 'tone' => 'green', 'title' => 'Purchase Order', 'sub' => 'Create new purchase order', 'route' => 'backend.template.manage-inventory.index'], ['icon' => 'ri-edit-2-line', 'tone' => 'blue', 'title' => 'Stock Adjustment', 'sub' => 'Adjust stock manually', 'route' => 'backend.template.manage-inventory.index'], ['icon' => 'ri-loop-left-line', 'tone' => 'violet', 'title' => 'Stock Transfer', 'sub' => 'Transfer between locations', 'route' => 'backend.template.manage-inventory.index'], ['icon' => 'ri-delete-bin-line', 'tone' => 'red', 'title' => 'Wastage Entry', 'sub' => 'Record wastage', 'route' => 'backend.template.manage-inventory.index'], ]; @endphp @foreach ($actions as $action)

{{ $action['title'] }}

{{ $action['sub'] }}

@endforeach
{{-- Footer note --}}
@endsection @section('scripts') @endsection