Files
supermarket/internal/web/templates/metrics-month.html
T
davidandClaude Opus 5.5 5e799c7541 Phase 4 part 2: MRR, its movements, NRR and cohorts
Each customer's MRR at each month's end, from the recurring lines of paid
and open invoices: the amount after discounts over the billing interval,
prorations over their part-period. Moves are new, expansion, contraction,
churn and reactivation (sub-dollar noise ignored); NRR monthly and over
12 months; cohorts by first paid month. A start month, suggested when
most of the business appears at once (billing moved to Stripe), makes
those customers the base. Metrics page with a chart, the month table,
cohorts, and each month's customer moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:17:53 -07:00

18 lines
1.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{define "content"}}{{with .Data}}{{$m := .M}}
<div class="heading">
<h1>MRR in {{$m.Month}}</h1>
<div class="buttons"><a class="button secondary" href="/metrics">Metrics</a></div>
</div>
<p class="lede">{{usd $m.MRR}} from {{num $m.Customers}} customers{{if $m.Partial}}, so far this month{{end}}. Net change {{usd $m.NetNew}}: new {{usd $m.New}}, expansion {{usd $m.Expansion}}, reactivation {{usd $m.Reactivation}}, contraction −{{usd $m.Contraction}}, churn −{{usd $m.Churn}}.</p>
{{if .Changes}}
<table class="list">
<thead><tr><th>Customer</th><th>Movement</th><th class="num">MRR before</th><th class="num">After</th><th class="num">Change</th></tr></thead>
<tbody>{{range .Changes}}<tr>
<td>{{or .Customer.Name .Customer.Email .Customer.ID}}{{if and .Customer.Name .Customer.Email}} <span class="muted small">{{.Customer.Email}}</span>{{end}}</td>
<td><span class="badge {{if or (eq .Kind "churn") (eq .Kind "contraction")}}failed{{else}}published{{end}}">{{.Kind}}</span></td>
<td class="num">{{usd .Before}}</td><td class="num">{{usd .After}}</td><td class="num">{{usd (sub .After .Before)}}</td>
</tr>{{end}}</tbody>
</table>
{{else}}<p class="help">No customer moved this month.</p>{{end}}
{{end}}{{end}}