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

📘 Grand livre fournisseur

← Retour
{% if not fournisseurs %}
Veuillez d'abord créer un fournisseur.
{% elif livres %}
{% if livres|length > 1 %}
{% for livre in livres %} {% endfor %}
FournisseurDébitCréditSolde final (MAD)
{{ livre.fournisseur.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.fournisseur.nom }}

{% if livre.fournisseur.numero_compte %}Compte n° : {{ livre.fournisseur.numero_compte }}{% endif %}
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Ă» au fournisseur)" if livre.solde_final >= 0 else "(en notre faveur)" }}
{% endfor %} {% endif %} {% endblock %}