@php $fromLabel = $from ? \Carbon\CarbonImmutable::parse($from)->format('d M Y') : '-'; $toLabel = $to ? \Carbon\CarbonImmutable::parse($to)->format('d M Y') : '-'; $periodLabel = $fromLabel.' – '.$toLabel; $cashierName = null; foreach ($cashiers as $u) { if ((int) $u->id === (int) ($cashierId ?? 0)) { $cashierName = (string) $u->name; break; } } $cashierLabel = $cashierName ?: 'Semua kasir'; $txTotal = method_exists($rows, 'total') ? (int) $rows->total() : 0; $avgDiscount = $txTotal > 0 ? ((float) $totalDiscount / $txTotal) : 0.0; $fmtCurrency = fn ($value) => 'Rp'.number_format((float) $value, 0, ',', '.'); @endphp

Laporan Diskon Manual

Periode: {{ $periodLabel }} · Kasir: {{ $cashierLabel }}

Export Excel

Total Diskon

{{ $fmtCurrency((float) $totalDiscount) }}

Jumlah Transaksi

{{ number_format($txTotal, 0, ',', '.') }}

Rata-rata Diskon/Transaksi

{{ $fmtCurrency($avgDiscount) }}

@forelse ($rows as $t) @empty @endforelse
Waktu Transaksi Diskon Kasir

{{ $t->created_at?->format('d/m/Y H:i') }}

{{ \App\Helpers\DataLabelHelper::enum($t->channel ?? null, 'channel') }}

{{ $t->code }}

Total: Rp{{ number_format((int) $t->total, 0, ',', '.') }}

Rp{{ number_format((int) $t->manual_discount_amount, 0, ',', '.') }}

{{ $t->manualDiscountByUser?->name ?? '-' }}

{{ $rows->links('livewire.pagination.admin') }}