Generalize email system with invoice workflow and Stiftungsgeschichte category

- Rename DestinataerEmailEingang → EmailEingang with category support
  (destinataer, rechnung, land_pacht, stiftungsgeschichte, allgemein)
- Add invoice capture workflow: create Verwaltungskosten from email,
  link DMS documents as invoice attachments, track payment status
- Add Stiftungsgeschichte email category with auto-detection patterns
  (Ahnenforschung, Genealogie, Chronik, etc.) and DMS integration
- Update poll_emails task with category detection and DMS context mapping
- Show available history documents in Geschichte editor sidebar
- Consolidate DMS views, remove legacy dokument templates
- Update all detail/form templates for DMS document linking
- Add deploy.sh script and streamline compose.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
SysAdmin Agent
2026-03-12 10:17:14 +00:00
parent f4fc512ad3
commit e6f4c5ba1b
44 changed files with 1076 additions and 3428 deletions

View File

@@ -72,18 +72,21 @@
<div class="col-12">
<h6 class="text-primary">Verwendungsnachweis</h6>
<p class="mb-3">
<a href="{% url 'stiftung:dokument_detail' foerderung.verwendungsnachweis.pk %}">
{{ foerderung.verwendungsnachweis.titel }}
</a>
{{ foerderung.verwendungsnachweis.titel }}
</p>
</div>
</div>
{% endif %}
<!-- Verknüpfte Dokumente -->
<!-- Dokumente (DMS) -->
<div class="row">
<div class="col-12">
<h6 class="text-primary">Verknüpfte Dokumente</h6>
<div class="d-flex justify-content-between align-items-center mb-2">
<h6 class="text-primary mb-0">Dokumente</h6>
<a href="{% url 'stiftung:dms_upload' %}?foerderung={{ foerderung.pk }}" class="btn btn-sm btn-success">
<i class="fas fa-upload me-1"></i>Dokument hochladen
</a>
</div>
{% if verknuepfte_dokumente %}
<div class="table-responsive">
<table class="table table-sm table-hover">
@@ -100,8 +103,7 @@
<tr>
<td>
<strong>{{ dokument.titel }}</strong>
<br>
<small class="text-muted">ID: {{ dokument.paperless_document_id }}</small>
{% if dokument.dateiname_original %}<br><small class="text-muted">{{ dokument.dateiname_original }} ({{ dokument.get_human_size }})</small>{% endif %}
</td>
<td>
<span class="badge bg-secondary">{{ dokument.get_kontext_display }}</span>
@@ -115,12 +117,15 @@
</td>
<td>
<div class="btn-group" role="group">
<a href="{{ dokument.get_paperless_url }}" target="_blank" class="btn btn-sm btn-outline-primary" title="In Paperless öffnen">
<i class="fas fa-external-link-alt"></i>
<a href="{% url 'stiftung:dms_download' dokument.pk %}" class="btn btn-sm btn-outline-primary" title="Herunterladen">
<i class="fas fa-download"></i>
</a>
<a href="{% url 'stiftung:dokument_update' dokument.pk %}" class="btn btn-sm btn-outline-warning" title="Bearbeiten">
<a href="{% url 'stiftung:dms_edit' dokument.pk %}" class="btn btn-sm btn-outline-warning" title="Bearbeiten">
<i class="fas fa-edit"></i>
</a>
<a href="{% url 'stiftung:dms_delete' dokument.pk %}" class="btn btn-sm btn-outline-danger" title="Löschen">
<i class="fas fa-trash"></i>
</a>
</div>
</td>
</tr>
@@ -128,17 +133,12 @@
</tbody>
</table>
</div>
<div class="mt-2">
<a href="{% url 'stiftung:dokument_management' %}" class="btn btn-sm btn-success">
<i class="fas fa-plus me-1"></i>Weiteres Dokument verknüpfen
</a>
</div>
{% else %}
<div class="text-center py-3">
<i class="fas fa-file-alt fa-2x text-muted mb-2"></i>
<p class="text-muted mb-2">Keine Dokumente verknüpft</p>
<a href="{% url 'stiftung:dokument_management' %}" class="btn btn-success btn-sm">
<i class="fas fa-plus me-1"></i>Erstes Dokument verknüpfen
<p class="text-muted mb-2">Keine Dokumente vorhanden</p>
<a href="{% url 'stiftung:dms_upload' %}?foerderung={{ foerderung.pk }}" class="btn btn-success btn-sm">
<i class="fas fa-upload me-1"></i>Erstes Dokument hochladen
</a>
</div>
{% endif %}