edit
This commit is contained in:
@@ -76,6 +76,9 @@ class BatchLineItemsController < ApplicationController
|
|||||||
product_category_id=params[:product_category]
|
product_category_id=params[:product_category]
|
||||||
find_client=Client.find_by_id(client_id)
|
find_client=Client.find_by_id(client_id)
|
||||||
location_code=find_client.location_code
|
location_code=find_client.location_code
|
||||||
|
client_name=find_client.name.downcase
|
||||||
|
find_product=ProductCategory.find_by_id(product_category_id)
|
||||||
|
product_name=find_product.name.downcase
|
||||||
|
|
||||||
find_user=User.find_by_id(user_id)
|
find_user=User.find_by_id(user_id)
|
||||||
if !find_user.nil?
|
if !find_user.nil?
|
||||||
@@ -103,10 +106,11 @@ class BatchLineItemsController < ApplicationController
|
|||||||
.select("*,product.product_type_id ,product.name,'' as secret_token,'' as location")
|
.select("*,product.product_type_id ,product.name,'' as secret_token,'' as location")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
datestr= Time.now.strftime("%Y/%m/%d %H:%M:%S")
|
||||||
|
filename=client_name.to_s+"_"+product_name.to_s+"_"+datestr
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.csv { send_data @batchLineItems.to_csv(client_id,location_code), filename: "encoder-#{Date.today}.csv" }
|
format.csv { send_data @batchLineItems.to_csv(client_id,location_code), filename: "#{filename}.csv" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user