This commit is contained in:
Sunandar
2017-02-20 12:47:49 +06:30
parent febbeda4d6
commit 93085271a9
2 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -28,7 +28,7 @@
<img src="<%= asset_path( 'spinner.gif' ) %>" />
</div>
</div>
<div class="row content">
<div class="row content">
<div class="card">
<div class="card-header">
<strong>Batch Line Item List</strong>