<html>
<head>
<style>
body{font-family:sans-serif,arial;font-size:10pt}
table{border-collapse:collapse;/*page-break-inside: avoid;*/}
div.table{page-break-inside: avoid;}
th,td{border:solid gray 1px;padding:5pt;vertical-align:top}
.nopagebreakinside{page-break-inside: avoid;}
div.page_break + div.page_break{
  page-break-before: always;
}
.cond8pt{font-size:9pt;}
.table-noborder{border:0}
.table-noborder>td{border:0;text-align:left;}
.table-border td{border:solid #666 1px}
/*.table-noborder td{border:solid #999 1px}*/
table{border-color:#666}
table td{border-color:#666}
table.2col50 td,table.2col50 th{width:50%}
table.3col33 td,table.3col33 th{width:33.33333%}
footer { position: fixed; bottom: -60px; left: 0px; right: 0px; font-size:9pt;text-align:center; height: 50px; }

</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
	<td style="border:0"><p style="margin:0;font-size:28pt;font-weight:bold;color:#999">{{$demande->intervention->user->fullname}}</p>
	</td>
	 <td width="" style="border:0"><p style="margin-top:0;font-size:16pt;text-align:right"><strong> </strong></p>
    <p style="text-align:right"><strong>Date</strong> : 
    {{ \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $demande->date_facture,'UTC')->timezone('America/Martinique')->isoFormat('L') }}
    </p>
    </td>
	</tr>
	<tr class="table-noborder"><td>Emetteur</td><td>Adressé à :</td></tr>
  	<tr>
    <td width="" style="border:solid #ddd 1px;margin-right:10pt;background:#dedede">
    <p style="margin:0">{{$demande->intervention->user->raison_sociale}}<br/>{{$demande->intervention->user->fullname}}<br/>
    Siret : {{$demande->intervention->user->siret}}</p>
    </td>
    <td width="" style="border:solid #ddd 1px">
     <p style="margin:0">{{$societe->raison_sociale}}<br/>{{$societe->adresse}}<br/>{{$societe->code_postal}} {{$societe->commune}}<br/>
    Siret : {{$societe->siret}}</p>
    </td>
  </tr>
</table>
<p>Agissant pour le compte de : {{$demande->nomcomplet_client}} - {{($demande->adressecomplete_client)}}
    @if ($demande->siret_client)
    <br/> - siret : {{$demande->siret_client}}
    @endif</p>
<table width="100%" style="margin-top:20pt;" border="1">
	<thead style="background:#ededed">
	<tr>
	<th>Désignation</th>
	<th style="text-align:right">puht</th>
	<th style="text-align:right">txTVA</th>
	<th style="text-align:right">TVA</th>
	<th style="text-align:right">montant TTC</th>
	
	</tr>
	</thead>
<tbody>
  <tr>
		<td class="text-left">{!!nl2br($demande->intervention->descriptif)!!}</td>
		<td style="text-align:right">{{number_format($montant_prestation_ht,2,","," ")}}</td>
		<td style="text-align:right">{{number_format($societe->tva_travaux->taux,2,',',' ')}}%</td>
		<td style="text-align:right">{{number_format($montant_tva,2,',',' ')}}</td>
		<td style="text-align:right">{{number_format($demande->intervention->montant_prestation_ht + $societe->tva_travaux->taux * $demande->intervention->montant_prestation_ht/100,2,',',' ')}}</td>
	</tr>

</tbody>
</table>
<table width="100%" cellspacing="0" cellpadding="0" cellspacing="0" style="padding:0;margin:0;cell-padding:0;cell-spacing:0" >
	<tr>
		<td class="table-noborder"><h3>Conditions de règlement</h3><p>{{$demande->pcent_acompte}} % à la commande<br/>
		Solde à la réception des travaux</p>
		
		</td>
		<td class="table-noborder" style="padding:0;margin:0;">
        <h3 style="text-align:right;margin-bottom:6pt">Totaux</h3>
        <table width="100%" class="2col50">
        <tr>
        <td>Total HT</td>
        <td style="text-align:right;">{{number_format($montant_prestation_ht,2,","," ")}}</td>
        </tr>
        </table>
        <div class="nopagebreakinside">
            <table width="100%" class="2col50">
            <tr>
            <td>TVA taux {{number_format($societe->tva_travaux->taux,2,","," ")}}%</td>
            <td style="text-align:right;">{{number_format($montant_tva,2,","," ")}}</td>
            </tr>
           </table>
        </div>
        <table width="100%" class="2col50">
        <tr>
        <td><strong>Total TTC</strong></td>
        <td style="text-align:right;">{{number_format($montant_prestation_ttc,2,","," ")}}</td>
        </tr>
        </table>
        </td>
    </tr>

</table>
<footer>{{$demande->intervention->user->fullname}}</footer>
</body>
</html>
