forked from CGM_Public/pretix_original
Fix #585 -- Creating invoices for refunded orders
This commit is contained in:
@@ -131,7 +131,11 @@
|
||||
action="{% url "control:event.order.reissueinvoice" event=request.event.slug organizer=request.event.organizer.slug code=order.code id=i.pk %}">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-default btn-xs">
|
||||
{% trans "Cancel and reissue" %}
|
||||
{% if order.status == "r" or order.status == "c" %}
|
||||
{% trans "Generate cancellation" %}
|
||||
{% else %}
|
||||
{% trans "Cancel and reissue" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
@@ -366,8 +366,11 @@ class OrderInvoiceReissue(OrderView):
|
||||
if inv.canceled:
|
||||
messages.error(self.request, _('The invoice has already been canceled.'))
|
||||
else:
|
||||
generate_cancellation(inv)
|
||||
inv = generate_invoice(self.order)
|
||||
c = generate_cancellation(inv)
|
||||
if self.order.status not in (Order.STATUS_CANCELED, Order.STATUS_REFUNDED):
|
||||
inv = generate_invoice(self.order)
|
||||
else:
|
||||
inv = c
|
||||
self.order.log_action('pretix.event.order.invoice.reissued', user=self.request.user, data={
|
||||
'invoice': inv.pk
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user