edit export csv
This commit is contained in:
@@ -54,4 +54,4 @@ class Api::BatchLineItemsController < ApplicationController
|
||||
@out=false,'Sorry!Unauthorized user!'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -49,8 +49,12 @@ class Api::BatchesController < ApplicationController
|
||||
check_member= Member.authenticate_session_token(session_token)
|
||||
if !check_member.nil?
|
||||
batch=Batch.find_by_id(batch_id)
|
||||
batch_line_items=batch.batch_line_item.count
|
||||
@out=true,batch_line_items
|
||||
batch_line_count=0
|
||||
batch_line_items= BatchLineItem.limit(1)
|
||||
if !batch_line_items.empty?
|
||||
batch_line_count=batch.batch_line_item.count
|
||||
end
|
||||
@out=true,batch_line_count
|
||||
else
|
||||
@out = false, "Sorry!Unauthorized user!"
|
||||
end
|
||||
@@ -59,6 +63,7 @@ class Api::BatchesController < ApplicationController
|
||||
session_token=params[:session_token]
|
||||
created_by=params[:created_by]
|
||||
|
||||
|
||||
check_member= Member.authenticate_session_token(session_token)
|
||||
if !check_member.nil?
|
||||
if !created_by.nil?
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user