@extends('layouts.app') @section('content') @php $featureSettings = \App\Models\Setting::getStoreSettings(); $discountsEnabled = (bool) ($featureSettings->enable_discounts ?? true); $vouchersEnabled = (bool) ($featureSettings->enable_vouchers ?? true); $marketplaceEnabled = (bool) ($featureSettings->enable_marketplace ?? true); $promosEnabled = $discountsEnabled || $vouchersEnabled; $showDiscounts = $promosEnabled && (float) ($transaction->discount ?? 0) > 0; $showMarketplace = $marketplaceEnabled && ($transaction->store_type === 'marketplace' || (float) ($transaction->marketplace_tax_amount ?? 0) > 0); $showOrderNumber = $marketplaceEnabled && $transaction->items->contains(fn ($item) => filled($item->order_number)); $showItemAdjustments = $showDiscounts || $showMarketplace; $showPpn = (float) ($transaction->ppn_tax_amount ?? 0) > 0; $discountLabel = $vouchersEnabled && $transaction->voucher_code ? 'Voucher ' . $transaction->voucher_code : 'Diskon'; @endphp
{{ $transaction->created_at->isoFormat('dddd, D MMMM YYYY') }} • Jam {{ $transaction->created_at->format('H:i') }}
| Produk | @if($showOrderNumber)No. Pesanan | @endifQty | Harga | @if($showItemAdjustments)Promo / Marketplace | @endifSubtotal |
|---|---|---|---|---|---|
|
{{ $item->product->name ?? 'Produk Dihapus' }}
{{ $item->product->barcode ?? '-' }}
|
@if($showOrderNumber)
{{ $item->order_number ?? '-' }} | @endif{{ $item->quantity }} | Rp {{ number_format($item->price, 0, ',', '.') }} | @if($showItemAdjustments)
@if($showDiscounts && (float) $item->discount_amount > 0)
- Rp {{ number_format($item->discount_amount, 0, ',', '.') }}
{{ rtrim(rtrim(number_format($item->discount_percent, 2, ',', '.'), '0'), ',') }}%
@endif
@if($showMarketplace && (float) $item->shopee_admin_fee_percent > 0)
{{ rtrim(rtrim(number_format($item->shopee_admin_fee_percent, 2, ',', '.'), '0'), ',') }}%
Rp {{ number_format($item->shopee_admin_fee_amount, 0, ',', '.') }}
@elseif(!$showDiscounts || (float) $item->discount_amount <= 0)
-
@endif
|
@endif
Rp {{ number_format($item->subtotal, 0, ',', '.') }} |
"{{ $transaction->note }}"
🚫 Transaksi ini telah dibatalkan. Stok produk telah dikembalikan.