@extends('agency.layouts.app') @section('title', 'Ödemeler') @section('content') @php use App\Models\Payment\Payment; $dtColumns = [ ['key' => 'code', 'label' => 'Kayıt No', 'sortable' => true, 'sort' => 'code', 'width' => '96px'], ['key' => 'paid_at', 'label' => 'Tarih', 'sortable' => true, 'sort' => 'paid_at', 'width' => '116px'], ['key' => 'counterparty', 'label' => 'Taraf'], ['key' => 'method', 'label' => 'Yöntem', 'sortable' => true, 'sort' => 'method', 'width' => '150px'], ['key' => 'link', 'label' => 'İlişki', 'width' => '150px'], ['key' => 'description', 'label' => 'Açıklama', 'visible' => false], ['key' => 'amount', 'label' => 'Tutar', 'sortable' => true, 'sort' => 'amount', 'align' => 'end', 'width' => '150px'], ['key' => 'status', 'label' => 'Durum', 'sortable' => true, 'sort' => 'status', 'align' => 'center', 'width' => '110px'], ['key' => '_actions', 'label' => '', 'fixed' => true, 'align' => 'end', 'width' => '96px'], ]; $dtFilters = [ ['key' => 'direction', 'label' => 'Yön', 'value' => request('direction'), 'options' => Payment::DIRECTIONS], ['key' => 'status', 'label' => 'Durum', 'value' => request('status'), 'options' => Payment::STATUSES], ['key' => 'method', 'label' => 'Yöntem', 'value' => request('method'), 'options' => Payment::selectableMethods()], ['key' => 'category', 'label' => 'Sınıf', 'value' => request('category'), 'options' => Payment::CATEGORIES], ['key' => 'currency', 'label' => 'Para Birimi', 'value' => request('currency'), 'options' => $currencies->mapWithKeys(fn ($c) => [$c => $c])->all()], ['key' => 'date_from', 'label' => 'Başlangıç', 'type' => 'date', 'value' => request('date_from')], ['key' => 'date_to', 'label' => 'Bitiş', 'type' => 'date', 'value' => request('date_to')], ]; $dtStats = [ ['label' => 'Bu Ay Tahsilat', 'value' => number_format($stats['in_month'], 0, ',', '.') . '₺', 'icon' => 'fa-arrow-down-long', 'color' => '#059669'], ['label' => 'Bu Ay Ödeme', 'value' => number_format($stats['out_month'], 0, ',', '.') . '₺', 'icon' => 'fa-arrow-up-long', 'color' => '#e11d48'], ['label' => 'Bekleyen Hareket', 'value' => number_format($stats['pending'], 0, ',', '.') . '₺', 'icon' => 'fa-hourglass-half', 'color' => '#d97706'], ['label' => 'Tahsil Edilecek Bakiye', 'value' => number_format($stats['receivable'], 0, ',', '.') . '₺', 'icon' => 'fa-hand-holding-dollar', 'color' => '#4f46e5'], ]; @endphp