def METHOD_NAME(user, png=False, pdf=False):
    purchases = (
        user.owned_purchases.filter_by(is_paid_for=True)
        .join(PriceTier, Product, ProductGroup)
        .with_entities(Purchase)
        .order_by(Purchase.id)
    )
    admissions = purchases.filter(ProductGroup.type == "admissions").all()
    vehicle_tickets = purchases.filter(
        ProductGroup.type.in_(["parking", "campervan"])
    ).all()
    tees = purchases.filter(ProductGroup.type == "tees").all()
    hires = purchases.filter(ProductGroup.type == "hire").all()
    transferred_tickets = (
        user.transfers_from.join(Purchase)
        .filter_by(state="paid")
        .with_entities(PurchaseTransfer)
        .order_by("timestamp")
        .all()
    )
    return render_template(
        "receipt.html",
        user=user,
        format_inline_qr=format_inline_qr,
        format_inline_barcode=format_inline_barcode,
        admissions=admissions,
        vehicle_tickets=vehicle_tickets,
        transferred_tickets=transferred_tickets,
        tees=tees,
        hires=hires,
        pdf=pdf,
        png=png,
    )