diff --git a/src/pretix/control/logdisplay.py b/src/pretix/control/logdisplay.py
index 160c070970..b12e3d04b2 100644
--- a/src/pretix/control/logdisplay.py
+++ b/src/pretix/control/logdisplay.py
@@ -325,6 +325,8 @@ def pretixcontrol_logentry_display(sender: Event, logentry: LogEntry, **kwargs):
'pretix.device.initialized': _('The device has been initialized.'),
'pretix.device.keyroll': _('The access token of the device has been regenerated.'),
'pretix.device.updated': _('The device has notified the server of an hardware or software update.'),
+ 'pretix.giftcards.created': _('The gift card has been created.'),
+ 'pretix.giftcards.transaction.manual': _('A manual transaction has been performed.'),
}
data = json.loads(logentry.data)
diff --git a/src/pretix/control/templates/pretixcontrol/organizers/giftcard.html b/src/pretix/control/templates/pretixcontrol/organizers/giftcard.html
index 34f7398e16..89b7e561c6 100644
--- a/src/pretix/control/templates/pretixcontrol/organizers/giftcard.html
+++ b/src/pretix/control/templates/pretixcontrol/organizers/giftcard.html
@@ -11,81 +11,95 @@
{% trans "TEST MODE" %}
{% endif %}
-
-
-
- {% trans "Details" %}
-
-
-
-
- - {% trans "Gift card code" %}
- - {{ card.secret }}
- - {% trans "Creation date" %}
- - {{ card.issuance|date:"SHORT_DATETIME_FORMAT" }}
- - {% trans "Current value" %}
- - {{ card.value|money:card.currency }}
- - {% trans "Currency" %}
- - {{ card.currency }}
- {% if card.issued_in %}
- - {% trans "Issued through sale" %}
- -
-
- {{ card.issued_in.order.full_code }}-{{ card.issued_in.positionid }}
-
- {% endif %}
-
-
-
-
-
-
- {% trans "Transactions" %}
-
-
-
-
-
- | {% trans "Date" %} |
- {% trans "Order" %} |
- {% trans "Value" %} |
-
-
-
- {% for t in card.transactions.all %}
-
- | {{ t.datetime|date:"SHORT_DATETIME_FORMAT" }} |
-
- {% if t.order %}
-
- {{ t.order.full_code }}
-
- {% else %}
- {% trans "Manual transaction" %}
+
+
+
+
+
+ {% trans "Details" %}
+
+
+
+
+ - {% trans "Gift card code" %}
+ - {{ card.secret }}
+ - {% trans "Creation date" %}
+ - {{ card.issuance|date:"SHORT_DATETIME_FORMAT" }}
+ - {% trans "Current value" %}
+ - {{ card.value|money:card.currency }}
+ - {% trans "Currency" %}
+ - {{ card.currency }}
+ {% if card.issued_in %}
+ - {% trans "Issued through sale" %}
+ -
+
+ {{ card.issued_in.order.full_code }}-{{ card.issued_in.positionid }}
+
{% endif %}
- |
-
- {{ t.value|money:card.currency }}
- |
-
- {% endfor %}
-
-
-
- |
- |
-
-
- |
+
+
+
+
+
+
+ {% trans "Transactions" %}
+
+
+
+
+
+ | {% trans "Date" %} |
+ {% trans "Order" %} |
+ {% trans "Value" %} |
+
+
+
+ {% for t in card.transactions.all %}
+
+ | {{ t.datetime|date:"SHORT_DATETIME_FORMAT" }} |
+
+ {% if t.order %}
+
+ {{ t.order.full_code }}
+
+ {% else %}
+ {% trans "Manual transaction" %}
+ {% endif %}
+ |
+
+ {{ t.value|money:card.currency }}
+ |
+
+ {% endfor %}
+
+
+
+ |
+ |
+
+
+ |
-
-
-
+
+
+
+
+
+
+
+
+
+ {% trans "Gift card history" %}
+
+
+ {% include "pretixcontrol/includes/logs.html" with obj=card %}
+
+
{% endblock %}
diff --git a/src/pretix/control/views/orders.py b/src/pretix/control/views/orders.py
index b250c02e18..e625916600 100644
--- a/src/pretix/control/views/orders.py
+++ b/src/pretix/control/views/orders.py
@@ -724,6 +724,7 @@ class OrderRefundView(OrderView):
currency=self.request.event.currency,
testmode=self.order.testmode
)
+ giftcard.log_action('pretix.giftcards.created', user=self.request.user, data={})
refunds.append(OrderRefund(
order=self.order,
payment=None,
diff --git a/src/pretix/control/views/organizer.py b/src/pretix/control/views/organizer.py
index d5c405f4c6..589763d347 100644
--- a/src/pretix/control/views/organizer.py
+++ b/src/pretix/control/views/organizer.py
@@ -1056,9 +1056,11 @@ class GiftCardCreateView(OrganizerDetailViewMixin, OrganizerPermissionRequiredMi
form.instance.transactions.create(
value=form.cleaned_data['value']
)
- form.instance.log_action('pretix.giftcards.transaction.manual', user=self.request.user, data={
- 'value': form.cleaned_data['value']
- })
+ form.instance.log_action('pretix.giftcards.created', user=self.request.user, data={})
+ if form.cleaned_data['value']:
+ form.instance.log_action('pretix.giftcards.transaction.manual', user=self.request.user, data={
+ 'value': form.cleaned_data['value']
+ })
return redirect(reverse(
'control:organizer.giftcard',
kwargs={