@extends('layouts.app') @section('content')

Stock Opening

@include('components.notifications')
@error('category_id')
{{ $message }}
@enderror
@if(isset($warehouse_id)) @if($items->isEmpty())

No items found for the selected warehouse/Category

@else @if($opening)
@csrf @php $serial = 1; @endphp @foreach($items as $item) @endforeach
SL Item Name
{{ $serial++ }} {{ $item->name }} @if($item->variations->isNotEmpty()) @foreach($item->variations as $variation) @php $stock = $variation->stocks->firstWhere('warehouse_id', $warehouse_id); // Ensure $stock is defined @endphp @endforeach
SKU Attributes Quantity Rate(cost) Amount(cost)
{{ $variation->sku }} @foreach($variation->variationAttributes as $attribute) {{ $attribute->attributeValue->value }}@if(!$loop->last), @endif @endforeach
@else @php $stock = $item->stocks->firstWhere('warehouse_id', $warehouse_id); @endphp
SKU Quantity Rate(cost) Amount(cost)
{{ $item->unique_code }}
@endif
@endif

Printable Stock Overview

Opening Date: {{ settings('Inventory.opening-date') ?? 'Not set' }}

@php $serial = 1; @endphp @foreach($items as $item) @if($item->variations->isNotEmpty()) @foreach($item->variations as $index => $variation) @if ($index === 0) @else @endif @endforeach @else @php $stock = $item->stocks->firstWhere('warehouse_id', $warehouse_id); @endphp @endif @endforeach
SL Item Name SKU Attributes Quantity Cost Rate Cost Amount
{{ $serial++ }} {{ $item->name }} {{ $variation->sku }} @foreach($variation->variationAttributes as $attribute) {{ $attribute->attributeValue->value }}@if(!$loop->last), @endif @endforeach @php $stock = $variation->stocks->firstWhere('warehouse_id', $warehouse_id); @endphp {{ $stock ? $stock->available_stock : 0 }} {{ $stock ? $stock->rate : 0 }} {{ $stock ? $stock->amount : 0 }}
{{ $variation->sku }} @foreach($variation->variationAttributes as $attribute) {{ $attribute->attributeValue->value }}@if(!$loop->last), @endif @endforeach @php $stock = $variation->stocks->firstWhere('warehouse_id', $warehouse_id); @endphp {{ $stock ? $stock->available_stock : 0 }} {{ $stock ? $stock->rate : 0 }} {{ $stock ? $stock->amount : 0 }}
{{ $serial++ }} {{ $item->name }} {{ $item->unique_code }} {{ $stock ? $stock->available_stock : 0 }} {{ $stock ? $stock->rate : 0 }} {{ $stock ? $stock->amount : 0 }}
@endif @endif
@endsection