Commit Graph

13 Commits

Author SHA1 Message Date
SysAdmin Agent
2a7c9d8529 Add IMAP configuration UI and sidebar navigation for email inbox
- Email settings page at /administration/email/ with IMAP config form
- Connection test button to verify IMAP connectivity
- Sidebar link "E-Mail Eingang" for quick access
- AppConfiguration model extended with email category and password type
- init_config command includes IMAP default settings
- DB-based IMAP config with env var fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:01:05 +00:00
SysAdmin Agent
96204c04dd Fix email poll: search all recent emails (not just UNSEEN) on manual trigger
The manual "Jetzt abrufen" button now runs synchronously and searches all
emails from the last 30 days instead of only unread ones. This fixes the
issue where already-read emails in IMAP were invisible to the poll task.
Duplicate detection (by sender+date+subject) prevents re-imports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:00:50 +00:00
SysAdmin Agent
c3c6755027 Modernize Destinataer detail page: tabbed UI with integrated timeline
Replaces the old multi-card layout (1368 lines) with a compact, modern
tabbed interface (Stammdaten | Nachweise | Zahlungen | Timeline | Dokumente | Notizen).
All information is now accessible from one page without excessive clicking.

- Add timeline events to destinataer_detail view (merged from timeline view logic)
- Compact profile header with avatar initials, status badges, key contact info
- Inline editing preserved with table-based layout for cleaner data display
- Tab state persisted in URL hash for bookmarkable deep links
- Dropdown menu for less-used actions (export, archive, delete)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:55:21 +00:00
SysAdmin Agent
8e1db11f8d Fix NoReverseMatch in email_eingang views: add stiftung: namespace prefix
The redirect() calls in email_eingang_poll_trigger and email_eingang_detail
were missing the 'stiftung:' namespace prefix, causing NoReverseMatch errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:41:12 +00:00
SysAdmin Agent
b47ffd4a3c Fix Verpachtungen list + migrate legacy pacht data to LandVerpachtung
- Add migrate_to_landverpachtung management command that converts
  old Land-level pacht fields (aktueller_paechter, pachtbeginn, etc.)
  into proper LandVerpachtung records
- Fix SyntaxError in system.py (fancy Unicode quotes in f-strings)
- Ran migration: 1 LandVerpachtung record created for Jens Bodden

The old system stored pacht data directly on the Land model.
The new LandVerpachtung model supports multiple leases per Land.
The verpachtung_list view queries LandVerpachtung, which was empty.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:36:39 +00:00
SysAdmin Agent
cf127b043d 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>
2026-03-11 20:07:30 +00:00
SysAdmin Agent
113bd53a3a Fix paechter_workflow FieldError: use correct related_name 'neue_verpachtungen'
The Paechter model's reverse relation from LandVerpachtung uses
related_name='neue_verpachtungen', not the default 'landverpachtung'.
Fixed the annotate() query in top_paechter section of paechter_workflow view.
2026-03-11 13:53:14 +00:00
SysAdmin Agent
502fab31fc Fix paechter_workflow FieldError: use correct related_name 'abrechnungen'
The Land model's ForeignKey from LandAbrechnung uses related_name='abrechnungen',
not the default 'landabrechnung'. Fixed the exclude() query in paechter_workflow view.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:25:05 +00:00
SysAdmin Agent
2be72c3990 Phase 4: SEPA-Validierung (schwifty), Globale Suche (Cmd+K) & Jahresbericht-Modul
- SEPA-Export: IBAN/BIC-Validierung via schwifty, Schuldner-Konto aus StiftungsKonto
- Globale Suche: Cmd+K Modal über Destinatäre, Pächter, Ländereien, Förderungen, Dokumente
- Jahresbericht: Vollständige Jahresbilanz mit Einnahmen/Ausgaben/Netto, Unterstützungen,
  Landabrechnungen, Verwaltungskosten nach Kategorie, PDF-Export

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:57:36 +00:00
SysAdmin Agent
a79a0989d6 Phase 3: Django-natives DMS – Paperless-NGX durch DokumentDatei ersetzt
- Neues Modell DokumentDatei mit PostgreSQL FTS (SearchVectorField, GinIndex)
- Upload-Pfad: dokumente/YYYY/MM/<uuid>/dateiname
- 7 DMS-Views: list, detail, download, upload (HTMX Drag&Drop), delete, edit, search_api
- Templates: list, detail, edit, upload mit Drag&Drop-Zone, Partials
- URLs: /dms/ komplett verdrahtet
- Sidebar: DMS als Primäreintrag, Paperless als Legacy
- Migrationsskript: manage.py migrate_paperless_dokumente (DokumentLink → DokumentDatei)
- compose.yml: paperless-Dienst deaktiviert (Legacy-Kommentarblock)
- Migration 0048 angewendet

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 11:10:08 +00:00
SysAdmin Agent
ee2c827d85 Phase 2: Destinatär-Timeline, Nachweis-Board, Zahlungs-Pipeline & Pächter-Workflow
2a. Destinatär-Timeline (/destinataere/<pk>/timeline/)
    - Chronologische Ansicht aller Events (Zahlungen, Nachweise, E-Mails, Notizen)
    - Filter nach Typ via GET-Parameter

