@php $customerName = (string) ($transaction->member?->name ?? $transaction->name ?? '-'); $orderType = (string) ($transaction->order_type ?? ''); $paymentMethodKey = (string) ($transaction->payment_method ?? ''); $paymentMethodLabel = \App\Helpers\DataLabelHelper::enum($paymentMethodKey !== '' ? $paymentMethodKey : null, 'payment_method'); $paymentStatusKey = (string) ($transaction->payment_status ?? ''); $paymentStatusLabel = \App\Helpers\DataLabelHelper::enum($paymentStatusKey !== '' ? $paymentStatusKey : null, 'payment_status'); $inventoryApplied = $transaction->inventory_applied_at !== null; $user = auth()->user(); $voidQuickMaxCount = (int) ($correctionRules['void_quick_max_count_per_day'] ?? 0); $voidWindowMinutes = (int) ($correctionRules['void_quick_window_minutes'] ?? 0); $voidQuickUsedToday = (int) ($voidQuickUsedToday ?? 0); $refundQuickMaxAmount = (int) ($correctionRules['refund_quick_max_amount'] ?? 0); $refundQuickMaxCount = (int) ($correctionRules['refund_quick_max_count_per_day'] ?? 0); $refundQuickUsedToday = (int) ($refundQuickUsedToday ?? 0); $voidNeedsApproval = (bool) ($voidNeedsApproval ?? false); $refundNeedsApproval = (bool) ($refundNeedsApproval ?? false); $fmtCurrency = fn ($value) => 'Rp'.number_format((float) $value, 0, ',', '.'); $voucherDiscount = (int) ($transaction->voucher_discount_amount ?? 0); $manualDiscount = (int) ($transaction->manual_discount_amount ?? 0); $pointDiscount = (int) ($transaction->point_discount_amount ?? 0); $discountTotal = (int) ($transaction->discount_total_amount ?? ($voucherDiscount + $manualDiscount + $pointDiscount)); $netSubtotal = max(0, (int) ($transaction->subtotal ?? 0) - $discountTotal); $displayItems = $transaction->transactionItems->whereNull('parent_transaction_item_id')->values(); @endphp
{{ optional($transaction->created_at)->format('d M Y, H:i') }} · {{ $paymentMethodLabel }} · {{ $paymentStatusLabel }}
Subtotal
Total Diskon
Pajak PB1
Total
{{ $event->actor?->name ?? 'System' }}
{{ optional($event->created_at)->format('d M Y, H:i') }}
Alasan: {{ $meta['reason'] }}
@endif @if (! empty($meta['amount']))Nominal: {{ $fmtCurrency((int) $meta['amount']) }}
@endif @if ($event->action === 'voucher_redeem') @if (! empty($meta['voucher_code']))Voucher: {{ (string) $meta['voucher_code'] }}
@endif @if (! empty($meta['discount_amount']))Diskon: {{ $fmtCurrency((int) $meta['discount_amount']) }}
@endif @endif @if ($event->action === 'manual_discount') @if (! empty($meta['amount']))Diskon: {{ $fmtCurrency((int) $meta['amount']) }}
@endif @if (! empty($meta['type']) && ! empty($meta['value']))Aturan: {{ $meta['type'] === 'percent' ? ((int) $meta['value']).'%' : $fmtCurrency((int) $meta['value']) }}
@endif @endif @if ($event->action === 'point_redeem') @if (! empty($meta['points_redeemed']))Poin dipakai: {{ number_format((int) $meta['points_redeemed'], 0, ',', '.') }}
@endif @if (! empty($meta['point_discount_amount']))Diskon poin: {{ $fmtCurrency((int) $meta['point_discount_amount']) }}
@endif @endif @if (! empty($meta['approval_required'])) @php($approvedName = ! empty($meta['approved_by_user_id']) ? ($approvedBy[(int) $meta['approved_by_user_id']] ?? null) : null)Approval: {{ $approvedName ? 'Disetujui oleh '.$approvedName : 'Dibutuhkan' }}
@endif @if (! empty($meta['previous_payment_status']) || ! empty($meta['new_payment_status']))Status: {{ \App\Helpers\DataLabelHelper::enum($meta['previous_payment_status'] ?? null, 'payment_status') }} → {{ \App\Helpers\DataLabelHelper::enum($meta['new_payment_status'] ?? null, 'payment_status') }}
@endif @if (array_key_exists('revert_inventory', $meta))Revert stok: {{ (bool) $meta['revert_inventory'] ? 'Ya' : 'Tidak' }}
@endifBelum ada koreksi.
Void hanya untuk transaksi pending.
Refund dicatat untuk kebutuhan audit dan laporan.