@extends('layouts.erp') @section('title', $item->number) @section('page_title', 'Achat '.$item->number) @section('content')
@php $steps = ['demande' => 'Demande', 'valide' => 'Validé', 'commande' => 'Commande', 'reception' => 'Réception', 'facture' => 'Facture', 'paye' => 'Payé']; $nextLabel = ['demande' => 'Valider', 'valide' => 'Passer en commande', 'commande' => 'Réceptionner', 'reception' => 'Facturer'][$item->status] ?? null; @endphp @foreach($steps as $key => $label) {{ $label }} @endforeach @if($nextLabel)
@csrf
@endif
Achat {{ $item->number }}
Fournisseur{{ $item->supplier->name ?? '—' }}
Agence{{ $item->boutique->name ?? '—' }}
Date{{ optional($item->purchase_date)->format('d/m/Y') ?: '—' }}
Statut{{ ucfirst($item->status) }}
Total{{ number_format($item->total, 0, ',', ' ') }} F
Payé{{ number_format($item->paid_amount, 0, ',', ' ') }} F
Reste{{ number_format(max(0, $item->total - $item->paid_amount), 0, ',', ' ') }} F
@if(!empty($entry))
Écriture@if(auth()->user()->allows('journal-entries')){{ $entry->number }}@else{{ $entry->number }}@endif
@endif @if($item->notes)
Notes{{ $item->notes }}
@endif
@if(in_array($item->status, ['reception', 'facture', 'paye'], true) && (float) $item->paid_amount < (float) $item->total)
Paiement fournisseur
@csrf
@endif
Lignes
@foreach($item->items as $line) @endforeach
DescriptionQtéP.U.Total
{{ $line->description }} {{ $line->quantity }} {{ number_format($line->unit_price, 0, ',', ' ') }} F {{ number_format($line->total, 0, ',', ' ') }} F
@endsection