{{-- Gömülü ödeme listesi — satış, müşteri, tedarikçi ve fatura kartlarında aynı bileşen kullanılır. Klasik tablo düzeni; satır tıklanınca ödemenin quick-view kartı açılır, böylece kartlar arasında ileri-geri gezilebilir. Beklenen: $payments : Payment koleksiyonu $createUrl : "Ödeme Ekle" bağlantısı (null ise buton çıkmaz) $summary : ['label' => ..., 'value' => ..., 'tone' => 'ok|warn|neutral'] listesi (opsiyonel) $emptyText : boş durum metni (opsiyonel) --}} @include('agency.partials.qv-table') @php $summary = $summary ?? []; $emptyText = $emptyText ?? 'Bu kayda ait ödeme hareketi yok.'; $createUrl = $createUrl ?? null; @endphp
@if(count($summary))
@foreach($summary as $s)
{{ $s['label'] }} {{ $s['value'] }}
@endforeach
@endif
{{ $payments->count() }} hareket @if($createUrl) @endif
@forelse($payments as $p) @php $docCount = $p->documents_count ?? $p->documents()->count(); $copyAll = implode("\n", array_filter([ 'Tarih: ' . $p->paid_at?->format('d.m.Y H:i'), 'Yöntem: ' . $p->method_label, 'Muhatap: ' . $p->counterparty_label, $p->reference_no ? 'Referans: ' . $p->reference_no : null, 'Tutar: ' . ($p->direction === 'in' ? '+' : '−') . number_format((float) $p->amount, 2, ',', '.') . ' ' . $p->currency, $p->invoice ? 'Fatura: ' . $p->invoice->invoice_number : null, $p->description ? 'Açıklama: ' . $p->description : null, ])); @endphp @empty @endforelse
Tarih Yöntem Muhatap Referans Açıklama Fatura Durum Tutar
{{ $p->paid_at?->format('d.m.Y H:i') ?: '—' }} {{ $p->method_label }} @if($docCount) {{ $docCount }} @endif @if($p->counterparty_quick_view_url) {{ $p->counterparty_label }} @else {{ $p->counterparty_label ?: '—' }} @endif @if($p->reference_no) {{ $p->reference_no }} @else — @endif {{ $p->description ?: '—' }} @if($p->invoice) {{ $p->invoice->invoice_number }} @elseif($p->sale_id && $p->direction === 'in') faturasız @else — @endif @if($p->status !== 'completed') {{ $p->status_label }} @else — @endif {{ $p->direction === 'in' ? '+' : '−' }}{{ number_format((float) $p->amount, 2, ',', '.') }} {{ $p->currency }}
Ödeme kaydı yok {{ $emptyText }}
@if($createUrl && $payments->isEmpty())
@endif
{{-- Quick-view parçaları layout'suz döndüğü için stil satır içi verilir --}} @once @endonce