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

Total Frekuensi

{{ $stats['totalTransactions'] }} Transaksi

Akumulasi Belanja

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

Poin Loyalty

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

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

Struk Transaksi #{{ $trx->id }}

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

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

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

Total Pembayaran

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

Metode Bayar

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

Bonus Poin

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

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

Item Pembelian POS

@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 Belanja

Riwayat transaksi belanja Anda di toko POS akan tercatat di sini.

@endif