show location code in client list
This commit is contained in:
@@ -10,7 +10,7 @@ class BatchLineItemsController < ApplicationController
|
||||
@clients=Client.all.order('id desc')
|
||||
@product_categories=ProductCategory.all.order('id desc')
|
||||
|
||||
find_client=Client.select(:id).order('id desc').first
|
||||
find_client=Client.select(:id).order('id desc').last
|
||||
if !find_client.nil?
|
||||
client_id=find_client.id
|
||||
|
||||
@@ -18,7 +18,7 @@ class BatchLineItemsController < ApplicationController
|
||||
if !find_batch.nil?
|
||||
@product_category_id=find_batch.product_category_id
|
||||
end
|
||||
sub_query="(select * from batches where client_id="+client_id.to_s+" and product_category_id ="+@product_category_id.to_s+" )"
|
||||
sub_query="(select * from batches where client_id="+client_id.to_s+" and product_category_id ="+@product_category_id.to_s+" )"
|
||||
@batchLineItems=BatchLineItem.joins('inner join '+sub_query+' as batches on batches.id=batch_line_items.batch_id')
|
||||
.select('batch_line_items.*,batches.order_ref as batch_name').order('batch_line_items.id desc').page(params[:page]).per(10)
|
||||
else
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Address</th>
|
||||
<th>Address</th>
|
||||
<th>Location Code</th>
|
||||
<th>Created At </th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
@@ -32,7 +33,8 @@
|
||||
<td><%= client.name rescue '' %></td>
|
||||
<td><%= client.email rescue '' %></td>
|
||||
<td><%= client.phone rescue '' %></td>
|
||||
<td><%= client.address rescue '' %></td>
|
||||
<td><%= client.address rescue '' %></td>
|
||||
<td><%= client.location_code rescue '' %></td>
|
||||
<td><%= client.created_at.strftime("%e,%b %Y %I:%M %p") rescue '' %></td>
|
||||
<td>
|
||||
<%= link_to 'Detail',
|
||||
|
||||
Reference in New Issue
Block a user