Add settled balance panel, cash booking mode, and Kasse dashboard line

- Balance panel turns green with "Bezahlt ✓" + breakdown when open_balance <= 0, on all four tab pages (me, pay, staff_user, staff_pay)
- booking_mode radio on me.html and staff_user.html: normal / for_free / cash_paid; cash_paid auto-creates matching UserPayment(method=cash)
- Dashboard finance section shows "Kasse (bar)" sum of all cash payments for cross-checking
- staff_pay prefill lower-capped at 0; "Zahlung eintragen" always visible on staff_user

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 20:02:14 +02:00
parent 51d079a467
commit d612acd715
8 changed files with 173 additions and 70 deletions
+10 -17
View File
@@ -20,7 +20,10 @@ Username = `slugify(input)`. POST name:
## Booking
- `/suff/me/` shows: greeting, total/paid/open balance, drink grid, day-grouped history.
- `+1` POST creates `Consumption(amount=1, day=current_weekday, for_free=False)`.
- Single form wraps two radio buttons (`booking_mode`) + all drink buttons (`name="drink_id"`).
- `booking_mode` values: `normal` (default, no radio selected), `for_free`, `cash_paid`.
- `+1` POST creates `Consumption(amount=1, day=current_weekday, for_free=...)`.
- `cash_paid` booking auto-creates matching `UserPayment(method=cash)` — same as anonymous walk-ins.
- Trash icon per row → `confirm_delete.html` → POST deletes own consumption (booking phase only).
- History grouped by festival day, newest-first per day.
@@ -29,6 +32,7 @@ Username = `slugify(input)`. POST name:
- `/suff/pay/` — user enters amount + method (cash/paypal/bank/other) + optional note. Creates `UserPayment`. Pre-fills with current `open_balance`.
- Method choices: `UserPayment.Method`.
- Open balance = sum(Consumption.price where !for_free) sum(UserPayment.amount).
- Balance panel shows settled state (green "Bezahlt ✓" + breakdown) when `open_balance <= 0`; amber with "Offen X €" otherwise. Applied on `/suff/me/`, `/suff/pay/`, `/suff/staff/u/<name>/`, `/suff/staff/u/<name>/pay/`.
## Crew (`is_staff`)
@@ -36,11 +40,13 @@ Separate page tree under `/suff/staff/`:
- `/suff/staff/` — alphabetical user list, anonymous gast on top, "Neuen Benutzer anlegen" link.
- `/suff/staff/new/` — register user. Name required, PIN optional 3 digits.
- `/suff/staff/u/<name>/` — book/pay/delete for that user. Mirrors `me.html`.
- `/suff/staff/u/<name>/` — book/pay/delete for that user. Mirrors `me.html`. "Zahlung eintragen" link always visible.
- `/suff/staff/u/<name>/pin/` — overwrite PIN (3 digits required, no clear).
- `/suff/staff/u/<name>/pay/` — record payment for that user.
- `/suff/staff/u/<name>/pay/` — record payment for that user. Amount pre-fills with `max(open_balance, 0)`.
- `/suff/staff/u/<name>/book/<id>/delete/` — delete consumption (and matching auto-payment if anon).
Staff booking form has same `booking_mode` radios (normal / for_free / cash_paid) as user view.
Target username highlighted via `.staff-target` (cyan pill) on every crew page.
## Anonymous walk-ins
@@ -60,6 +66,7 @@ Target username highlighted via `.staff-target` (cyan pill) on every crew page.
## Dashboard
- `/suff/dashboard/` (staff only). Donations vs. expenses with progress bar, drink inventory rows, refinance %, per-user open balances, top spender, top drink, busiest day, top drinker per day.
- Finance section includes "Kasse (bar)" — sum of all `UserPayment(method=cash)` — for cross-checking real cash in the box.
## Drink categories
@@ -82,24 +89,10 @@ Mobile-first dark theme. `#161616` bg, `#EE9933`/`#FFCC77` amber, `#885522` brow
## Open ideas / next session
### Entry fee handling
Festival entry is flexible (1030 €, sometimes paid as overpayment on drink tab). Options brainstormed:
- **A. Implicit overpayment** — pre-fill pay form with `open_balance + 20`, treat anything above drinks as entry/donation. Zero schema change.
- **B. Quick-pick suggestions** — pay page offers buttons: `Nur Getränke (X €)`, `+10`, `+20`, `+30`, plus free-form. Recommended.
- **C. Explicit split** — separate entry field/checkbox. More UI, more accurate stats (`entry = paid consumed`), more friction.
Lean B. Stats can later derive entry as `paid consumed_drinks_price` per user.
### Pay-on-the-spot / quick-pay-cash
Single button on `me` (and crew_user) page: "Offenen Betrag bar bezahlen" → creates `UserPayment(method=cash, amount=open_balance)`. Lets bar crew clear tab in one tap when guest pays cash directly. (Skipped for now, keep in mind.)
### Round to nearest 10 €
When pre-filling pay amount or showing quick-pick buttons, optionally round up to nearest multiple of 10 €. E.g. drinks 26.50 € → suggest 30, 40, 50. Easier cash handling, implicit donation/entry.
### Prepay vs. pay-at-end
Currently a single open balance. Could surface "Prepay 50 €" as a flow vs. "Pay at the end" — same data model, different framing. Maybe a "Vorkasse" preset on pay page.