{% extends "base.html" %} {% block content %}
Quick Actions
{% if g.user.role in ['DIRECTOR', 'PRINCIPAL', 'REGISTRAR'] %} + Admit Student {% endif %} {% if g.user.role in ['DIRECTOR', 'PRINCIPAL', 'BURSAR'] %} + Record M-Pesa / Bank Payment Run Payroll {% endif %} {% if g.user.role in ['DIRECTOR', 'PRINCIPAL', 'TEACHER'] %} + Enter Marks / Rubrics {% endif %} {% if g.user.role in ['DRIVER'] %} View My Bus Routes {% endif %} {% if g.user.role in ['CATERER'] %} + Log Today's Meal Count {% endif %} {% if g.user.role in ['STOREKEEPER'] %} + Issue Uniform / Book {% endif %} {% if g.user.role in ['MATRON'] %} + Issue Exeat Gate Pass {% endif %}
{% if g.user.role in ['DIRECTOR', 'PRINCIPAL', 'BURSAR'] %}
Active Learners

{{ stats.students }}

Across {{ stats.campuses }} campus(es)
Term Fees Collected

KES {{ "{:,.0f}".format(stats.collected) }}

{{ stats.collection_rate }}% of KES {{ "{:,.0f}".format(stats.billed) }} billed
Outstanding Fee Arrears

KES {{ "{:,.0f}".format(stats.arrears) }}

View debtor invoices →
Active Staff & Wallets

{{ stats.staff }} Staff

SMS: {{ stats.sms_credits }} • AI: {{ stats.ai_credits }}
{% elif g.user.role == 'TEACHER' %}
My Assigned Classes

{{ assigned_grades|length }}

{% for gr in assigned_grades %}{{ gr.name }} {% endfor %}
Learners in My Classes

{{ stats.students }}

Open class list →
Active Term

{{ active_term.name if active_term else 'Not Set' }}

{{ active_term.curriculum if active_term else '' }}
Today's Status

{{ 'Open' if school_open_today else 'Break' }}

View assessments →
{% else %}
Active Learners

{{ stats.students }}

Transport Routes

{{ stats.routes }}

Learners Out on Exeat

{{ stats.on_exeat }}

Low-Stock Store Items

{{ stats.low_stock }}

{% endif %}
{% if campus_breakdown %}
Campus Performance Breakdown
Group Overview
{% for c in campus_breakdown %} {% endfor %}
CampusStudentsCollected (KES)Arrears (KES)
{{ c.name }}
{{ c.level }}
{{ c.students }} {{ "{:,.0f}".format(c.collected) }} {{ "{:,.0f}".format(c.arrears) }}
{% endif %} {% if g.user.role in ['DIRECTOR', 'PRINCIPAL', 'BURSAR'] %}
Recent M-Pesa & Bank Receipts
View All →
{% for p in recent_payments %} {% set st = student_map.get(p.student_id) %} {% else %} {% endfor %}
ReceiptStudentChannelAmount (KES)
{{ p.receipt_no }} {{ st.full_name if st else p.account_ref_entered }} {{ p.payment_method }} {{ "{:,.2f}".format(p.amount) }}
No payments recorded yet.
{% endif %} {% if g.user.role in ['DIRECTOR', 'PRINCIPAL', 'STOREKEEPER', 'MATRON', 'CATERER', 'DRIVER'] %}
Operations & Logistics Snapshot
Active Bus Routes{{ stats.routes }}
Students Currently Out on Exeat{{ stats.on_exeat }}
Store / Uniform Items Below Reorder Level{{ stats.low_stock }}
School Session Status Today{{ 'Open (Normal Classes)' if school_open_today else 'Closed / Break' }}
{% endif %}
{% endblock %}