Fix #301 -- Add net revenue to sales overview (#313)

This commit is contained in:
Tobias Kunze
2016-11-10 22:24:43 +01:00
committed by Raphael Michel
parent 5999604e8e
commit 2f0c7c0ebc
5 changed files with 53 additions and 41 deletions

View File

@@ -1,14 +1,14 @@
{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load order_overview %}
{% block title %}{% trans "Order overview" %}{% endblock %}
{% block title %}{% trans "Sales overview" %}{% endblock %}
{% block content %}
{% url "control:event.orders" organizer=request.event.organizer.slug event=request.event.slug as listurl %}
<div class="pull-right">
<div class="btn-group" role="group" id="sumtoggle">
<button type="button" data-target=".count" class="btn btn-default active">{% trans "Show number" %}</button>
<button type="button" data-target=".sum" class="btn btn-default">
{% blocktrans with currency=request.event.currency %}Show {{ currency }}{% endblocktrans %}</button>
<button type="button" data-target=".count" class="btn btn-default active">{% trans "Sales" %}</button>
<button type="button" data-target=".sum-gross" class="btn btn-default">{% trans "Revenue (gross)" %}</button>
<button type="button" data-target=".sum-net" class="btn btn-default">{% trans "Revenue (net)" %}</button>
</div>
</div>
<h1>{% trans "Order overview" %}</h1>

View File

@@ -17,6 +17,6 @@ def cut(value, autoescape=True):
esc = conditional_escape
else:
esc = noop
return mark_safe('<span class="count">{0}</span><span class="sum">{1}</span>'.format(
esc(value[0]), esc(formats.localize(value[1]))
return mark_safe('<span class="count">{0}</span><span class="sum-gross">{1}</span><span class="sum-net">{2}</span>'.format(
esc(value[0]), esc(formats.localize(value[1])), esc(formats.localize(value[2]))
))