{{-- resources/views/stock_aging/by_category.blade.php --}} @extends('layouts.app') @section('title', $categoryData['label'] ?? 'Stock Aging - Category') @section('content') @php $categoryColors = [ '0-30' => '#28a745', '31-60' => '#17a2b8', '61-90' => '#ffc107', '91-120' => '#fd7e14', '121-160' => '#e83e8c', '160+' => '#dc3545', ]; $categoryActions = [ '0-30' => 'Normal monitoring - continue regular sales activities', '31-60' => 'Monitor sales patterns - watch for slowing demand', '61-90' => 'Consider promotional activities to boost sales', '91-120' => 'Review pricing strategy and consider discounts', '121-160' => 'Take corrective action - aggressive promotion or bundle', '160+' => 'Immediate action required - clearance, return, or write-off', ]; $categoryIcons = [ '0-30' => 'fa-check-circle', '31-60' => 'fa-clock-o', '61-90' => 'fa-hourglass-half', '91-120' => 'fa-exclamation-triangle', '121-160' => 'fa-warning', '160+' => 'fa-skull', ]; $color = $categoryColors[$category] ?? '#6c757d'; $action = $categoryActions[$category] ?? 'Review'; $icon = $categoryIcons[$category] ?? 'fa-clock-o'; @endphp

{{ $categoryData['label'] ?? $category }} {{ $categoryData['age_range'] ?? '' }}

{{ $categoryData['label'] ?? $category }}

Total Value: KSh {{ number_format($totalValue, 2) }} | Total Products: {{ $totalProducts }} | Total Quantity: {{ number_format($totalQuantity, 2) }} Units | Percentage of Total: {{ $percentage }}%


Recommended Action: {{ $action }}

Filters

Reset

@component('components.widget', ['title' => $categoryData['label'] ?? $category . ' Products'])
@forelse($data as $item) @empty @endforelse
Product Location Category Brand Qty Unit Cost Stock Value Days in Stock Last Sale Avg Monthly Sales
{{ $item['product_name'] }}
SKU: {{ $item['sku'] }} @if(!empty($item['variation_name']) && $item['variation_name'] != 'DUMMY')
Variation: {{ $item['variation_name'] }} @endif
{{ $item['location_name'] }} {{ $item['category_name'] ?? '' }} {{ $item['brand_name'] ?? '' }} {{ number_format($item['quantity'], 2) }} {{ $item['unit'] ?? '' }} KSh {{ number_format($item['unit_cost'], 2) }} KSh {{ number_format($item['stock_value'], 2) }} {{ $item['avg_days_in_stock'] }} days {{ $item['last_sale_date'] ? \Carbon\Carbon::parse($item['last_sale_date'])->format('d-m-Y') : 'Never' }} {{ number_format($item['avg_monthly_sales'], 2) }}
No products found in this category.
@endcomponent
@stop @section('javascript') @stop