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

@@ -622,8 +622,8 @@
{# ════════ TAB: Dokumente ════════ #}
<div class="tab-pane fade" id="pane-dokumente" role="tabpanel">
<div class="d-flex justify-content-end mb-3">
<a href="{% url 'stiftung:dokument_management' %}" class="btn btn-success btn-sm">
<i class="fas fa-plus me-1"></i>Dokument verknuepfen
<a href="{% url 'stiftung:dms_upload' %}?destinataer={{ destinataer.pk }}" class="btn btn-success btn-sm">
<i class="fas fa-upload me-1"></i>Dokument hochladen
</a>
</div>
{% if verknuepfte_dokumente %}
@@ -635,14 +635,17 @@
<tbody>
{% for d in verknuepfte_dokumente %}
<tr>
<td><strong>{{ d.titel }}</strong><br><small class="text-muted">ID: {{ d.paperless_document_id }}</small></td>
<td>
<strong>{{ d.titel }}</strong>
{% if d.dateiname_original %}<br><small class="text-muted">{{ d.dateiname_original }} ({{ d.get_human_size }})</small>{% endif %}
</td>
<td><span class="badge bg-secondary">{{ d.get_kontext_display }}</span></td>
<td>{{ d.beschreibung|default:"-"|truncatewords:10 }}</td>
<td>
<div class="btn-group btn-group-sm">
<a href="{{ d.get_paperless_url }}" target="_blank" class="btn btn-outline-primary" title="In Paperless oeffnen"><i class="fas fa-external-link-alt"></i></a>
<a href="{% url 'stiftung:dokument_update' d.pk %}" class="btn btn-outline-warning" title="Bearbeiten"><i class="fas fa-edit"></i></a>
<a href="{% url 'stiftung:dokument_delete' d.pk %}" class="btn btn-outline-danger" title="Loeschen"><i class="fas fa-unlink"></i></a>
<a href="{% url 'stiftung:dms_download' d.pk %}" class="btn btn-outline-primary" title="Herunterladen"><i class="fas fa-download"></i></a>
<a href="{% url 'stiftung:dms_edit' d.pk %}" class="btn btn-outline-warning" title="Bearbeiten"><i class="fas fa-edit"></i></a>
<a href="{% url 'stiftung:dms_delete' d.pk %}" class="btn btn-outline-danger" title="Loeschen"><i class="fas fa-trash"></i></a>
</div>
</td>
</tr>
@@ -653,7 +656,7 @@
{% else %}
<div class="text-center py-4 text-muted">
<i class="fas fa-file-alt fa-2x mb-2"></i>
<p>Keine Dokumente verknuepft.</p>
<p>Keine Dokumente vorhanden.</p>
</div>
{% endif %}
</div>