Refactoring logic in total to select a sale, convert it to USD, and increment the total amount