Move MusicGPT cost totals from pricing page to sales page

This commit is contained in:
Troll (Hermes Agent) 2026-08-11 03:16:28 +00:00
parent 0c79984619
commit af91664ed0
3 changed files with 29 additions and 26 deletions

9
app.py
View file

@ -739,13 +739,15 @@ def admin_dashboard():
def admin_sales():
"""
Sales report: delivered requests only.
Shows customer email, name, chosen version, and Square payment reference.
Shows customer email, name, chosen version, Square payment reference,
and aggregate MusicGPT generation/stems costs in USD.
"""
redir = require_admin()
if redir:
return redir
sales = list_requests(status='delivered')
return render_template('admin/sales.html', sales=sales, statuses=STATUS_LABELS)
cost_totals = get_musicgpt_cost_totals()
return render_template('admin/sales.html', sales=sales, statuses=STATUS_LABELS, cost_totals=cost_totals)
@app.route('/admin/pricing', methods=['GET', 'POST'])
@ -791,8 +793,7 @@ def admin_pricing():
'name': entry.get('name', '') if isinstance(entry, dict) else '',
'price': entry.get('price', '') if isinstance(entry, dict) else ''
})
cost_totals = get_musicgpt_cost_totals()
return render_template('admin/pricing.html', fixed=fixed, customs=customs, cost_totals=cost_totals)
return render_template('admin/pricing.html', fixed=fixed, customs=customs)
@app.route('/kiosk')