{% load i18n %} {% for line in lines %} {% ifchanged line.user_external_id %} {% endifchanged %} {% ifchanged line.user_external_id line.activity_label %} {% if line.activity_label or not forloop.first %} {% endif %} {% endifchanged %} {% if line.details.check_type_label or line.details.status != 'absence' or line.details.partial_bookings %} {% endif %} {% endfor %} {% if invoice.collection %} {% if not invoice.paid_amount %} {% else %} {% endif %} {% elif invoice_payments %} {% else %} {% endif %}
{{ line.user_name }}
{% trans "Services" %} {% trans "Details" %} {% trans "Unit amount" %} {% trans "Quantity" %} {% trans "Total amount" %}
{{ line.activity_label|default:" " }}
{{ line.label }} {% if not line.details.partial_bookings %} {% if line.details.check_type_label %} {{ line.details.check_type_label }} {% elif line.details.status == 'absence' %} {% trans "Absence" %} {% endif %} {% endif %} {% if document_model == 'middle' and line.display_description %} {{ line.description }} {% endif %} {% blocktrans with amount=line.unit_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %} {{ line.quantity|floatformat }} {% blocktrans with amount=line.total_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Debt amount:" %} {% blocktrans with amount=invoice.total_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Total amount:" %} {% blocktrans with amount=invoice.total_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Paid amount:" %} {% blocktrans with amount=invoice.paid_amount_before_collect|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Debt amount:" %} {% blocktrans with amount=invoice.collected_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Debt forwarded to the Treasury on:" %} {{ invoice.collection.created_at|date:"d/m/Y" }}
{% trans "Invoiced amount:" %} {% blocktrans with amount=invoice.total_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Paid amount:" %} {% blocktrans with amount=invoice.paid_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Remaining amount:" %} {% blocktrans with amount=invoice.remaining_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}
{% trans "Total amount:" %} {% blocktrans with amount=invoice.total_amount|floatformat:"2" %}{{ amount }}€{% endblocktrans %}

{% trans "Payment deadline:" %} {{ invoice.date_payment_deadline|date:"d/m/Y" }}

{% if not invoice.collection and invoice_payments %}

{% trans "Details of payments recorded on this invoice" %} {% for invoice_payment in invoice_payments %}
{% if invoice_payment.payment.payment_type.slug == 'credit' %} - {% blocktrans with payment_num=invoice_payment.payment.formatted_number payment_date=invoice_payment.payment.created_at|date:"d/m/Y" amount=invoice_payment.payment.amount|floatformat:"2" credit_nums=invoice_payment.payment.credit_formatted_numbers|join:' ' payment_type=invoice_payment.payment.payment_type %}{{ payment_num }} of {{ payment_date }} amount {{ amount }}€ of {{ payment_type }} {{ credit_nums }}{% endblocktrans %} {% else %} - {% blocktrans with payment_num=invoice_payment.payment.formatted_number payment_date=invoice_payment.payment.created_at|date:"d/m/Y" amount=invoice_payment.payment.amount|floatformat:"2" payment_type=invoice_payment.payment.payment_type %}{{ payment_num }} of {{ payment_date }} amount {{ amount }}€ of {{ payment_type }}{% endblocktrans %} {% endif %} {% endfor %}

{% if invoice.remaining_amount == 0 %}

{% trans "Total amount paid - Invoice paid*." %}
{% trans "*Subject to actual cashing of payments by check." %}

{% endif %} {% endif %}