@extends('layouts.panel') @section('title', 'پروفایل انبار: ' . $warehouse->name) @section('content')

{{ $warehouse->name }}

{{ $warehouse->location ? $warehouse->location : 'انبار' }}

بازگشت به لیست
تعداد محصولات
{{ $stats['total_products'] }}
تعداد آیتم‌های موجودی
{{ $stats['total_items'] }}
مجموع مقدار موجودی
{{ number_format($stats['total_quantity']) }}

اطلاعات انبار

نام شهر
{{ $warehouse->location ?: '-' }}
اسم انبار
{{ $warehouse->name ?: '-' }}
آدرس
{{ $warehouse->address ?: '-' }}
شماره تماس
@php $phones = is_array($warehouse->phone_numbers) ? $warehouse->phone_numbers : json_decode($warehouse->phone_numbers, true); @endphp @if($phones && count($phones) > 0) @foreach($phones as $phone)
{{ $phone['number'] ?? '' }}@if(isset($phone['support']) && $phone['support']) ({{ $phone['support'] }})@endif
@endforeach @else - @endif
توضیحات
{{ $warehouse->description ?: '-' }}

لیست موجودی‌ها

@if($inventories->count() > 0) @foreach($inventories as $index => $inventory) @php $totalOutputs = $inventory->outputs->sum('quantity'); $remainingQuantity = max(0, $inventory->quantity - $totalOutputs); $lastOutput = $inventory->outputs->sortByDesc('created_at')->first(); // Extract row number, expiration date, brand, and grade from notes $rowNumber = null; $expirationDate = null; $brand = null; $grade = null; if ($inventory->notes) { $notesLines = explode("\n", $inventory->notes); foreach ($notesLines as $line) { if (preg_match('/شماره ردیف انبار:\s*(.+)/', $line, $matches)) { $rowNumber = trim($matches[1]); } if (preg_match('/تاریخ انقضا:\s*(.+)/', $line, $matches)) { $expirationDate = trim($matches[1]); } if (preg_match('/برند:\s*(.+)/', $line, $matches)) { $brand = trim($matches[1]); } if (preg_match('/گرید:\s*(.+)/', $line, $matches)) { $grade = trim(preg_replace('/⭐\s*/', '', $matches[1])); } } } @endphp @endforeach @else @endif
ردیف نام محصول شماره ردیف انبار مقدار باقی مانده برند گرید تاریخ / مقدار برداشتی تاریخ انقضا عملیات
{{ $index + 1 }}
{{ $inventory->product->name ?? 'نامشخص' }}
{{ $rowNumber ?? '-' }}
{{ number_format($remainingQuantity, 0) }} {{ $inventory->unit ?? '' }}
کل: {{ number_format((float)$inventory->quantity, 0) }} {{ $inventory->unit ?? '' }}
{{ $brand ?? '-' }} {{ $grade ?? '-' }} @if($lastOutput)
@jdate($lastOutput->created_at, 'Y/m/d')
-{{ number_format($lastOutput->quantity, 0) }} {{ $inventory->unit ?? '' }}
@else - @endif
@if($expirationDate) @php // Try to convert to Jalali if it's a Gregorian date try { if (preg_match('/^(\d{4})-(\d{2})-(\d{2})$/', $expirationDate, $matches)) { $date = new \Carbon\Carbon($expirationDate); $jalali = \Morilog\Jalali\Jalalian::fromCarbon($date); echo $jalali->format('Y/m/d'); } else { echo $expirationDate; } } catch (\Exception $e) { echo $expirationDate; } @endphp @else - @endif
مشاهده ویرایش
هیچ موجودی‌ای در این انبار یافت نشد
@endsection @push('styles') @endpush @push('scripts') @endpush