@extends('layouts.appadmin')

@section('content')
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">

        

            <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
          <h1 class="font-weight-bold">Factures de vente ({{$ventes->count()}})</h3>
          </div><!-- /.col -->
          <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <a href="{{asset('vente')}}" class="btn btn-info">+facture</a>
            </ol>
         </div>  </div>  </div>
     

    <section class="content">
      <div class="row">
        <div class="col-12">
          <div class="card">
          <div class="card-header  bg-info">
          <div class="col-md-6 font-weight-bold"><i class="fas  fa fa-users"></i> 
          vous avez .....
      </div> 
      </div> 


 





            <!-- /.card-header -->
            <div class="card-body">
              <table id="example1" class="table table-bordered table-striped text-center">
                <thead>
                <tr>
                  <th>Ref facture</th>
                  <th>client</th>
                  <th>date</th>
                  <th>Mode réglement</th>
                  <th>Total TTC</th>
                  <th>Etat</th>
                  <th>Echeance</th>
                  <th width="100">action</th>
             
                </tr>
                </thead>
                <tbody>
                    @foreach($ventes as $vente)
                    <tr>
                      <td>{{$vente->id}} </td>

             <td class="text-primary font-weight-bold"> <a href="">{{$vente->client->nom}}</a>   </td> 
             <td>{{date('d-m-Y', strtotime($vente->createf_at))}}  </td> 
                <td> {{$vente->modepayement->mode}} </td> 
              <td class="text-success font-weight-bold"> {{$vente->prixtotal}} DH</td> 
             <td> {{$vente->encour->etat}} </td> 
             <td> {{$vente->dateecheance}} </td> 
            
             <td>
              

             </td>
            </tr>
             @endforeach
          </tbody>
        </table>



                </div>  </div>
    </div>
  
  </div>

                </section>
    </div>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->
  
        @endsection

        <script src="{{asset('dash/plugins/jquery/jquery.min.js')}}"></script>







<script>
$(document).ready( function () {
    $('#example1').DataTable();
} );
</script>
</body>
</html>