forked from CGM_Public/pretix_original
Allow to mark add-ons as "included" in price
This commit is contained in:
@@ -183,6 +183,7 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
|
||||
event=self.request.event,
|
||||
prefix='{}_{}'.format(cartpos.pk, iao.addon_category.pk),
|
||||
category=iao.addon_category,
|
||||
price_included=iao.price_included,
|
||||
initial=current_addon_products,
|
||||
data=(self.request.POST if self.request.method == 'POST' else None),
|
||||
quota_cache=quota_cache,
|
||||
|
||||
@@ -293,6 +293,9 @@ class AddOnsForm(forms.Form):
|
||||
tax_value = round_decimal(price * (1 - 100 / (100 + item.tax_rate)))
|
||||
price_net = price - tax_value
|
||||
|
||||
if self.price_included:
|
||||
price = Decimal('0.00')
|
||||
|
||||
if not price:
|
||||
n = '{name}'.format(
|
||||
name=label
|
||||
@@ -336,6 +339,7 @@ class AddOnsForm(forms.Form):
|
||||
current_addons = kwargs.pop('initial')
|
||||
quota_cache = kwargs.pop('quota_cache')
|
||||
item_cache = kwargs.pop('item_cache')
|
||||
self.price_included = kwargs.pop('price_included')
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user