@extends('layouts.admin') @section('title', $warehouse->name) @section('page_title', __('Warehouse') . ' - ' . $warehouse->name) @section('content')
{{ $warehouse->name }} @if($warehouse->is_main)رئيسي@endif

{{ $warehouse->code }}


المدير: {{ $warehouse->manager?->name ?? '-' }}

{{ __('Phone') }}: {{ $warehouse->phone ?? '-' }}

{{ __('Address') }}: {{ $warehouse->address ?? '-' }}

{{ __('Status') }}: @if($warehouse->is_active){{ __('Active') }} @else{{ __('Inactive') }}@endif

@php $stocks = $warehouse->stocks()->with('product')->get(); $total = $stocks->sum('quantity'); $lowStock = $stocks->filter(fn ($s) => $s->product && $s->product->min_stock > 0 && $s->quantity <= $s->product->min_stock)->count(); @endphp
إجمالي عدد الأصناف

{{ $stocks->count() }}

إجمالي الكمية

{{ $total }}

أصناف مخزون منخفض

{{ $lowStock }}

المخزون
@forelse($stocks as $s) @php $min = $s->product?->min_stock ?? 0; [$st, $cls] = $s->quantity <= 0 ? ['نافد','danger'] : (($min > 0 && $s->quantity <= $min) ? ['منخفض','warning text-dark'] : ['متاح','success']); @endphp @empty @endforelse
{{ __('Code') }}{{ __('Product') }}الكميةالحد الأدنى{{ __('Status') }}
{{ $s->product?->code }}{{ $s->product?->name }}{{ $s->quantity }}{{ $min }}{{ $st }}
لا يوجد مخزون
@endsection