@php $ModeGPHARMA = ModeGpharma() ?? 1; foreach ($tableauParam as $key => $value) { $info = $value['info']; $barcodeImage = $value['barcodeImage']; $donneesLigne = $value['donneesLigne']; /* Les avantages de promotion. Absents des commandes anciennes : le PDF doit s'imprimer quand meme. */ $promo = $value['promo'] ?? []; $bilanPromo = $value['bilanPromo'] ?? []; if($info == null){ continue; } $NomAgence = $info -> NomAgence ?? ''; $libelleTournee = $info -> LibelleTournee ?? ""; @endphp @if($key != 0)
@endif
Logo de l\'entreprise


@if($ModeGPHARMA == 2) AGENCE : {{ $NomAgence}}

@endif TOURNEE : {{ $libelleTournee}}

@isset( $info -> LibelleGroupementClient) @if ($info -> LibelleGroupementClient != null && $info -> LibelleGroupementClient != '') GROUPEMENT : {{ $info -> LibelleGroupementClient}}

@endif @endisset
Date : {{ $info == null ? "" : convertirDateLettre($info -> DateCommandeClient)}}
BON DE COMMANDE N° {{ $info == null ? "" : $info -> NumeroCommandeClient}}

Barcode

N° CLIENT : {{ $info -> CodeClient}}
{{ $info -> NomClient }}


@if ($info -> RepresentantLegalClient != null && $info -> RepresentantLegalClient != '') {{ $info -> RepresentantLegalClient }}
@endif @if ($info -> AdresseGeoClient != null && $info -> AdresseGeoClient != '') {{ $info -> AdresseGeoClient }}
@endif @if ( $info -> NumeroCC != null && $info -> NumeroCC != '') N° CC : {{ $info -> NumeroCC }}
@endif @if ($info -> NumeroRC != null && $info -> NumeroRC != '') N° RC : {{ $info -> NumeroRC }}
@endif @if ( $info -> TelephoneFixeClient != null && $info -> TelephoneFixeClient != '') TEL. FIXE : {{ $info -> TelephoneFixeClient }}
@endif
@php foreach ($donneesLigne as $key => $Ligne) { @endphp @php } @endphp
BON DE COMMANDE N° {{ $info -> NumeroCommandeClient}}

{{ $info -> NomClient}}
N° CODE DESIGNATION
PRODUIT
QTE A
COLLECTER
QTE FACTUREE UG
{{ $key + 1 }} {{ ($ModeGPHARMA == 3) ? $Ligne -> CodeCipProduit1 : $Ligne -> CodeEanProduit }} {{ $Ligne -> DesignationProduit }} {{ $Ligne -> QteAffecteeTotale }} {{ $Ligne -> QteAffectee }} {{ $Ligne -> QteUniteGratuite }}
{{-- Les avantages de promotion obtenus. Rien n'est imprime quand il n'y en a pas. --}} @if (count($promo) > 0) @php $libellesAvantage = [ 'PRODUIT_OFFERT' => 'Produit offert', 'GOODIE' => 'Cadeau offert', 'SURREMISE_TAUX' => 'Remise', 'REMISE_FORFAIT' => 'Remise sur prix cession HT', ]; foreach ($promo as $avantage) { $estUnDon = in_array($avantage->TypeAvantage, ['PRODUIT_OFFERT', 'GOODIE'], true); $quantite = rtrim(rtrim(number_format((float) $avantage->QteAvantage, 2, ',', ' '), '0'), ','); if ($estUnDon) { $obtenu = $quantite . ' × ' . $avantage->ProduitOffert; } elseif ($avantage->TypeAvantage === 'SURREMISE_TAUX') { $obtenu = '+ ' . rtrim(rtrim(number_format((float) $avantage->TauxApplique, 2, ',', ' '), '0'), ',') . ' % sur ' . $quantite . ' unite(s)'; } else { /* Le forfait est exprime par unite sur la fiche fournisseur. Depuis qu'il baisse le prix unitaire, la baisse consentie est inscrite telle quelle : c'est elle que la facture montre. Les avantages plus anciens, portes par le taux, n'en ont pas — on la redresse alors depuis le montant. */ $parUnite = (float) $avantage->BaisseUnitaire > 0 ? (float) $avantage->BaisseUnitaire : ((float) $avantage->QteAvantage > 0 ? (float) $avantage->MontantAvantage / (float) $avantage->QteAvantage : 0); $obtenu = formatNumeriquePerf($parUnite) . ' EUR par unite, sur ' . $quantite . ' unite(s)'; } /* Un avantage repris — marchandise retournee — reste imprime, dit comme tel : le bon doit expliquer ce qui s'est passe. */ $repris = (bool) $avantage->Repris; @endphp @php } @endphp
AVANTAGES PROMOTIONNELS @php $resume = []; if (($bilanPromo['montant'] ?? 0) > 0) { $resume[] = formatNumeriquePerf($bilanPromo['montant']) . ' de remise'; } if (($bilanPromo['uniteOfferte'] ?? 0) > 0) { $resume[] = rtrim(rtrim(number_format((float) $bilanPromo['uniteOfferte'], 2, ',', ' '), '0'), ',') . ' article(s) offert(s)'; } $resume[] = ($bilanPromo['offres'] ?? 0) . ' offre(s)'; @endphp  —  {{ implode(' · ', $resume) }}
AVANTAGE SUR QUEL ARTICLE CE QUE LE CLIENT OBTIENT OFFRE
{{ $libellesAvantage[$avantage->TypeAvantage] ?? $avantage->TypeAvantage }} @if ($repris) (RETOURNE) @endif {{ $avantage->DesignationProduit }} {{ $obtenu }} {{ $avantage->LibelleRegle }}
@endif
@php } @endphp