Faturalar {{-- Bu sayfanın 57 satırlık kendi CSS'i SİLİNDİ (59 !important, 5 gradyan, kendi kaydırma çubuğu, kendi sekme çubuğu, kendi tablo iskeleti). --}} @php $tip = $tip ?? 'musteri'; $durumRol = ['taslak' => 'uyari', 'onayli' => 'ok', 'iptal' => 'hata']; $statusOptions = ['taslak' => 'Taslak', 'onayli' => 'Onaylı', 'iptal' => 'İptal']; $columnFilters = [ 'fatura_no' => ['type' => 'text', 'label' => 'Fatura No', 'placeholder' => 'FTR_...'], 'resmi_fatura_no' => ['type' => 'text', 'label' => 'Resmî No', 'placeholder' => 'resmî no...'], 'keska_arsiv_no' => ['type' => 'text', 'label' => 'Arşiv No', 'placeholder' => 'arşiv no...'], 'hakedis' => ['type' => 'text', 'label' => 'Hakediş', 'placeholder' => 'HKD_...'], 'contact' => ['type' => 'text', 'label' => 'Firma', 'placeholder' => 'firma adı...'], 'project' => ['type' => 'text', 'label' => 'Proje Kodu', 'placeholder' => 'PRJ_...'], 'project_name' => ['type' => 'text', 'label' => 'Proje Adı', 'placeholder' => 'proje adı...'], 'fatura_tarihi' => ['type' => 'date', 'label' => 'Tarih'], 'total_amount_min' => ['type' => 'number', 'label' => 'En az tutar','placeholder' => 'min ₺...'], 'status' => ['type' => 'select', 'label' => 'Durum', 'options' => $statusOptions], ]; $formId = 'ftrFilterForm'; $firmaBaslik = $tip === 'tedarikci' ? 'Tedarikçi' : ($tip === 'all' ? 'Firma' : 'Müşteri'); @endphp
{{-- Sekmeler TİP eksenini, şerit DURUM eksenini gösteriyor. --}}
@foreach([ ['all', 'tumu', 'Tümü', ($tipCounts['musteri'] ?? 0) + ($tipCounts['tedarikci'] ?? 0)], ['musteri', 'musteri', 'Müşteri', $tipCounts['musteri'] ?? 0], ['tedarikci', 'tedarikci', 'Tedarikçi', $tipCounts['tedarikci'] ?? 0], ] as [$tk, $tsimge, $tad, $tsay]) {{ $tad }} @endforeach
{{-- Tedarikçi sekmesinde fatura KESİLMEZ, gelen fatura İŞLENİR (alış). --}} @if($tip === 'tedarikci') Gelen Fatura @else Yeni Fatura @endif Fatura No Resmî No Arşiv No Hakediş Proje Kodu Proje Adı {{ $firmaBaslik }} Tarih Ara Toplam KDV Toplam Durum İşlemler @foreach($faturalar as $f) {{ $f->fatura_no }} {{ $f->resmi_fatura_no ?: '—' }} {{ $f->keska_arsiv_no ?: '—' }} @if($f->hakedis) {{ $f->hakedis->hakedis_no }} @else Serbest @endif @if($f->proje) {{ $f->proje->project_number }} @else — @endif @if($f->proje?->title) {{ $f->proje->title }} @else — @endif @if($f->contact) {{ $f->contact->display_name }} @else — @endif {{ $f->fatura_tarihi?->format('d.m.Y') ?? '—' }} {{ number_format((float) $f->ara_toplam, 2, ',', '.') }} ₺ {{ number_format((float) $f->kdv_tutari, 2, ',', '.') }} ₺ {{ number_format((float) $f->toplam, 2, ',', '.') }} ₺ {{-- Durum = NOKTA (tema defteri kuralı); model'in statusBadge() satır içi stilleri artık kullanılmıyor. --}} {{ $f->statusLabel() }} {{-- "Detay" YOK: fatura no zaten detaya gidiyor. --}}
@if($f->status === 'taslak') @endif
@endforeach {{ $faturalar->withQueryString()->links() }}