@extends('layout')
@section('title','Détails approvisionnement emballage')
@section('content')


<div class="section-header">
            <h1>Détails approvisionnement emballage</h1>
            <div class="section-header-breadcrumb">
              <div class="breadcrumb-item active"><a href="#">Détails approvisionnement emballage</a></div>
              <div class="breadcrumb-item"><a href="#">Détails</a></div>
            </div>
          </div>
        
		  
		  
		  <div class="section-body">
            <div class="row">
              <div class="col-12">
                <div class="card">
                  <div class="card-header">
                    <h4>Détails</h4>
                  </div>
                  <div class="card-body">
                    <div class="table-responsive">
                      <table class="table table-striped" id="table-1">
                        <thead>
                          <tr>
                            <th class="text-center"> N° </th>
                            <th class="text-center">Emballage</th>
                            <th class="text-center">Nbre en coli/carton</th>
                            <th class="text-center">Qté approv.</th>
                            <th class="text-center">Qté total approv.</th>
							 <th class="text-center">Prix unitaire</th>
							  <th class="text-center">Montant total </th>
                   
                          </tr>
                        </thead>
                        <tbody>
						 @foreach($detail as $details)
						 @php
						 $qte = $details->qte / DB::table('emballage')->where('id', $details->emballage_id)->first()->nbreencarton;
						 @endphp
                          <tr>
                            <td class="text-center">{{$loop->iteration}}</td>
                            <td class="text-center"> {{ DB::table('emballage')->where('id', $details->emballage_id)->first()->designation }}</td>
                            <td class="text-center"> {{ DB::table('emballage')->where('id', $details->emballage_id)->first()->nbreencarton }}</td>
							 
                            <td class="text-center"> {{$qte}}</td>
                            <td style="color:red;text-align:center"> {{$details->qte}}</td>
							 @php
                            	
								$mtl = $details->montligne;
                                $mtl1 =  number_format($mtl, 0, ' ', ' ');
								
								$mp = $details->pa;
                                $mp1 =  number_format($mp, 0, ' ', ' ');
								
                              @endphp
							 <td class="text-center"> {{$mp1}} FCFA</td>
							  <td class="text-center"> {{$mtl1}} FCFA</td>
                          </tr>
                      @endforeach
                        </tbody>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
           
           
          </div>
		  
		  
	   @push('scripts') 
	   
	  
@endpush

@endsection