@extends('layouts.user') @section('styles') @endsection @section('content') @php $slot = $pemesanan->slotParkir; $lokasi = $slot?->lokasiParkir; $kend = $pemesanan->kendaraan; $statusBadgeClass = match($pembayaran->status) { 'sukses' => 'sbadge-sukses', 'gagal' => 'sbadge-gagal', default => 'sbadge-menunggu', }; $statusLabel = match($pembayaran->status) { 'sukses' => '✓ Lunas', 'gagal' => '✕ Gagal', default => '◷ Menunggu Pembayaran', }; $mulai = Carbon\Carbon::parse($pemesanan->waktu_mulai); $selesai = $pemesanan->waktu_selesai ? Carbon\Carbon::parse($pemesanan->waktu_selesai) : null; $metodeLabel = [ 'transfer' => 'Transfer Bank', 'qris' => 'QRIS', 'e-wallet' => 'E-Wallet', 'bca' => 'BCA Virtual Account', ]; $paymentIndex = \App\Models\Pembayaran::where('pemesanan_id', $pemesanan->id) ->where('id', '<=', $pembayaran->id) ->count(); $isOvertime = $paymentIndex > 1; @endphp
Detail Pembayaran {{ $statusLabel }}
{{-- ── Amount ── --}}
Total Pembayaran
Rp {{ number_format($pembayaran->jumlah, 0, ',', '.') }}
{{-- ── Booking Info ── --}}
Booking Parkir
{{ $lokasi?->nama ?? '-' }}
{{ $slot?->kode_slot ?? '-' }}
{{ $kend?->plat_nomor ?? '-' }} {{ $kend ? trim(($kend->merek ?? '') . ' ' . ($kend->model ?? '')) : '-' }}
{{-- ── Time ── --}}
Waktu
Mulai {{ $mulai->format('H:i, d/m/Y') }}
@if ($selesai)
Selesai {{ $selesai->format('H:i, d/m/Y') }}
@endif
Durasi {{ $pemesanan->durasi_parkir ?? '-' }} jam
Harga per Jam Rp {{ number_format($lokasi?->harga_per_jam ?? 0, 0, ',', '.') }}
{{-- ── Payment Info ── --}}
Informasi Pembayaran
Kode Booking {{ $pemesanan->kode_pemesanan }}
Metode {{ $metodeLabel[$pembayaran->metode] ?? $pembayaran->metode ?? '-' }}
@if ($pembayaran->referensi_pembayaran)
Referensi {{ $pembayaran->referensi_pembayaran }}
@endif
Status {{ $statusLabel }}
{{-- ── Catatan ── --}} @if ($pemesanan->catatan)
Catatan
{{ $pemesanan->catatan }}
@endif
{{-- ── CTA ── --}} @if ($pembayaran->status === 'menunggu')
@else
@endif
@endsection @section('scripts') @endsection