@extends('layouts.super_admin') @section('title', 'Pencairan Komisi') @section('content')
@php // Taruh di mana aja, misal AppServiceProvider atau Helper file function formatCurrency($number) { if ($number >= 1_000_000_000) { return 'Rp ' . number_format($number / 1_000_000_000, 1, ',', '.') . 'B'; } elseif ($number >= 1_000_000) { return 'Rp ' . number_format($number / 1_000_000, 1, ',', '.') . 'M'; } return 'Rp ' . number_format($number, 0, ',', '.'); } @endphp
{{ formatCurrency($totalWithdrawn) }}
Total Pencairan
{{ $pendingCount }}
Pending Approval
{{ formatCurrency($approvedThisMonth) }}
Disetujui Bulan Ini
{{ formatCurrency($totalAdminFee) }}
Biaya Admin
{{-- Header label --}}
Filter Pencairan
@php $statuses = ['pending' => 'Pending', 'approved' => 'Disetujui', 'rejected' => 'Ditolak']; @endphp {{-- Status --}}
{{-- Sales --}}
{{-- Tanggal --}}
{{-- Actions --}}
Daftar Pencairan @if($pendingCount > 0) {{ $pendingCount }} Pending @endif
@if($withdraws->count() > 0)
@foreach($withdraws as $withdraw) @endforeach
No Sales Tanggal Nominal Status Action
{{ ($withdraws->currentPage() - 1) * $withdraws->perPage() + $loop->iteration }}
{{ $withdraw->sales->user->name }}
{{ $withdraw->sales->user->email }}
{{ $withdraw->date ? $withdraw->date->format('d M Y') : '-' }}
Rp {{ number_format($withdraw->amount, 0, ',', '.') }}
@if($withdraw->status === 'approved') Disetujui @elseif($withdraw->status === 'pending') Pending @else Ditolak @endif
@else

Tidak ada data pencairan

@endif
@endsection