<html>
    <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link id="bs-css" href="css/bootstrap-cerulean.min.css" rel="stylesheet">
	<link href="css/charisma-app.css" rel="stylesheet">
    <link href='bower_components/fullcalendar/dist/fullcalendar.css' rel='stylesheet'>
    <link href='bower_components/fullcalendar/dist/fullcalendar.print.css' rel='stylesheet' media='print'>
    <link href='bower_components/chosen/chosen.min.css' rel='stylesheet'>
    <link href='bower_components/colorbox/example3/colorbox.css' rel='stylesheet'>
    <link href='bower_components/responsive-tables/responsive-tables.css' rel='stylesheet'>
    <link href='bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css' rel='stylesheet'>
    <link href='css/jquery.noty.css' rel='stylesheet'>
    <link href='css/noty_theme_default.css' rel='stylesheet'>
    <link href='css/elfinder.min.css' rel='stylesheet'>
    <link href='css/elfinder.theme.css' rel='stylesheet'>
    <link href='css/jquery.iphone.toggle.css' rel='stylesheet'>
    <link href='css/uploadify.css' rel='stylesheet'>
    <link href='css/animate.min.css' rel='stylesheet'>
        <title>Facture globale client</title>
    </head>
      <body style="font-family:'Montserrat';" onload="window.print();">
            <div class="container">
		   <div class="row">
		    <div class="col-md-12">  
                <center>
				<br/>				
				<img src="{{public_path('assets/img/logohopital.jpg')}}"/><br/><br/>
				<p><b>Ordre Hospitalier de St Jean de Dieu</b></p>
				<hr style="width:150px;" />
				<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>Client : {{DB::table('client_externe')->where('id', $vente->client_id)->first()->noms}}</b></p>
					<p><b>No FACTURE : {{$vente->numero}}</b></p>
					<p><b>DATE :</b> {{$vente->date}}</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:30px;">N°</th>
                        <th style="width:105px;">PRODUIT</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 width="30px" height="30px" align="center">{{$loop->iteration}}</td>
		   <td width="200px" height="30px" align="center">{{DB::table('produit_vendable_fini')->where('id', $lignes->produit_id)->first()->designation}}</td><td align="center">&nbsp;&nbsp; {{$lignes->pv}} </td><td align="center">&nbsp;&nbsp; {{$lignes->qte}} </td><td align="center">&nbsp;&nbsp; {{$lignes->montligne}} </td></tr>
			@endforeach
		</tbody>
        
        </table>
		
		@php 
			if ($vente->type_vente=="ORDINAIRE"){
					$subv = 0;
		
			} else {
				
				$subv = 0;
			}
		@endphp
        <p style="margin-top:10px;">
		@php
			$lh = $vente->montant;
			$lh1 =  number_format($lh, 0, ' ', ' ');
			$lh2 = $ligneM;
			$lh2 =  number_format($lh2, 0, ' ', ' ');
		@endphp
			<table border='1' style="border-collapse: collapse;margin-left:25px;width:450px;margin-left:470px;" cellspacing="3">
			<tr><td width="130px" height="25px">Total</td> =<td width="80px" style="text-align:center;"> {{$lh2}} F</td></tr>
			<tr><td width="130px" height="25px"><b>A payer</b></td> =<td width="80px" style="text-align:center;"> <b>{{$lh1}} F</b></td></tr>
			</table>
        </p>
		<p style="margin-left:430px;margin-top:90px;"><strong>Caissier 1,</strong><br/>
        Ce <?php echo date('d-m-Y');?>
        </p>
      </div>
        <footer style="position:fixed;bottom:0;text-align:center;">
        <p align="center"><strong><font color="#dc2a26">&copy; Ordre Hospitalier de St Jean de Dieu 2019-2020</font> </strong>  </p>
        </footer>
      </body>
     </html> 