<html>
    <head>
	
        <title>Facture appro emballage</title>
    </head>
      <body style="font-family:'Montserrat';">
            <div class="container">
		   <div class="row">
		    <div class="col-md-12">  
                <center>
				<br/>				
				<img src="{{public_path('assets/img/logo3.png')}}"/><br/>
				<p><b>EasyShop Pro 2.0</b></p>
				<hr style="width:100px;" />
				<p><b></b></p>
				</center>
		    </div>
		</div></div>
		<!--BLOC DU GERANT-->
		<div class="container">
		<div class="row"> 
                <div class="col-md-4" style="margin-left:20px;">
					<p><b><font color="brown">FACTURE COMMANDE APPRO EMBALLAGE</font></b></p>
					<p><b>Fournisseur : {{DB::table('fournisseur')->where('id', $appro->fournisseur_id)->first()->nom}}</b></p>
					<p><b>No FACTURE : {{$appro->numero}}</b></p>
					@php
					$date_appro= explode('-', $appro->date_appro);
					$date_appro= array_reverse($date_appro);
					$date_appro= implode('/', $date_appro);
					@endphp
					<p><b>DATE :</b> {{$date_appro}}</p>
			        </div>
				<div class="col-md-4">  
                    &nbsp;
		        </div>
		</div>
		</div>
     <center>
	    <br/>
        <table class="rpp" border='1' style="border-collapse: collapse;margin-left:25px;width:auto" cellspacing="3">
		<thead>
                      <tr>
                        <th style="width:55px;">N°</th>
                        <th style="width:105px;">EMBALLAGE</th>
						<th style="width:105px;">PRIX UNIT.</th>
                        <th style="width:105px;">QTE</th>
						<th style="width:205px;">MONTANT</th>
                      </tr>
                    </thead>
        <tbody>
			@foreach($ligne as $lignes)
           <tr>
		   <td align="center">{{$loop->iteration}}</td>
			<td width="200px" height="30px" align="center">
				{{DB::table('emballage')->where('id', $lignes->emballage_id)->first()->libelle}}
			</td>
			<td align="center">{{$lignes->pa}}</td>
			<td align="center">{{$lignes->qte}}</td>
			<td align="center">{{$lignes->montligne}} </td>
			</tr>
			@endforeach
			<tr>
				<td colspan="3"></td>
				<td height="25px">Total =</td>
				@php
			$lh = $appro->montant;
			$lh1 =  number_format($lh, 0, ' ', ' ');
			@endphp
				<td style="text-align:center;"> {{$lh1}} F</td>
			</tr>
		</tbody>
        </table>
		<p style="margin-left:430px;margin-top:90px;"><strong>Enregistrée par {{DB::table('users')->where('id',$appro->user_id)->first()->nom}},</strong><br/>
        Ce <?php echo date('d-m-Y');?>
        </p>
      </div>
        <footer style="position:fixed;bottom:0;text-align:center;">
        <p align="center"><strong>&copy; EasyShop Pro 2.0 2019-2020 </strong>  </p>
        </footer>
      </body>
     </html> 