Fix payment system balance integration and add calendar functionality
- Implement automated payment tracking with Django signals - Fix duplicate transaction creation with unique referenz system - Add calendar system with CRUD operations and event management - Reorganize navigation menu (rename sections, move admin functions) - Replace Geschichte editor with EasyMDE markdown editor - Add management commands for balance reconciliation - Create missing transactions for previously paid payments - Ensure account balances accurately reflect all payment activity Features added: - Calendar entries creation and administration via menu - Payment status tracking with automatic balance updates - Duplicate prevention for payment transactions - Markdown editor with live preview for Geschichte pages - Database reconciliation tools for payment/balance sync Bug fixes: - Resolved IntegrityError on payment status changes - Fixed missing account balance updates for paid payments - Prevented duplicate balance deductions on re-saves - Corrected menu structure and admin function placement
This commit is contained in:
58
app/stiftung/management/commands/create_sample_events.py
Normal file
58
app/stiftung/management/commands/create_sample_events.py
Normal file
@@ -0,0 +1,58 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from stiftung.models import StiftungsKalenderEintrag
|
||||
from datetime import date, timedelta
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Creates sample calendar events for testing'
|
||||
|
||||
def handle(self, *args, **options):
|
||||
today = date.today()
|
||||
|
||||
events = [
|
||||
{
|
||||
'titel': 'Vorstandssitzung',
|
||||
'beschreibung': 'Monatliche Vorstandssitzung zur Besprechung aktueller Stiftungsangelegenheiten',
|
||||
'datum': today + timedelta(days=7),
|
||||
'kategorie': 'termin',
|
||||
'prioritaet': 'hoch',
|
||||
},
|
||||
{
|
||||
'titel': 'Zahlungserinnerung Familie Müller',
|
||||
'beschreibung': 'Quartalsweise Unterstützung €500',
|
||||
'datum': today + timedelta(days=3),
|
||||
'kategorie': 'zahlung',
|
||||
'prioritaet': 'kritisch',
|
||||
},
|
||||
{
|
||||
'titel': 'Pachtvertrag Müller läuft aus',
|
||||
'beschreibung': 'Vertrag für Grundstück A123 muss verlängert werden',
|
||||
'datum': today + timedelta(days=30),
|
||||
'kategorie': 'vertrag',
|
||||
'prioritaet': 'hoch',
|
||||
},
|
||||
{
|
||||
'titel': 'Geburtstag Maria Schmidt',
|
||||
'beschreibung': '75. Geburtstag',
|
||||
'datum': today + timedelta(days=5),
|
||||
'kategorie': 'geburtstag',
|
||||
'prioritaet': 'normal',
|
||||
}
|
||||
]
|
||||
|
||||
created_count = 0
|
||||
for event_data in events:
|
||||
event, created = StiftungsKalenderEintrag.objects.get_or_create(
|
||||
titel=event_data['titel'],
|
||||
defaults=event_data
|
||||
)
|
||||
if created:
|
||||
created_count += 1
|
||||
self.stdout.write(f'Created: {event.titel}')
|
||||
else:
|
||||
self.stdout.write(f'Already exists: {event.titel}')
|
||||
|
||||
total = StiftungsKalenderEintrag.objects.count()
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(f'✅ Created {created_count} new events. Total: {total}')
|
||||
)
|
||||
Reference in New Issue
Block a user