adjust the function generate_receipt.