@extends('layouts.app') @section('title', __('dashboard.product_details')) @section('page_heading', __('dashboard.product_details')) @section('breadcrumb')
  • {{ __('dashboard.Home') }}
  • {{ __('dashboard.Products') }}
  • {{ $product->name }}
  • @endsection @section('content') @include('dashboard.partials.audit-log-styles')
    @if(is_array($product->images) && count($product->images) > 0)

    {{ __('dashboard.Product Images') }}

    @can('edit products') {{ __('dashboard.Edit') }} @if(!$product->is_scrapped) @endif @endcan
    @foreach($product->images as $img)
    Product Image
    @if($product->main_image == $img)
    {{ __('dashboard.Main') }}
    @endif
    @endforeach
    @endif

    {{ __('dashboard.product_information') }}

    @can('edit products') {{ __('dashboard.Edit') }} @endcan
    {{ __('dashboard.Name') }}

    {{ $product->name }}

    {{ __('dashboard.SKU') }}

    {{ $product->sku }}

    {{ __('dashboard.Type') }}

    {{ __($product->type) }}

    {{ __('dashboard.Category') }}

    {{ $product->category->name ?? 'N/A' }}

    {{ __('dashboard.Price') }}

    {{ number_format($product->price, 2) }}

    تكلفة الاقتناء

    {{ number_format((float) $product->acquisition_cost, 2) }}

    {{ __('dashboard.Stock') }}

    {{ $product->stock }}

    حالة الأصل

    {{ $product->is_scrapped ? 'هالك' : ($product->inventory_status === 'maintenance' ? 'في الصيانة' : 'متاح') }}

    @if($product->is_scrapped)
    سبب الهالك

    {{ $product->scrap_reason ?: '-' }}

    {{ optional($product->scrapped_at)->format('Y-m-d H:i') ?? '-' }} بواسطة {{ $product->scrapper?->name ?? '-' }}
    @endif
    @if($product->selectedOptions->count() > 0)
    {{ __('dashboard.Product Options') }}
    @foreach($product->selectedOptions as $selectedOption)
    {{ $selectedOption->option->name }}: {{ $selectedOption->value }}
    @endforeach @endif @if($product->sourceManufacturingOrder) @endif

    إحصائيات المنتج

    @if($product->type == 'rent') @foreach($productStats as $stat)
    {{ $stat['label'] }}

    {{ $stat['value'] }}

    @endforeach @elseif($product->type == 'sale')
    إجمالي القطع المباعة

    {{ $productStats[0]['value'] }}

    القيمة الإجمالية للبيع

    {{ $productStats[1]['value'] }}

    @endif
    @if($product->type == 'rent' && $reservationCount > 0)

    الحجوزات ({{ $reservationCount }})

    @foreach($reservationRows as $reservation) @endforeach
    # العميل تاريخ المناسبة تاريخ الإرجاع {{ __('dashboard.status_label') }} الإجمالي المدفوع إجراءات
    {{ $reservation['id'] }} {{ $reservation['customer_name'] }} {{ $reservation['event_date'] }} {{ $reservation['return_date'] }} {{ $reservation['status'] }} {{ $reservation['final_total'] }}
    @endif @if($product->type == 'rent')

    الصيانة والتلفيات

    @csrf
    @forelse($maintenanceRows as $maintenance) @empty @endforelse
    # العنوان {{ __('dashboard.type_label') }} {{ __('dashboard.status_label') }} التكلفة تحميل العميل العميل إجراء
    {{ $maintenance['id'] }}
    {{ $maintenance['title'] }}
    {{ $maintenance['started_at'] ?? '-' }}
    {{ $maintenance['type'] }} {{ $maintenance['status'] === 'completed' ? 'مكتملة' : 'مفتوحة' }} {{ $maintenance['maintenance_cost'] }} {{ $maintenance['customer_charge_amount'] }} {{ $maintenance['customer_name'] }} @if($maintenance['status'] !== 'completed')
    @csrf @method('PATCH')
    @else {{ $maintenance['completed_at'] ?? '-' }} @endif
    لا توجد سجلات صيانة حتى الآن.
    @endif

    {{ __('dashboard.history_title') }}

    {{ __('dashboard.history_total') }}: {{ $auditSummary['total'] }} {{ __('dashboard.history_created') }}: {{ $auditSummary['created'] }} {{ __('dashboard.history_updated') }}: {{ $auditSummary['updated'] }} {{ __('dashboard.history_deleted') }}: {{ $auditSummary['deleted'] }} {{ __('dashboard.history_toggle') }}
    @forelse ($auditEntries as $entry)
    {{ $entry['headline'] }} {{ __('dashboard.history_event_by') }} {{ $entry['actor'] }}
    {{ $entry['timestamp'] }} ({{ $entry['timestamp_human'] }})
    @foreach ($entry['changes'] as $change)
    {{ $change['label'] }}: 
    @if($change['has_old']) {{ $change['old'] }} @endif {{ $change['new'] }}
    @endforeach
    @empty

    {{ __('dashboard.history_no_history_found') }}

    @endforelse
    @if(!$product->is_scrapped) @endif @endsection