@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
{{-- Header Buttons --}}
Kembali ke Riwayat
Cetak Ulang Struk Cetak Invoice (A4) @if(auth()->user()->role === 'admin' && $transaction->status !== 'cancelled') @else Transaksi Dibatalkan @endif
{{-- Main Card --}}
{{-- Card Header --}}

Nota #{{ $transaction->transaction_code }}

{{ $transaction->created_at->isoFormat('dddd, D MMMM YYYY') }} • Jam {{ $transaction->created_at->format('H:i') }}

Kasir {{ $transaction->user->name ?? 'Unknown' }}
{{-- items list --}}
@if($showOrderNumber) @endif @if($showItemAdjustments) @endif @foreach($transaction->items as $item) @if($showOrderNumber) @endif @if($showItemAdjustments) @endif @endforeach
ProdukNo. PesananQty HargaPromo / MarketplaceSubtotal
{{ $item->product->name ?? 'Produk Dihapus' }}
{{ $item->product->barcode ?? '-' }}
{{ $item->order_number ?? '-' }}{{ $item->quantity }} Rp {{ number_format($item->price, 0, ',', '.') }} @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
Rp {{ number_format($item->subtotal, 0, ',', '.') }}
{{-- Summary --}}
Jumlah Item {{ $transaction->items->sum('quantity') }}
Subtotal Rp {{ number_format($transaction->subtotal, 0, ',', '.') }}
@if($showMarketplace)
Pajak Marketplace @if(($transaction->marketplace_tax_mode ?? 'global') === 'global') ({{ rtrim(rtrim(number_format((float) ($transaction->marketplace_tax_rate ?? 0), 2, ',', '.'), '0'), ',') }}%) @else (Per Item) @endif {{ $transaction->marketplace_tax_burden === 'customer' ? '+' : '-' }} Rp {{ number_format($transaction->marketplace_tax_amount ?? 0, 0, ',', '.') }}
@endif @if($showDiscounts)
{{ $discountLabel }} - Rp {{ number_format($transaction->discount ?? 0, 0, ',', '.') }}
@endif @if($showPpn)
PPN ({{ rtrim(rtrim(number_format((float) ($transaction->ppn_tax_rate ?? 0), 2, ',', '.'), '0'), ',') }}%) {{ $transaction->ppn_tax_burden === 'customer' ? '+' : '-' }} Rp {{ number_format($transaction->ppn_tax_amount ?? 0, 0, ',', '.') }}
@endif
Total Rp {{ number_format($transaction->total_amount, 0, ',', '.') }}
Metode Pembayaran {{ $transaction->payment_method }}
Bayar / Kembali Rp {{ number_format($transaction->amount_paid, 0, ',', '.') }} / Rp {{ number_format($transaction->change_amount, 0, ',', '.') }}
@if($transaction->order_type === 'booking')
Info Booking {{ $transaction->booking_code ?? '-' }} • {{ $transaction->booker_name ?? $transaction->customer_name }} @if($transaction->booker_phone) {{ $transaction->booker_phone }} @endif
Status Booking / Pembayaran {{ strtoupper($transaction->booking_status ?? 'draft') }} • {{ $transaction->payment_status_label }} Sisa: Rp {{ number_format($transaction->remaining_amount ?? 0, 0, ',', '.') }}
@endif @if($transaction->note)
Catatan Transaksi

"{{ $transaction->note }}"

@endif
@if($transaction->status === 'cancelled')

🚫 Transaksi ini telah dibatalkan. Stok produk telah dikembalikan.

@endif
@push('scripts') @endpush @endsection