mirror of
https://github.com/pretix/pretix-servicefees.git
synced 2024-12-26 04:53:09 +01:00
Correctly display relative fee
This commit is contained in:
parent
17e418e8b8
commit
0d16743997
1 changed files with 11 additions and 3 deletions
|
@ -90,10 +90,18 @@ def order_fee(sender: Event, invoice_address, total, meta_info, **kwargs):
|
|||
|
||||
@receiver(front_page_top, dispatch_uid="service_fee_front_page_top")
|
||||
def front_page_top_recv(sender: Event, **kwargs):
|
||||
fee = sender.settings.get('service_fee_abs', as_type=Decimal)
|
||||
if fee:
|
||||
fees = []
|
||||
fee_abs = sender.settings.get('service_fee_abs', as_type=Decimal)
|
||||
if fee_abs:
|
||||
fees = fees + [money_filter(fee_abs, sender.currency)]
|
||||
|
||||
fee_percent = sender.settings.get('service_fee_percent', as_type=Decimal)
|
||||
if fee_percent:
|
||||
fees = fees + ['{} %'.format(fee_percent)]
|
||||
|
||||
if fee_abs or fee_percent:
|
||||
return '<p>%s</p>' % ugettext('A service fee of {} will be added on top of each order.').format(
|
||||
money_filter(fee, sender.currency)
|
||||
' + '.join(fees)
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue