{% extends "base.html" %} {% block title %}{{ customer.display_name }} — Customer{% endblock %} {% block content %}
{# ── Back + Header ── #}
arrow_back Back to Customers

person {{ customer.display_name }} {% if has_bc %} BC {% endif %}

{% if customer.website %} {% set ws_href = customer.website if customer.website.startswith('http') else 'https://' + customer.website %}
link {{ customer.website }} open_in_new {% if site_check %} {% if site_check.is_online == true %} {% set tip = 'Online' %} {% if site_check.error_message %}{% set tip = 'Online (' ~ site_check.http_status ~ ' — ' ~ site_check.error_message ~ ')' %} {% elif site_check.http_status %}{% set tip = 'Online (' ~ site_check.http_status ~ ', ' ~ (site_check.response_time_ms or '?') ~ 'ms)' %}{% endif %} {% elif site_check.is_online == false %} {% set tip = 'Offline' %} {% if site_check.error_message %}{% set tip = 'Offline — ' ~ site_check.error_message %}{% endif %} {% endif %} {% if site_check.module_found == true %}Module OK {% elif site_check.module_found == false %}Module ?{% endif %} {% if site_check.last_check_at %}checked {{ site_check.last_check_at }}{% endif %} {% endif %}
{% endif %}
{% if customer.country_code %} {{ customer.country_code }} {% endif %} {% if customer.language %} | {{ customer.language }} {% endif %} | {{ customer.customer_hash[:16] }}...
{# ── Stat cards ── #}

Revenue

€{{ customer.total_revenue }}

Orders

{{ customer.total_orders }}

Products

{{ customer.total_products }}

Tickets

{{ customer.total_threads }}

{# ── Info cards: BC + Support ── #}
{# Business Care card #}

verified Business Care

{% if has_bc and bc_info %}
Status Active
Product {{ bc_info.product_name or '--' }}
Last BC Order {{ bc_info.order_date.strftime('%Y-%m-%d') if bc_info.order_date else '--' }}
Amount €{{ bc_info.amount or '0' }}
{% else %}

No Business Care subscription

{% endif %}
{# Support Status card #}

support Support Status

{% if support_info %}
Has Support {% if support_info.has_support %} Yes {% elif support_info.has_support == false %} No {% else %} Unknown {% endif %}
{% if support_info.support_type %}
Type {{ support_info.support_type }}
{% endif %} {% if support_info.zen_type %}
Zen Type {{ support_info.zen_type }}
{% endif %} {% if support_info.zen_nb_days_left is not none %}
Days Left {{ support_info.zen_nb_days_left }}
{% endif %} {% if support_info.support_expiration_date %}
Expires {{ support_info.support_expiration_date.strftime('%Y-%m-%d') }}
{% endif %}
{% else %}

No support data available

{% endif %}
{# ── Timeline row ── #}

Timeline

First Order {{ customer.first_order_date.strftime('%Y-%m-%d') if customer.first_order_date else '--' }}
Last Order {{ customer.last_order_date.strftime('%Y-%m-%d') if customer.last_order_date else '--' }}
First Ticket {{ customer.first_thread_date.strftime('%Y-%m-%d') if customer.first_thread_date else '--' }}
Last Ticket {{ customer.last_thread_date.strftime('%Y-%m-%d') if customer.last_thread_date else '--' }}
{# ── Inferred Purchases (from BC subscriptions) ── #} {% if inferred_products %}

lightbulb Inferred Purchases (from Business Care subscriptions)

{% for ip in inferred_products %}
{% if ip.pico_url %} {% else %}
inventory_2
{% endif %}
{{ ip.name }} Inferred from: {{ ip.bc_name }}
inferred
{% endfor %}
{% endif %} {# ── Purchase History ── #}

receipt_long Purchase History ({{ orders|length }})

{% if orders %}
{% for o in orders %} {% endfor %}
Date Order ID Product Type Amount
{{ o.order_date.strftime('%Y-%m-%d') if o.order_date else '--' }} {{ o.id_order or o.provider_order_id }}
{% if o.product_type == 'business_care' %}
BC
{% elif o.pico_url %} {% endif %} {{ o.product_name or '--' }}
{% if o.transaction_type == 'income' %} income {% elif o.transaction_type == 'payment' %} payment {% else %} {{ o.transaction_type or '--' }} {% endif %} {% if o.transaction_type == 'income' %} €{{ o.amount or '0' }} {% elif o.transaction_type == 'payment' %} €{{ o.amount or '0' }} {% else %} €{{ o.amount or '0' }} {% endif %}
{% else %}

No purchase history

{% endif %}
{# ── Support Threads ── #}

forum Support Threads ({{ threads|length }})

{% if threads %}
{% for t in threads %} {% endfor %}
Subject Product Status Priority Support Last Activity
{% if t.ticket_id %} {{ t.subject | truncate(50) }} {% else %} {{ t.subject | truncate(50) }} {% endif %} {{ t.product_name or '--' }} {% if t.status == 'open' %} open {% elif t.status == 'in_progress' %} in progress {% elif t.status == 'waiting_customer' %} waiting {% elif t.status == 'closed' %} closed {% else %} -- {% endif %} {% if t.priority %} {{ t.priority | upper }} {% else %} -- {% endif %} {% if t.is_support_expired %} expired {% elif t.has_support %} active {% elif t.has_support == false %} none {% else %} -- {% endif %} {{ t.last_activity_at.strftime('%Y-%m-%d') if t.last_activity_at else '--' }}
{% else %}

No support threads

{% endif %}
{% endblock %}