- Add payment method selection (PayPal/Bar) to order form - Store payment_method and payment_status in database - Add payment status badges in admin orders view - Add "mark as paid" functionality for admins - PayPal account configurable via PAYPAL_ACCOUNT env variable - Frontend loads PayPal account dynamically from /wawi/config endpoint - Update email notifications to include payment method Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
102 lines
3.8 KiB
HTML
Executable File
102 lines
3.8 KiB
HTML
Executable File
{% extends "base.html" %}
|
||
{% block content %}
|
||
{% with messages = get_flashed_messages() %}
|
||
{% if messages %}
|
||
<div class="note">
|
||
{% for m in messages %}
|
||
<div>{{ m }}</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endif %}
|
||
{% endwith %}
|
||
<div class="card">
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Datum</th>
|
||
<th>Name</th>
|
||
<th>Handy</th>
|
||
<th>Mannschaft</th>
|
||
<th>Artikel</th>
|
||
<th>Größe</th>
|
||
<th>Menge</th>
|
||
<th>Zahlungsart</th>
|
||
<th>Zahlung</th>
|
||
<th>Notiz</th>
|
||
<th>Status</th>
|
||
<th class="actions">Aktion</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for o in rows %}
|
||
<tr>
|
||
<td>{{ o.created_at }}</td>
|
||
<td>{{ o.name }}</td>
|
||
<td>{{ o.handy }}</td>
|
||
<td>{{ o.mannschaft }}</td>
|
||
<td>{{ o.artikel }}</td>
|
||
<td>{{ o.groesse }}</td>
|
||
<td>{{ o.menge }}</td>
|
||
<td>
|
||
{% if o.payment_method == "paypal" %}PayPal
|
||
{% else %}Bar
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
{% if o.payment_status == "paid" %}<span class="badge success">Bezahlt</span>
|
||
{% else %}<span class="badge warning">Unbezahlt</span>
|
||
{% endif %}
|
||
</td>
|
||
<td>{{ o.notiz or "–" }}</td>
|
||
<td>
|
||
{% if o.canceled %}Storniert
|
||
{% elif o.done %}Erledigt
|
||
{% else %}Offen
|
||
{% endif %}
|
||
</td>
|
||
<td class="actions">
|
||
{% if not o.done and not o.canceled %}
|
||
<form method="post" action="{{ url_for('bp.complete_order', order_id=o.id) }}" onsubmit="return confirm('Bestellung als erledigt markieren?');">
|
||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||
<button class="btn small" type="submit">Erledigt</button>
|
||
</form>
|
||
{% if o.payment_status != "paid" %}
|
||
<form method="post" action="{{ url_for('bp.mark_paid', order_id=o.id) }}" onsubmit="return confirm('Als bezahlt markieren?');">
|
||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||
<button class="btn small success" type="submit">Bezahlt</button>
|
||
</form>
|
||
{% endif %}
|
||
<form method="post" action="{{ url_for('bp.cancel_order', order_id=o.id) }}" onsubmit="return confirm('Bestellung wirklich stornieren?');">
|
||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||
<button class="btn small danger" type="submit">Stornieren</button>
|
||
</form>
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
<tr class="order-history">
|
||
<td colspan="12">
|
||
<details class="inline-details">
|
||
<summary>Historie</summary>
|
||
<div class="history-grid">
|
||
<div><strong>Abgeschlossen von:</strong> {{ o.completed_by or "–" }}</div>
|
||
<div><strong>Abgeschlossen am:</strong> {{ o.completed_at or "–" }}</div>
|
||
<div><strong>Bezahlt markiert von:</strong> {{ o.paid_by or "–" }}</div>
|
||
<div><strong>Bezahlt markiert am:</strong> {{ o.paid_at or "–" }}</div>
|
||
<div><strong>Storniert von:</strong> {{ o.canceled_by or "–" }}</div>
|
||
<div><strong>Storniert am:</strong> {{ o.canceled_at or "–" }}</div>
|
||
</div>
|
||
</details>
|
||
</td>
|
||
</tr>
|
||
{% else %}
|
||
<tr>
|
||
<td colspan="12" class="empty">Keine Bestellungen.</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
{% endblock %}
|