{% extends 'layouts/base.html' %} {% block content %}

{{ 'Administration Dashboard' if is_super_admin else 'Team Dashboard' if is_manager else 'My Dashboard' }}

Current lead and approved-sales activity

{% if is_super_admin %} System Settings {% endif %}
{% set icons = ['target', 'trophy', 'receipt-text', 'indian-rupee', 'users', 'briefcase-business'] %} {% for k, v in stats.items() if k != 'total_sales' %}
{{ k.replace('_', ' ').title() }} {{ v }}
{% endfor %}
{% if is_super_admin %}

Manager and Team Performance

Approved sales this month and lead status distribution for every active manager and their direct reports.

{% for group in manager_performance %}

{{ group.manager.name }}

{% if group.totals %}
{{ group.totals.assigned_leads }} assigned leads {{ group.totals.sale_count }} approved orders ₹{{ '%.2f'|format(group.totals.approved_sales) }} this month
{% for status in group.statuses %}{% endfor %} {% for member in group.rows %} {% for status in group.statuses %}{% endfor %} {% endfor %}
Team Member Assigned Leads{{ status.replace('_', ' ').title() }}Orders Approved Sales
{{ member.name }}{% if member.is_manager %} Manager{% endif %} {{ member.assigned_leads }}{{ member.status_counts.get(status, 0) }}{{ member.sale_count }} ₹{{ '%.2f'|format(member.approved_sales) }}
{% else %}

No direct reports or performance data is mapped to this manager yet.

{% endif %}
{% else %}

No active managers found.

{% endfor %}
{% endif %}

Recently Updated Leads

{% for l in recent_leads %} {% endfor %}
Name Phone Status Priority Updated
{{ l.customer_name }} {{ l.phone or '-' }} {{ l.status }} {{ l.priority }} {{ l.updated_at }}

Current Month Overview

{% set chart_max = chart|map(attribute=1)|max if chart else 1 %} {% for label, value in chart %}
{{ label }}
{{ '₹{:,.2f}'.format(value) if 'sales' in label|lower else value|int }}
{% endfor %}
{% if is_manager %}

Team Progress

You and every member reporting to you, with assigned leads split by status and approved sales for the current month.

{% if team_totals %}
Team Members{{ direct_report_count }}
Group Assigned Leads{{ team_totals.assigned_leads }}
Group Sales Orders (Month){{ team_totals.sale_count }}
Total Group Sales (Month)₹{{ '%.2f'|format(team_totals.approved_sales) }}
{% endif %}
{% for status in team_statuses %}{% endfor %} {% for member in team_rows %} {% for status in team_statuses %} {% endfor %} {% else %} {% endfor %} {% if team_totals %} {% for status in team_statuses %}{% endfor %} {% endif %}
Team Member Assigned Leads{{ status.replace('_', ' ').title() }}Sales Orders (Month) Approved Sales (Month) Incentive % Incentive Amount Leads
{{ member.name }}{% if member.is_manager %} You{% endif %} {{ member.assigned_leads }} {% set count = member.status_counts.get(status, 0) %} {% if count %} {{ count }} {% else %}0{% endif %} {{ member.sale_count }} ₹{{ '%.2f'|format(member.approved_sales) }} {{ member.percentage }}% ₹{{ '%.2f'|format(member.incentive) }} View
No team members are mapped to you yet. Set the Manager field on each employee record.
Group Total {{ team_totals.assigned_leads }}{{ team_totals.status_counts.get(status, 0) }}{{ team_totals.sale_count }} ₹{{ '%.2f'|format(team_totals.approved_sales) }} - ₹{{ '%.2f'|format(team_totals.incentive) }} All
{% if team_rows %}

Share of Group Sales This Month

{% set sales_max = team_rows|map(attribute='approved_sales')|max %} {% for member in team_rows %}
{{ member.name }}{% if member.is_manager %} (You){% endif %}
₹{{ '%.2f'|format(member.approved_sales) }}
{% endfor %} {% endif %}
{% endif %} {% if not is_super_admin %}
{% endif %} {% endblock %}