{{-- On-screen preview. The document itself is the PDF template rendered to HTML (passed in as $document) and embedded in an isolated iframe so its print CSS cannot leak into the app shell, what you see here is exactly what the downloaded PDF contains. --}}
@php // Joined toolbar segments: one compact row, scrolls sideways on phones. $seg = 'inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap px-3 text-xs font-medium transition'; @endphp
{{ __('Invoices') }} / {{ $invoice->invoice_number }}
@if (($canManage ?? false) && $invoice->status !== 'PAID') {{ __('Edit') }} @endif @if (($canRecordPayment ?? false) && $invoice->status !== 'VOID' && (float) $invoice->balance_due > 0) {{ __('Record Payment') }} @endif @if (($canManage ?? false) && $invoice->status !== 'VOID') {{ __('Send') }} @endif {{ __('Delivery Note') }} @if (($canDelete ?? false) && ! $invoice->isDeletionLocked()) {{ __('Delete') }} @endif
{{ __('Download PDF') }}
{{-- Linked production job(s). An invoice is the sale; the job is the work. The document itself is what the page is for, so the state of that work sits under it rather than pushing it down the page, saving a hop through the jobs list. Labels/colours mirror the job page (Job::STATUS_LABELS is the single source for the wording). --}} @if (($canViewJobs ?? false) && $invoice->jobs->isNotEmpty()) @php $jobStatusMeta = [ 'pending' => ['color' => 'slate', 'dot' => 'bg-slate-400'], 'in_production' => ['color' => 'sky', 'dot' => 'bg-sky-500'], 'on_hold' => ['color' => 'amber', 'dot' => 'bg-amber-500'], 'completed' => ['color' => 'emerald', 'dot' => 'bg-emerald-500'], 'ready_for_collection' => ['color' => 'amber', 'dot' => 'bg-amber-400'], 'delivered' => ['color' => 'violet', 'dot' => 'bg-violet-500'], 'closed' => ['color' => 'slate', 'dot' => 'bg-slate-500'], 'cancelled' => ['color' => 'rose', 'dot' => 'bg-rose-400'], ]; @endphp

{{ trans_choice('Linked Job|Linked Jobs', $invoice->jobs->count()) }}

    @foreach ($invoice->jobs as $linkedJob) @php $meta = $jobStatusMeta[$linkedJob->status] ?? ['color' => 'slate', 'dot' => 'bg-slate-400']; @endphp
  • {{ $linkedJob->job_number }} {{ App\Models\Job::statusLabel($linkedJob->status) }}

    @if ($linkedJob->title) {{ $linkedJob->title }} · @endif {{ __(':percent% complete', ['percent' => (int) $linkedJob->progress]) }} @if ($linkedJob->due_date) · {{ __('Due :date', ['date' => $linkedJob->due_date->format('d M Y')]) }} @endif

    {{ __('Open job') }}
  • @endforeach
@endif