{% 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>Rechnung</th><th>Kunde</th><th>Betrag</th><th>Fälligkeit</th><th></th></tr>
  </thead>
  <tbody>
    {% for f in forderungen %}
    <tr>
      <td>{{ f.rechnungsnummer }}</td>
      <td>{{ f.kunde.name if f.kunde else '' }}</td>
      <td>{{ f.betrag }}</td>
      <td>{{ f.faelligkeit }}</td>
      <td><a href="/detail/{{ f.id }}" class="btn btn-sm btn-primary">Details</a></td>
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endblock %}
