Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Do not show refunded amount in template

Marcin Gębala786f9dfead3b
diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.py
index a89b05648a..d39cfaaaae 100644
--- a/saleor/dashboard/order/views.py
+++ b/saleor/dashboard/order/views.py
@@ -47,8 +47,7 @@ def order_details(request, pk):
messages.success(request, _('Note added'))
return redirect('dashboard:order-details', pk=pk)
- captured = preauthorized = refunded = Price(
- 0, currency=order.get_total().currency)
+ captured = preauthorized = Price(0, currency=order.get_total().currency)
if payment:
can_capture = (payment.status == 'preauth' and
order.status != 'cancelled')
@@ -57,17 +56,13 @@ def order_details(request, pk):
preauthorized = payment.get_total_price()
if payment.status == 'confirmed':
captured = payment.get_captured_price()
- if payment.status == 'refunded':
- refunded = Price(payment.total - payment.captured_amount,
- currency=payment.currency)
else:
can_capture = can_release = can_refund = False
ctx = {'order': order, 'payment': payment, 'notes': notes, 'groups': groups,
'note_form': note_form, 'captured': captured,
- 'preauthorized': preauthorized, 'refunded': refunded,
- 'can_capture': can_capture, 'can_release': can_release,
- 'can_refund': can_refund}
+ 'preauthorized': preauthorized, 'can_capture': can_capture,
+ 'can_release': can_release, 'can_refund': can_refund}
return TemplateResponse(request, 'dashboard/order/detail.html', ctx)
diff --git a/saleor/dashboard/templates/dashboard/order/detail.html b/saleor/dashboard/templates/dashboard/order/detail.html
index be9ec9da5a..2f28ed4895 100644
--- a/saleor/dashboard/templates/dashboard/order/detail.html
+++ b/saleor/dashboard/templates/dashboard/order/detail.html
@@ -72,9 +72,6 @@
{% if captured %}
<p>Captured amount: {% gross captured %}</p>
{% endif %}
- {% if refunded %}
- <p>Refunded amount: {% gross refunded %}</p>
- {% endif %}
{% if can_capture %}
<a class="btn btn-success" data-target="#base-modal" href="{% url 'dashboard:manage-payment' pk=payment.pk action='capture' %}" data-toggle="modal">{% trans "Capture" %}</a>
{% elif can_refund %}