Added function to build unique IDs for sales