edit batch line registe
This commit is contained in:
@@ -4,7 +4,7 @@ class Api::BatchLineItemsController < ApplicationController
|
|||||||
batch_id=params[:batch_id]
|
batch_id=params[:batch_id]
|
||||||
session_token=params[:session_token]
|
session_token=params[:session_token]
|
||||||
manufacture_uid = params[:card_manufacture]
|
manufacture_uid = params[:card_manufacture]
|
||||||
card_type = params[:card_type]
|
# card_type = params[:card_type]
|
||||||
user_id=""
|
user_id=""
|
||||||
|
|
||||||
check_member= Member.authenticate_session_token(session_token)
|
check_member= Member.authenticate_session_token(session_token)
|
||||||
@@ -25,14 +25,18 @@ class Api::BatchLineItemsController < ApplicationController
|
|||||||
wristband_code=hex_str[0..15]
|
wristband_code=hex_str[0..15]
|
||||||
|
|
||||||
check_manufacture = BatchLineItem.find_by_manufacture_uid_and_wristband_code(manufacture_uid,wristband_code)
|
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=BatchLineItem.new
|
||||||
batchLineItem.wristband_code=wristband_code
|
batchLineItem.wristband_code=wristband_code
|
||||||
batchLineItem.serial_no=serial_no
|
batchLineItem.serial_no=serial_no
|
||||||
batchLineItem.batch_id=batch_id
|
batchLineItem.batch_id=batch_id
|
||||||
batchLineItem.manufacture_uid = manufacture_uid
|
batchLineItem.manufacture_uid = manufacture_uid
|
||||||
batchLineItem.card_type = card_type.upcase
|
batchLineItem.card_type = card_type
|
||||||
|
|
||||||
if batchLineItem.save
|
if batchLineItem.save
|
||||||
lookup=Lookup.find_by_name('generate_serial_no')
|
lookup=Lookup.find_by_name('generate_serial_no')
|
||||||
|
|||||||
Reference in New Issue
Block a user