@extends('layouts.master')

@section('content')



<section class="invoice" style="border: 0px solid #f4f4f4;" >
      <!-- title row -->

     


       
     

       

      <!-- Table row -->
      <div class="row">
        <div class="col-xs-12 table-responsive">
          <table class="table table-striped">
            <thead>
            <tr>
                  <th> تاريخ و سـاعـة الـوصـول</th>
                  
                  
                  <th >المـورد</th>
                  <th >الـصنـف</th>
                  <th >الـكـمـيـة / كـجـم</th>
                  <th >الـكـمـيـة / عـدد</th>
                  <th >سـعـر الـوحـدة</th>
                  <th >الأجـمالـي</th>
            <th>Action</th>
            </tr>
            </thead>
            <tbody>
             
             
            @foreach( $mains as  $key=>$main )

                 
                 <tr>
                 
                   <td>{{ $main->created_at}} </td>
                   <td > {{ $main->supplier->name}} </td>
                  <td > {{ $main->waste->name }}</td>
                   
                   @if ( $main->waste->unit == "كجم")
                   <td > {{ $main->quantity }}  </td>
                   @else
                   <td > </td>
                   @endif
                   @if ( $main->waste->unit == "عدد")
                   <td > {{ $main->quantity }}  </td>
                   @else
                   <td > </td>
                   @endif
 
                   <td >{{$main->price ? $main->price : ''}} </td>
                 <td  >{{$main->price ? $main->price * $main->quantity: ''}} </td>
<td><a href='{{url("/main/edit/$main->id")}}' target="_blank"  > <i class='fa fa-edit' style="font-size:16px;color:red"></i> </a></td>
                   
                 </tr>
                 @endforeach



                  
            </tbody>

            <tfoot>
              <tr>
              
              <td>  <div style="text-align:center;font-weight:bold;color: #000;padding: 10px;border: solid 3px green;">
                    عدد الكارتات :
                  <span style="font-size:18px;font-weight:bold"> {{count($mains)}} <span>
                </div> </td>
              <td>  </td>
                <td style="font-weight: bold;font-size: 20px;">  الأجـمـالـي</td>
                <td style="font-weight: bold;font-size: 20px;"> {{$sum_kg}}   كـجـم</td>
                <td style="font-weight: bold;font-size: 20px;"> {{$sum_num}}    عدد </td>
                <td>  </td> 
                <td style="font-weight: bold;font-size: 20px;" > {{$total_price}} جـ </td>
              </tr>
            </div>

          </table>
        </tfoot>
        <!-- /.col -->
      </div>
       
    



 
 



      
</section>




@endsection