2b. Nachweis-Board (/nachweis-board/)
    - Quartals-Übersicht aller aktiver Destinatäre (Q1–Q4) in einer Tabellenansicht
    - Batch-Erinnerung: erzeugt Audit-Log-Einträge für säumige Destinatäre
    - Semester-Logik erhalten (15.03 / 15.09 Fristen)

2c. Zahlungs-Pipeline (/zahlungs-pipeline/)
    - 5-Stufen-Kanban: Offen → Nachweis eingereicht → Freigegeben → Überwiesen → Abgeschlossen
    - Vier-Augen-Prinzip: can_be_freigegeben() prüft anderen Nutzer als Ersteller
    - SEPA pain.001 XML-Export (/sepa-export/) für freigegebene Zahlungen
    - Neue Status-Werte: nachweis_eingereicht, freigegeben, abgeschlossen
    - Neue Felder: freigegeben_von, freigegeben_am, erstellt_von

2d. Pächter-Workflow (/paechter/workflow/)
    - Pipeline nach Restlaufzeit: abgelaufen / <6M / 6–24M / >24M / unbefristet
    - Ausstehende Jahresabrechnungen (Vorjahr ohne Abrechnung)
    - Pachtanpassungen fällig (Verträge > 5 Jahre laufend)
    - Top-Pächter nach Gesamtfläche

Sidebar-Navigation um Pipeline, Nachweis-Board und Pacht-Workflow erweitert.
Migration 0047 erzeugt und angewendet.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 10:40:43 +00:00
SysAdmin Agent
bf47ba11c9 Phase 1: Sidebar-Navigation, Dashboard-Cockpit & HTMX-Integration
- New sidebar layout (6 sections: Dashboard, Personen, Land, Finanzen, Dokumente, System)
- Collapsible sidebar with localStorage persistence
- Top bar with user dropdown and breadcrumbs
- Dashboard cockpit with live KPI cards (Destinataere, Foerderungen, Zahlungen, Laendereien)
- Action items: overdue Nachweise, pending payments, upcoming events, new emails, expiring leases
- Quick actions panel and recent audit log
- HTMX (2.0.4) and Alpine.js (3.14.8) integration via CDN
- django-htmx middleware and CSRF token setup
- Fix IMAP_PORT empty string handling in settings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 10:22:42 +00:00
SysAdmin Agent
3ca2706e5d Phase 0: forms.py, admin.py und views.py in Domain-Packages aufteilen
- forms.py → forms/ Package (8 Domänen: destinataere, land, finanzen,
  foerderung, dokumente, veranstaltung, system, geschichte)
- admin.py → admin/ Package (7 Domänen, alle 22 @admin.register dekoriert)
- views.py (8845 Zeilen) → views/ Package (10 Domänen: dashboard, destinataere,
  land, paechter, finanzen, foerderung, dokumente, unterstuetzungen,
  veranstaltung, geschichte, system)
- __init__.py in jedem Package re-exportiert alle Symbole für Rückwärtskompatibilität
- urls.py bleibt unverändert (funktioniert durch Re-Exports)
- Django system check: 0 Fehler, alle URL-Auflösungen funktionieren

Keine funktionalen Änderungen – reine Strukturverbesserung für Vision 2026.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 09:55:15 +00:00