From da917692f088ddee68adf6bdb6fe76bbc3e98964 Mon Sep 17 00:00:00 2001 From: "Troll (Hermes Agent)" Date: Tue, 4 Aug 2026 01:20:56 +0000 Subject: [PATCH] Add admin Sales report page --- app.py | 13 ++++++ templates/admin/dashboard.html | 3 +- templates/admin/sales.html | 72 ++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 templates/admin/sales.html diff --git a/app.py b/app.py index d6d5ffa..ce1d4db 100644 --- a/app.py +++ b/app.py @@ -781,6 +781,19 @@ def admin_dashboard(): return render_template('admin/dashboard.html', requests=requests, statuses=STATUS_LABELS, current_status=status_filter, refresh_seconds=get_refresh_seconds()) +@app.route('/admin/sales') +def admin_sales(): + """ + Sales report: delivered requests only. + Shows customer email, name, chosen version, and Square payment reference. + """ + redir = require_admin() + if redir: + return redir + sales = list_requests(status='delivered') + return render_template('admin/sales.html', sales=sales, statuses=STATUS_LABELS) + + @app.route('/admin/request/', methods=['GET', 'POST']) def admin_request(rid): """ diff --git a/templates/admin/dashboard.html b/templates/admin/dashboard.html index 2efa4f5..63bdbda 100644 --- a/templates/admin/dashboard.html +++ b/templates/admin/dashboard.html @@ -110,8 +110,9 @@
- + diff --git a/templates/admin/sales.html b/templates/admin/sales.html new file mode 100644 index 0000000..6a7b642 --- /dev/null +++ b/templates/admin/sales.html @@ -0,0 +1,72 @@ + + + + + + Sales Report — Admin + + + +
+ + +

Sales Report

+ + {% if sales %} + + + + + + + + + + + + {% for s in sales %} + + + + + + + + {% endfor %} + +
IDNameEmailPickedPayment Reference
#{{ s.id }}{{ s.name }}{{ s.email }}{% if s.customer_approved == 'both' %}Both Versions{% else %}Version {{ s.customer_approved.upper() }}{% endif %}{{ s.square_payment_ref or '-' }}
+ {% else %} +

No delivered requests yet.

+ {% endif %} +
+ +