diff --git a/app.py b/app.py index 89bf9fd..37ce7c5 100644 --- a/app.py +++ b/app.py @@ -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') diff --git a/templates/admin/pricing.html b/templates/admin/pricing.html index 7ae75a8..86dcc5f 100644 --- a/templates/admin/pricing.html +++ b/templates/admin/pricing.html @@ -71,28 +71,7 @@ {% endfor %} {% endwith %} -
-

MusicGPT Costs (USD)

-
-
-

Songs generated

-

{{ cost_totals.song_count }}

-
-
-

Completed A/B pairs

-

{{ cost_totals.completed_pairs }}

-
-
-

Music cost total

-

${{ "%.4f"|format(cost_totals.total_cost) }}

-
-
-

Stems cost total

-

${{ "%.4f"|format(cost_totals.stems_total) }}

-
-
-

Per-song cost approx. $0.035–$0.045 USD on the current MusicGPT plan (v6 / v6-pro).

-
+

Standard Items

diff --git a/templates/admin/sales.html b/templates/admin/sales.html index 5759f4c..632962e 100644 --- a/templates/admin/sales.html +++ b/templates/admin/sales.html @@ -42,6 +42,29 @@

Sales Report

{% if sales %} +
+

MusicGPT Costs (USD)

+
+
+

Songs generated

+

{{ cost_totals.song_count }}

+
+
+

Completed A/B pairs

+

{{ cost_totals.completed_pairs }}

+
+
+

Music cost total

+

${{ "%.4f"|format(cost_totals.total_cost) }}

+
+
+

Stems cost total

+

${{ "%.4f"|format(cost_totals.stems_total) }}

+
+
+

Per-song cost approx. $0.035–$0.045 USD on the current MusicGPT plan (v6 / v6-pro).

+
+