Rearranged the receipt generation.