@extends('layouts.app') @section('content')

{{ __('customers.details') }}

@if($customer->photo) {{ $customer->first_name }} {{ $customer->last_name }} @else {{ mb_substr($customer->first_name, 0, 1) }}{{ mb_substr($customer->last_name, 0, 1) }} @endif
{{ $customer->first_name }} {{ $customer->last_name }} {{ $customer->customer_code }}
@if($customer->height)
Boy {{ $customer->height }} cm
@endif @if($customer->weight)
Kilo {{ $customer->weight }} kg
@endif @if($customer->shoe_size)
Ayakkabı {{ $customer->shoe_size }}
@endif @if($customer->gender)
Cinsiyet {{ $customer->gender == 'male' ? 'Erkek' : 'Kadın' }}
@endif
İletişim & Detaylar
@if($customer->birth_date)
Doğum Tarihi {{ $customer->birth_date->translatedFormat('d F Y') }}
@endif @if($customer->wedding_anniversary)
Evlilik Yıldönümü {{ $customer->wedding_anniversary->translatedFormat('d F Y') }}
@endif @if($customer->address)
Adres {{ $customer->address }}
@endif
Müşteri Tipi {{ $customer->type === 'corporate' ? __('customers.corporate') : __('customers.individual') }}
@if($customer->type === 'corporate') @if($customer->tax_office)
Vergi Dairesi {{ $customer->tax_office }}
@endif @if($customer->tax_number)
Vergi Numarası {{ $customer->tax_number }}
@endif @else @if($customer->tckimlik)
T.C. Kimlik No {{ $customer->tckimlik }}
@endif @endif
{{ __('messages.total_orders') }}
{{ $customer->orders->count() }} Adet
{{ __('messages.measurements') }}
{{ $customer->measurements->count() }} Kayıt
{{ __('messages.total_revenue') }}
@money($customer->orders->sum('base_total_price'))
{{ __('messages.pending_balances') }}
@money($customer->orders->sum(fn($o) => $o->balance * $o->exchange_rate))

Son Siparişler Müşterinin en son oluşturulan siparişleri

@if($recentOrders->isNotEmpty())
@foreach($recentOrders->take(5) as $order)
{{ $order->order_number }} {{ $order->order_date?->translatedFormat('d F Y') }}
@moneyWithCurrency($order->total_price, $order->currency) @if($order->balance > 0) Borç: @moneyWithCurrency($order->balance, $order->currency) @else Ödendi @endif
@endforeach
@else
{{ __('customers.no_orders') }}
@endif

Son Ölçüler Kıyafet türlerine göre en güncel ölçüler

@if($uniqueLatestMeasurements->isNotEmpty())
@foreach($uniqueLatestMeasurements->take(5) as $m)
{{ $m->clothType->title }} Kod: {{ $m->measurement_number }}
{{ $m->date?->translatedFormat('d F Y') }}
@endforeach
@else
{{ __('customers.no_measurements') }}
@endif

{{ __('customers.recent_orders') }}

@can('Create:Order') @if(app('current_company')->canCreateOrder()) {{ __('orders.create_new') }} @else @endif @endcan
@if($recentOrders->isNotEmpty())
@php $statusClasses = [ 'draft' => 'badge-light-warning', 'active' => 'badge-light-primary', 'completed' => 'badge-light-success', 'cancelled' => 'badge-light-danger', 'delivered' => 'badge-light-info', 'Draft' => 'badge-light-warning', 'In Production' => 'badge-light-info', 'Ready for Trial' => 'badge-light-primary', 'Completed' => 'badge-light-success', 'Delivered' => 'badge-light-success', ]; $statusLabels = [ 'draft' => __('orders.status_draft'), 'active' => __('orders.status_active'), 'completed' => __('orders.status_completed'), 'cancelled' => __('orders.status_cancelled'), 'delivered' => __('orders.status_delivered'), 'Draft' => __('orders.status_draft'), 'In Production' => __('orders.status_in_production'), 'Ready for Trial' => __('orders.status_ready_for_trial'), 'Completed' => __('orders.status_completed'), 'Delivered' => __('orders.status_delivered'), ]; @endphp @foreach($recentOrders as $order) @endforeach
{{ __('common.order_number') }} {{ __('common.date') }} {{ __('common.status') }} {{ __('common.total') }} {{ __('messages.balance') }} {{ __('common.actions') }}
{{ $order->order_number }} {{ $order->order_date?->translatedFormat('d F Y') }} {{ $statusLabels[$order->status] ?? $order->status }} @moneyWithCurrency($order->total_price, $order->currency) @moneyWithCurrency($order->balance, $order->currency) {{ __('common.view') }}
@else
{{ __('customers.no_orders') }}
@endif

{{ __('common.measurements') }}

@can('Create:Measurement') {{ __('customers.record_measurement') }} @endcan
@if($uniqueLatestMeasurements->isNotEmpty())
@foreach($uniqueLatestMeasurements as $m) @endforeach
{{ __('common.date') }} {{ __('common.cloth_type') }} {{ __('common.ref_no') }} {{ __('common.actions') }}
{{ $m->date?->translatedFormat('d F Y') }} {{ $m->clothType->title }} {{ $m->measurement_number }} {{ __('common.view') }}
@else
{{ __('customers.no_measurements') }}
@endif
@endsection