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

Stock Management

Total Stock Items

{{ $totalStocks }}

Total Value

LKR {{ number_format($totalValue, 2) }}

Out of Stock

{{ $outOfStock }}

Low Stock

{{ $lowStock }}

@if ($categoryStats && $selectedCategory)
@if ($selectedCategory->icon) @else @endif

{{ $selectedCategory->cat_name }}

Category Statistics

Clear Filter

Total Products

{{ $categoryStats['total_products'] }}

Stock Items

{{ $categoryStats['total_stocks'] }}

Total Value

LKR {{ number_format($categoryStats['total_value'], 2) }}

In Stock

{{ $categoryStats['in_stock'] }}

Out of Stock

{{ $categoryStats['out_of_stock'] }}

Low Stock

{{ $categoryStats['low_stock'] }}

@if (isset($categoryStats['brands']) && $categoryStats['brands']->count() > 0)

Brands in {{ $selectedCategory->cat_name }}

@foreach ($categoryStats['brands'] as $brand)
{{ $brand->brand_name }}
{{ $brand->total_products }} Items
In Stock: {{ $brand->in_stock }}
@endforeach
@endif
@endif
@forelse($stocks as $stock) @empty @endforelse
Product SKU Batch Barcode Cost Price Selling Price Quantity Available Status Actions
{{ $stock->product->product_name }}
{{ $stock->product->sku }}
{{ $stock->product->sku }} {{ $stock->batch->batch_number }} {{ $stock->batch->barcode ?? '-' }} @if ($stock->cost_price > 0) LKR {{ number_format($stock->cost_price, 2) }} @else - @endif @if ($stock->selling_price > 0) LKR {{ number_format($stock->selling_price, 2) }} @else - @endif
{{ number_format($stock->total_quantity, 0) }}
@if ($stock->foc_quantity > 0)
FOC: {{ number_format($stock->foc_quantity, 0) }} @if ($stock->paid_quantity > 0) + Paid: {{ number_format($stock->paid_quantity, 0) }} @endif
@endif
{{ number_format($stock->total_available_quantity, 0) }}
@if ($stock->foc_available_quantity > 0)
FOC: {{ number_format($stock->foc_available_quantity, 0) }} @if ($stock->paid_available_quantity > 0) + Paid: {{ number_format($stock->paid_available_quantity, 0) }} @endif
@endif
@if ($stock->total_available_quantity == 0) Out of Stock @elseif($stock->total_available_quantity <= $stock->total_quantity / 2) Low Stock @else In Stock @endif View
No stock items found.
{{ $stocks->links() }}
@endsection