@if ($activeTab === 'pos')
@if ($orderType === 'dine_in') @endif
@endif
@if ($activeTab === 'pos')
@forelse ($this->productCards as $product) @php $image = (string) ($product['image'] ?? ''); $imageUrl = $image !== '' ? asset('storage/'.$image) : null; $variants = (array) ($product['variants'] ?? []); $firstVariant = $variants[0] ?? null; $variantCount = count($variants); $hasVariant = is_array($firstVariant) && ((int) ($firstVariant['id'] ?? 0) > 0); $basePrice = $hasVariant ? (int) round((float) ($firstVariant['price'] ?? 0)) : null; $after = $hasVariant && ($firstVariant['price_afterdiscount'] ?? null) !== null ? (int) round((float) ($firstVariant['price_afterdiscount'] ?? 0)) : null; $percent = $hasVariant && ($firstVariant['percent'] ?? null) !== null ? (int) ($firstVariant['percent'] ?? 0) : 0; $computed = ($hasVariant && $basePrice !== null && $percent > 0 && $percent < 100) ? max(0, (int) round($basePrice - ($basePrice * ($percent / 100)))) : null; $final = null; if ($after !== null && $basePrice !== null && $after > 0 && $after < $basePrice) { $final = $after; } elseif ($computed !== null && $basePrice !== null && $computed < $basePrice) { $final = $computed; } elseif ($basePrice !== null) { $final = $basePrice; } $isPromo = $final !== null && $basePrice !== null && $final < $basePrice; $isPackage = (bool) ($product['is_package'] ?? false); $packageType = (string) ($product['package_type'] ?? 'simple'); $packageComponentVariantIds = (array) ($product['package_component_variant_ids'] ?? []); $statusVariantId = $hasVariant ? (int) ($firstVariant['id'] ?? 0) : 0; $stockStatus = null; if ($isPackage && $packageType !== 'complex' && $packageComponentVariantIds !== []) { $componentStatuses = []; foreach ($packageComponentVariantIds as $componentVariantId) { $componentVariantId = (int) $componentVariantId; if ($componentVariantId <= 0) { continue; } $componentStatuses[] = $this->variantStockStatuses[$componentVariantId] ?? null; } if (in_array('missing_bom', $componentStatuses, true)) { $stockStatus = 'missing_bom'; } elseif (in_array('insufficient', $componentStatuses, true)) { $stockStatus = 'insufficient'; } elseif (in_array('low', $componentStatuses, true)) { $stockStatus = 'low'; } elseif ($componentStatuses !== []) { $stockStatus = 'ok'; } } elseif (! $isPackage && $statusVariantId > 0) { $stockStatus = $this->variantStockStatuses[$statusVariantId] ?? null; } $stockBadge = null; if ($stockStatus === 'missing_bom') { $stockBadge = ['label' => 'Resep belum diatur', 'class' => 'bg-gray-900/70 text-white']; } elseif ($stockStatus === 'insufficient') { $stockBadge = ['label' => 'Stok bahan kurang', 'class' => 'bg-error-600 text-white']; } elseif ($stockStatus === 'low') { $stockBadge = ['label' => 'Stok bahan menipis', 'class' => 'bg-warning-600 text-white']; } @endphp @empty

Tidak ada produk.

@endforelse

Keranjang

@if ($editingTransactionId) Edit Pending @endif
@forelse ($cartItems as $idx => $item) @php $qty = (int) ($item['quantity'] ?? 0); $price = (int) ($item['price'] ?? 0); $original = (int) ($item['original_price'] ?? $price); $isPromo = $original > 0 && $price > 0 && $price < $original; $isComplexPackage = (string) ($item['package_type'] ?? '') === 'complex'; @endphp

{{ $item['name'] ?? '-' }}

@if (! empty($item['variant_name']))

{{ $item['variant_name'] }}

@endif
Rp {{ number_format($price, 0, ',', '.') }} @if ($isPromo) Rp {{ number_format($original, 0, ',', '.') }} @endif
@if ($isComplexPackage) @endif
{{ $qty }}
Rp {{ number_format($qty * $price, 0, ',', '.') }}
@empty

Keranjang masih kosong.

@endforelse
Subtotal Rp {{ number_format($subtotal, 0, ',', '.') }}
@if ($taxAmount > 0)
Pajak PB1 ({{ number_format((float) $taxRate, 2, ',', '.') }}%) Rp {{ number_format($taxAmount, 0, ',', '.') }}
@endif @if ($roundingAmount !== 0)
Pembulatan Rp {{ number_format($roundingAmount, 0, ',', '.') }}
@endif
Total Rp {{ number_format($total, 0, ',', '.') }}
@if (! $cartLocked) @else
@endif
@else

Online Lunas

{{ (int) $this->selfOrderPaidUnprocessed->count() }}
@can('transactions.view') @forelse ($this->selfOrderPaidUnprocessed as $trx)
{{ $trx->code }} @if ($trx->diningTable) {{ $trx->diningTable->name }} @endif
Rp{{ number_format((int) $trx->total, 0, ',', '.') }} · {{ (int) $trx->transaction_items_count }} item @if ($trx->paid_at) · {{ $trx->paid_at->format('d M Y, H:i') }} @elseif ($trx->created_at) · {{ $trx->created_at->format('d M Y, H:i') }} @endif
@can('transactions.details') Detail @endcan @can('transactions.print') @endcan
@empty
Belum ada transaksi online lunas.
@endforelse @else
Anda tidak memiliki akses untuk melihat transaksi.
@endcan

Bayar di Kasir

{{ (int) $this->selfOrderCashPending->count() }}
@can('transactions.view') @forelse ($this->selfOrderCashPending as $trx)
{{ $trx->code }} @if ($trx->diningTable) {{ $trx->diningTable->name }} @endif
Rp{{ number_format((int) $trx->total, 0, ',', '.') }} · {{ (int) $trx->transaction_items_count }} item @if ($trx->created_at) · {{ $trx->created_at->format('d M Y, H:i') }} @endif
@can('transactions.details') Detail @endcan
@empty
Belum ada pesanan bayar di kasir.
@endforelse @else
Anda tidak memiliki akses untuk melihat transaksi.
@endcan
@endif
@if ($tableModalOpen) @endif @if ($variantModalOpen) @endif @if ($complexPackageModalOpen) @php $invalid = false; foreach ($complexPackageComponents as $component) { $baseQty = (int) ($component['base_quantity'] ?? 0); $allocations = (array) ($component['allocations'] ?? []); if ($baseQty <= 0 || $allocations === []) { $invalid = true; break; } $sum = 0; foreach ($allocations as $alloc) { $qty = (int) ($alloc['quantity'] ?? 0); $variantId = (int) ($alloc['variant_id'] ?? 0); if ($qty <= 0 || $variantId <= 0) { $invalid = true; break 2; } $sum += $qty; } if ($sum !== $baseQty) { $invalid = true; break; } } @endphp @endif @if ($pendingOrdersModalOpen) @endif @if ($savePendingModalOpen) @endif @if ($checkoutModalOpen) @php $paymentMethods = [ ['id' => 'cash', 'name' => 'Tunai'], ['id' => 'qris', 'name' => 'QRIS'], ['id' => 'transfer_bank', 'name' => 'Transfer Bank'], ['id' => 'gofood', 'name' => 'GoFood'], ['id' => 'grab_food', 'name' => 'GrabFood'], ['id' => 'shopee_food', 'name' => 'ShopeeFood'], ]; @endphp