<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> Proforma</title>
		<style>
		table {
			border-collapse: collapse;
			border-radius: 1em;
			overflow: hidden;
		}
		
		th, td {
			padding : 0.4em;
			background : #ddd;
			border-bottom: 2px solid white;
		}
		
		</style>
    </head>
      <body style="font-family:'Montserrat';font-size:15px;" onload="window.print();">
            <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-top:30px; border: 1px solid #004365;border-radius:10px;width:300px;">
				<p style="border-collapse: collapse;margin-left:20px;width:300px;line-height:2;margin-top:-2px;" cellspacing="3" >	
					@if ($devis->etat == "Validée")
				<b><font color="red">No FACTURE :</font> {{$devis->numero}}</b>
					@else
						<b>FACTURE : {{$devis->etat}}</b>
					@endif
					<br/>
					@php
					$date= explode('-', $devis->date);
					$date= array_reverse($date);
					$date= implode('/', $date);
					@endphp
					<b>DATE : {{$date}}</b>
			    </p>
			    </div>
				<div class="col-md-4" style="margin-left:400px;margin-top:-130px; border: 1px solid #004365;border-radius:10px;width:300px;">
				<p style="border-collapse: collapse;margin-left:10px;width:300px;line-height:2;margin-top:-2px;" cellspacing="3" >	
					<b>CLIENT :
					
					@if ($devis->nomcli == "")
					N/A
					@else
					{{ $devis->nomcli }}	
					@endif
					</b>
					<br/>
					<b>CONTACTS :
					
					{{ $devis->contact }}	
					</b>
			    </p>
			    </div>
		</div>
		</div>
	    <br/>
        <table>
		<thead>
                      <tr>
                        <th style="width:30px;">N°</th>
                        <th style="width:105px;">Désignation</th>
						<th style="width:105px;">P.U</th>
                        <th style="width:105px;">Qté</th>
						<th style="width:205px;">Montant</th>
                      </tr>
                    </thead>
        <tbody style="height:500px;">
			@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')->where('id', $lignes->produit_id)->first()->desi}}</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>
		
		
        <p style="margin-top:10px;">
		@php
			$lh = $devis->montant;
			$lh1 =  number_format($lh, 0, ' ', ' ');
			$lh2 = $ligneM;
			$rem =  number_format($devis->montant_remise, 0, ' ', ' ');
			$nc =  number_format($devis->net_com, 0, ' ', ' ');
			$lh2 =  number_format($lh2, 0, ' ', ' ');
			$ht = DB::table('devis')->where('id', $lignes->vente_id)->first()->montant_ht;
			$ht1 =  number_format($ht, 0, ' ', ' ');
			$ttc = DB::table('devis')->where('id', $lignes->vente_id)->first()->montant;
			$ttc1 =  number_format($ttc, 0, ' ', ' ');
			$taux = DB::table('devis')->where('id', $lignes->vente_id)->first()->total_taux;
			$taux1 =  number_format($taux, 0, ' ', ' ');
			
		@endphp
			<table border='1' style="border-collapse: collapse;margin-left:25px;width:550px;margin-left:400px;" cellspacing="3">
			
			</table>
			<table style="margin-left:25px;width:550px;margin-left:400px;" cellspacing="3">
			<tr><td width="200px" height="25px">Montant HT</td> =<td width="80px" style="text-align:center;"> {{$ht1}} F</td></tr>
			<tr><td width="200px" height="25px">Remise ({{$devis->remise}}%)</td> =<td width="80px" style="text-align:center;"> {{$rem}} F</td></tr>
			<tr><td width="200px" height="25px">Net Com </td> =<td width="80px" style="text-align:center;"> {{$nc}} F</td></tr>
			@foreach($lignetax as $lignetax)
			@php
			$mtl =  number_format($lignetax->montligne, 0, ' ', ' ');
			@endphp
			<tr><td width="200px" height="25px">Taux ({{$lignetax->taux}})</td> <td width="80px" style="text-align:center;"> {{$mtl}} F</td></tr>
			@endforeach
			<tr><td width="200px" height="25px"><b>Montant TTC</b></td> =<td width="80px" style="text-align:center;"> <b>{{$ttc1}} F</b></td></tr>
			<tr><td  style="text-align:center;" colspan="2" height="25px"> <b>{{$montant1}} francs</b></td></tr>
			</table>
			
        </p>
		<p style="margin-left:580px;margin-top:90px;"><strong>Servie par {{DB::table('users')->where('id', $devis->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> 