{% extends "base.html" %} {% block title %}KPI Dashboard{% endblock %} {% block header %}KPI Dashboard{% endblock %} {% block content %} {% set total_score = own_total_weighted_score|float if own_total_weighted_score is defined else 0 %} {% if total_score >= 85 %} {% set kpi_status = "Excellent" %} {% set kpi_status_class = "status-excellent" %} {% set kpi_status_icon = "bi-trophy" %} {% elif total_score >= 70 %} {% set kpi_status = "Good" %} {% set kpi_status_class = "status-good" %} {% set kpi_status_icon = "bi-hand-thumbs-up" %} {% elif total_score >= 50 %} {% set kpi_status = "Average" %} {% set kpi_status_class = "status-average" %} {% set kpi_status_icon = "bi-dash-circle" %} {% else %} {% set kpi_status = "Needs Improvement" %} {% set kpi_status_class = "status-low" %} {% set kpi_status_icon = "bi-exclamation-triangle" %} {% endif %}
KPI Management

KPI Dashboard

Track target achievement, weighted score, and team KPI performance for the selected period.
Selected User
{{ selected_user.name if selected_user else '—' }}
{{ period_type|title }} View
Filters
Select employee and reporting period to review KPI performance.
{{ selected_user.name if selected_user else 'KPI Dashboard' }}
Showing KPI performance for {{ period_type|title }}
Total Assigned Weightage
{{ '%.2f'|format(own_total_weightage|float if own_total_weightage is defined else 0) }}%
Total KPI weight assigned in selected period
Total Weighted Score
{{ '%.2f'|format(own_total_weighted_score|float if own_total_weighted_score is defined else 0) }}%
Earned KPI score out of assigned weightage
Overall KPI Status
{{ kpi_status }}
{{ '%.2f'|format(total_score) }}%
Own KPI Performance
Assigned KPI Scorecard
{{ own_rows|length if own_rows else 0 }} KPI(s)
{% if own_rows and own_rows|length > 0 %}
{% for row in own_rows %} {% set ach = row.achievement|float %} {% set progress_width = 100 if ach > 100 else ach %} {% if ach >= 85 %} {% set ach_class = "status-excellent" %} {% elif ach >= 70 %} {% set ach_class = "status-good" %} {% elif ach >= 50 %} {% set ach_class = "status-average" %} {% else %} {% set ach_class = "status-low" %} {% endif %}
{{ row.kpi.name }}
{% if row.kpi.code %}
{{ row.kpi.code }}
{% endif %}
{{ '%.2f'|format(ach) }}%
Target
{% if row.kpi.unit == '%' %} {{ '%.2f'|format(row.target|float) }}% {% else %} {{ '%.2f'|format(row.target|float) }} {% endif %}
Actual
{% if row.kpi.unit == '%' %} {{ '%.2f'|format(row.actual|float) }}% {% else %} {{ '%.2f'|format(row.actual|float) }} {% endif %}
Achievement {{ '%.2f'|format(ach) }}%
Weightage
{{ '%.2f'|format(row.weightage|float) }}%
Weighted Score
{{ '%.2f'|format(row.weighted_score|float) }}%
{{ row.assignment.target_mode|replace('_', ' ')|title }} {% if row.kpi.code in ['total_sales','sales','sales_kpi','cn_invoice_value_inr','crystal_nexus_invoice_value_inr','confirmed_billed_jobcard_value_inr','billed_jobcard_value_inr','confirmed_billed_quotation_value_inr'] %} {% endif %}
{% endfor %}
{% else %}
No KPI assignments found
No KPI assignments found for this user in the selected period.
{% endif %}
{% if team_rows is defined and team_rows|length > 0 %}
Team KPI Performance
Team Aggregate Scorecard
{{ team_rows|length }} KPI(s)
{% for row in team_rows %} {% set team_ach = row.achievement|float %} {% set team_progress_width = 100 if team_ach > 100 else team_ach %} {% endfor %}
KPI Target Actual Achievement Mode
{{ row.kpi.name }}
{{ row.kpi.code }}
{% if row.kpi.unit == '%' %} {{ '%.2f'|format(row.target|float) }}% {% else %} {{ '%.2f'|format(row.target|float) }} {% endif %} {% if row.kpi.unit == '%' %} {{ '%.2f'|format(row.actual|float) }}% {% else %} {{ '%.2f'|format(row.actual|float) }} {% endif %}
{{ '%.2f'|format(team_ach) }}%
{% if row.assignment and row.assignment.target_mode %} {{ row.assignment.target_mode|replace('_', ' ')|title }} {% else %} Team Aggregate {% endif %}
Team KPI is calculated as the sum of reportees' targets and actuals.
{% endif %}
{% endblock %}