{% extends "base.html" %} {% block contenu %}

{{ _("Chercher un achat") }}

{{ _("Tapez un fournisseur, une date, un montant ou « ticket caisse », dans n'importe quel ordre. Exemples :") }} {{ _("Migros") }} · {{ _("Migros 10.2026") }} · {{ _("ticket caisse 2026") }} · {{ _("Fournex 15.10.2026") }} · {{ _("cash 2026") }} · {{ _("employe") }} {{ _("(achats avec une carte privée d'employé) ·") }} 452.40

{% if q or du or au %}{{ _("Effacer") }}{% endif %}
{% if q or du or au %}
{{ _("{0} achat(s)", (achats|length)) }} {{ _("— total") }} {{ _("{0} CHF", (total|chf)) }} {% if lu %} {{ _("· compris : {0}", (lu|join(', '))) }}{% endif %} {% if du or au %} {{ _("· du {0} au {1}", (du|date_ch if du else '…'), (au|date_ch if au else '…')) }}{% endif %} {% if suggestions %}
{{ _("Rien trouvé. Vouliez-vous dire :") if not achats else _("Vouliez-vous dire :") }} {% for s in suggestions %}{{ s }}{{ ' · ' if not loop.last }}{% endfor %} ?
{% endif %}
{% for a in achats %} {% else %}{% endfor %} {% if achats %}{% endif %}
{{ _("Date") }}{{ _("Fournisseur / texte") }}{{ _("Compte") }}{{ _("Payé par") }}{{ _("Montant") }}
{{ a.date|date_ch }} {{ a.texte or _('(sans texte)') }} {% if a.fichier and paiements.get(a.fichier) %}
💳 {{ paiements[a.fichier] }}
{% endif %}
{% for c in a.comptes %}
{{ c }} {{ _(noms.get(c, '')) }}
{% endfor %}
{{ a.paye }} {{ _(noms.get(a.paye, '')) }} {{ a.montant|chf }} {% if a.fichier %}📎{% endif %}
{{ _("Aucun achat trouvé.") }}
{{ _("Total") }}{{ total|chf }}

{{ _("En orange : à vérifier ou au compte d'attente 1099. Cliquez sur le texte pour corriger l'écriture, sur 📎 pour voir le ticket ou la facture.") }}

{% if docs %}

{{ _("Autres documents de l'archive (pas comptés comme achat)") }}

{% for d in docs %}{% endfor %}
{{ _("Fichier") }}{{ _("Résultat") }}{{ _("Ce qui a été fait") }}
{{ d.nom }}{{ _(libelles_statuts.get(d.statut, (d.statut, ''))[0]) }}{{ (d.resultat or '')[:250] }}
{% endif %} {% endif %} {% endblock %}