diff --git a/app/controllers/api/batch_line_items_controller.rb b/app/controllers/api/batch_line_items_controller.rb index eface47..6fb9c80 100644 --- a/app/controllers/api/batch_line_items_controller.rb +++ b/app/controllers/api/batch_line_items_controller.rb @@ -4,7 +4,7 @@ class Api::BatchLineItemsController < ApplicationController batch_id=params[:batch_id] session_token=params[:session_token] manufacture_uid = params[:card_manufacture] - card_type = params[:card_type] + # card_type = params[:card_type] user_id="" check_member= Member.authenticate_session_token(session_token) @@ -25,14 +25,18 @@ class Api::BatchLineItemsController < ApplicationController wristband_code=hex_str[0..15] check_manufacture = BatchLineItem.find_by_manufacture_uid_and_wristband_code(manufacture_uid,wristband_code) - if check_manufacture.nil? - + if check_manufacture.nil? + card_type="" + find_batch= Batch.find_by_id(batch_id) + if !find_batch.nil? + card_type=find_batch.adult_or_child.upcase + end batchLineItem=BatchLineItem.new batchLineItem.wristband_code=wristband_code batchLineItem.serial_no=serial_no batchLineItem.batch_id=batch_id batchLineItem.manufacture_uid = manufacture_uid - batchLineItem.card_type = card_type.upcase + batchLineItem.card_type = card_type if batchLineItem.save lookup=Lookup.find_by_name('generate_serial_no')