| Désignation | Qté | P.U. HT | Remise | Total HT |
|---|---|---|---|---|
|
{{ $ligne->produit->nom ?? 'Produit' }}
@if($ligne->produit && $ligne->produit->code_barres)
{{ $ligne->produit->code_barres }} @endif |
{{ $ligne->quantite }} | {{ number_format($ligne->prix_unitaire, 0, ',', ' ') }} | @php $remiseAffichee = '-'; $clientRemise = $facture->client ? floatval($facture->client->remise_defaut ?? 0) : 0; // Remise globale du document (nouveau champ) $docRemiseType = $facture->remise_globale_type ?? 'pourcentage'; $docRemiseValeur = floatval($facture->remise_globale_valeur ?? 0); $ligneRemise = floatval($ligne->remise_valeur ?? 0); // Priorité 1: remise sur la ligne elle-même if ($ligneRemise > 0) { $remiseAffichee = $ligne->remise_type === 'pourcentage' ? number_format($ligneRemise, 0) . '%' : number_format($ligneRemise, 0, ',', ' '); } // Priorité 2: remise globale du document elseif ($docRemiseValeur > 0) { $remiseAffichee = $docRemiseType === 'pourcentage' ? number_format($docRemiseValeur, 0) . '%' : number_format($docRemiseValeur, 0, ',', ' '); } // Priorité 3: remise par défaut du client elseif ($clientRemise > 0) { $remiseAffichee = number_format($clientRemise, 0) . '%'; } @endphp {{ $remiseAffichee }} | {{ number_format($ligne->montant_ht ?? ($ligne->quantite * $ligne->prix_unitaire), 0, ',', ' ') }} |