edit batch line registe

This commit is contained in:
Sunandar
2017-01-31 13:43:02 +06:30
parent 58dcf588df
commit 1d96d2bb31

View File

@@ -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')