{% extends "ui/templates/base/layout.html" %} {% block content %}

{{ client.client_name }} — Business Structure

Maintain Business Units, Client Branches and statutory registrations under one PAN/legal client.

Back to Client
{% if request.query_params.get('message') %}
{{ request.query_params.get('message') }}
{% endif %} {% if request.query_params.get('error') %}
{{ request.query_params.get('error') }}
{% endif %} {% if can_edit %}

Add Business Unit

Add Client Branch

Add Registration

{% endif %} {% if can_edit and request.query_params.get('edit_business') %} {% for edit_row in businesses if edit_row.id|string == request.query_params.get('edit_business') %}

Edit Business Unit

Updates this existing Business Unit; linked records remain attached.

Cancel
{% endfor %} {% endif %} {% if can_edit and request.query_params.get('edit_branch') %} {% for edit_row in branches if edit_row.id|string == request.query_params.get('edit_branch') %}

Edit Client Branch

Updates this existing branch without changing its record ID.

Cancel
{% endfor %} {% endif %} {% if can_edit and request.query_params.get('edit_registration') %} {% for edit_row in registrations if edit_row.id|string == request.query_params.get('edit_registration') %}

Edit Registration

The existing registration ID and linked credentials remain unchanged.

Cancel
{% endfor %} {% endif %}
Business Units
{% for row in businesses %}{% else %}{% endfor %}
CodeBusiness UnitTrade NameNatureStatus
{{ row.business_code }}{{ row.business_name }}{% if row.is_primary %} Primary{% endif %}{{ row.trade_name or '-' }}{{ row.nature_of_business or '-' }}{{ 'Active' if row.is_active else 'Inactive' }}{% if can_edit %}
Edit
{% endif %}
No Business Units added.
Client Branches
{% for row in branches %}{% else %}{% endfor %}
CodeClient BranchTypeLocationStatus
{{ row.branch_code }}{{ row.branch_name }}{% if row.is_primary %} Primary{% endif %}{{ row.branch_type|replace('_',' ')|title }}{{ row.city or '' }}{% if row.city and row.state %}, {% endif %}{{ row.state or '-' }}{{ 'Active' if row.is_active else 'Inactive' }}{% if can_edit %}
Edit
{% endif %}
No Client Branches added.
Registrations
Portal credentials linked to each registration are available here without exposing encrypted values.
{% for row in registrations %} {% set linked_credentials = registration_credentials.get(row.id, []) %} {% else %} {% endfor %}
Type Number Trade / Unit Name State Status Credentials Actions
{{ registration_type_codes.get(row.id, "-") }} {{ row.registration_number }} {{ row.trade_name or row.legal_name or '-' }} {{ row.state or '-' }} {{ row.status|replace('_',' ')|title }} {% if can_open_credentials %} {% if linked_credentials %}
{{ linked_credentials|length }} credential{{ '' if linked_credentials|length == 1 else 's' }} ▼
{% for credential in linked_credentials %}
{{ credential.title }}
{{ credential_category_labels.get(credential.category, credential.category|replace('_',' ')|title) }}
{{ credential.status|replace('_',' ')|title }}
View credential
{% endfor %}
{% else %} No credentials added {% endif %} {% else %} Restricted {% endif %}
{% if can_edit %} Edit {% endif %} {% if can_manage_credentials %} {{ '+ Add Another Credential' if linked_credentials else '+ Add Credential' }} {% endif %} {% if can_edit %}
{% endif %}
No registrations added.
{% endblock %}