{% 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

Plan
{{ premium_state.plan | upper }}
Trial
{% if premium_state.trial_active %} Active ({{ premium_state.trial_days_left }} day{% if premium_state.trial_days_left != 1 %}s{% endif %} left) {% else %} Ended {% 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 %}
Your current caps:
    {% for it in (ent_items or []) %} {% if (it.category | lower) == "limits" %}
  • {{ it.name }}: {{ it.value }}{% if it.unit %} {{ it.unit }}{% endif %}
  • {% endif %} {% endfor %}
{% if is_superadmin %}
Upgrade / Apply licence Quick start: paste {"plan":"pro"} below and click Save.
{% endif %}
{% endif %}
{% if is_superadmin %}
{% if last_licence_error %}
Last licence issue: {{ last_licence_error }}
{% endif %}
{% endif %}
Trial started
{{ premium_state.trial_started_at or '—' }}
{% if is_superadmin %}
Instance fingerprint
{{ premium_state.instance_id or '—' }}
Entitlements source
{{ premium_state.source }}
Licence file
{% if licence_exists %} Found: {{ licence_path }} {% else %} Not found: {{ licence_path }} {% endif %}
{% endif %}
{% if premium_state.trial_active %}
Trial is full-access. If you upload a Pro/Enterprise licence now, it will be stored and will take over automatically after the trial ends.
{% endif %}
This is self-hosted BYOK. Upgrade is automatic: click a plan below, complete Stripe checkout.

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 or Downgrade”.
{% 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 licence.json

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

Paste licence JSON

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

Raw licence.json (first 8k chars)

{% if licence_raw %}
{{ licence_raw }}
{% else %}
No licence file content to display.
{% endif %}
{% endif %}