edit ticket controller

This commit is contained in:
Sunandar
2017-02-03 13:46:59 +06:30
parent 721fd282ca
commit b4c9e8cc8e
8 changed files with 67 additions and 55 deletions

View File

@@ -6,7 +6,9 @@ class BatchLineItemsController < ApplicationController
user_id=current_member.user_id
@batches=Batch.where('user_id=?',user_id)
@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)
@batchLineItems=BatchLineItem.joins('inner join batches on batches.id=batch_line_items.batch_id')
.where('batches.user_id=?',user_id)
.select('batch_line_items.*,batches.order_ref as batch_name').page(params[:page]).per(2)
end
def export
batch_list=params[:batch]
@@ -30,7 +32,7 @@ class BatchLineItemsController < ApplicationController
end
@batchLineItems = BatchLineItem.all.select('serial_no,wristband_code,batch_id,manufacture_uid,card_type')
end
respond_to do |format|
format.html
format.csv { send_data @batchLineItems.to_csv(user_id), filename: "encoder-#{Date.today}.csv" }