generated from coulomb/repo-seed
Fix cumulative platform cost Stripe double-counting
Split infrastructure vs payment-processing costs. Liquidity burn now uses infrastructure cash out only (€1,155.20 cumulative) because Stripe fees are already deducted from net member payments. Total platform cost (€1,158.24) remains visible for gross-margin economics.
This commit is contained in:
@@ -30,10 +30,11 @@ def _history_rows(
|
||||
continue
|
||||
payment = revenue_by_period.get(month.period)
|
||||
net_payment = payment.net_amount if payment else Decimal("0")
|
||||
period_net = net_payment - month.platform_cost
|
||||
period_net = net_payment - month.infrastructure_cost
|
||||
lines.append(
|
||||
f"| {month.period} | {month.active_members} | {month.gross_revenue} | "
|
||||
f"{month.platform_cost} | {period_net:.2f} |"
|
||||
f"{month.infrastructure_cost} | {month.payment_processing_cost} | "
|
||||
f"{month.total_platform_cost} | {period_net:.2f} |"
|
||||
)
|
||||
return "\n".join(lines)
|
||||
|
||||
@@ -73,12 +74,15 @@ def render_dashboard(
|
||||
|--------|------:|
|
||||
| Active members | {snapshot.active_members} |
|
||||
| Member payments (gross) | {snapshot.monthly_revenue} {snapshot.currency} |
|
||||
| Platform cost | {snapshot.monthly_platform_cost} {snapshot.currency} |
|
||||
| Infrastructure cost | {snapshot.monthly_infrastructure_cost} {snapshot.currency} |
|
||||
| Payment processing cost | {snapshot.monthly_payment_processing_cost} {snapshot.currency} |
|
||||
| Total platform cost | {snapshot.monthly_total_platform_cost} {snapshot.currency} |
|
||||
| Platform cost per member | {snapshot.cost_per_member} {snapshot.currency} |
|
||||
| Period gross margin | {snapshot.gross_margin} {snapshot.currency} |
|
||||
| Period gross margin % | {snapshot.gross_margin_pct}% |
|
||||
| Period net liquidity | {snapshot.period_net_liquidity} {snapshot.currency} ({snapshot.liquidity_status}) |
|
||||
|
||||
_Period net liquidity = net member payments − infrastructure cost (processing fees already netted from payments)._
|
||||
_Revenue source: {snapshot.revenue_source}_
|
||||
|
||||
## Liquidity & Budget (through {liquidity.through_period})
|
||||
@@ -87,15 +91,17 @@ _Revenue source: {snapshot.revenue_source}_
|
||||
|--------|------:|
|
||||
| Initial budget | {liquidity.initial_budget} {liquidity.currency} |
|
||||
| Cumulative member payments (net) | {liquidity.cumulative_member_payments} {liquidity.currency} |
|
||||
| Cumulative platform cost | {liquidity.cumulative_platform_cost} {liquidity.currency} |
|
||||
| Cumulative infrastructure cost | {liquidity.cumulative_infrastructure_cost} {liquidity.currency} |
|
||||
| Cumulative payment processing | {liquidity.cumulative_payment_processing_cost} {liquidity.currency} |
|
||||
| Cumulative total platform cost | {liquidity.cumulative_total_platform_cost} {liquidity.currency} |
|
||||
| Cumulative net liquidity | {liquidity.cumulative_net_liquidity} {liquidity.currency} ({liquidity.liquidity_status}) |
|
||||
| Remaining budget | {liquidity.remaining_budget} {liquidity.currency} ({budget_state}) |
|
||||
| Months tracked | {liquidity.months_tracked} |
|
||||
|
||||
## Monthly History
|
||||
|
||||
| Period | Members | Gross revenue | Platform cost | Net liquidity |
|
||||
|--------|--------:|--------------:|--------------:|--------------:|
|
||||
| Period | Members | Gross revenue | Infrastructure | Processing | Total platform | Net liquidity |
|
||||
|--------|--------:|--------------:|---------------:|-----------:|---------------:|--------------:|
|
||||
{history_lines}
|
||||
|
||||
## Pricing Model Registry
|
||||
|
||||
Reference in New Issue
Block a user