@extends('layouts.app') @section('title', __('dashboard.Reservation Details')) @section('page_heading', __('dashboard.Reservation') . ' #' . $reservation->id) @section('content')
@can('view reservations') طباعة @endcan @can('create reservation returns') مرتجع @endcan @can('edit reservations') {{ __('dashboard.Edit') }} @endcan {{ __('dashboard.Reservations') }}
@include('dashboard.partials.audit-log-styles') {{-- KPIs --}}
@foreach([ ['lbl'=>__('dashboard.price'), 'val'=>number_format($reservation->price,2), 'color'=>'var(--c-primary)', 'bg'=>'var(--c-primary-bg)', 'icon'=>'fa-solid fa-tag'], ['lbl'=>'إجمالي المدفوع', 'val'=>number_format($reservation->paid_amount,2), 'color'=>'#16a34a', 'bg'=>'#f0fdf4', 'icon'=>'fa-solid fa-circle-check'], ['lbl'=>__('dashboard.Remaining Amount'), 'val'=>number_format($remainingAmount,2), 'color'=>'#d97706', 'bg'=>'#fffbeb', 'icon'=>'fa-solid fa-hourglass-half'], ['lbl'=>__('dashboard.refunded_amount'), 'val'=>number_format($reservation->refunded_amount,2), 'color'=>'#dc2626', 'bg'=>'#fef2f2', 'icon'=>'fa-solid fa-rotate-left'], ] as $k)
{{ $k['val'] }}
{{ $k['lbl'] }}
@endforeach
{{-- Left column --}}
{{-- Product + Customer --}}
{{-- Product --}}
{{ __('dashboard.Product') }}
{{ $statusText }}
{{ $reservation->product->name }}
{{ $reservation->product->sku }}
@foreach([ [__('dashboard.Price Before Discount'), number_format($reservation->price_before_discount??0,2)], [__('dashboard.Discount'), number_format($reservation->discount??0,2)], [__('dashboard.Shipping'), number_format($reservation->shipping_cost??0,2)], ['ضرائب', number_format($reservation->total_taxes??0,2)], ] as [$lbl,$val])
{{ $lbl }} {{ $val }}
@endforeach
{{-- Customer --}}
{{ __('dashboard.Customer') }}
ملف العميل
{{ $reservation->customer->name }}
@foreach([ [__('dashboard.Phone'), $reservation->customer->phone ?: '—'], [__('dashboard.Other Phone'), $reservation->customer->other_phone ?: '—'], [__('dashboard.Governorate'), $reservation->customer->governorate ?: '—'], ] as [$lbl,$val])
{{ $lbl }} {{ $val }}
@endforeach
{{-- Dates --}}
{{ __('dashboard.dates') }}
@foreach([ [__('dashboard.event_date'), $reservation->event_date->format('Y-m-d'), 'fa-solid fa-calendar-days', '#eff6ff','#2563eb'], [__('dashboard.fitting_date'), $reservation->fitting_date?->format('Y-m-d') ?? '—', 'fa-solid fa-scissors', '#f0fdf4','#16a34a'], [__('dashboard.customer_pickup_date'), $reservation->customer_pickup_date->format('Y-m-d'), 'fa-solid fa-arrow-up-right-from-square', '#fffbeb','#d97706'], [__('dashboard.customer_return_date'), $reservation->customer_return_date->format('Y-m-d'), 'fa-solid fa-box','#fef2f2','#dc2626'], ] as [$lbl,$val,$icon,$bg,$color])
{{ $lbl }}
{{ $val }}
@endforeach
{{-- Options & Notes --}} @if($reservation->selectedOptions->count() > 0 || $reservation->notes)
{{ __('dashboard.Notes & Options') }}
@if($reservation->selectedOptions->count() > 0)
@foreach($reservation->selectedOptions as $opt) {{ $opt->option->name }}: {{ $opt->value }} @endforeach
@endif @if($reservation->notes)
{{ $reservation->notes }}
@endif
@endif {{-- Audit --}}
{{ __('dashboard.history_title') }}
{{-- Right column --}}
{{-- Payment form --}}
الدفعات والفواتير
@csrf
سجل الدفعات
@forelse($reservation->payments as $payment)
دفعة #{{ $payment->id }} — {{ number_format($payment->amount,2) }}
{{ $payment->created_at->format('Y-m-d H:i') }} | {{ $payment->payment_method }}
@empty
لا توجد دفعات مسجلة
@endforelse
{{-- User assignments --}}
{{ __('dashboard.user_assignments') }}
@foreach([ [__('dashboard.created_by'), optional($reservation->creator)->name ?? '—'], [__('dashboard.delivered_by'), optional($reservation->deliverer)->name ?? '—'], [__('dashboard.finished_by'), optional($reservation->finisher)->name ?? '—'], ] as [$lbl,$val])
{{ $lbl }} {{ $val }}
@endforeach
{{ __('dashboard.edit_user_assignments') }}
@endsection