edit export csv

This commit is contained in:
Sunandar
2017-01-25 17:35:30 +06:30
parent 0c4f797551
commit 3f35298e96
5 changed files with 18 additions and 11 deletions

View File

@@ -6,9 +6,10 @@ class BatchLineItemsController < ApplicationController
@batches=Batch.all
@batchLineItems=BatchLineItem.joins('inner join batches on batches.id=batch_line_items.batch_id').select('batch_line_items.*,batches.order_ref as batch_name').page(params[:page]).per(2)
end
def create
def export
batch_list=params[:batch]
if ! batch_list.nil?
user_id=current_member.user_id
if !batch_list.nil?
batch_list.each do |batch|
find_batch=Batch.find_by_id(batch)
if !find_batch.nil?
@@ -18,8 +19,7 @@ class BatchLineItemsController < ApplicationController
end
end
@batchLineItems = BatchLineItem.where('batch_id in (?) ',batch_list).select('*')
else
user_id=current_member.user_id
else
batches=Batch.all
batches.each do |batch|
export_count=batch.export_count