{{-- Backdrop --}} @if($isOpen)
@endif {{-- Unsaved Changes Confirmation --}}

Unsaved Changes

You have unsaved changes. Are you sure you want to close?

{{-- Slide Panel --}}
@if($isOpen) {{-- Header --}}
@if($isNewInvoice)

New Invoice

@else {{ $reference ?: 'No Ref' }}

Edit Invoice

@endif @if($isDirty) Unsaved @endif
{{-- Toast Notifications --}} @if(session()->has('inv-message'))
{{ session('inv-message') }}
@endif @if(session()->has('inv-error'))
{{ session('inv-error') }}
@endif {{-- Tabs --}} {{-- Content --}}
{{-- Details Tab --}} @if($activeTab === 'details')
{{-- Summary Cards --}}
Drops {{ count($selectedDrops) }}
Total Qty {{ number_format($this->totalQty) }}
Total Value {{ $this->currencySymbol }}{{ number_format($this->totalValue, 2) }}
{{-- Form Grid --}}
@if($invoiceId) Locked @endif @error('customer_id')
{{ $message }}
@enderror
@error('invoiceDate')
{{ $message }}
@enderror
@error('reference')
{{ $message }}
@enderror
@error('supplierInvoiceRef')
{{ $message }}
@enderror
@if(!$isNewInvoice && $status)
@if(in_array($status, ['ready', 'sent_to_zoho', 'complete'])) Sent to Finance @else {{ ucwords(str_replace('_', ' ', $status)) }} @endif
@endif
@if($existingFileName)
{{ $existingFileName }}
@endif PDF, JPG, PNG or GIF (max 10MB) @error('invoiceFile')
{{ $message }}
@enderror
Uploading...
{{-- Drops Tab --}} @elseif($activeTab === 'drops')
{{-- Header with search --}}
@if(!$customer_id)

Select a customer first

Customer is required to view available drops
@elseif($this->availableDrops->isEmpty())

No shipped drops available

Only shipped drops can be added to an invoice
@else
@foreach($this->availableDrops as $drop) @php $line = $drop->line; $order = $line?->order; $colourway = $line?->colourway; $design = $colourway?->style_versions?->styles?->designs; $isSelected = in_array($drop->id, $selectedDrops); $totalQty = $drop->sizes->sum('qty'); @endphp
@if($isSelected) @endif
RT{{ $design?->id ?? '—' }} {{ $colourway?->name ?? $line?->imported_colour ?? '—' }}
{{ $order?->customer_po ?? '—' }} {{ $totalQty }} pcs @if($drop->shipped_date) {{ $drop->shipped_date->format('d M') }} @endif
@endforeach
@endif {{-- Selected summary --}} @if(count($selectedDrops) > 0)
{{ count($selectedDrops) }} Drops
{{ number_format($this->totalShippedPcs) }} Total Shipped Pcs
@endif
@endif
{{-- Footer --}} @endif