95 lines
3.2 KiB
HTML
95 lines
3.2 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Sales Report — Admin</title>
|
||
<style>
|
||
body{
|
||
font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
|
||
background:#111827;
|
||
color:#f3f4f6;
|
||
margin:0;
|
||
padding:1rem;
|
||
line-height:1.5;
|
||
}
|
||
.container{max-width:1100px;margin:0 auto;}
|
||
h1{color:#60a5fa;margin-top:0;}
|
||
a{color:#93c5fd;}
|
||
table{
|
||
width:100%;
|
||
border-collapse:collapse;
|
||
background:#1f2937;
|
||
border-radius:.5rem;
|
||
overflow:hidden;
|
||
}
|
||
th,td{padding:.7rem;text-align:left;border-bottom:1px solid #374151;}
|
||
th{background:#111827;color:#9ca3af;}
|
||
tr:hover{background:#2d3748;}
|
||
.topbar{float:right;display:flex;gap:.75rem;align-items:center;}
|
||
.topbar a{color:#93c5fd;text-decoration:none;}
|
||
.empty{padding:1rem;color:#9ca3af;}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<div class="topbar">
|
||
<a href="{{ url_for('admin_dashboard') }}">Dashboard</a>
|
||
<a href="{{ url_for('admin_settings') }}">Settings</a>
|
||
<a href="{{ url_for('admin_logout') }}" style="color:#f87171">Log out</a>
|
||
</div>
|
||
|
||
<h1>Sales Report</h1>
|
||
|
||
{% if sales %}
|
||
<div class="section" style="background:#1f2937;padding:1rem;border-radius:.5rem;margin-bottom:1rem">
|
||
<h2 style="margin-top:0">MusicGPT Costs (USD)</h2>
|
||
<div class="price-row" style="display:grid;grid-template-columns:repeat(4,1fr);gap:1rem">
|
||
<div>
|
||
<p class="hint" style="margin:0">Songs generated</p>
|
||
<p style="font-size:1.25rem;font-weight:700;margin:.25rem 0">{{ cost_totals.song_count }}</p>
|
||
</div>
|
||
<div>
|
||
<p class="hint" style="margin:0">Completed A/B pairs</p>
|
||
<p style="font-size:1.25rem;font-weight:700;margin:.25rem 0">{{ cost_totals.completed_pairs }}</p>
|
||
</div>
|
||
<div>
|
||
<p class="hint" style="margin:0">Music cost total</p>
|
||
<p style="font-size:1.25rem;font-weight:700;margin:.25rem 0">${{ "%.4f"|format(cost_totals.total_cost) }}</p>
|
||
</div>
|
||
<div>
|
||
<p class="hint" style="margin:0">Stems cost total</p>
|
||
<p style="font-size:1.25rem;font-weight:700;margin:.25rem 0">${{ "%.4f"|format(cost_totals.stems_total) }}</p>
|
||
</div>
|
||
</div>
|
||
<p class="hint" style="margin-top:.5rem">Per-song cost approx. $0.035–$0.045 USD on the current MusicGPT plan (v6 / v6-pro).</p>
|
||
</div>
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>ID</th>
|
||
<th>Name</th>
|
||
<th>Email</th>
|
||
<th>Picked</th>
|
||
<th>Payment Reference</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for s in sales %}
|
||
<tr>
|
||
<td>#{{ s.id }}</td>
|
||
<td>{{ s.name }}</td>
|
||
<td>{{ s.email }}</td>
|
||
<td>{% if s.customer_approved == 'both' %}Both Versions{% else %}Version {{ (s.customer_approved or 'none').upper() }}{% endif %}</td>
|
||
<td>{{ s.square_payment_ref or '-' }}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% else %}
|
||
<p class="empty">No delivered requests yet.</p>
|
||
{% endif %}
|
||
</div>
|
||
</body>
|
||
</html>
|