{{-- Müşteri künyesi — Özet sekmesinin sağ sütunu. Amaç: telefon, e-posta, kimlik ve fatura bilgileri gibi gün içinde en çok kopyalanan veriler tek yerde ve tek tıkla panoya alınabilir olsun. Kopyalama drawer'daki genel [data-copy] mekanizmasıyla çalışır. Beklenen: $customer --}} @php // Fatura muhatabı seçenekleri: kurumsal profiller (kendi şirket kartı ya da // bağlı şirketler) + şahıs profili. Kurumsal varsa önce o gösterilir. $billingProfiles = app(\App\Services\Customer\CustomerBillingService::class)->profiles($customer); $isCorporate = app(\App\Services\Customer\CustomerBillingService::class)->isCorporate($customer); $addressLine = trim(implode(' ', array_filter([ $customer->address, $customer->district, $customer->city, $customer->postal_code, ]))); $billingAddress = $customer->billing_address ?: $addressLine; $billingTaxNo = $customer->billing_tax_number ?: ($isCorporate ? $customer->company_tax_number : $customer->national_id); $billingTaxOffice = $customer->billing_tax_office ?: $customer->company_tax_office; $billingTitle = $isCorporate ? ($customer->company_name ?: $customer->full_name) : $customer->full_name; // Fatura bilgisini tek blokta kopyalayabilmek için hazır metin $billingBlock = trim(implode("\n", array_filter([ $billingTitle, $billingTaxOffice ? 'Vergi Dairesi: ' . $billingTaxOffice : null, $billingTaxNo ? ($isCorporate ? 'Vergi No: ' : 'T.C. Kimlik No: ') . $billingTaxNo : null, $billingAddress ?: null, $customer->billing_email ? 'E-posta: ' . $customer->billing_email : null, ]))); // [etiket, değer, ikon] üçlüleri — değeri boş olanlar basılmaz $contactRows = array_filter([ ['Telefon', $customer->phone, 'fa-phone'], ['İkinci Telefon', $customer->phone_alt, 'fa-mobile-screen'], ['E-posta', $customer->email, 'fa-envelope'], ['Adres', $addressLine, 'fa-location-dot'], ], fn ($r) => filled($r[1])); // Ad ve soyad tek tek de kopyalanabilsin (form doldururken parça parça lazım olur) $nameRows = array_filter([ ['Ad', $customer->first_name, 'fa-user'], ['Soyad', $customer->last_name, 'fa-user'], ['Ad Soyad', $customer->full_name, 'fa-signature'], [$isCorporate ? 'Şirket Unvanı' : null, $isCorporate ? $customer->company_name : null, 'fa-building'], ], fn ($r) => filled($r[0]) && filled($r[1])); $identityRows = array_filter([ [$isCorporate ? 'Vergi No' : 'T.C. Kimlik No', $isCorporate ? $customer->company_tax_number : $customer->national_id, 'fa-id-card'], ['Vergi Dairesi', $customer->company_tax_office, 'fa-building-columns'], ['Pasaport No', $customer->passport_number, 'fa-passport'], ], fn ($r) => filled($r[1])); $billingRows = array_filter([ ['Fatura Unvanı', $billingTitle, 'fa-file-signature'], ['Vergi Dairesi', $billingTaxOffice, 'fa-building-columns'], [$isCorporate ? 'Vergi No' : 'T.C. Kimlik No', $billingTaxNo, 'fa-hashtag'], ['Fatura E-posta', $customer->billing_email, 'fa-envelope-open-text'], ['Fatura Adresi', $billingAddress, 'fa-location-dot'], ], fn ($r) => filled($r[1])); @endphp @once @endonce