2056d5bbc7
Self-service /suff/pay/ page lets users record their own payments (cash/PayPal/bank/other) against their tab. Open balance is shown on /suff/me/ alongside total and paid amount, with a Bezahlen button when something is owed. Staff-only /suff/dashboard/ replaces the drink_stats / total_balance / user_stats CLI commands with a mobile-friendly festival view: overall refinancing progress bar (Spenden vs. Ausgaben with Bilanz), drinks refinancing bar (sales revenue vs. purchase cost with profit), per-drink sold/total/balance, open balances per user, and fun facts (top spender, top drink, busiest day, and top user per festival day). Linked from /suff/me/ when the logged-in user is staff. seed_drinks_2026 also creates the non-drink Payments we already know about (toilets, drinks/equipment down payment, band fees per stage day), idempotently keyed on (purpose, date). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
103 lines
3.3 KiB
HTML
103 lines
3.3 KiB
HTML
{% extends "suff/base.html" %}
|
||
{% load money %}
|
||
|
||
{% block content %}
|
||
<h2>Dashboard {{ year }}</h2>
|
||
|
||
<section>
|
||
<h3>Refinanzierung gesamt</h3>
|
||
<div class="progress-wrap">
|
||
<div class="progress-bar" style="width: {{ total_pct_capped }}%;"></div>
|
||
<span class="progress-label">{{ total_pct }}%</span>
|
||
</div>
|
||
<p class="muted-left">
|
||
Spenden {{ total_donations|euro }} / Ausgaben {{ total_payments|euro }}
|
||
</p>
|
||
<p class="muted-left">
|
||
Bilanz: <b>{{ total_balance|euro }}</b>
|
||
</p>
|
||
</section>
|
||
|
||
<section>
|
||
<h3>Refinanzierung Getränke</h3>
|
||
<div class="progress-wrap">
|
||
<div class="progress-bar" style="width: {{ refinance_pct_capped }}%;"></div>
|
||
<span class="progress-label">{{ refinance_pct }}%</span>
|
||
</div>
|
||
<p class="muted-left">
|
||
Verkaufserlös {{ sales_revenue|euro }} / Einkaufspreis {{ purchase_cost|euro }}
|
||
</p>
|
||
<p class="muted-left">
|
||
Aktueller Gewinn: <b>{{ drinks_profit|euro }}</b>
|
||
</p>
|
||
</section>
|
||
|
||
<section>
|
||
<h3>Getränke</h3>
|
||
<ul class="history">
|
||
{% for d in drink_rows %}
|
||
<li class="dash-row">
|
||
<span class="hist-what"><b>{{ d.name }}</b></span>
|
||
<span class="hist-when">{{ d.sold }}/{{ d.total }} verkauft</span>
|
||
<span class="hist-price">{{ d.balance|euro }}</span>
|
||
</li>
|
||
{% endfor %}
|
||
</ul>
|
||
</section>
|
||
|
||
<section>
|
||
<h3>Offene Beträge</h3>
|
||
{% if user_rows %}
|
||
<ul class="history">
|
||
{% for u in user_rows %}
|
||
<li>
|
||
<span class="hist-when">{{ u.username }}</span>
|
||
<span class="hist-what">{{ u.consumed|euro }} − {{ u.paid|euro }}</span>
|
||
<span class="hist-price">{{ u.open|euro }}</span>
|
||
</li>
|
||
{% endfor %}
|
||
</ul>
|
||
{% else %}
|
||
<p class="muted-left">Niemand hat etwas konsumiert.</p>
|
||
{% endif %}
|
||
</section>
|
||
|
||
<section>
|
||
<h3>Fun Facts</h3>
|
||
<ul class="history">
|
||
{% if top_spender %}
|
||
<li>
|
||
<span class="hist-when">Top-Zecher</span>
|
||
<span class="hist-what">{{ top_spender.username }}</span>
|
||
<span class="hist-price">{{ top_spender.total|euro }}</span>
|
||
</li>
|
||
{% endif %}
|
||
{% if top_drink %}
|
||
<li>
|
||
<span class="hist-when">Top-Getränk</span>
|
||
<span class="hist-what">{{ top_drink.name }}</span>
|
||
<span class="hist-price">{{ top_drink.amount }}x</span>
|
||
</li>
|
||
{% endif %}
|
||
{% if busiest_day %}
|
||
<li>
|
||
<span class="hist-when">Härtester Tag</span>
|
||
<span class="hist-what">{{ busiest_day.label }}</span>
|
||
<span class="hist-price">{{ busiest_day.amount }} Flaschen</span>
|
||
</li>
|
||
{% endif %}
|
||
{% for f in top_per_day %}
|
||
<li>
|
||
<span class="hist-when">{{ f.label }}</span>
|
||
<span class="hist-what">{{ f.username }}</span>
|
||
<span class="hist-price">{{ f.amount }} Flaschen</span>
|
||
</li>
|
||
{% endfor %}
|
||
</ul>
|
||
</section>
|
||
|
||
<div class="logout-form">
|
||
<a href="{% url 'suff:me' %}" class="link-btn link-btn-secondary">Zurück</a>
|
||
</div>
|
||
{% endblock %}
|