@php /** @var \App\Models\PurchaseOrder $order */ /** @var array{name: string, legal_name: string, address: ?string, city: ?string, country: ?string, phone: ?string, email: ?string, website: ?string, tax_id: ?string, registration: ?string} $company */ /** @var ?string $buyerSignatureDataUri */ $money = static fn ($value): string => \App\Support\MoneyFormatter::format((float) $value, $company['currency'] ?? null); $lines = $order->lines; $location = collect([$company['city'], $company['country']])->filter()->implode(', '); $buyer = $order->validator ?? $order->creator; @endphp Bon de commande {{ $order->code }}
@include('pdf.partials.company-identity', ['company' => $company, 'showName' => true])

Bon de commande

N° {{ $order->code }}
{{ $order->order_date?->format('d/m/Y') ?? '—' }} · {{ $order->status->label() }}
Fournisseur
{{ $order->supplier?->name ?? '—' }}
@if ($order->supplier?->code) {{ $order->supplier->code }} @if ($order->supplier?->contact_name) · @endif @endif @if ($order->supplier?->contact_name) {{ $order->supplier->contact_name }} @endif @if ($order->supplier?->code || $order->supplier?->contact_name)
@endif @if ($order->supplier?->address) {{ $order->supplier->address }}
@endif @if ($order->supplier?->phone) Tél. {{ $order->supplier->phone }} @endif @if ($order->supplier?->email) {{ $order->supplier?->phone ? ' · ' : '' }}{{ $order->supplier->email }} @endif
Références
@if ($order->supplier?->payment_terms) @endif
Livraison souhaitée {{ $order->expected_delivery_date?->format('d/m/Y') ?? '—' }}
Échéance facturation {{ $order->invoice_due_date?->format('d/m/Y') ?? '—' }}
Émetteur {{ $order->creator?->name ?? '—' }}
Paiement {{ $order->supplier->payment_terms }}
@forelse ($lines as $index => $line) @empty @endforelse
N° Code Désignation Qté P.U. Montant
{{ $index + 1 }} {{ $line->product?->code ?? '—' }} {{ $line->description }} {{ (int) $line->quantity }} {{ $money($line->unit_price) }} {{ $money($line->line_total) }}
Aucune ligne
Total TTC {{ $money($order->total_amount) }}
@if ($order->notes)
Observations : {{ $order->notes }}
@endif
Engagement ferme de commande. Toute livraison et facturation doivent mentionner le N° {{ $order->code }}. Quantités, prix et délais = ceux du présent document, sauf accord écrit contraire.
Acheteur
{{ $buyer?->name ?? '……………………' }} · {{ $order->validated_at?->format('d/m/Y') ?? $order->order_date?->format('d/m/Y') ?? '………' }} @if ($buyerSignatureDataUri) Signature @else
Signature / cachet
@endif
Fournisseur — accusé de réception
Nom : …………………… · Date : ………
Signature / cachet