{% extends "base/base.html" %}
{% block content %}
<div class="d-flex mb-3">
  <a class="btn btn-secondary me-2" href="/export/csv">Export CSV</a>
  <a class="btn btn-secondary" href="/export/xlsx">Export XLSX</a>
</div>
<table class="table table-striped">
  <thead>
    <tr>
        <th>.</th>
        <th>Filiale</th>
        <th>Kunde</th>
        <th>Bereich</th>
        <th>Verursacher</th>
        <th>RG-Nr.</th>
        <th>RG-Datum</th>
        <th>Tage</th>
        <th>Mahnstufe</th>
        <th>offen</th>
        <th>Kunde<br>offen ges.</th>
        <th>Kommentar</th>
    </tr>
  </thead>
  <tbody>
    {% for row in forderungen_liste %}
    <tr>
      <td><a href="/forderungen/details/{{ row.Client_DB }}_{{ row.Document_No }}" class="btn btn-sm btn-primary">X</a></td>
      <td>{{ row.Standort_Name }}</td>
      <td>{{ row.Kunde }}</td>
      <td>{{ row.Bereich }}</td>
      <td>{{ row.Verursacher }}</td>
      <td>{{ row.Document_No }}</td>
      <td>{{ row.Invoice_Date|date_format }}</td>
      <td>{{ row.Tage }}</td>
      <td>{{ row.Mahnstufe }}</td>
      <td>{{ row.offen|number_format }}</td>
      <td>{{ row.offen_Kunde_gesamt|number_format }}</td>
      <td>{{ row.Kommentar_Fibu or '' }}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endblock %}