GiftCard: Add more information to transactions (#3308)

This commit is contained in:
Raphael Michel
2023-05-12 09:38:35 +02:00
committed by GitHub
parent 916ee0697f
commit c0419518c3
19 changed files with 247 additions and 85 deletions

View File

@@ -70,29 +70,32 @@
<thead>
<tr>
<th>{% trans "Date" %}</th>
<th>{% trans "Order" %}</th>
<th>{% trans "Information" %}</th>
<th class="text-right">{% trans "Value" %}</th>
</tr>
</thead>
<tbody>
{% for t in card.transactions.all %}
{% for t in transactions %}
<tr>
<td>{{ t.datetime|date:"SHORT_DATETIME_FORMAT" }}</td>
<td>
{% if t.order %}
<a href="{% url "control:event.order" event=t.order.event.slug organizer=t.order.event.organizer.slug code=t.order.code %}">
{{ t.order.full_code }}
</a>
{% if t.refund and t.value > 0 and t.value <= card.value %}
<button type="submit" name="revert" value="{{ t.pk }}"
class="btn btn-default btn-xs" data-toggle="tooltip"
title="{% trans "Create a payment on the respective order that cancels out with this transaction. The order will then likely be overpaid." %}">
<span class="fa fa-repeat"></span>
{% trans "Revert" %}
</button>
{% endif %}
{% else %}
<em>{% trans "Manual transaction" %}{% if t.text %}: {{ t.text }}{% endif %}</em>
{{ t.display_backend }}
{% if t.refund and t.value > 0 and t.value <= card.value %}
<button type="submit" name="revert" value="{{ t.pk }}"
class="btn btn-default btn-xs" data-toggle="tooltip"
title="{% trans "Create a payment on the respective order that cancels out with this transaction. The order will then likely be overpaid." %}">
<span class="fa fa-repeat"></span>
{% trans "Revert" %}
</button>
{% endif %}
{% if staff_session and t.info %}
<pre><code>{{ t.info|pprint }}</code></pre>
{% endif %}
{% if t.acceptor and t.acceptor != request.organizer %}
<span class="text-muted">
<br>
<span class="fa fa-group"></span> {{ t.acceptor }}
</span>
{% endif %}
</td>
<td class="text-right">