{% load i18n %}

{% if provider %} {% blocktrans trimmed with provider=provider.verbose_name %} Invoicing (PT) — {{ provider }} {% endblocktrans %} {% else %} {% trans "Invoicing (PT)" %} {% endif %}

{% if provider and not configured %}
{% blocktrans trimmed with provider=provider.verbose_name %} {{ provider }} is not fully configured, or its connection has expired, so no documents can be issued for this event. {% endblocktrans %} {% trans "Open the invoicing settings" %}
{% endif %} {% if billing_changed %}
{% blocktrans trimmed with number=changed_invoice.display_number %} The buyer changed their billing details after invoice {{ number }} was issued. To accept the change, issue a credit note and then a new invoice. {% endblocktrans %}
{% endif %} {% if not cycles and not is_paid %}

{% trans "Invoices are only issued once the order is paid." %}

{% endif %} {% if cycles or is_paid and configured %} {% comment %} Same shape as pretix's own "Payments" panel on this page: a table-condensed with one row per document and its own inline actions, rather than a details list per document — reads better once a credit note sits alongside the invoice. {% endcomment %}
{% comment %} One invoice + credit note pair per cycle, oldest first: an order paid again after a credited refund gets a new invoice. Actions only while a provider can actually issue (configured). {% endcomment %} {% trans "Invoice" as invoice_label %} {% trans "Credit note" as credit_label %} {% trans "Retry issuance" as retry_label %} {% for cycle in cycles %} {% if is_paid and configured %} {% include "pretix_ptinvoicing/control/order_document_row.html" with doc=cycle.invoice label=invoice_label action="plugins:pretix_ptinvoicing:issue" action_label=retry_label %} {% else %} {% include "pretix_ptinvoicing/control/order_document_row.html" with doc=cycle.invoice label=invoice_label action="" %} {% endif %} {% if cycle.invoice.status == "success" %} {% if not configured %} {% include "pretix_ptinvoicing/control/order_document_row.html" with doc=cycle.credit_note label=credit_label action="" %} {% elif cycle.credit_note %} {% trans "Retry credit note" as credit_action %} {% include "pretix_ptinvoicing/control/order_document_row.html" with doc=cycle.credit_note label=credit_label action="plugins:pretix_ptinvoicing:credit" action_label=credit_action action_icon="undo" %} {% else %} {% trans "Issue credit note" as credit_action %} {% include "pretix_ptinvoicing/control/order_document_row.html" with doc=None label=credit_label action="plugins:pretix_ptinvoicing:credit" action_label=credit_action action_icon="undo" %} {% endif %} {% endif %} {% endfor %} {% if needs_invoice and configured %} {% endif %}
{% trans "Kind" %} {% trans "Status" %} {% trans "Document" %} {% trans "Last attempt" %}
{{ invoice_label }} {% if cycles %} {% trans "Paid again after the last invoice was credited." %} {% else %} {% trans "No invoice issued for this order yet." %} {% endif %} {% trans "Issue invoice now" %}
{% endif %}