Untitled
unknown
plain_text
a year ago
596 B
10
Indexable
def test(wsn_id)
create_display_id(wsn_id)
end
def create_display_id(wsn_id, prefix = nil, _suffix = nil)
str = wsn_id.to_s.rjust(10, '0')
# WSN Generation Logic WMS = "_" (underscore) and FBE = "-" hyphen
display_id = ((str.to_i)/26).to_s(36).upcase.rjust(6, '0') + "#{WarehouseService.settings.wsn_delimiter}" +('A'..'Z').to_a[(str.to_i)%26]
update_wsn_display(wsn_id, display_id)
end
def update_wsn_display(wsn_id, display_id)
query = "UPDATE wh_serial_numbers SET display_id = '#{display_id}' where id = #{wsn_id}"
sql_stream.execute_by_sql(query)
endEditor is loading...
Leave a Comment