<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</title>
		<style>
		table {
			border-collapse: collapse;
			
			
			
		}
		
		th, td {
			padding : 0.1em;
			background : #fff;
			border-bottom: 1px dashed #000;
		}
		.bloc1{
		display:inline-block;
		position:absolute;	
		margin-top:-37px;
		height:30px;
		margin-left:5px;
	}
	.bloc2{
		display:inline-block;
		position:relative;
		margin-left:50px;
		margin-top:2px;
		width:200px;
		padding-top: 20px;
		text-align:center;
	}
	.bloc{
		display:inline-block;
		position:absolute;
		width:450px;
		border-radius:10px;
		padding-left: 25px;
		height:100px;
		margin-left:20px;
		
	}
		
		</style>
    </head>
      <body style="font-family:'Montserrat';font-size:13px;" onload="window.print();">
	
	  <div class="bloc"> 
			<div class="bloc2">  			
				<p style="margin-left:-160px;margin-top:-55px;color:#000;font-size:12px;">
					ETS EDIH DEGBOEVI
					<span style="font-size:14px;"><b>ADDITION TABLE </b></span><br/>
					
				</p>
		    </div>
			
		    </div>
			
		<!--BLOC DU GERANT-->
		<div class="container">
		</div>
	    <br/>
	    <br/>
	    <br/>
        <table style="width:250px;margin-left:-20px;margin-top:50px">
		<thead>
		  <tr>
			<th style="width:10%;text-align:center">QTE</th>
			<th style="width:40%;">ARTICLE</th>
			<th style="width:30%;text-align:right">TOTAL</th>
			<th style="width:30%;text-align:right">BENEF</th>
		  </tr>
		</thead>
        <tbody style="height:500px;">
			@foreach($produit as $produits)
			@php
			$qte = DB::table('ligne_vente_client')->where('produit_id', $produits->id)->sum('qte');
			$mtl = $qte * $produits->prix_detail;
			$mtl = number_format($mtl, 0, ' ', ' ');
			$benef = DB::table('ligne_vente_client')->where('produit_id', $produits->id)->sum('benef');
			$total= DB::table('ligne_vente_client')->sum('montligne');
			$totalbenef= DB::table('ligne_vente_client')->sum('benef');
			@endphp
           <tr>
			   <td align="center">&nbsp;&nbsp; {{$qte}} </td>
			   <td height="20px" align="center">{{$produits->designation}}</td>
			   <td align="right">&nbsp;&nbsp; {{$mtl}} </td>
			   <td align="right">&nbsp;&nbsp; {{number_format($benef, 0, ' ', ' ')}} </td>
		   </tr>
			@endforeach
		</tbody>
		<tfoot>
		  <tr>
			   <td align="center">&nbsp;&nbsp; Total vente </td>
			   <td height="20px" align="center">  {{number_format($total, 0, ' ', ' ')}}</td>
			   <td align="right">&nbsp;&nbsp; Total bénéf</td>
			   <td align="right">&nbsp;&nbsp; {{number_format($totalbenef, 0, ' ', ' ')}} </td>
		   </tr>  
		</tfoot>
        </table>
		
	
      </div>
        <footer style="position:fixed;bottom:30px;text-align:center;font-size:14px">
        <p align="center"></p>
	
        </footer>
      </body>
     </html> 