@section('page-title', 'Riwayat Belanja') {{-- Stats Cards --}}

Total Transaksi

{{ $stats['totalTransactions'] }}

Total Belanja

Rp {{ number_format($stats['totalSpent'], 0, ',', '.') }}

Poin Terkumpul

{{ number_format($member->points ?? 0) }} Pts

{{-- Filter --}}
@if($filterMonth) @endif
{{-- Transactions List --}}
@if($transactions->count() > 0)
@foreach($transactions as $trx)

Belanja #{{ $trx->id }}

{{ $trx->created_at->format('d M Y • H:i') }}

Rp {{ number_format($trx->totalAmount, 0, ',', '.') }}

{{ $trx->status }}
{{-- Expanded Details --}}

Total Belanja

Rp {{ number_format($trx->totalAmount, 0, ',', '.') }}

Metode Bayar

{{ $trx->paymentMethod ?? 'CASH' }}

Poin Didapat

+{{ floor($trx->totalAmount / 1000) }} Pts

@if($trx->items && $trx->items->count() > 0)

Item Pembelian

@foreach($trx->items->take(5) as $item)
{{ $item->product->name ?? 'Produk' }} x{{ $item->quantity }} Rp {{ number_format($item->totalPrice ?? 0, 0, ',', '.') }}
@endforeach @if($trx->items->count() > 5)

+{{ $trx->items->count() - 5 }} item lainnya

@endif
@endif
@endforeach
{{ $transactions->links() }}
@else

Belum Ada Transaksi

Riwayat belanja Anda akan muncul di sini

@endif