Move generate_upc() to scat.php so it can be used more widely