Merge branch 'master' of bitbucket.org:code2lab/nemo_encoder

This commit is contained in:
nandar
2017-08-04 16:30:50 +06:30

View File

@@ -31,15 +31,20 @@ class BatchLineItem < ApplicationRecord
sufix_len=max_length-prefix.length
sufix_str="0" * sufix_len
value_len= max_value.to_s.length
start=0
ends=sufix_len-value_len-1
sufix_str= sufix_str[start..ends]
prefix=prefix[start..2]
prefix_len=prefix.to_s.length
client_len= client_id.to_s.length
ends= prefix_len -client_len -1
prefix=prefix[start..ends]
prefix_str=prefix.to_s + client_id.to_s
serial_no=prefix_str.to_s+sufix_str+max_value.to_s
return serial_no
end
end
def self.to_csv(client_id,location_code)