@extends('shared.vertical', ['title' => 'Müşteri Detayı']) @section('styles') @include('nfc.admin.customers.partials.material3-styles') @endsection @section('content') @php $packageIsActive = $activeSubscription && $activeSubscription->status === 'active' && ($activeSubscription->is_lifetime || !$activeSubscription->expires_at || !$activeSubscription->expires_at->isPast()); $subscriptionStatus = !$activeSubscription ? 'Paket Yok' : match($activeSubscription->status){'active'=>'Aktif','expired'=>'Süresi Doldu','suspended'=>'Pasif','pending'=>'Bekliyor',default=>ucfirst($activeSubscription->status)}; @endphp
MÜŞTERİ DETAYI

{{ $customer->name }}

{{ $customer->type==='company'?'Bayi':'Bireysel' }}{{ $customer->dealer_enabled ? ' · Bayi Yetkili' : '' }} · #{{ $customer->id }}

Müşterileri Aç Aboneliği Yönet Düzenle
@csrf @method('DELETE')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
NFC Kart{{ $customer->cards_count }}
Ayrılmış Stok{{ $customer->stock_cards_count }}
QR{{ $customer->linked_qrs_count }}
Yetkili Kullanıcı{{ $customer->business_users_count }}
Alt Müşteri{{ $customer->child_customers_count }}
Müşteri Durumu{{ $customer->status==='active'?'Aktif':'Pasif' }}
Abonelik Özeti {{ $activeSubscription?->snapshotPackageName() ?: 'Paket Yok' }} {{ $subscriptionStatus }}@if($activeSubscription) · {{ $activeSubscription->is_lifetime ? 'Sınırsız / Ömür Boyu' : (($activeSubscription->starts_at?->format('d.m.Y') ?: '-').' → '.($activeSubscription->expires_at?->format('d.m.Y') ?: '-')) }}@endif @if($activeSubscription && !$activeSubscription->is_lifetime && $activeSubscription->extensions->isNotEmpty())
@foreach($activeSubscription->extensions as $extension) {{ ($extension->extension_type ?? 'package')==='free_days' ? '+'.((int)$extension->days).' gün' : '+'.((int)$extension->months).' ay' }} · {{ $extension->is_paid ? 'Ücretli' : 'Ücretsiz' }} @endforeach
@endif
Müşteri Bilgileri
Kimlik, iletişim ve adres bilgileri. Abonelik işlemleri bu sayfadan yapılmaz.
{{ $customer->identity_type==='tc'?'T.C. Kimlik Numarası':($customer->identity_type==='vkn'?'Vergi Kimlik Numarası':'Kimlik / Vergi Numarası') }} : {{ $customer->tax_identity_number ?: '-' }}
Yetkili : {{ $customer->contact_name ?: '-' }}
Telefon : {{ $customer->phone ?: '-' }}
E-posta : @if($customer->email){{ $customer->email }}@else-@endif
Hesap Tipi : {{ $customer->type==='person'?'Bireysel':'Bayi' }}
Bayi Yetkisi : {{ $customer->dealer_enabled ? 'Açık' : 'Kapalı' }}
@if($customer->parent_customer_id)
Üst Müşteri / Stok Sahibi : {{ $customer->parentCustomer?->name ?: '#'.$customer->parent_customer_id }}
@endif @if($customer->created_via==='nfc_stock_first_scan')
Kayıt Kaynağı : NFC İlk Okutma / Stok Kart Kurulumu
@endif @if($customer->created_via==='corporate_panel')
Kayıt Kaynağı : Bayi Panel
Yöneten Bayi : {{ $customer->managedByCustomer?->name ?: '-' }}
Oluşturan Kullanıcı : {{ $customer->createdByBusinessUser?->name ?: '-' }}
@endif
İl : {{ $customer->city ?: '-' }}
İlçe : {{ $customer->district ?: '-' }}
Adres : {{ $customer->address ?: '-' }}
Not : {{ $customer->notes ?: '-' }}
@if($childCustomers->isNotEmpty())
Alt Müşteriler
Bu müşterinin stok kartlarından ilk okutma kurulumu ile veya üst müşteri ilişkisiyle bağlanan alt müşteriler.
@foreach($childCustomers as $childCustomer) @endforeach
MüşteriTipİlNFC KartYetkili KullanıcıDurum
{{ $childCustomer->name }}
{{ $childCustomer->email ?: '-' }}
{{ $childCustomer->typeLabel() }} {{ $childCustomer->city ?: '-' }} {{ $childCustomer->cards_count }} {{ $childCustomer->business_users_count }} {{ $childCustomer->status==='active'?'Aktif':'Pasif' }} Detay
@endif
Stok Geçmişi / Atanan Stoklar
Bu müşteriye ayrılmış stok kartlarını, mevcut durumlarını ve son değişikliklerini gösterir. Kurulmuş/aktif kartlar geçmişte kalmaya devam eder; güvenlik nedeniyle yalnız STOK durumundaki kurulmamış kartlar silinebilir veya başka müşteriye atanabilir.
Tüm Stok Listesinde Aç
@if($stockCards->isNotEmpty())
@csrf @method('DELETE')
@endif
@forelse($stockCards as $stockCard) @php $canManageAllocation = !$stockCard->customer_id && $stockCard->status === 'stock' && in_array($stockCard->setup_state,[null,'stock'],true) && !$stockCard->claimed_by_business_user_id && !$stockCard->claimed_at; $canDeleteStock = $canManageAllocation; $statusLabel = match($stockCard->status){'stock'=>'STOK','active'=>'AKTİF','suspended'=>'ASKIDA',default=>mb_strtoupper((string)$stockCard->status,'UTF-8')}; @endphp @empty @endforelse
SeçKart / QRKategoriDurumAtama / Güncellemeİşlem
@if($canDeleteStock)@else—@endif
{{ $stockCard->card_code }}{{ $stockCard->linkedQr?->qr_code ?: 'QR yok' }} · {{ $stockCard->stock_batch ?: 'Parti yok' }}@if($stockCard->label){{ $stockCard->label }}@endif
{{ $stockCard->stockCategory?->name ?: '-' }}{{ $stockCard->stockCategory?->nfcCategory?->name ?: 'Genel / esnek kategori' }}
{{ $statusLabel }}{{ $stockCard->customer?->name ? 'Kurulum: '.$stockCard->customer->name : 'Müşteri atanmadı' }}@if($stockCard->claimedBy)Bağlayan: {{ $stockCard->claimedBy->name }}@endif
{{ $stockCard->created_at?->format('d.m.Y H:i') ?: '-' }}Son değişiklik: {{ $stockCard->updated_at?->format('d.m.Y H:i') ?: '-' }}
Detay @if($canDeleteStock)
@csrf @method('DELETE')
@endif
@csrf @method('PUT')
@unless($canManageAllocation)@endunless
@unless($canManageAllocation)@endunless
@if($canManageAllocation)Kart henüz kurulmadığı için kategori ve stok sahibi değiştirilebilir. Stok sahibini değiştirirsen kart yeni müşterinin stok geçmişine taşınır.@else Kart kurulmuş/bağlanmış durumda. Geçmiş bütünlüğü için kategori ve stok sahibi kilitlidir; yalnız etiket ve stok partisi düzenlenebilir.@endif
Bu müşteriye henüz stok kartı ayrılmamış.
@include('nfc.admin.partials.entity-assets',['cards'=>$cards,'showBusinessColumn'=>false])
@endsection