📑 Verträge

<% if (success) { %>
<%= success %>
<% } %> <% if (error) { %>
<%= error %>
<% } %>
Gesamt Verträge
<%= totals.total || 0 %>
Aktiv
<%= totals.active || 0 %>
Pausiert
<%= totals.paused || 0 %>
Inaktiv
<%= totals.inactive || 0 %>
Minderjährige
<%= totals.minors || 0 %>
Monatl. Umsatz (aktiv)
<%= Number(totals.total_monthly||0).toFixed(2).replace('.',',') %> €

Verteilung nach Kategorie

Übersicht

<% byCategory.forEach(row => { %> <% }) %>
Kategorie Gesamt Aktiv Pausiert Inaktiv Monatl. Umsatz
<%= row.category_name || '– Keine Kategorie –' %> <%= row.total %> <%= row.active %> <%= row.paused %> <%= row.inactive %> <%= Number(row.monthly_revenue||0).toFixed(2).replace('.',',') %> €

Verträge nach Tarif

<% byTariff.forEach(row => { %> <% }) %>
Tarif Laufzeit Aktueller Preis Mitglieder Davon aktiv Monatl. Umsatz Status
<%= row.tariff_name %> <%= row.duration_months %> Monate <%= Number(row.price_monthly).toFixed(2).replace('.',',') %> €/Monat <%= row.total %> <%= row.active %> <%= Number(row.monthly_revenue||0).toFixed(2).replace('.',',') %> € <%= row.tariff_active ? '✅ Aktiv' : '❌ Inaktiv' %>

Auslaufende Verträge – nächste 3 Monate (<%= expiring.length %>)

<% if (expiring.length === 0) { %>

✅ Keine auslaufenden Verträge in den nächsten 3 Monaten.

<% } else { %>
<% expiring.forEach(m => { %> <% const endDate = new Date(m.effective_end); const diffDays = Math.ceil((endDate - new Date()) / (1000*60*60*24)); const urgency = diffDays <= 30 ? 'urgent' : diffDays <= 60 ? 'warning' : 'normal'; %> <% }) %>
Mitglied Tarif Vereinbarter Preis Vertragsende Restlaufzeit Aktionen
<%= m.last_name %>, <%= m.first_name %>
<%= m.email %>
<%= m.tariff_name %> <%= Number(m.agreed_price||m.price_monthly).toFixed(2).replace('.',',') %> € <%= endDate.toLocaleDateString('de-DE') %> noch <%= diffDays %> Tage
👤 Karteikarte
<% } %>