<!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')}}">

  <link rel="stylesheet" href="{{asset('css/app.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>
<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;
    }

    .table-condensed > tbody > tr > td {
      border :none;
    }

  </style>
  
<style>
.page-break {
    page-break-after: always;
}
</style>
<body >
<!-- <div class="hidden-print text-center" style="float:left; margin:20px" >
        <a  class="btn btn-danger" href="{{URL::previous()}}">Back</a>
    </div> -->
  <!-- Main content -->
   <section class="invoice">
      <!-- title row -->
      <div class="row">
        <div class="col-xs-12">
          <div class="box-header with-border">
            <div class="pull-center">
              <!-- <address style="text-align: right">
                <h3><b>{{$mr}}</b></h3>
                <pre style="border: none;background: transparent;">{{$mr}}</pre>
              </address> -->
              <address style="text-align: center;display:none;">
                <h3><b></b></h3>
                <pre style="border: none;background: transparent;">{{$mr->entered->location->address_one ?? ''}}<br>{{$mr->entered->location->address_two ?? ''}}<br>Mob No: {{$mr->entered->location->phone_no ?? ''}} </pre>
              </address>
              <address style="text-align: center">SALES ORDER</address>
            </div>
          </div>
        </div>
        <!-- /.col -->
      </div>

      <!-- info row -->
      <div class="row invoice-info">          
          <div class="col-sm-4 invoice-col pull-right">
            <table class="table" style="text-align: right;">
              <tr>
            {!!DNS1D::getBarcodeSVG($mr->request_no, 'C39')!!}
         <!--  </div> -->
                <td style="border: none; font-family:times New Roman;"><b>MR NO:</td>
                <td style="border: none;"><b style="font-family:times New Roman; ">{{$mr->prefix ?? 0}}{{$mr->request_no ?? 0}}</td>
              </tr>
              <tr>
                <td style="border: none; font-family:times New Roman;"><b>Date</td>
                <td style="border: none;"><b style="font-family:times New Roman; ">{{date('d-m-Y',strtotime($mr->request_date))}}</td>
              </tr>
            </table>
            <input type="hidden" name="mr_id" id="mr_id" value="{{$mr->id}}">
        </div>

        <div class="box-header">
          <div class="col-xs-6">
            <table class="table table-bordered">
              <tr>
                <td>
                  <b style="font-family:times New Roman; ">{{$mr->customer->name}}</b>
                    <address style="text-align: left;margin-left: -8px;;margin-bottom: -7px;">
                    <pre style="border: none;background: transparent;"><b>{{$mr->parent->name}}, {{$mr->customer->address}}</b></pre>
                  </address> 
                  <br>
                  
                   
                   <!-- <b style="font-family:times New Roman; ">{{$mr->entered->location->company_name ?? ''}}</b><br>

                   <b style="font-family:times New Roman; ">{{$mr->entered->location->address_one ?? ''}}</b><br>
                   <b style="font-family:times New Roman; ">{{$mr->entered->location->address_two ?? ''}}</b><br>-->

                  <b style="font-family:times New Roman; "> Mob No: {{$mr->customer->mobileno ?? ''}}</b><br>

                  <b style="font-family:times New Roman; "> Veicle No: {{$mr->customer_vehicleno}}</b><br>
                  <b style="font-family:times New Roman; "> Salesman: {{$mr->entered->name}}</b>
                </td>
              </tr>
            </table>
          </div>
      

          <div class="col-xs-12 table-responsive">
            <table class="table table-bordered table-striped">
              <thead>
                <tr style="background: #bebdbf;">
                  <th style="text-align: center">Sl No.</th>
                  <th style="text-align: center">Product Name</th>
                  <th style="text-align: center">Packing</th>
                  <th style="text-align: center">Unit</th>
                  <th style="text-align: center">Qty</th>
                  <th style="text-align: center">Unit Price</th>
                </tr>
              </thead>
              <tbody>
                <?php $c=1;$tot=0;$wgt=0;?>
                @foreach($products as $prd)
                <tr>
                  <td style="text-align: center"><b style="font-family:times New Roman; ">{{$c++}}</td>
                  <td><b>{{$prd->product['name']}} @if($prd->remarks != null) ({{$prd->remarks}}) @endif</td>
                  <td  style="text-align: center"><b >{{$prd->grade['grade']}}</b></td>
                  <td style="text-align: center"><b>{{$prd->unit['unit']}}</td>
                  <td style="text-align: center"><b style="font-family:times New Roman; ">{{$prd->qty}}</td>
                  <td style="text-align: center"><b style="font-family:times New Roman; ">{{($prd->price > 0)? $prd->price : ''}}</td>
                </tr>
                @endforeach
                <tr>
                  <th colspan="3" style="text-align: right;"></th>
                  <th></th>
                  <th colspan="1" style="text-align: right;">Total:</th>
                  <th><b style="font-family:times New Roman; "></th>
                </tr>
              </tbody>
            </table>
          </div>

        </div>

       <!--  <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 style="font-size: 13px;margin-left: -10px;"><b><u>Export Queries/Documents Required</u></b></h3>
            </div>
            <table class="table">
              <tr>
                <td class="col-xs-6" style="border: none;"><i class="fa fa-fw fa-square-o"></i>Packing List</td>
                 <td class="col-xs-6" style="border: none;"><i class="fa fa-fw fa-square-o"></i>Phytosanitary Certificate</td>
              </tr>
              <tr>
                <td class="col-xs-6" style="border: none;"><i class="fa fa-fw fa-square-o"></i>Certificate of Orgin(1) original & (2) copies duly stamped by chamber of commerce</td>
                <td class="col-xs-6" style="border: none;"><i class="fa fa-fw fa-square-o"></i>Commercial invoice in atleast (1) original copy</td>
              </tr>
               <tr>
                <td class="col-xs-6" style="border: none;"><i class="fa fa-fw fa-square-o"></i>AWB</td>
                 <td class="col-xs-6" style="border: none;"></td>
              </tr>
            </table>
          </div>
        </div> -->

        <div class="box-header">
         <!--  <div class="col-xs-6">
              <h5>PAYMENT MODE: {{$mr}}</h5>
              <h5>SHIPPING TERMS: PO VALID FOR 10 DAYS</h5>
              <h5>INCASE OF DAMAGES THE SAME SHALL BE INFORMED IN 24 HOURS FROM THE SHIPMENT ARRIVED AT OUR STORE</h5>
            
                <h3 style="font-size: 13px;margin-left: -10px;"><b><u>SHIPPING INSTRUCTIONS</u></b></h3>
                <h5>CIF MUSCAT</h5>
          </div> -->
         <!--  <div class="col-xs-6">
            <table class="table table-bordered">
              <thead>
                <tr>
                  <th>Prepared by</th>
                  <th>Reviewed By</th>
                  <th>Approved By</th>
                </tr> 
              </thead>
              <tbody>
                <tr>
                  <td><textarea class="form-control" style="border: none;" cols="7" rows="4"></textarea></td>
                  <td></td>
                  <td></td>
                </tr> 
              </tbody>
                 
            </table>
          </div> -->

          

        </div>

      </div>







