<!DOCTYPE html>
<html >
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>SUHOL</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="{{asset('lte/bower_components/bootstrap/dist/css/bootstrap.min.css')}}">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="{{asset('lte/bower_components/font-awesome/css/font-awesome.min.css')}}">
  <!-- Ionicons -->
  <link rel="stylesheet" href="{{asset('lte/bower_components/Ionicons/css/ionicons.min.css')}}">
  <!-- Theme style -->
  <link rel="stylesheet" href="{{asset('lte/dist/css/AdminLTE.min.css')}}">

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->

  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body >
<div class="hidden-print text-center" style="float:left; margin:20px" >
        <a  class="btn btn-danger" href="{{URL::previous()}}">Back</a>
    </div>
<br><br><br>
  <!-- Main content -->
   <section class="invoice">
      <!-- title row -->
      <div class="row">
        <div class="col-xs-12">
          <h2 class="page-header">
            <i class=""></i> Product Variation Report
            <small class="pull-right">Date: {{date('d-m-Y',strtotime($from))}} - {{date('d-m-Y',strtotime($to))}}</small>
          </h2>
        </div>
        <!-- /.col -->
      </div>
      <!-- info row -->
      @if(count($variationList) == 0)
      No data available
      @else
         
      @if($category != NULL)
      <div class="row invoice-info">
        <div class="col-sm-4 invoice-col">
         <u> <strong> Category   : @foreach($category as $cat){{$cat->category}}, @endforeach</strong></u> <br>
        </div>
        <!-- /.col -->
      </div><br>@endif
      <!-- /.row -->
      @if($tags != NULL)
      <strong> Tags : @foreach($tags as $tag) {{$tag->name}} @endforeach</strong><br><br>@endif
      
      @if($customer != NULL)
      <strong> Customer  : {{$customer}} </strong> <br><br>@endif
      <!-- Table row -->
      <div class="row" style="page-break-after: always;">
        <div class="col-xs-12 table-responsive">
          <table class="table table-bordered table-striped">
            <thead>
            <tr>
              <th>Sl No.</th>
              <th>MR No</th>
              @if($customer == NULL)
              <th>Customer</th>
              @endif
              <th>Product</th>
              <th>Request Date</th>
              <th>Request Qty</th>
              <th>Approved Qty</th>
              <th>Diffrence</th>
              <th>Status</th>
            </tr>
            </thead>
            <tbody>
            <?php $c = 1;  $qty = 0 ; $flag = 0; ?>
            @if($variationList != NULL)
            @foreach($variationList as $list)
            @if($list->reqQty != $list->aprQty)
            <tr>
              <td>{{$c++}}</td>
              <td>{{$list->request_no}}</td>
              @if($customer == NULL)
              <td>{{$list->cname}}</td>
              @endif
              <td>{{$list->pname}}</td>
              <td>{{date('d-m-Y', strtotime($list->request_date))}}</td>
              <td>{{$list->reqQty}}</td>
              <td>{{$list->aprQty}}</td>
              <td>{{$list->aprQty - $list->reqQty}}</td>
              <td>@if($list->status == 'REQ')
                      PENDING
                    @elseif($list->status == 'APR')
                      APPROVED
                    @elseif($list->status == 'REC')
                      RECEIVED
                    @else
                    PURCHASE REQUEST
                    @endif      
                    </td>
            </tr>
            @endif
            @endforeach
            @endif
            </tbody>
            
          </table>
          
        @endif
        </div>
        
        <!-- /.col -->
      </div>
      <!-- /.row -->

      

      <!-- this row will not appear when printing -->
      <div class="row no-print">
        <div class="col-xs-12">
          <a  target="_blank"  class="btn btn-default pull-right" onclick="window.print();"><i class="fa fa-print"></i> Print</a>
         
        </div>
      </div>
    </section>
    <!-- /.content -->
  <!-- /.content -->
</div>
<!-- ./wrapper -->
</body>
</html>
