{% extends "dashboard/layout.html" %} {% block title %}{{ _('Billing & Invoices – Dashboard') }}{% endblock %} {% block dashboard_content %}

{{ _('Billing & Invoices') }}

{{ _('View your subscription details and payment history') }}

{{ _('Current Plan') }}

{{ plan.name if plan else _('Free Plan') }}
{% if plan and plan.price_monthly > 0 %} ${{ '%.2f'|format(plan.price_monthly) }}/{{ _('month') }} {% if user.get('subscription_status') %} · {{ user.subscription_status }} {% endif %} {% else %} {{ _('Free forever') }} {% endif %}
{% if plan and plan.price_monthly == 0 %} {{ _('Upgrade Plan') }} {% else %} {{ _('Change Plan') }} {% if user.get('subscription_status') not in ('cancelled', 'canceled') %}
{% endif %} {% endif %}
{% if plan and plan.price_monthly > 0 %}
{% if user.get('subscription_expires_at') %}
{{ _('Next Billing Date') }}
{{ user.subscription_expires_at[:10] if user.subscription_expires_at else '–' }}
{% endif %}
{{ _('Auto-Renew') }}
{% set ar = user.get('auto_renew', 1) %} {{ _('On') if ar else _('Off') }}
{{ _('Status') }}
{{ user.get('subscription_status', 'free')|capitalize }}
{% endif %}

{{ _('Invoice History') }}

{{ invoices|length }} {{ _('record(s)') }} {% if invoices %} {{ _('Export CSV') }} {% endif %}
{% if invoices %}
{% for inv in invoices %} {% set inv_amount = (inv.amount / 100) if inv.source == 'stripe' else inv.amount %} {% endfor %}
{{ _('Date') }} {{ _('Description') }} {{ _('Amount') }} {{ _('Status') }} {{ _('Invoice') }}
{{ inv.created_at[:10] if inv.created_at else '–' }} {{ inv.description or _('Subscription payment') }} ${{ '%.2f'|format(inv_amount) }} {{ (inv.currency or 'USD')|upper }} {{ (inv.status or 'unknown')|capitalize }}
{% else %}

{{ _('No invoices yet') }}

{{ _('Your payment history will appear here after your first subscription payment.') }}

{% if plan and plan.price_monthly == 0 %} {{ _('Upgrade to a paid plan') }} {% endif %}
{% endif %}
{% endblock %}