{% extends "pos/base.html" %} {% block title %}Active Branches Overview{% endblock %} {% block content %}
{# PAGE HEADER #}

Active Branches Overview

{{ total_branches }} active branch{{ total_branches|pluralize:"es" }} {% if tenant_groups %} across {{ tenant_groups|length }} tenant{{ tenant_groups|length|pluralize }}{% endif %}
Add Branch
{# ══ SERVER-SIDE FILTER BAR ══ #}
→
Clear
{# ══ COLOR FILTER BAR (client-side, instant) ══ #}
Filter by Last Login:
{# ══ RESULTS ══ #} {% if tenant_groups %} {% for group in tenant_groups %}
{{ group.company_name }} Tenant ID: {{ group.tenant_id }}
{{ group.branches|length }} branch{{ group.branches|length|pluralize:"es" }}
{% for item in group.branches %} {% with br=item.branch %} {% endwith %} {% endfor %}
Branch Name Tenant ID Phone Address Expiry Date Last Login Action
{{ br.branch_name }} {{ br.pos_business_id }} {% if br.phone_no %} {{ br.phone_no }} {% elif br.mobile_no %} {{ br.mobile_no }} {% else %}—{% endif %} {% if br.address %} {{ br.address }} {% else %}—{% endif %} {% if br.expiry_date %} {{ br.expiry_date|date:"d M Y" }}
{% if br.expiry_date < today %} Expired {% elif br.expiry_date == today %} Today {% else %}{{ br.expiry_date|timeuntil }} left{% endif %} {% else %} No expiry {% endif %}
{% if item.last_login %} {{ item.last_login|date:"d M Y H:i" }} {% else %} No login recorded {% endif %} Edit
{% endfor %} {% else %}
No active branches found

{% if expiry_range or search_val %} No branches match the selected filters. Clear filters {% else %}There are no active branches in the system yet.{% endif %}

{% endif %} {# ══ SUMMARY FOOTER ══ #} {% if tenant_groups %}
Summary by Last Login Category
Login Category Branches Tenants Distribution
Total — —
{% endif %}
{% endblock %} {% block javascripts %} {{ block.super }} {% endblock %}