Backend order list: Show payment amount

This commit is contained in:
Raphael Michel
2020-12-15 15:44:38 +01:00
parent c6a98fad5a
commit a40951060f
3 changed files with 12 additions and 2 deletions

View File

@@ -113,7 +113,7 @@
<a href="?{% url_replace request 'ordering' '-datetime' %}"><i class="fa fa-caret-down"></i></a>
<a href="?{% url_replace request 'ordering' 'datetime' %}"><i class="fa fa-caret-up"></i></a>
</th>
<th class="text-right flip">{% trans "Order total" %}
<th class="text-right flip">{% trans "Order paid / total" %}
<a href="?{% url_replace request 'ordering' '-total' %}"><i class="fa fa-caret-down"></i></a>
<a href="?{% url_replace request 'ordering' 'total' %}"><i class="fa fa-caret-up"></i></a></th>
<th class="text-right flip">{% trans "Positions" %}</th>
@@ -158,6 +158,13 @@
{% elif o.is_pending_with_full_payment %}
<span class="label label-danger">{% trans "FULLY PAID" %}</span>
{% endif %}
{% if o.payment_refund_sum == o.total or o.payment_refund_sum == 0 %}
<span class="text-muted">
{% endif %}
{{ o.payment_refund_sum|money:request.event.currency }} /
{% if o.payment_refund_sum == o.total or o.payment_refund_sum == 0 %}
</span>
{% endif %}
{{ o.total|money:request.event.currency }}
</td>
<td class="text-right flip">{{ o.pcnt|default_if_none:"0" }}</td>

View File

@@ -153,7 +153,7 @@ class OrderList(OrderSearchMixin, EventPermissionRequiredMixin, PaginationMixin,
annotated = {
o['pk']: o
for o in
Order.annotate_overpayments(Order.objects).filter(
Order.annotate_overpayments(Order.objects, sums=True).filter(
pk__in=[o.pk for o in ctx['orders']]
).annotate(
pcnt=Subquery(s, output_field=IntegerField()),