{% extends "ui/templates/base/layout.html" %} {% block content %}
Clients · Unified Management

Client Management

Compact Client → Business → Branch → Registration management using the existing ERP masters and permissions.

{% if can_create %}+ Add Client{% endif %} Existing Client List
{% for label, value in [ ('Clients', counters.clients), ('Businesses', counters.businesses), ('Branches', counters.branches), ('Registrations', counters.registrations), ('GSTINs', counters.gstin), ('TANs', counters.tan) ] %}
{{ label }}
{{ value }}
{% endfor %}
Search covers client name/code, business/trade name, PAN, GSTIN, TAN, CIN/LLPIN, branch, mobile and email.
Clear
{{ total }} client{{ '' if total == 1 else 's' }}
Expand only the client you need. Existing detail/edit/business-structure pages remain available.
Page {{ page }} of {{ pages }}
{% for node in hierarchy %} {% set client = node.client %}
›
{{ client.client_name }}
{{ client.client_code }} {% if client.trade_name and client.trade_name != client.client_name %}· {{ client.trade_name }}{% endif %} {% if client.pan %}· PAN {{ client.pan }}{% endif %}
{{ client.client_type }}
{{ node.business_count }}business
{{ node.branch_count }}branch
{% if can_edit %} + Business + Branch + Registration {% endif %} View Manage {% if can_edit %}Edit{% endif %}
{% if node.businesses %}
{% for business_node in node.businesses %} {% set business = business_node.row %}
{{ business.business_name }} {% if business.is_primary %}Primary Business{% endif %} {% if not business.is_active %}Inactive{% endif %}
{{ business.business_code }}{% if business.trade_name %} · Trade: {{ business.trade_name }}{% endif %}{% if business.nature_of_business %} · {{ business.nature_of_business }}{% endif %}
{% if can_edit %} + Branch + Registration {% endif %} Manage business
{% for branch_node in business_node.branches %} {% set branch = branch_node.row %}
↳ {{ branch.branch_name }} {{ branch.branch_code }}{% if branch.city %} · {{ branch.city }}{% endif %}{% if branch.state %}, {{ branch.state }}{% endif %} {% if branch.is_primary %}Primary Branch{% endif %}
{{ branch_node.registrations|length }} registration{{ '' if branch_node.registrations|length == 1 else 's' }} {% if can_edit %} + Registration {% endif %}
{% if branch_node.registrations %}
{% for reg, rt in branch_node.registrations %}
{{ rt.code }} {{ reg.registration_number }} {{ reg.status|title }}
{% if reg.trade_name or reg.legal_name %}
{{ reg.trade_name or reg.legal_name }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %} {% if business_node.registrations %}
Business-level registrations
{% for reg, rt in business_node.registrations %}
{{ rt.code }} {{ reg.registration_number }} {{ reg.trade_name or reg.legal_name or '' }}
{% endfor %}
{% endif %}
{% endfor %}
{% else %}
No Business/Business Unit has been created for this client. {% if can_edit %}Create business structure{% endif %}
{% endif %} {% if node.unassigned_registrations %}
Client-level / unassigned registrations
{% for reg, rt in node.unassigned_registrations %}
{{ rt.code }} {{ reg.registration_number }} {{ reg.trade_name or reg.legal_name or '' }}
{% endfor %}
{% endif %}
{% else %}
No clients match the selected filters.
Clear one or more filters and try again.
{% endfor %}
{% if pages > 1 %}
Showing {{ ((page - 1) * per_page) + 1 if total else 0 }}–{{ [page * per_page, total]|min }} of {{ total }}
{% set qs = 'q=' ~ (q|urlencode) ~ '&status=' ~ (status|urlencode) ~ '&client_type=' ~ (client_type|urlencode) ~ '®istration_type=' ~ (registration_type|urlencode) ~ '®istration_status=' ~ (registration_status|urlencode) ~ '&per_page=' ~ per_page %} {% if page > 1 %}Previous{% endif %} {{ page }} / {{ pages }} {% if page < pages %}Next{% endif %}
{% endif %}
{% endblock %}