@php $selectedWarehouse = (int) ($itemFilters['warehouse_id'] ?? 0); $selectedType = $itemFilters['type'] ?? ''; $selectedCategory = (int) ($itemFilters['category_id'] ?? 0); $filtersApplied = $selectedWarehouse > 0; @endphp
Filter Items
@if($filtersApplied) @endif

Select a warehouse and optional type/category, then load items to enter opening balances part by part.

@if(!$filtersApplied)
Choose a Warehouse and click Load Items to begin entering opening balances.
@else
@csrf @if($selectedType) @endif @if($selectedCategory) @endif
@php $whName = $warehouses->firstWhere('id', $selectedWarehouse)?->name ?? 'Selected warehouse'; @endphp
Entering opening balance for {{ $whName }}. Inventory debits on save; Opening Balance Equity credits the offset.
Item Opening Balances {{ $rows->count() }} items
@forelse($rows as $index => $row) @php $typeLabels = ['inventory' => 'Inventory', 'service' => 'Service', 'non_inventory' => 'Non-Inventory']; @endphp @empty @endforelse @if($rows->isNotEmpty()) @endif
Code Item Name Type Category Dr/Cr Quantity Rate Amount
{{ $row->code }} {{ $row->name }} {{ $typeLabels[$row->type] ?? $row->type }} {{ $row->category?->name ?? '—' }} @include('masters.opening-balance.partials._dr-cr-badge', [ 'drCr' => $row->opening_dr_cr, 'amount' => $row->opening_amount, ]) {{ $currencySymbol }}{{ number_format($row->opening_amount, 2) }}
No items match the selected filters.
Totals (visible rows) Totals (visible rows) 0 {{ $currencySymbol }}0.00
@if($canSave && $rows->isNotEmpty()) @endif
@endif @push('scripts') @endpush