{{ __('Product Performance Report') }}

{{ __('Report Type') }}: {{ ucfirst($reportType) }}

{{ __('Period') }}: {{ $startDate }} {{ __('to') }} {{ $endDate }}

{{ __('Generated on') }}: {{ now()->format('Y-m-d H:i:s') }}

{{ __('Summary') }}

{{ __('Total Products Sold') }} {{ $products->sum('total_quantity') }}
{{ __('Total Sales Amount') }} {{ number_format($products->sum('total_sales'), 2) }}
{{ __('Number of Different Products Sold') }} {{ $products->count() }}

{{ __('Product Performance Details') }}

@foreach($products as $product) @endforeach
{{ __('Product') }} {{ __('Category') }} {{ __('Quantity Sold') }} {{ __('Total Sales') }} {{ __('% of Total') }}
{{ $product->product->name }} {{ $product->product->category->name }} {{ $product->total_quantity }} {{ number_format($product->total_sales, 2) }} @if($products->sum('total_sales') > 0) {{ number_format(($product->total_sales / $products->sum('total_sales')) * 100, 2) }}% @else 0.00% @endif
{{ __('Total') }} {{ $products->sum('total_quantity') }} {{ number_format($products->sum('total_sales'), 2) }} 100.00%

{{ __('Top 5 Best Selling Products') }}

@foreach($products->take(5) as $index => $product) @endforeach
{{ __('Rank') }} {{ __('Product') }} {{ __('Category') }} {{ __('Quantity Sold') }} {{ __('Total Sales') }}
{{ $index + 1 }} {{ $product->product->name }} {{ $product->product->category->name }} {{ $product->total_quantity }} {{ number_format($product->total_sales, 2) }}