@php $themeColor = $storeSettings['theme_color'] ?? '#4f46e5'; $normalizeHex = function (string $hex): string { $hex = ltrim(trim($hex), '#'); if (strlen($hex) === 3) { $hex = $hex[0].$hex[0].$hex[1].$hex[1].$hex[2].$hex[2]; } return strlen($hex) === 6 ? '#'.$hex : '#4f46e5'; }; $mixHex = function (string $hex, string $targetHex, float $percent) use ($normalizeHex): string { $hex = $normalizeHex($hex); $targetHex = $normalizeHex($targetHex); $percent = max(0, min(100, $percent)) / 100; [$r1, $g1, $b1] = [hexdec(substr($hex, 1, 2)), hexdec(substr($hex, 3, 2)), hexdec(substr($hex, 5, 2))]; [$r2, $g2, $b2] = [hexdec(substr($targetHex, 1, 2)), hexdec(substr($targetHex, 3, 2)), hexdec(substr($targetHex, 5, 2))]; $r = (int) round($r1 + (($r2 - $r1) * $percent)); $g = (int) round($g1 + (($g2 - $g1) * $percent)); $b = (int) round($b1 + (($b2 - $b1) * $percent)); return sprintf('#%02x%02x%02x', $r, $g, $b); }; $themeColor = $normalizeHex($themeColor); $themeDark = $mixHex($themeColor, '#000000', 22); $themeSoftBorder = $mixHex($themeColor, '#ffffff', 72); $themeSofterBorder = $mixHex($themeColor, '#ffffff', 82); $themeSoftBg = $mixHex($themeColor, '#ffffff', 92); $themeGrandBg = $mixHex($themeColor, '#ffffff', 86); $discountsEnabled = (bool) ($storeSettings['enable_discounts'] ?? true); $vouchersEnabled = (bool) ($storeSettings['enable_vouchers'] ?? true); $marketplaceEnabled = (bool) ($storeSettings['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)); $showPpn = (float) ($transaction->ppn_tax_amount ?? 0) > 0; $discountLabel = $vouchersEnabled && $transaction->voucher_code ? 'Voucher ' . $transaction->voucher_code : 'Diskon'; @endphp
@php $isOnline = $transaction->store_type === 'online'; $isBooking = $transaction->order_type === 'booking'; $paymentBadgeClass = $transaction->payment_status === 'paid' ? 'badge-paid' : ($transaction->payment_status === 'partial' ? 'badge-partial' : 'badge-unpaid'); $paymentLabel = $transaction->payment_status === 'paid' ? 'LUNAS' : ($transaction->payment_status === 'partial' ? 'SEBAGIAN' : 'BELUM BAYAR'); @endphp|
@if(!empty($storeSettings['store_logo']))
{{ $storeSettings['store_name'] ?? 'ADK POS' }}
{!! nl2br(e($storeSettings['store_address'] ?? 'Alamat toko belum diatur')) !!}
Telp: {{ $storeSettings['store_phone'] ?? '-' }} |
INVOICE
|
|
Informasi Pelanggan {{ $transaction->customer_name ?? 'Pelanggan Umum' }}
@if($isBooking)
Info Booking
@endif
@if($isOnline && $transaction->recipient_address)
@if($transaction->booking_code) Kode: {{ $transaction->booking_code }} @endif @if($transaction->booking_date) Jadwal: {{ \Illuminate\Support\Carbon::parse($transaction->booking_date)->format('d/m/Y H:i') }} @endif @if($transaction->booker_name) Pemesan: {{ $transaction->booker_name }} @endif @if($transaction->booker_phone) Telp Pemesan: {{ $transaction->booker_phone }} @endif
{{ $transaction->recipient_address }}
@endif
{{ $transaction->recipient_city }} {{ $transaction->recipient_postal_code }} Telp: {{ $transaction->recipient_phone ?: '-' }} |
Informasi Transaksi
|
| No | Item | @if($showOrderNumber)No. Pesanan | @endifQty | Harga | Subtotal |
|---|---|---|---|---|---|
| {{ $index + 1 }} |
{{ $item->product->name ?? 'Produk Dihapus' }}
@if(!empty($item->product?->variant_name))
Varian: {{ $item->product->variant_name }}
@endif
@if($item->custom_width && $item->custom_height)
Ukuran: {{ rtrim(rtrim(number_format((float) $item->custom_width, 2, ',', '.'), '0'), ',') }} x
{{ rtrim(rtrim(number_format((float) $item->custom_height, 2, ',', '.'), '0'), ',') }}
{{ $item->product && $item->product->pricing_unit === 'cm2' ? 'cm' : 'm' }}
@endif
@if($item->note)
Catatan: {{ $item->note }}
@endif
@if($showDiscounts && (float) $item->discount_amount > 0)
Diskon {{ rtrim(rtrim(number_format((float) $item->discount_percent, 2, ',', '.'), '0'), ',') }}%
(- Rp {{ number_format((float) $item->discount_amount, 0, ',', '.') }})
@endif
@if($showMarketplace && (float) $item->shopee_admin_fee_percent > 0)
Pajak Marketplace {{ rtrim(rtrim(number_format((float) $item->shopee_admin_fee_percent, 2, ',', '.'), '0'), ',') }}%
(Rp {{ number_format((float) $item->shopee_admin_fee_amount, 0, ',', '.') }})
@endif
|
@if($showOrderNumber)
{{ $item->order_number ?: '-' }} | @endif{{ number_format($item->quantity, 0, ',', '.') }} | Rp {{ number_format($item->price, 0, ',', '.') }} | Rp {{ number_format($item->subtotal, 0, ',', '.') }} |
|
@if($transaction->note)
Catatan Transaksi {{ $transaction->note }}
Informasi Pengiriman
|
Ringkasan Pembayaran
|