Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SanitizeAllSerials=
- fun()->
- {ok,InventoryLocations}=db_functions:get_all_data(inventory_location,record),
- lists:map(
- fun(InventoryLocation)->
- Barcode=erlang:binary_to_list(hd(erlang:element(3,InventoryLocation))),
- ReferenceId=element(2,InventoryLocation),
- InventoryLocation1=erlang:setelement(3,InventoryLocation,[re:replace(Barcode,"IMEI","",[{return,binary}])]),
- db_functions:db_create_or_update_term(inventory_location,ReferenceId,InventoryLocation1,[])
- end,InventoryLocations)
- end,
- FixAllEntries=
- fun()->
- {ok,InventoryLocations}=db_functions:get_all_data(inventory_location,record),
- lists:map(
- fun(InventoryLocation)->
- Metadata=inventory_location:get_metadata(InventoryLocation),
- ReferenceId=element(2,InventoryLocation),
- db_functions:db_create_or_update_term(inventory_location,ReferenceId,InventoryLocation,Metadata)
- end,InventoryLocations)
- end.
- GetContainerSerials=
- fun()->
- {ok,ItemSerials}=inventory_location:search_by([{master_data_type,equal,item}],record),
- lists:map(
- fun(ItemSerials)->
- A=[hd(element(3,ItemSerials)),element(6,ItemSerials),element(9,ItemSerials)],
- A
- end,ItemSerials)
- end.
- UpdateBarcode1=
- fun(Ref,Barcode)->
- {ok,InventoryLocation}=inventory_location:get_by_id(Ref),
- InventoryLocation1=erlang:setelement(3,InventoryLocation,[Barcode]),
- db_functions:db_create_or_update_term(inventory_location,Ref,InventoryLocation1,[])
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement