{% extends 'base.html' %} {% load static %} {% block title %}Subscription & Billing - {{ organization.name }}{% endblock %} {% block page_pretitle %}Billing Dashboard{% endblock %} {% block page_title %}Subscription & Billing{% endblock %} {% block page_actions %} View All Plans Buy Credits {% endblock %} {% block extra_css %} {% endblock %} {% block content %}

{{ organization.name }}

{{ current_plan.name }} Plan

{% if scheduled_change %} Scheduled to {{ scheduled_change.new_plan.name }} on {{ scheduled_change.effective_date|date:"d M Y" }} {% else %} Active since {{ subscription_start_date|date:"d M Y" }} {% endif %}

{{ days_until_renewal|default:"N/A" }}
Days Until Renewal
RM {{ next_billing_amount|default:0|floatformat:2 }}
Next Billing Amount
{{ credit_balance.balance|default:0|floatformat:0 }}
AI Credits Available
{{ unpaid_invoices_count|default:0 }}
Unpaid Invoices
{% if current_plan.ai_accounting_enabled %}

AI Token Usage This Month

{% if token_limit %}
{{ tokens_used_this_month|floatformat:0 }} / {{ token_limit|floatformat:0 }} tokens {{ token_percentage|floatformat:1 }}%
{% if token_percentage > 10 %}{{ token_percentage|floatformat:1 }}%{% endif %}
{% if tokens_remaining > 0 %}

{{ tokens_remaining|floatformat:0 }} tokens remaining

{% else %}

Token limit reached! Consider buying more credits.

{% endif %} {% elif token_limit is None %}
Unlimited Tokens
Used this month: {{ tokens_used_this_month|floatformat:0 }} tokens
{% endif %}
{{ tokens_used_this_month|default:0|floatformat:0 }}
Tokens Used
RM {{ total_cost_this_month|default:0|floatformat:2 }}
Total Cost
{{ usage_by_module|length|default:0 }}
Modules Used
{% endif %}

Recent Invoices

View All
{% if recent_invoices %} {% for invoice in recent_invoices %}
{{ invoice.invoice_number }}
{{ invoice.created_at|date:"d M Y" }}
RM {{ invoice.total_amount|floatformat:2 }}
{{ invoice.get_status_display }}
{% endfor %} {% else %}

No invoices yet

{% endif %}
{% if usage_by_module %}

Usage by AI Module

{% for module in usage_by_module %}
{% if module.module_type == 'accounting' %} AI Accounting {% elif module.module_type == 'advisor' %} AI Advisor {% elif module.module_type == 'documents' %} AI Documents {% endif %}
{{ module.total_tokens|floatformat:0 }} tokens
RM {{ module.total_cost|floatformat:2 }}
{% endfor %}
{% endif %}
Plan Features
Plan: {{ current_plan.name }}
Price: RM {{ current_plan.price_monthly|floatformat:2 }}/month
{{ current_plan.max_users }} Users
AI Accounting
POS System
LHDN Tax
Renewal: {{ next_renewal_date|date:"d M Y" }}
Need Help?

Contact support for billing assistance

Contact Support
{% endblock %}