Allow to mark add-ons as "included" in price

This commit is contained in:
Raphael Michel
2017-07-12 18:42:09 +02:00
parent 79562e7ad9
commit c1158c3175
11 changed files with 163 additions and 4 deletions

View File

@@ -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)