<!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">
  <style type="text/css">
    .table > thead > tr > th,
    .table > tbody > tr > th,
    .table > tfoot > tr > th,
    .table > thead > tr > td,
    .table > tbody > tr > td,
    .table > tfoot > tr > td {
      padding: 1px;
      line-height: 1.42857143;
      vertical-align: top;
      border-top: 1px solid #ddd;
    }

    .table > thead > tr > th {
      vertical-align: bottom;
      border-bottom: 2px solid #ddd;
    }

    body {
      font-size: 14px;
    }

    @media print {
      @page {
        margin: 0;
        size: a5;
        font-size: 14px;
      }
      .invoice {
        position: absolute;
        top: 0;
        right: 0;
      }
      .page-header {
        margin-left: 2%;
      }
      .pull-right {
        margin-right: 10%;
      }
      .invoice-info {
        margin-left: 2%;
        font-size: 12px;
      }
      .table-responsive {
        margin-left: 2%;
        font-size: 10px;
      }
    }

  </style>
</head>
<body >
<div class="hidden-print text-center" style="float:left; margin:20px" >
  <a  class="btn btn-danger" href="{{route('mr.customerwise.report.index')}}">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> MR Customer Wise Report
        <small class="pull-right">Request Date: {{date('d-m-Y',strtotime($request->request_date))}}</small>
      </h2>
    </div>
    <!-- /.col -->
  </div>

  <div class="row invoice-info">
    <div class="col-sm-5 invoice-col">
     <strong> Customer Name  :  </strong> {{$request->customer->name ?? $request->customer_name}}, {{$request->parent->name}}<br>
      
    </div>
    <!-- /.col -->
    <div class="col-sm-4 invoice-col">
       <strong> MR No. : </strong> {{$request->prefix}} {{$request->request_no}} 
    </div>

    @if($categories != NULL)
    <div class="col-sm-3 invoice-col">
       <strong> Category : </strong> @foreach($categories as $cat){{$cat}}, @endforeach
    </div>
    @endif
   
  </div><br>
  <!-- /.row -->


  <!-- Table row -->
  <div class="row" style="page-break-after: always;">
    <div class="col-xs-12 table-responsive">
      <table class="table table-bordered table-striped" style="font-size: 12px;">
        <thead>
        <tr><th colspan="7">{{$req->customer ?? $request->customer_name}}</th></tr>
        <tr>
          <th>Sl No.</th>
          <th>Product</th>
          <th>Packing</th>
          <th>Unit</th>
          <th>Price</th>
          @if($status == 'REQ')
          <th>Quantity</th>
          @else
          
          <th>Qty</th>
          @endif
        </tr>
        </thead>
        <tbody>
        <?php $c = 1; ?>
        @if($products != NULL)
        @foreach($products as $prod)
        <tr>
          <td>{{$c++}}</td>
          <td>{{$prod->product}}</td>
          <td>{{$prod->grade}}</td>
          <td>{{$prod->unit}}</td>
          <td></td>
          @if($status == 'REQ')
          <td>{{$prod->qty}}</td>
          @else
          
          <td>{{$prod->apr}}</td>
          @endif
        </tr>
        @endforeach
        @endif
        </tbody>
      </table>
    </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 -->

<!-- ./wrapper -->
</body>
</html>
