forked from CGM_Public/pretix_original
Backend order list: Show payment amount
This commit is contained in:
@@ -333,6 +333,9 @@ class Order(LockModel, LoggedModel):
|
|||||||
payment_sum=payment_sum_sq,
|
payment_sum=payment_sum_sq,
|
||||||
refund_sum=refund_sum_sq,
|
refund_sum=refund_sum_sq,
|
||||||
)
|
)
|
||||||
|
qs = qs.annotate(
|
||||||
|
payment_refund_sum=Coalesce(payment_sum_sq, 0) - Coalesce(refund_sum_sq, 0),
|
||||||
|
)
|
||||||
|
|
||||||
qs = qs.annotate(
|
qs = qs.annotate(
|
||||||
pending_sum_t=F('total') - Coalesce(payment_sum_sq, 0) + Coalesce(refund_sum_sq, 0),
|
pending_sum_t=F('total') - Coalesce(payment_sum_sq, 0) + Coalesce(refund_sum_sq, 0),
|
||||||
|
|||||||
@@ -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-down"></i></a>
|
||||||
<a href="?{% url_replace request 'ordering' 'datetime' %}"><i class="fa fa-caret-up"></i></a>
|
<a href="?{% url_replace request 'ordering' 'datetime' %}"><i class="fa fa-caret-up"></i></a>
|
||||||
</th>
|
</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-down"></i></a>
|
||||||
<a href="?{% url_replace request 'ordering' 'total' %}"><i class="fa fa-caret-up"></i></a></th>
|
<a href="?{% url_replace request 'ordering' 'total' %}"><i class="fa fa-caret-up"></i></a></th>
|
||||||
<th class="text-right flip">{% trans "Positions" %}</th>
|
<th class="text-right flip">{% trans "Positions" %}</th>
|
||||||
@@ -158,6 +158,13 @@
|
|||||||
{% elif o.is_pending_with_full_payment %}
|
{% elif o.is_pending_with_full_payment %}
|
||||||
<span class="label label-danger">{% trans "FULLY PAID" %}</span>
|
<span class="label label-danger">{% trans "FULLY PAID" %}</span>
|
||||||
{% endif %}
|
{% 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 }}
|
{{ o.total|money:request.event.currency }}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right flip">{{ o.pcnt|default_if_none:"0" }}</td>
|
<td class="text-right flip">{{ o.pcnt|default_if_none:"0" }}</td>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ class OrderList(OrderSearchMixin, EventPermissionRequiredMixin, PaginationMixin,
|
|||||||
annotated = {
|
annotated = {
|
||||||
o['pk']: o
|
o['pk']: o
|
||||||
for o in
|
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']]
|
pk__in=[o.pk for o in ctx['orders']]
|
||||||
).annotate(
|
).annotate(
|
||||||
pcnt=Subquery(s, output_field=IntegerField()),
|
pcnt=Subquery(s, output_field=IntegerField()),
|
||||||
|
|||||||
Reference in New Issue
Block a user