Properly restrict refunds to full payment amount

This commit is contained in:
Raphael Michel
2018-09-03 15:41:05 +02:00
parent 7274905a92
commit 21530f315f
6 changed files with 27 additions and 12 deletions

View File

@@ -50,10 +50,7 @@
{% trans "Cancel order" %}
</a>
{% endif %}
{% if order.status == 'p' %}
<button name="status" value="n" class="btn btn-default">{% trans "Mark as not paid" %}</button>
{% endif %}
{% if overpaid|add:order.total != 0 %}
{% if order.payment_refund_sum > 0 %}
<a href="{% url "control:event.order.refunds.start" event=request.event.slug organizer=request.event.organizer.slug code=order.code %}" class="btn btn-default">
{% trans "Create a refund" %}
</a>

View File

@@ -35,10 +35,12 @@
</div>
</fieldset>
<p>&nbsp;</p>
<fieldset class="form-inline form-order-change">
<legend>{% trans "What should happen to the order?" %}</legend>
{% bootstrap_field form.action layout='horizontal' horizontal_label_class='sr-only' horizontal_field_class='' %}
</fieldset>
{% if form.action %}
<fieldset class="form-inline form-order-change">
<legend>{% trans "What should happen to the order?" %}</legend>
{% bootstrap_field form.action layout='horizontal' horizontal_label_class='sr-only' horizontal_field_class='' %}
</fieldset>
{% endif %}
<p>&nbsp;</p>
{% csrf_token %}