diff --git a/app/controllers/batch_line_items_controller.rb b/app/controllers/batch_line_items_controller.rb
index da0a025..9454cd2 100644
--- a/app/controllers/batch_line_items_controller.rb
+++ b/app/controllers/batch_line_items_controller.rb
@@ -76,6 +76,9 @@ class BatchLineItemsController < ApplicationController
product_category_id=params[:product_category]
find_client=Client.find_by_id(client_id)
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)
if !find_user.nil?
@@ -103,10 +106,11 @@ class BatchLineItemsController < ApplicationController
.select("*,product.product_type_id ,product.name,'' as secret_token,'' as location")
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|
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
\ No newline at end of file
diff --git a/app/views/batch_line_items/index.html.erb b/app/views/batch_line_items/index.html.erb
index 725f2d3..745d7c4 100644
--- a/app/views/batch_line_items/index.html.erb
+++ b/app/views/batch_line_items/index.html.erb
@@ -28,7 +28,7 @@
-