@extends('layouts.print') @section('title', ($order->type === \App\Enums\OrderType::DELIVERY_NOTE ? 'Bon de Livraison' : 'Facture') . ' ' . $order->number) @section('content')
watermark

{{ $order->type === \App\Enums\OrderType::DELIVERY_NOTE ? 'Bon de Livraison' : 'Facture' }}

Numéro: {{ $order->number }}

Date: {{ $order->created_at->format('d/m/Y') }}

Destinataire:

{{ $order->customer->name ?? 'Client passager' }}
{{ $order->customer->address ?? '' }}
{{ $order->customer->phone_1 ?? '' }}
{{ $order->customer->tax_id ?? '' }}

@if($order->type === \App\Enums\OrderType::INVOICE) @endif @php $groupedItems = $order->items->groupBy(function($item) use ($order) { if ($item->source) { return 'Bon de Livraison # ' . $item->source->number; } return $order->type === \App\Enums\OrderType::DELIVERY_NOTE ? 'Articles' : 'Articles (Direct)'; }); @endphp @foreach($groupedItems as $groupName => $items) @if($groupName !== 'Articles' && $groupName !== 'Articles (Direct)') @endif @foreach($items as $item) @if($order->type === \App\Enums\OrderType::INVOICE) @endif @endforeach @endforeach
SourceDésignation Qte P.U (HT) Total HT R% Net HT
{{ $groupName }}
{{ $item->source ? $item->source->number : '-' }}{{ $item->product->designation ?? 'Produit Inconnu' }} {{ $item->quantity }} {{ number_format($item->unit_price, 3) }} {{ number_format($item->total_price_ht_nd ?? ($item->unit_price * $item->quantity), 3) }} {{ number_format($item->discount_percentage ?? 0, 1) }}% {{ number_format($item->total, 3) }}
@if($order->revenue_stamp > 0) @endif
Total HT {{ number_format($order->total_price_ht, 3) }} TND
TVA {{ number_format($order->vat, 3) }} TND
Timbre Fiscal {{ number_format($order->revenue_stamp, 3) }} TND
Total TTC {{ number_format($order->total_price, 3) }} TND
@if(!isset($is_pdf))

Retour
@endif @endsection