{% load i18n %}
{% if invoice.label or invoice.previous_invoice %}
{{ invoice.label }}{% if invoice.previous_invoice %}{% if invoice.label %} - {% endif %}{% trans "Initial invoice number:" %} {{ invoice.previous_invoice.formatted_number }}{% endif %}
{% endif %}
{% trans "Direct debit:" %} {{ invoice.direct_debit|yesno }}
{% trans "Publication date:" %} {{ invoice.date_publication|date:"d/m/Y" }}
{% if invoice.date_payment_deadline_displayed %}
{% trans "Displayed payment deadline:" %} {{ invoice.date_payment_deadline_displayed|date:"d/m/Y" }}
{% endif %}
{% trans "Effective payment deadline:" %} {{ invoice.date_payment_deadline|date:"d/m/Y" }}
{% trans "Due date:" %} {{ invoice.date_due|date:"d/m/Y" }}
{% if not pool and not invoice.collection and not invoice.cancelled_at and user_can_invoice %}
{% trans "Edit" %}
{% endif %}
{% if invoice.date_debit %}
{% trans "Debit date:" %} {{ invoice.date_debit|date:"d/m/Y" }}
{% endif %}
{% if not pool and invoice.pool %}
{% trans "Origin:" %} {% trans "Campaign" %}
{% else %}
{% trans "Origin:" %} {{ invoice.get_origin_display }}
{% endif %}
{% for line in object_list %}
{% if invoice.pool %}
{% url 'lingo-manager-invoicing-pool-journal' regie_pk=regie.pk pk=invoice.pool.campaign_id pool_pk=invoice.pool.pk as journal_url %}
{% endif %}
{% ifchanged line.user_external_id %}
{% trans "Paid amount:" %} {% blocktrans with amount=invoice.paid_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% endif %}
{% if invoice.remaining_amount or invoice.total_amount == 0 %}
{% if not invoice.paid_amount and not pool and not invoice.collection and user_can_invoice %}
{% trans "Remaining amount:" %} {% blocktrans with amount=invoice.remaining_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}