PDF editor: Add variable for price including bundles (Z#23197864) (#5284)

This commit is contained in:
Raphael Michel
2025-07-08 17:21:43 +02:00
committed by GitHub
parent a381adac33
commit 13833b05b1

View File

@@ -159,8 +159,17 @@ DEFAULT_VARIABLES = OrderedDict((
"editor_sample": _("123.45 EUR"),
"evaluate": lambda op, order, event: money_filter(op.price, event.currency)
}),
("price_with_bundled", {
"label": _("Price including bundled products"),
"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 and p.is_bundled
), event.currency)
}),
("price_with_addons", {
"label": _("Price including add-ons"),
"label": _("Price including add-ons and bundled products"),
"editor_sample": _("123.45 EUR"),
"evaluate": lambda op, order, event: money_filter(op.price + sum(
p.price