@extends('layouts.app') @section('title', 'Vente') @section('breadcrumb', 'Commercial / Vente') @section('content') @php $vTypes = ['' => 'Tous', 'devis' => 'Devis', 'commande_vente' => 'Commande', 'bl' => 'BL', 'facture_vente' => 'Facture', 'avoir_vente' => 'Avoir']; $tabIcons = ['' => ['fa-th-list','#6b7280'], 'devis' => ['fa-file-alt','#3b82f6'], 'commande_vente' => ['fa-shopping-cart','#f59e0b'], 'bl' => ['fa-truck','#8b5cf6'], 'facture_vente' => ['fa-file-invoice-dollar','#10b981'], 'avoir_vente' => ['fa-undo-alt','#ef4444']]; $activeTab = request('type', ''); $tabBase = request()->except(['type', 'page']); $createUrl = fn($t) => route('vente.create') . '?type=' . $t; @endphp
{{ $docs->total() }} document(s){{ $activeTab ? ' — ' . ($vTypes[$activeTab] ?? $activeTab) : '' }}
| Numéro | Type | Client | Date | Total TTC | Statut | Actions |
|---|---|---|---|---|---|---|
| {{ $doc->numero }} | {{ $doc->type_libelle }} | {{ $doc->client?->nom ?? '-' }} | {{ $doc->date->format('d/m/Y') }} | {{ number_format($doc->total_ttc, 3, ',', ' ') }} | @php $colors = ['brouillon'=>'badge-muted','confirme'=>'badge-info','livre'=>'badge-warning','facture'=>'badge-success','annule'=>'badge-danger']; @endphp {{ ucfirst($doc->statut) }} |
@if(!in_array($doc->statut, ['annule','facture']))
@endif
@php
$venteRowAllowed = ['devis'=>['commande_vente'=>'Commande','bl'=>'Bon de Livraison','facture_vente'=>'Facture'],'commande_vente'=>['bl'=>'Bon de Livraison','facture_vente'=>'Facture'],'bl'=>['facture_vente'=>'Facture'],'facture_vente'=>['avoir_vente'=>'Avoir']];
$cibles = !$doc->converted ? ($venteRowAllowed[$doc->type] ?? []) : [];
@endphp
@if(count($cibles) > 0)
@endif
|
| Aucun document trouvé | ||||||
Un BL sera créé automatiquement avant la facture.
Le document original sera marqué comme traité.