Generate billing history file and export to txt file