@php use Illuminate\Support\Str; @endphp {{ Str::title(str_replace('_', ' ', $document->type)) }} - {{ $document->document_number }}
@if(isset($isReprint) && $isReprint) COPY - {{ Str::title(str_replace('_', ' ', $document->type)) }} @else {{ Str::title(str_replace('_', ' ', $document->type)) }} @endif
Company Information
@if($company && $company->logo_path) Company Logo @endif
Name:{{ $company->company_name }}
Address:{{ $company->address }}
Tel No_:{{ $company->phone }}
Email:{{ $company->email }}
VAT No:{{ $company->vat_no }}
TIN No:{{ $company->tax_id }}
Currency:{{ $document->currency_code }}
Supplier Information
Supplier Name:{{ $document->supplier->supplier_account ?? '—' }}
Supplier Address: {{ $document->supplier->address ?? '—' }}
Supplier Email:{{ $document->supplier->email ?? '—' }}
Supplier Phone:{{ $document->supplier->contact_1 ?? '—' }}
Supplier Contact Person:{{ $document->contact_person }}
Supplier City:{{ $document->supplier->city ?? '—' }}
Supplier Province:{{ $document->supplier->province ?? '—' }}
Supplier VAT:{{ $document->supplier->vat }}
Supplier TIN:{{ $document->supplier->tin }}
{{ Str::title(str_replace('_', ' ', $document->type)) }} #: {{ $document->document_number }}
Order Date: {{ $document->document_date->format('d M Y') }}
Order #: {{ $document->order_number }}
@foreach($document->lines as $line) @endforeach
HS Code Code Description Additional Description Qty UOM Description Price (incl) Disc % Tax Total (incl)
{{ $line->hs_code }} @if($line->module === 'GL') {{ optional($line->account)->code }} @else {{ optional($line->item)->code }} @endif @if($line->module === 'GL') {{ optional($line->account)->account_name }} @else {{ optional($line->item)->description1 }} @endif {{ $line->description }} {{ $line->confirmed_quantity }} {{ optional($line->uom)->description ?? '' }} {{ number_format($line->price, 2) }} {{ number_format($line->discount_percent, 2) }}% {{ number_format($line->line_tax, 2) }} {{ number_format($line->line_total, 2) }}
Received by: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Date: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Signed: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Exclusive Total: {{ optional($document->currency)->symbol ?? $document->currency_code }} {{ number_format($document->exclusive_total, 2) }}
Tax: {{ optional($document->currency)->symbol ?? $document->currency_code }} {{ number_format($document->tax_amount, 2) }}
Discount: {{ optional($document->currency)->symbol ?? $document->currency_code }} {{ number_format($document->discount_total, 2) }}
Inclusive Total: {{ optional($document->currency)->symbol ?? $document->currency_code }} {{ number_format($document->inclusive_total, 2) }}

Terms & Conditions
{{ $document->notes ?? 'No terms provided' }}

Sales Representative:.....................................................

Banking Details
@php $bankDetails = $company->bank_details ?? []; @endphp @forelse($bankDetails as $bank)
Bank Name: {{ $bank['bank_name'] ?? '' }}
Account Name: {{ $bank['account_name'] ?? '' }}
Account Number: {{ $bank['account_number'] ?? '' }}
Branch: {{ $bank['branch'] ?? '' }}

@empty
No banking details available
@endforelse
@inject('linkService', 'App\Services\DocumentLinkService') @php $incomingLinks = $linkService->getLinkedFrom($document->id, $document->type); $outgoingLinks = $linkService->getLinkedTo($document->id, $document->type); @endphp @if($incomingLinks->isNotEmpty() || $outgoingLinks->isNotEmpty())
Document Flow & Links
@if($incomingLinks->isNotEmpty())
Parent / Source Documents
@foreach($incomingLinks as $link) @php $parent = $linkService->resolveModel($link->source_id, $link->source_type); $parentUrl = null; if ($parent) { if (in_array($link->source_type, ['receipt'])) { $parentUrl = route('receipts.create'); } elseif (in_array($link->source_type, ['purchase_order', 'goods_received', 'sales_invoice', 'returns_debit'])) { $parentUrl = route('supplier.documents.pdf', $parent->id); } else { $parentUrl = route('documents.pdf', $parent->id); } } @endphp @if($parent) {{ str_replace('_', ' ', $link->source_type) }} #{{ $parent->document_number ?? $parent->receipt_number ?? $parent->id }} @endif @endforeach
@endif @if($incomingLinks->isNotEmpty() && $outgoingLinks->isNotEmpty())
@endif @if($outgoingLinks->isNotEmpty())
Child / Converted Documents
@foreach($outgoingLinks as $link) @php $child = $linkService->resolveModel($link->target_id, $link->target_type); $childUrl = null; if ($child) { if (in_array($link->target_type, ['receipt'])) { $childUrl = route('receipts.create'); } elseif (in_array($link->target_type, ['purchase_order', 'goods_received', 'sales_invoice', 'returns_debit'])) { $childUrl = route('supplier.documents.pdf', $child->id); } else { $childUrl = route('documents.pdf', $child->id); } } @endphp @if($child) {{ str_replace('_', ' ', $link->target_type) }} #{{ $child->document_number ?? $child->receipt_number ?? $child->id }} @endif @endforeach
@endif
@endif