@extends('admin.layout') @section('title', 'Detail Voucher') @section('content')

Detail Voucher

{{ $voucher->code }}

Total Penggunaan

{{ $voucher->used_count }}

@if($voucher->max_uses)

dari {{ $voucher->max_uses }} maks.

@endif

Nilai Diskon

@if($voucher->type === 'percentage'){{ $voucher->discount_value }}% @else Rp {{ number_format($voucher->discount_value, 0, ',', '.') }} @endif

{{ $voucher->type === 'percentage' ? 'Persentase' : 'Nominal Tetap' }}

Status

{{ $voucher->status_label }}

Informasi Voucher

Nama
{{ $voucher->name }}
@if($voucher->description)
Deskripsi
{{ $voucher->description }}
@endif
Min. Pembelian
{{ $voucher->min_purchase > 0 ? 'Rp ' . number_format($voucher->min_purchase, 0, ',', '.') : 'Tidak ada' }}
@if($voucher->max_discount)
Maks. Diskon
Rp {{ number_format($voucher->max_discount, 0, ',', '.') }}
@endif
Berlaku Mulai
{{ $voucher->valid_from?->format('d M Y H:i') ?? 'Tidak terbatas' }}
Berlaku Sampai
{{ $voucher->valid_until?->format('d M Y H:i') ?? 'Tidak terbatas' }}
Dibuat
{{ $voucher->created_at->format('d M Y H:i') }}

Statistik Penggunaan

@if($voucher->max_uses) @php $pct = $voucher->max_uses > 0 ? ($voucher->used_count / $voucher->max_uses * 100) : 0; @endphp
Dipakai: {{ $voucher->used_count }} Maks: {{ $voucher->max_uses }}

{{ number_format($pct, 1) }}% terpakai

@else

Penggunaan tidak dibatasi

@endif
{{-- Riwayat Penggunaan --}}

Riwayat Penggunaan

{{ $usages->total() }} total
@if($usages->isEmpty())
Belum ada riwayat penggunaan
@else
@foreach($usages as $usage) @endforeach
Waktu Identitas Order ID Diskon Diterapkan
{{ $usage->created_at->format('d M Y H:i') }} {{ $usage->user_identifier ?? '-' }} {{ $usage->order_id ?? '-' }} Rp {{ number_format($usage->discount_applied, 0, ',', '.') }}
@if($usages->hasPages())
{{ $usages->links() }}
@endif @endif
@endsection