{% if cancel_effective_at_iso %}
Cancellation scheduled.
Access remains active until {{ cancel_effective_at_iso }} (UTC).
{% endif %}

Billing & plan

Back to Admin
{% with messages = get_flashed_messages(with_categories=False) %} {% if messages %} {% for m in messages %}
{{ m }}
{% endfor %} {% endif %} {% endwith %} {# Payment failure grace warning (from remote licence service sync) #} {% if premium_state.remote_status and (premium_state.remote_status | lower) == 'past_due' %}
Payment failed. {% if premium_state.remote_grace_until %} Grace period ends: {{ premium_state.remote_grace_until }}. {% else %} Your subscription is in grace period. {% endif %} Update billing to avoid downgrade. {% if is_superadmin %}
{% endif %}
{% endif %}

Current status

{{ premium_state.plan | upper }}
{% if premium_state.trial_active %} Online lease active {% else %} No active online lease {% endif %} {{ premium_state.source | upper }}
Runtime root: {{ runtime_root or '' }}
Runtime lease path: {{ runtime_lease_path or '' }}
Tamper queue path: {{ tamper_queue_path or '' }}
Tamper audit path: {{ tamper_audit_path or '' }}
{% if premium_state.trial_active %}
Premium access now depends on a continuously refreshed online runtime lease. Local unsigned JSON is not trusted in protected mode.
{% endif %} {% if (not premium_state.trial_active) and (premium_state.plan | lower == "free") %} {% set ns = namespace(missing=[]) %} {% for it in (ent_items or []) %} {% if it.type == "bool" and (it.category | lower) == "features" and (not it.value) %} {% set _ = ns.missing.append(it.name) %} {% endif %} {% endfor %}
You're on FREE. {% if ns.missing %}
Locked on this plan: {{ ns.missing | join(", ") }}.
{% endif %}
{% endif %} {% if last_licence_error %}
Last premium issue: {{ last_licence_error }}
{% endif %}
This is self-hosted BYOK. Upgrade is automatic: click a plan below and complete Stripe checkout.
Trial started
{{ premium_state.trial_started_at or '—' }}
{% if is_superadmin %}
Instance fingerprint
{{ premium_state.instance_id or '—' }}
Licence file
{% if licence_exists %} Found:
{{ licence_path }} {% else %} Not found:
{{ licence_path }} {% endif %}
{% endif %}

Entitlements

{% set feats = [] %} {% set lims = [] %} {% for it in (ent_items or []) %} {% if it.type == "bool" and (it.category | lower) == "features" %} {% set _ = feats.append(it) %} {% elif (it.category | lower) == "limits" %} {% set _ = lims.append(it) %} {% endif %} {% endfor %}
Features
    {% for it in feats %}
  • {% if it.value %}✓{% else %}✕{% endif %} {{ it.name }}
  • {% endfor %}
Limits
    {% for it in lims %}
  • {{ it.name }}: {{ it.value }}{% if it.unit %} {{ it.unit }}{% endif %}
  • {% endfor %}
Show raw entitlements JSON
{{ entitlements_json }}
{% if is_superadmin %}

Plan actions

Upgrade, downgrade, or manage the current subscription.
{% set cur = (premium_state.plan | lower) %}
{# FREE / TRIAL: show Pro + Enterprise #} {% if cur in ['free','trial'] %}
{% elif cur == 'pro' %} {# PRO: show upgrades to Business & Enterprise #}
{% elif cur == 'business' %} {# BUSINESS: show upgrade to Enterprise & downgrade to Pro #}
{% elif cur == 'enterprise' %} {# ENTERPRISE: show downgrade to Business and Pro #}
{% else %}
Unknown plan state.
{% endif %}
Self-serve billing is via Stripe Portal (Manage billing). If you switch plans using checkout, Stripe will create a new subscription on the chosen plan.
{% if manual_licence_ui_enabled %}

Upload runtime_lease.json (development only)

Upload a JSON object. Example: {"plan":"pro"}.

Paste runtime lease JSON (development only)

This is intended for development/testing only. Production upgrades should use Stripe checkout.
{% endif %}

Licence diagnostics

Show raw runtime_lease.json (first 8k chars) {% if licence_raw %}
{{ licence_raw }}
{% else %}
No runtime lease file content to display.
{% endif %}
{% endif %}