From 2ee0f684c544064a31ad026e7717d8119c822f38 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 25 Apr 2019 19:34:18 +0200 Subject: [PATCH] PDF variable: price including add-ons --- src/pretix/base/pdf.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pretix/base/pdf.py b/src/pretix/base/pdf.py index 77e7e2d48..f246f4f3f 100644 --- a/src/pretix/base/pdf.py +++ b/src/pretix/base/pdf.py @@ -87,6 +87,15 @@ DEFAULT_VARIABLES = OrderedDict(( "editor_sample": _("123.45 EUR"), "evaluate": lambda op, order, event: money_filter(op.price, event.currency) }), + ("price_with_addons", { + "label": _("Price including add-ons"), + "editor_sample": _("123.45 EUR"), + "evaluate": lambda op, order, event: money_filter(op.price + sum( + p.price + for p in op.addons.all() + if not p.canceled + ), event.currency) + }), ("attendee_name", { "label": _("Attendee name"), "editor_sample": _("John Doe"),