forked from CGM_Public/pretix_original
Show refund status to customer on order page
This commit is contained in:
@@ -84,6 +84,25 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if order.status == "p" or order.status == "c" %}
|
||||
{% if refunds %}
|
||||
<div class="alert alert-info">
|
||||
{% for r in refunds %}
|
||||
{% if r.state == "created" or r.state == "transit" %}
|
||||
{% blocktrans trimmed with amount=r.amount|money:request.event.currency %}
|
||||
A refund of {{ amount }} will be sent out to you soon, please be patient.
|
||||
{% endblocktrans %}
|
||||
{% elif r.state == "done" %}
|
||||
{% blocktrans trimmed with amount=r.amount|money:request.event.currency %}
|
||||
A refund of {{ amount }} has been sent to you. Depending on the payment method, please allow for up to 14 days until it shows up
|
||||
on your statement.
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% if not forloop.last %}<br />{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if can_download and download_buttons and order.count_positions %}
|
||||
<div class="alert alert-info">
|
||||
{% blocktrans trimmed %}
|
||||
|
||||
@@ -18,7 +18,7 @@ from django.views.generic import TemplateView, View
|
||||
|
||||
from pretix.base.models import CachedTicket, Invoice, Order, OrderPosition
|
||||
from pretix.base.models.orders import (
|
||||
CachedCombinedTicket, OrderFee, OrderPayment, QuestionAnswer,
|
||||
CachedCombinedTicket, OrderFee, OrderPayment, OrderRefund, QuestionAnswer,
|
||||
)
|
||||
from pretix.base.payment import PaymentException
|
||||
from pretix.base.services.invoices import (
|
||||
@@ -145,6 +145,11 @@ class OrderDetails(EventViewMixin, OrderDetailMixin, CartMixin, TemplateView):
|
||||
|
||||
elif self.order.status == Order.STATUS_PAID:
|
||||
ctx['can_pay'] = False
|
||||
|
||||
ctx['refunds'] = self.order.refunds.filter(
|
||||
state__in=(OrderRefund.REFUND_STATE_DONE, OrderRefund.REFUND_STATE_TRANSIT, OrderRefund.REFUND_STATE_CREATED)
|
||||
)
|
||||
|
||||
return ctx
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user