@extends('layouts.app') @section('title', __('dashboard.Customer Details')) @section('page_heading', $customer->name) @section('content') @include('layouts.partials.workspace-page-styles') @include('dashboard.partials.audit-log-styles') {{-- KPIs --}}
@foreach([ ['icon'=>'fa-solid fa-calendar-check','bg'=>'var(--c-primary-bg)','color'=>'var(--c-primary)','val'=>$stats['reservations_count'],'lbl'=>__('dashboard.Total Reservations')], ['icon'=>'fa-solid fa-coins','bg'=>'#f0fdf4','color'=>'#16a34a','val'=>number_format($stats['net_reservations_value'],2),'lbl'=>__('dashboard.Reservations Total Value')], ['icon'=>'fa-solid fa-cart-shopping','bg'=>'#eff6ff','color'=>'#2563eb','val'=>$stats['sales_count'],'lbl'=>__('dashboard.Total Purchases')], ['icon'=>'fa-solid fa-wallet','bg'=>'#fffbeb','color'=>'#d97706','val'=>number_format($stats['net_sales_value'],2),'lbl'=>__('dashboard.Purchases Total Value')], ] as $k)
{{ $k['val'] }}
{{ $k['lbl'] }}
@endforeach
{{-- Customer Info --}}

{{ __('dashboard.Customer Details') }}

{{ __('dashboard.Name') }}
{{ $customer->name }}
{{ __('dashboard.Gender') }}
{{ $customer->gender === 'male' ? __('dashboard.Male') : __('dashboard.Female') }}
{{ __('dashboard.Governorate') }}
{{ $customer->governorate ?: '—' }}
{{ __('dashboard.Customer Since') }}
{{ $customer->created_at->format('Y-m-d') }}
@foreach($contactRows as $contact)
{{ $contact['label'] }}
{{ $contact['number'] }}
@endforeach @if($customer->address)
{{ __('dashboard.Address') }}
{{ $customer->address }}
@endif
{{-- Reservations --}}

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

{{ count($reservationRows) }}
@if(count($reservationRows))
@foreach($reservationRows as $r) @endforeach
#{{ __('dashboard.Product') }}{{ __('dashboard.Event Date') }}{{ __('dashboard.Return Date') }}{{ __('dashboard.Final Total') }}{{ __('dashboard.Status') }}
{{ $r['id'] }} {{ $r['product_name'] }} {{ $r['event_date'] }} {{ $r['return_date'] }} {{ $r['final_total'] }} {{ $r['status_text'] }} {{ __('dashboard.View') }}
@else

{{ __('dashboard.No reservations found for this customer.') }}

@endif
{{-- Sales --}}

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

{{ count($saleRows) }}
@if(count($saleRows))
@foreach($saleRows as $s) @endforeach
#{{ __('dashboard.Products') }}{{ __('dashboard.Final Total') }}{{ __('dashboard.Payment Status') }}{{ __('dashboard.Date') }}
{{ $s['id'] }} @foreach($s['products'] as $p)
{{ $p['name'] }} ({{ $p['quantity'] }})
@endforeach
{{ $s['final_total'] }} {{ $s['payment_status_text'] }} {{ $s['created_at'] }} {{ __('dashboard.View') }}
@else

{{ __('dashboard.No sales found for this customer.') }}

@endif
{{-- Embroidery --}} @if($embroideryRows->isNotEmpty())

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

{{ $embroideryRows->count() }}
@foreach($embroideryRows as $r) @endforeach
المرجعالعنوانالموعد{{ __('dashboard.status_label') }}
{{ $r['reference_code'] }} {{ $r['title'] }} {{ $r['target_date'] ?? '—' }} {{ $r['status'] }} {{ __('dashboard.view') }} @if($r['manufacturing_url'])التصنيع@endif
@endif {{-- Manufacturing --}} @if($manufacturingRows->isNotEmpty())

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

{{ $manufacturingRows->count() }}
@foreach($manufacturingRows as $r) @endforeach
المرجعالعنوان{{ __('dashboard.type_label') }}{{ __('dashboard.status_label') }}التكلفة
{{ $r['reference_code'] }} {{ $r['title'] }} {{ $r['type'] }} {{ $r['status'] }} {{ $r['total_cost'] }} {{ __('dashboard.view') }}
@endif {{-- Audit Log --}}

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

{{ $auditSummary['total'] }} {{ __('dashboard.history_toggle') }}
@forelse($auditEntries as $entry)
{{ $entry['headline'] }} {{ __('dashboard.history_event_by') }} {{ $entry['actor'] }}
{{ $entry['timestamp'] }} ({{ $entry['timestamp_human'] }})
@if($entry['changes']->isNotEmpty())
@foreach($entry['changes'] as $change)
{{ $change['label'] }}: @if($change['has_old']){{ $change['old'] }}@endif {{ $change['new'] }}
@endforeach
@endif
@empty

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

@endforelse
@endsection