Bug fixes + archive feature for Destinatäre

- Make Destinatär names clickable in list view (link to detail page)
- Nachweis-Board: auto-create missing VierteljahresNachweis records
  for active Destinatäre when viewing a year (fixes missing Q1 2026)
- Add archive/deactivate toggle for Destinatäre (button on detail page)
  with AuditLog entry and confirmation dialog
- Default Destinatär list to show active only (filter preset to "Aktiv")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
SysAdmin Agent
2026-03-11 20:07:30 +00:00
parent 113bd53a3a
commit cf127b043d
6 changed files with 47 additions and 3 deletions

View File

@@ -29,6 +29,18 @@
<i class="fas fa-times me-2"></i>Abbrechen
</button>
<form method="post" action="{% url 'stiftung:destinataer_toggle_archiv' pk=destinataer.pk %}" class="d-inline">
{% csrf_token %}
{% if destinataer.aktiv %}
<button type="submit" class="btn btn-outline-secondary me-2" onclick="return confirm('Destinatär archivieren? Er wird nicht mehr im Nachweis-Board und der aktiven Liste erscheinen.')">
<i class="fas fa-archive me-2"></i>Archivieren
</button>
{% else %}
<button type="submit" class="btn btn-outline-success me-2" onclick="return confirm('Destinatär wieder aktivieren?')">
<i class="fas fa-undo me-2"></i>Reaktivieren
</button>
{% endif %}
</form>
<a href="{% url 'stiftung:destinataer_list' %}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left me-2"></i>Zurück zur Liste
</a>

View File

@@ -130,10 +130,10 @@
{% for destinataer in page_obj %}
<tr>
<td>
<strong>{{ destinataer.vorname|default:"-" }}</strong>
<a href="{% url 'stiftung:destinataer_detail' pk=destinataer.pk %}" class="text-decoration-none fw-bold">{{ destinataer.vorname|default:"-" }}</a>
</td>
<td>
<strong>{{ destinataer.nachname }}</strong>
<a href="{% url 'stiftung:destinataer_detail' pk=destinataer.pk %}" class="text-decoration-none fw-bold">{{ destinataer.nachname }}</a>
{% if destinataer.geburtsdatum %}
<br><small class="text-muted">{{ destinataer.geburtsdatum|date:"d.m.Y" }}</small>
{% endif %}