{% extends "base_template.html" %} {% block title %}Documents Client - DOOBAT{% endblock %} {% block header_title %}Documents Client{% endblock %} {% block header_subtitle %}{{ client_name }} — {{ months }} derniers mois{% endblock %} {% block content %}
Devis ({{ quotations|length }})
{% if quotations %} {% for q in quotations %} {% endfor %}
N° Devis Date Statut Montant HT
{{ q.name }} {{ q.date_order|format_date }} {{ state_map_orders.get(q.state, q.state) }} {{ "%.2f"|format(q.amount_total) }} €
{% else %}

Aucun devis.

{% endif %}
Commandes ({{ orders|length }})
{% if orders %} {% set total_orders = orders|sum(attribute='amount_total') %}

Total commandes : {{ "%.2f"|format(total_orders) }} €

{% for o in orders %} {% endfor %}
N° Commande Date Statut Commercial Montant HT
{{ o.name }} {{ o.date_order|format_date }} {{ state_map_orders.get(o.state, o.state) }} {{ o.user_id[1] if o.user_id else '' }} {{ "%.2f"|format(o.amount_total) }} €
{% else %}

Aucune commande.

{% endif %}
Factures ({{ invoices|length }})
{% if invoices %} {% set total_invoiced = invoices|sum(attribute='amount_total') %} {% set total_due = invoices|sum(attribute='amount_residual') %}

Total facturé : {{ "%.2f"|format(total_invoiced) }} €  |  Solde dû : {{ "%.2f"|format(total_due) }} €

{% for inv in invoices %} {% set is_overdue = inv.payment_state == 'not_paid' and inv.invoice_date_due and inv.invoice_date_due < today %} {% endfor %}
N° Facture Date Échéance Statut Paiement Montant Restant
{{ inv.name }} {{ inv.invoice_date|format_date }} {{ inv.invoice_date_due|format_date }} {% if is_overdue %} ⚠️{% endif %} {{ state_map_invoices.get(inv.state, inv.state) }} {{ payment_map.get(inv.payment_state, inv.payment_state) }} {{ "%.2f"|format(inv.amount_total) }} € {{ "%.2f"|format(inv.amount_residual) }} €
{% else %}

Aucune facture.

{% endif %} {% endblock %}