{% extends "base.html" %} {% block titre %}Grand livre client{% endblock %} {% block contenu %}

📗 Grand livre client

← Retour
{% if not clients %}
Veuillez d'abord créer un client.
{% elif livres %}
{% if livres|length > 1 %}
{% for livre in livres %} {% endfor %}
ClientDébitCréditSolde final (MAD)
{{ livre.client.nom }} {{ "%.2f"|format(livre.total_debit) }} {{ "%.2f"|format(livre.total_credit) }} {{ "%.2f"|format(livre.solde_final) }}
Total : {{ "%.2f"|format(livres|sum(attribute="total_debit")) }} {{ "%.2f"|format(livres|sum(attribute="total_credit")) }} {{ "%.2f"|format(livres|sum(attribute="solde_final")) }}
{% endif %} {% for livre in livres %}

{{ livre.client.nom }}

Du {{ livre.date_debut.strftime('%d/%m/%Y') }} au {{ livre.date_fin.strftime('%d/%m/%Y') }}
{% for l in livre.lignes %} {% else %} {% endfor %}
Date Journal Référence Libellé Débit Crédit Solde DB Solde CR
{{ livre.date_debut.strftime('%d/%m/%Y') }} ANV À nouveau (solde d'ouverture) {{ "%.2f"|format(livre.solde_ouverture) if livre.solde_ouverture >= 0 else "" }} {{ "%.2f"|format(-livre.solde_ouverture) if livre.solde_ouverture < 0 else "" }}
{{ l.date.strftime('%d/%m/%Y') }} {{ l.journal }} {{ l.reference or "—" }} {{ l.libelle }} {{ "%.2f"|format(l.debit) if l.debit else "" }} {{ "%.2f"|format(l.credit) if l.credit else "" }} {{ "%.2f"|format(l.solde_db) if l.solde_db else "" }} {{ "%.2f"|format(l.solde_cr) if l.solde_cr else "" }}
Aucun mouvement sur cette période.
Total : {{ "%.2f"|format(livre.total_debit) }} {{ "%.2f"|format(livre.total_credit) }} Solde final : {{ "%.2f"|format(livre.solde_final) }} MAD {{ "(dĂ» par le client)" if livre.solde_final >= 0 else "(en faveur du client)" }}
{% endfor %} {% endif %} {% endblock %}