@php $money = fn (int $cents) => 'AUD '.number_format($cents / 100, 2); $canApprove = $wsMember->canApprove(); $statusPill = ['converted' => ['wd-pill-success', 'Approved'], 'declined' => ['wd-pill-danger', 'Declined']]; @endphp

Waiting for a decision

{{ $pending->count() }}
@forelse($pending as $i => ['cart' => $cart, 'quote' => $quote])
{{ strtoupper(substr($cart->customer->name ?: $cart->customer->email, 0, 1)) }}

{{ $cart->customer->name ?: $cart->customer->email }} requested {{ $money($quote['net_cents']) }}

{{ $cart->submitted_at?->diffForHumans() }} · {{ number_format($quote['units']) }} units · {{ count($quote['lines']) }} lines @if($cart->po_number) · PO {{ $cart->po_number }} @endif · {{ $cart->payment_method === 'account' ? 'On account' : 'Proforma' }} @if($cart->location) · {{ $cart->location->label }} @endif

@if($cart->notes)

“{{ $cart->notes }}”

@endif

{{ $money($quote['net_cents']) }}saves {{ $money($quote['savings_cents']) }} vs retail

View {{ count($quote['lines']) }} lines
@foreach($quote['lines'] as $line) @endforeach
{{ $line['title'] }} {{ $line['variant_title'] }} {{ number_format($line['quantity']) }} × {{ $money($line['unit_price_cents']) }} {{ $money($line['total_cents']) }}
@if($canApprove)
@csrf
@csrf
@else

Awaiting an approver at {{ $wsCompany->name }}.

@endif
@empty

All clear

{{ $canApprove ? 'No orders are waiting for your approval.' : 'You have no orders awaiting approval.' }}

@endforelse

History

@if($history->isEmpty())

Reviewed requests will appear here.

@else
@foreach($history as $cart) @php [$tone, $label] = $statusPill[$cart->status] ?? ['', ucfirst($cart->status)]; @endphp @endforeach
Requested bySubmittedDecisionReviewerValue
{{ $cart->customer->name ?: $cart->customer->email }} {{ $cart->submitted_at?->format('d M Y') }} {{ $label }} @if($cart->order){{ $cart->order->number }}@endif @if($cart->review_note)

“{{ $cart->review_note }}”

@endif
{{ $cart->reviewer?->name ?? ($cart->status === 'converted' ? 'Within limit' : '—') }} {{ $money((int) $cart->net_cents) }}
@endif