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

ERP Local Agent

Branch-local ERP runtime. Existing storage remains unchanged; future Tally/GST/local tools will use the same agent.

Scope: {{ storage_scope_title or '-' }}

ERP Local Agent release: {{ erp_local_agent_version or '-' }} ยท automatic updates enabled

{% if request.query_params.get('error') == 'branch_not_linked' %}
Your user is not linked to a branch. Please update the Partner/Branch Manager user profile with branch_id before enabling local storage.
{% endif %}
Storage Nodes
{{ nodes|length }}
Online / Active
{{ nodes|selectattr('is_active')|list|length }}
Recent Storage Jobs
{{ recent_jobs|length if recent_jobs is defined else 0 }}
Recent Download Requests
{{ recent_download_requests|length if recent_download_requests is defined else 0 }}
{% if request.query_params.get('created') == '1' %}
Storage node created. Use the Download ERP Local Agent button in the node row to generate the branch package. Secret and standalone .env are not displayed.
{% endif %} {% if request.query_params.get('error') == 'env_download_disabled' %}
Standalone .env download is disabled for security. Download the pre-configured ERP Local Agent ZIP instead.
{% endif %}
{% if can_manage_branch_storage %}

One-click branch setup

Recommended. ERP will create or reuse the branch node and immediately download the pre-configured LSA2 Windows Service ZIP. Secret is not shown on screen. If a branch already has a storage root, the existing root will be reused and will not be silently changed.

{% if forced_branch_id %}
{% set fb = branch_map.get(forced_branch_id) if branch_map else None %} {{ fb.name if fb else ('Branch ID ' ~ forced_branch_id) }}{% if fb and fb.code %} ({{ fb.code }}){% endif %}
{% else %} {% endif %}

For a new branch setup only. Existing branch nodes keep their already configured root.

Manual node creation

Use only when you want a custom node code/name.

{% if forced_branch_id %}
{% set fb = branch_map.get(forced_branch_id) if branch_map else None %} {{ fb.name if fb else ('Branch ID ' ~ forced_branch_id) }}{% if fb and fb.code %} ({{ fb.code }}){% endif %}
{% else %} {% endif %}
{% else %}
Storage setup package generation is available to Firm Admin, Partner and Branch Manager. This screen is monitoring-only for your current role.
{% endif %}

Configured ERP Local Agents

Partners/Branch Managers see only their managed branch. One branch should have one active node and one fixed storage root. Existing node secrets are not shown again.

{% for node in nodes %} {% set b = branch_map.get(node.branch_id) if branch_map and node.branch_id else None %} {% else %} {% endfor %}
NodeBranchStatusLast SeenRootAction
{{ node.node_name }}
{{ node.node_code }}
{{ b.name if b else (node.branch_id or 'Firm-level') }} {{ node.status }} {{ node.last_seen_at_utc or '-' }} {{ node.storage_root_path or '-' }} {% if can_manage_branch_storage %}
{% if node.status == 'disabled_duplicate' %} Duplicate disabled {% else %}
{% endif %}
{% else %}-{% endif %}
No storage nodes registered yet.

Recent Storage Jobs

{% for job in recent_jobs or [] %} {% else %} {% endfor %}
JobStatusCreated
#{{ job.id }}{{ job.status }}{{ job.created_at_utc or '-' }}
No recent storage jobs.

Recent Download Requests

{% for dr in recent_download_requests or [] %} {% else %} {% endfor %}
RequestStatusCreated
#{{ dr.id }}{{ dr.request_status }}{{ dr.created_at_utc or '-' }}
No recent download requests.
{% endblock %}