@php // Les montants de cet etat partent chez un laboratoire : deux decimales toujours, // zeros de fin compris, ce que formatNumeriquePerf supprime. $montant = fn($valeur) => number_format((float) $valeur, 2, ',', ' '); $quantite = fn($valeur) => number_format((float) $valeur, 0, ',', ' '); $nbColonnes = $synthese ? 5 : 7; @endphp
Logo @if ($infoSociete && $infoSociete->InfoEnteteSimple)
{{ $infoSociete->InfoEnteteSimple }}
@endif
STATISTIQUES DE VENTES PAR LABORATOIRE{{ $synthese ? ' — SYNTHÈSE' : '' }}
Laboratoire : {{ $libLaboratoire ?: 'TOUS LES LABORATOIRES' }}
Période : du {{ $periodeDebut }} au {{ $periodeFin }}
@if ($libSite !== '') Site : {{ $libSite }}    Type produit : {{ $libTypeProduit ?: 'TOUS' }}
@endif @if ($libClient !== '' && $libClient !== 'TOUS LES CLIENTS') Client : {{ $libClient }}
@endif @if ($libProduit !== '' && $libProduit !== 'TOUS LES PRODUITS') Produit : {{ $libProduit }}
@endif
@if (!$synthese) @endif @foreach ($groupes as $groupe) @foreach ($groupe['lignes'] as $ligne) @if (!$synthese) @endif @endforeach @endforeach
CIP CLIENT EAN LIBELLE PRODUITDATE FACTURE NUMERO FACTUREQTES VENDUES VALEUR{{ $devise ? ' (' . $devise . ')' : '' }}
{{ $groupe['CodeClient'] }}  {{ $groupe['NomClient'] }}   ({{ count($groupe['lignes']) }} ligne{{ count($groupe['lignes']) > 1 ? 's' : '' }}) {{ $quantite($groupe['totalQte']) }} {{ $montant($groupe['totalValeur']) }}
{{ $ligne['CodeClient'] ?? '' }} {{ $ligne['CodeArticle'] ?? '' }} {{ $ligne['Designation'] ?? '' }}{{ $ligne['DateFacture'] ?? '' }} {{ $ligne['NumeroFacture'] ?? '' }}{{ $quantite($ligne['QteVendue'] ?? 0) }} {{ $montant($ligne['Valeur'] ?? 0) }}
Total {{ $groupe['NomClient'] }} {{ $quantite($groupe['totalQte']) }} {{ $montant($groupe['totalValeur']) }}
TOTAL GÉNÉRAL — {{ $quantite($nbClients) }} client{{ $nbClients > 1 ? 's' : '' }}, {{ $quantite($nbLignes) }} ligne{{ $nbLignes > 1 ? 's' : '' }} {{ $quantite($totalQte) }} {{ $montant($totalValeur) }}