{% extends "base.html" %}

{% block content %}
<h2>Mes factures</h2>

<table id="member_invoices" class="full-width">
    <thead>
        <tr>
            <th>Numéro</th>
            <th>Date</th>
            <th>Montant</th>
            <th>Reste à payer</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        {% for invoice in invoices %}
        <tr>
            <td><a href="{% url 'billing:invoice' id=invoice.number %}">{{ invoice.number }}</a></td>
            <td>{{ invoice.date }}</td>
            <td>{{ invoice.amount }}</td>
            <td{% if invoice.amount_remaining_to_pay > 0 %} class="unpaid"{% endif %}>{{ invoice.amount_remaining_to_pay }}</td>
            <td><a href="{% url 'billing:invoice_pdf' id=invoice.number %}">PDF</a></td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}
