@extends('front.printer') @section('content') @php $nb_ligne=count($order->carts); $nbl=10; $nb_page=ceil($nb_ligne/$nbl); $deb=0; $tot_putot=0; $TtotalRemise=0; $TtotalVat=0; $qtes=0; @endphp @for($m=0;$m<$nb_page;$m++) @php $taille=1100; $deb=$m*$nbl; $fin=$deb+$nbl; @endphp @if($m==($nb_page-1)) @php $taille=1100; @endphp @endif @php $page=$m+1; @endphp
Adresse : {{$societe->adresse}}
Email : {{$societe->email}}
@if(!empty($societe->tel))
Téléphone : {{$societe->tel}}
@endif
@if($m==0)
Bon livraison N° {{$order->number}}
Date Commande : {{$order->date}}
{{$order->name}}
@if(!empty($order->adresse)) {{$order->adresse}} @endif
{{$order->tel}}
@else
@endif
@php $i=1; $tots =0; $total=0; @endphp @foreach ($order->carts as $key=>$line) @if ($key >= $deb && $key < $fin) @php $cart=$line; $qtes+=$line['qte']; $tab=[]; $border = "#fff"; @endphp @php $total=$cart->qte * $cart->prixttc; $tots+=$total; @endphp @php $typep=2 @endphp @if(!empty($cart->produit_id)) @php $typep=1; $produit_id=$cart->produit_id; @endphp @endif @if($typep==2) @php $name=$cart->stock->produit->name ; $produit_id=$cart->stock->produit_id;@endphp @php $img=$cart->stock->imagedeclinaisons[0]->image->image_name @endphp @else @php $name=$cart->produit->name @endphp @foreach($cart->produit->images as $image) @if($image->defaut==1) @php $img=$image->image_name @endphp @endif @endforeach @endif @php $tab=[] @endphp @if($typep==2) @foreach($cart->stock->declinaisons as $declinaison) @php $att= $declinaison->attributoption->attribut->id @endphp @php $valeur=$declinaison->valeur; @endphp @if($att==1) @php $valeur= $declinaison->attributoption->couleur @endphp @endif @php $tab[$att][$declinaison->attribut_option_id]=$valeur; @endphp @endforeach @php $color=''; $id_color=0; @endphp @php $size=''; $id_size=0; @endphp @foreach($tab[1] as $ind=>$couleur) @php $color=$couleur @endphp @php $id_color=$ind @endphp @endforeach @php $tab_taille=[] @endphp @if(isset($tab[2]) ) @php $tab_taille=$tab[2] @endphp @endif @if(isset($tab[3]) ) @php $tab_taille=$tab[3] @endphp @endif @foreach($tab_taille as $ind=>$taille) @php $size=$taille @endphp @php $id_size=$ind @endphp @endforeach @endif @if ($nb_ligne != $i) @php $border = "#CCCCCC dotted 1px;"; @endphp @endif @php $i++; @endphp @endif @endforeach @php $width=600; @endphp @if($m==($nb_page-1)) @php $width=500; @endphp @endif @if($m>0 && $m<($nb_page-1)) @php $width=700; @endphp @endif @for($k=0;$k<=$i;$k++) @php $width-=50; @endphp @endfor @if($i >=7) @php $width=''; @endphp @endif
Image Désignation Prix Quantité Total
{{$name}} {{number_format($cart->prixttc,3,'.',' ')}}
x {{$cart->qte}}
@if($typep==2) @endif
{{number_format($total,3,'.',' ')}}
@if($m==($nb_page-1))
--- Quantité totale : {{$qtes}} article(s) ---
@if($order->livraison==1) @php $tots+=$order->frais; @endphp @endif
Frais livraison : {{number_format($order->frais,3,'.',' ')}} {{$devise}}
Total : {{number_format($tots,3,'.',' ')}} {{$devise}}
@endif
{{"Page ".$page."/".$nb_page}}
@endfor @endsection