<div class="page-break">
</div>

     <!--  <div style="text-align: center;"><i>--This Is a system generated report--</i></div> -->

      <!-- this row will not appear when printing -->
    <div class="row no-print" >
        <div class="col-xs-12">
          @if($mr->print == 1) 
          <a  target="_blank"  class="btn btn-default pull-right" id="print" onclick="window.print();" style="background: green;color: white"><i class="fa fa-print" style="color: white"></i> Print</a>
          @else
          <a  target="_blank"  class="btn btn-default pull-right" id="print" onclick="window.print();" style="background: blue;color: white"><i class="fa fa-print" style="color: white"></i> Print</a>

           @endif 
        </div>
      </div>
    </section>
    <!-- /.content -->
  <!-- /.content -->

  <script src="{{asset('lte/bower_components/jquery/dist/jquery.min.js')}}"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="{{asset('lte/bower_components/jquery-ui/jquery-ui.min.js')}}"></script>
  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <!-- Bootstrap 3.3.7 -->
  <script src="{{asset('lte/bower_components/bootstrap/dist/js/bootstrap.min.js')}}"></script>
  
  <!-- Sparkline -->
  <script src="{{asset('lte/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js')}}"></script>
  
  <!-- Bootstrap WYSIHTML5 -->
  <script src="{{asset('lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js')}}"></script>
  <!-- Slimscroll -->
  <script src="{{asset('lte/bower_components/jquery-slimscroll/jquery.slimscroll.min.js')}}"></script>
  <!-- FastClick -->
  <script src="{{asset('lte/bower_components/fastclick/lib/fastclick.js')}}"></script>
  <!-- AdminLTE App -->
  <script src="{{asset('lte/dist/js/adminlte.min.js')}}"></script>
  
  <!-- AdminLTE for demo purposes -->
  <script src="{{asset('lte/dist/js/demo.js')}}"></script>

  <!--DataTables-->
<script src="{{asset('lte/bower_components/datatables.net/js/jquery.dataTables.min.js')}}"></script>
<script src="{{asset('lte/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js')}}"></script>
  
  <script>
 

  $(document).ready(function(){
    $("#print").click(function() {

      var mr_id = $("#mr_id").val();
      $.get("{{url('credit/sale/print')}}", {option: mr_id}, function(mode_data){
         
        });
    });
});
    
    
</script>
</body>
</html>
