{% extends "base.html" %} {% block title %}Customer Twin{% endblock %} {% block page_title %}Customer Twin{% endblock %} {% block content %}
{% if total_db_customers > 0 %}{{ total_db_customers }}{% else %}{{ estimated_total }}{% endif %}
Total Customers
{% if total_db_customers > 0 %} {{ customers|selectattr("status", "equalto", "active")|list|length }} {% else %} {{ (estimated_total * 0.85)|int }} {% endif %}
Active Customers
{% if total_db_customers > 0 %} {{ customers|selectattr("is_churned")|list|length }} {% else %} {{ (estimated_total * 0.05)|int }} {% endif %}
Churned
{% if total_db_customers > 0 %} {% set total_ltv = customers|map(attribute='lifetime_value')|sum %} {{ (total_ltv / total_db_customers) | format_currency }} {% else %} {{ 12500 | format_currency }} {% endif %}
Avg LTV
CSV Template Excel Template Export Excel Export PDF {% if total_db_customers > 0 %} {% endif %}
Customer Database
{% if total_db_customers > 0 %}{{ total_db_customers }}{% else %}{{ estimated_total }} (estimated){% endif %} customers
{% if total_db_customers == 0 %}

No customer records in database yet.

Your company has approximately {{ estimated_total }} customers based on company size.

{% else %}
{% for c in customers %} {% endfor %}
Customer Code Name Email Segment LTV Total Spent Orders Satisfaction Status Actions
{{ c.customer_code or '-' }} {{ c.full_name() or '-' }} {{ c.email or '-' }} {{ c.segment or 'General' }} {{ c.lifetime_value | format_currency }} {{ c.total_spent | format_currency }} {{ c.total_orders or 0 }} {% if c.satisfaction_score %} {{ "%.1f"|format(c.satisfaction_score) }} {% else %}-{% endif %} {{ c.status|title }}
{% endif %}
{% endblock %} {% block extra_js %} {% endblock %}