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

@@ -333,6 +333,9 @@ class Order(LockModel, LoggedModel):
payment_sum=payment_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(
pending_sum_t=F('total') - Coalesce(payment_sum_sq, 0) + Coalesce(refund_sum_sq, 0),