@extends('layouts.erp') @section('title', $item->number) @section('page_title', 'Document '.$item->number) @section('content') @php $labels = [ 'devis' => 'Devis', 'commande' => 'Bon de commande', 'facture' => 'Facture', 'livraison' => 'Bon de livraison', 'recu' => 'Reçu', 'avoir' => 'Avoir', ]; $fmt = fn ($n) => number_format((float) $n, 0, ',', ' ').' F'; $reste = max(0, (float) $item->total - (float) $item->paid_amount); $doc = $labels[$item->document_type] ?? ucfirst($item->document_type); @endphp
{{ $doc }} · {{ $item->number }}
Client{{ $item->client->name ?? '—' }}
Agence{{ $item->boutique->name ?? '—' }}
Date{{ optional($item->sale_date)->format('d/m/Y') ?: '—' }}
Statut{{ ucfirst($item->status) }}
Paiement{{ $item->payment_method ?: '—' }}
Total{{ $fmt($item->total) }}
Payé{{ $fmt($item->paid_amount) }}
Reste{{ $fmt($reste) }}
@if(!empty($entry))
Écriture@if(auth()->user()->allows('journal-entries')){{ $entry->number }}@else{{ $entry->number }}@endif
@endif @if($item->notes)
Notes{{ $item->notes }}
@endif
Lignes
@foreach($item->items as $line) @endforeach
DescriptionQtéP.U.Total
{{ $line->description }} {{ $line->quantity }} {{ $fmt($line->unit_price) }} {{ $fmt($line->total) }}
@if(request('imprimer')) @endif @endsection