<div class="row">
	<nav class="breadcrumb">
	  <a class="breadcrumb-item" href="<%= dashboard_path %>">Home</a>
	  <a class="breadcrumb-item active" href="<%= clients_path %>">Batches</a>
	  <a class="breadcrumb-item active" href="#">Show</a>
      <span style="float:right">
        <%= link_to 'Generate QR Code', generate_cards_path(@batch.id),:class => 'btn btn-primary' %> 
      </span> 

	</nav>
</div>

<div  class="row content">
	<div class="col-lg-6 show">
		<div class="row">
		  <div class="col-lg-4"><strong>Order Ref:</strong></div>
		  <div class="col-lg-8 uppercase"><%= @batch.order_ref %></div>
		</div>	 
		<div class="row">  
		  <div class="col-lg-4"><strong>Exported By:</strong></div>
		  <div class="col-lg-8"><%= @batch.exported_by %></div>
		</div>
		<div class="row">
		  <div class="col-lg-4"><strong>User Name:</strong></div>
		  <div class="col-lg-8"><%= @batch.user.name %></div>
		</div>
		<div class="row">
		  <div class="col-lg-4"><strong>Client:</strong></div>
		  <div class="col-lg-8"><%= @batch.client.name %></div>
		</div>	
		<div class="row">
		  <div class="col-lg-4"><strong>Date:</strong></div>
		  <div class="col-lg-8"><%= @batch.date.strftime("%e,%b %Y %I:%M %p") rescue ''  %></div>
		</div>		 	 		
	</div>
</div>
<div class="row">
	<div class="col-lg-8">
		<div class="col-lg-3"></div>
		<div class="col-lg-4 btn-show-action">
			<%= link_to 'Edit', edit_batch_path(@batch),:class => 'btn btn-primary' %> 
			<%= link_to 'Back', batches_path ,:class => 'btn btn-primary'%>
		</div>
	</div>
</div>

<div class="row content"> 
    <div class="card">     
    	<div class="card-header">              
            <strong>Batch Line Item List( <%= @result_count %> )</strong>                         
        </div>
        <div class="card-block">          
           <% flash.each do |key, value| %>   
              <% if key =='message'  %>       
               <div class="alert alert-danger center">
                <a class="close" data-dismiss="alert">×</a>
                <%= value %>    
              <% end %>      
              </div> 
          <% end %>
            <div id ="filterrific_results">
            <table class="table" style="border-top:none">
                <thead>
                  <tr>                 
                    <th>Serial No</th>        
                    <th>Asset Identity</th>
                    <th>Manufacture UID</th>
                    <th>Batch No</th>
                    <th>Asset Type</th>
                    <th>Barcode </th>
                    <th>Created At </th>    
                  </tr>
                </thead>
                <tbody>                 
                  <% @batchLineItems.each do |item| %>              
                    <tr>                       
                      <td><%= item.serial_no rescue '' %></td>     
                      <td><%= item.asset_identity rescue '' %></td>    
                      <td><%= item.manufacture_uid rescue '' %></td>   
                      <td><%= item.batch_name rescue '' %></td>  
                      <td><%= item.asset_type rescue '' %></td>           
                      <td><%= item.barcode rescue '' %></td>
                      <td><%= item.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>                          
                    </tr>
                  <% end %>
                </tbody>
            </table> 
            <%=paginate   @batchLineItems %>  
            <div>          

        </div>
    </div>