@php use App\Support\Money; use App\Support\Phone; $returned = old('returned', array_keys($items)); $collectedBy = old('collected_by', 'customer'); $owes = (float) $balance > 0; $input = 'mt-1 block w-full min-h-12 text-base rounded-lg border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500'; $section = 'rounded-xl bg-white p-4 shadow-sm sm:p-6 space-y-4'; @endphp ← Job {{ $job->job_no }}

Deliver device

{{ $job->device->display_name }} · {{ $job->customer->name }} · {{ $job->customer->phone_display }}

{{-- ========== Balance ========== --}}

Payment

@if ($draftInvoice)

The invoice is still a draft. Finalize it so the balance is correct.

@elseif (! $invoice)

There is no invoice yet. Create the invoice before handing over.

@endif @if (! $owes)

Nothing left to pay.

@else
! $allowed, 'bg-amber-50 text-amber-900' => $allowed])>

Balance to pay: {{ Money::format($balance) }}

@if ($allowed)

Allowed by {{ $job->balanceOverrideBy?->name }}: {{ $job->balance_override_reason }}

@else

The device cannot be delivered until this is paid, unless an admin allows it.

@endif
@if ($invoice && ! $allowed) Take the payment @endif @if (! $allowed) @can('allowBalance', $job)
@csrf

Admin: let the device go with this balance

@else

Ask an admin to open this page and allow delivery with a balance.

@endcan @endif @endif
{{-- ========== Handover form ========== --}}
@csrf {{-- Accessories --}}

Give back the accessories

@if ($items)

These were left with the device. Tick each item as you give it back.

@foreach ($items as $key => $label) @endforeach
@else

No accessories were left with the device.

@endif
{{-- Who collects --}}

Collected by

{{ $job->customer->name }} · {{ $job->customer->phone_display }}

{{-- Signature --}}

Signature

signs with a finger or the mouse to confirm they received the device{{ $items ? ' and the ticked items' : '' }}.

Sign here

Ask the customer to sign in the box.

@if ($canDeliver) @else

Cannot deliver: balance of {{ Money::format($balance) }} to pay.

@endif