{{-- Header --}}

Voucher

Kelola kode diskon untuk customer.

@can('voucher.create') @endcan
{{-- Statistik --}}

Total Voucher

{{ $stats['total'] }}

Voucher Aktif

{{ $stats['active'] }}

Voucher Kadaluarsa

{{ $stats['expired'] }}

Voucher Terpakai

{{ $stats['used'] }}

{{-- Filter Status (tab) --}}
{{-- Search & Sort --}}
{{-- Loading indicator --}}
Memuat data...
{{-- Tabel --}}
@forelse ($vouchers as $v) @php $isExpired = $v->valid_until && $v->valid_until->isPast(); $isUsedUp = $v->quota && $v->used_count >= $v->quota; @endphp @empty @endforelse
Tipe Nilai Diskon Min. Belanja Kuota Terpakai Status Aksi
{{ $v->code }} {{ $v->type === 'percent' ? 'Persentase' : 'Nominal Tetap' }} {{ $v->type === 'percent' ? $v->value . '%' : 'Rp ' . number_format($v->value, 0, ',', '.') }} @if ($v->type === 'percent' && $v->max_discount)

maks Rp {{ number_format($v->max_discount, 0, ',', '.') }}

@endif
{{ $v->min_order > 0 ? 'Rp ' . number_format($v->min_order, 0, ',', '.') : '—' }} @if ($v->valid_from || $v->valid_until)

{{ $v->valid_from?->format('d M Y') ?? '∞' }} – {{ $v->valid_until?->format('d M Y') ?? '∞' }}

@if ($isExpired) Kadaluarsa @endif @else Tidak ada batas @endif
{{ $v->quota ?? '∞' }} {{ $v->used_count }} @if ($isExpired || $isUsedUp) {{ $isExpired ? 'Kadaluarsa' : 'Habis' }} @else @endif
@can('voucher.edit') @endcan @can('voucher.delete') @endcan

Belum ada voucher.

{{ $vouchers->links() }}
{{-- ── Modal Form ──────────────────────────────────────────────────── --}}

{{ $editingId ? 'Edit Voucher' : 'Buat Voucher' }}

Hanya huruf dan angka, harus unik.

@error('code')

{{ $message }}

@enderror
{{ $type === 'percent' ? '%' : 'Rp' }}
@error('value')

{{ $message }}

@enderror
Rp
@error('min_order')

{{ $message }}

@enderror
@if ($type === 'percent')
Rp
@error('max_discount')

{{ $message }}

@enderror
@endif
@error('quota')

{{ $message }}

@enderror
@error('valid_from')

{{ $message }}

@enderror
@error('valid_until')

{{ $message }}

@enderror
{{-- ── Modal Hapus ─────────────────────────────────────────────────── --}}

Hapus Voucher?

Tindakan ini tidak dapat dibatalkan.