@include('styles.pdfs') @include('_partials.letterhead-pdf')

Stock Sheet

Generated on: {{ Carbon\Carbon::now()->format('F d, Y \a\t h:i A') }}
@if(isset($warehouse_name) && $warehouse_name)
Warehouse: {{ $warehouse_name }}
@elseif(isset($warehouse_names) && !empty($warehouse_names) && count($warehouse_names) > 1)
Warehouses: {{ implode(', ', $warehouse_names) }}
@else
Scope: All Active Warehouses
@endif
@php $currentCategory = null; $categoryTotal = 0; $grandTotal = 0; @endphp @foreach($stockData as $row) @if($currentCategory !== $row['category']) @if($currentCategory !== null) @php $grandTotal += $categoryTotal; $categoryTotal = 0; @endphp @endif @php $currentCategory = $row['category']; @endphp @endif @php $categoryTotal += $row['quantity']; @endphp @endforeach @if($currentCategory !== null) @php $grandTotal += $categoryTotal; @endphp @endif
Category Product SKU Warehouse Quantity
Category Total: {{ number_format($categoryTotal, 2) }}
{{ $row['category'] }}
{{ $row['category'] }} {{ $row['product'] }} {{ $row['sku'] ?? 'N/A' }} {{ $row['warehouse'] }} {{ number_format($row['quantity'], 2) }}
Category Total: {{ number_format($categoryTotal, 2) }}
GRAND TOTAL: {{ number_format($grandTotal, 2) }}
Total Items: {{ count($stockData) }}
Total Categories: {{ $totalCategories ?? collect($stockData)->pluck('category')->unique()->count() }}
Total Warehouses: {{ $totalWarehouses ?? collect($stockData)->pluck('warehouse')->unique()->count() }}