{% extends "base.html" %} {% block contenu %} {% set onglet = genre %} {% set modifiable = v.statut == 'brouillon' %} {% set st = s.statut if s else v.statut %}

{{ _(genres[genre]) }} {{ v.numero or _("(brouillon)") }} {{ _(statuts.get(st, st)) }}

{% if client_actuel %}{{ client_actuel.nom }} · {% endif %}{{ v.date|date_ch }}{% if v.echeance and genre == 'facture' %} · {{ _("échéance {0}", (v.echeance|date_ch)) }}{% endif %} {% if origine %} · {{ _("depuis") }} {{ _(genres[origine.genre]) }} {{ origine.numero or '' }}{% endif %}

{% include "_ventes_onglets.html" %} {% if v.id %}
{{ _("📄 Voir le PDF") }} {{ _("Télécharger") }} {% if genre == 'offre' and v.statut in ('envoyee', 'acceptee', 'refusee') %}
{% if v.statut != 'acceptee' %}
{% endif %} {% if v.statut != 'refusee' %}
{% endif %} {% endif %} {% if genre == 'facture' and v.statut == 'validee' %}
{% endif %} {% if v.statut in ('validee', 'envoyee', 'acceptee') and not paiements %}
{% endif %}
{% endif %} {% if modifiable %}
{{ _("+ nouveau client") }}
{% if genre == 'facture' %}
{% endif %}
{% for l in (lignes or [{}]) %} {% endfor %}
{{ _("Article") }}{{ _("Description") }}{{ _("Quantité") }} {{ _("Unité") }}{{ _("Prix") }} {{ _("TTC") if prix_ttc else _("HT") }} {{ _("Rabais %") }}{{ _("TVA %") }} {{ _("Compte") }}{{ _("Total") }}
{{ l.total|chf if l.total is defined else '' }}
{% if v.id %}{% endif %}
{% else %}
{% if v.titre %}

{{ v.titre }}

{% endif %} {% if v.intro %}

{{ v.intro }}

{% endif %} {% for l in lignes %} {% endfor %} {% if not prix_ttc %}{% endif %}
{{ _("Description") }}{{ _("Quantité") }}{{ _("Prix") }}{{ _("Rabais %") }}{{ _("TVA %") }}{{ _("Compte") }}{{ _("Total") }}
{{ l.libelle }}{{ '%g'|format(l.quantite) }} {{ l.unite or '' }}{{ l.prix|chf }} {{ '%g'|format(l.rabais) if l.rabais else '' }}{{ '%g'|format(l.taux) }}{{ l.compte }}{{ l.total|chf }}
{{ _("Total hors TVA") }}{{ ht|chf }}
{{ _("TVA") }}{{ tva|chf }}
{{ _("Total") }} CHF{{ total|chf }}
{% if v.conclusion %}

{{ v.conclusion }}

{% endif %}
{% endif %} {% if s and v.statut != 'brouillon' %}

{{ _("Situation") }}

{% if s.avoirs %}{% endif %} {% if s.frais %}{% endif %}
{{ _("Montant de la facture") }}{{ v.total|chf }}
{{ _("Notes de crédit") }}−{{ s.avoirs|chf }}
{{ _("Déjà payé") }}{{ s.paye|chf }}
{{ _("Frais de rappel") }}{{ s.frais|chf }}
{{ _("Reste à payer") }}{{ s.a_payer|chf }}
{% if reference_aff %}

{{ _("Référence de paiement") }} : {{ reference_aff }}
{{ _("Le paiement est reconnu tout seul quand vous importez le relevé bancaire (camt.053).") }}

{% endif %}

{{ _("Paiements") }}

{% if paiements %}{% for p in paiements %}{% endfor %}
{{ p.date|date_ch }}{{ _("relevé bancaire") if p.source == 'releve bancaire' else _("saisi à la main") }}{{ p.montant|chf }}
{% else %}

{{ _("Aucun paiement pour l'instant.") }}

{% endif %} {% if v.statut == 'validee' %}

{{ _("Montant négatif = remboursement au client.") }}

{% endif %}
{% if rappels %}

{{ _("Rappels") }}

{% for r in rappels %}{% endfor %}
{{ _(niveaux[r.niveau]) }}{{ r.date|date_ch }}{{ r.frais|chf }} PDF
{% endif %}
{% endif %} {% if derives %}

{{ _("Documents liés") }}

{% for d in derives %}
{{ _(genres[d.genre]) }} {{ d.numero or _("(brouillon)") }} · {{ d.total|chf }} · {{ _(statuts.get(d.statut, d.statut)) }}
{% endfor %}
{% endif %} {% include "_comptes_clavier.html" %} {% endblock %}