@php $preview = $this->preview; $previewTotals = $preview['totals']; $checkoutOrder = $this->checkoutOrder; $checkoutOrderStatus = $checkoutOrder?->status?->value; $isCheckoutWaitingPayment = $checkoutOrder?->status === \App\Enums\OrderStatus::WAITING_PAYMENT; @endphp
@include('filament.v2.partials.shell-header', [ 'pageHeading' => 'Orders Workstation', 'pageDescription' => 'Compose heterogeneous order lines for one customer, review totals, and save or edit waiting-payment drafts.', ])

Workstation Context

Checkout & Invoicing

@if ($checkoutOrder)
Active order
{{ $checkoutOrder->public_id }}
Status
{{ \Illuminate\Support\Str::headline((string) $checkoutOrderStatus) }}
Total
{{ $this->formatMinorAmount($checkoutOrder->money_total->getMinorAmount()->toInt(), $checkoutOrder->money_total->getCurrency()->getCurrencyCode()) }}

Payment link delivery

@if ($this->pendingPaymentLink)

{{ \Illuminate\Support\Str::headline((string) $this->pendingPaymentMethod) }} link ready

{{ $this->pendingPaymentLink }} @if ($this->pendingPaymentQrCodeDataUrl) Payment QR code @endif
@endif

Invoice actions

@if ($this->invoiceNumber)
Invoice: {{ $this->invoiceNumber }} @if ($this->invoicePdfUrl) · Open PDF @endif
@endif
@else

Select or save a draft order to unlock checkout, payment links, and invoice actions.

@endif

Recap

Valid lines
{{ $previewTotals['valid_lines'] }}
Invalid lines
{{ $previewTotals['invalid_lines'] }}
Estimated total
{{ $this->formatMinorAmount((int) $previewTotals['amount_minor'], (string) $previewTotals['currency']) }}
@if ($this->workstationFeedbackMessage)
{{ $this->workstationFeedbackMessage }}
@endif
@forelse ($lineItems as $index => $line) @php $linePreview = collect($preview['preview_lines'])->firstWhere('index', $index); $lineType = (string) ($line['orderable_type'] ?? ''); $isManual = $lineType === \App\Enums\OrderableType::MANUAL_INVOICE_ITEM->value; $lineOrderableOptions = $this->getOrderableOptionsForLine($index); $requiredKeys = $this->getRequiredMetadataKeysForLine($index); @endphp

Line #{{ $index + 1 }}

@if ($isManual)
@endif @if ($requiredKeys !== [])

Required metadata keys: {{ implode(', ', $requiredKeys) }}

@endif @if ($linePreview)
@if ($linePreview['status'] === 'valid') Valid · {{ $linePreview['title'] }} · {{ $this->formatMinorAmount((int) $linePreview['amount_minor'], (string) $linePreview['currency']) }} @else Invalid · {{ $linePreview['error'] }} @endif
@endif
@empty
No order line. Add your first line to start composing a draft order.
@endforelse