{% extends "pos/base.html" %} {% load static %} {% block stylesheets %} {% endblock %} {% block content %}
{% if form.initial.username %} Edit User {% else %} Add New User {% endif %}
{% csrf_token %} {% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}
{{ form.username }} {% if form.username.errors %}
{{ form.username.errors }}
{% endif %}
{{ form.email }} {% if form.email.errors %}
{{ form.email.errors }}
{% endif %}
{{ form.password1 }} {{ form.password1.help_text }} {% if form.password1.errors %}
{{ form.password1.errors }}
{% endif %}
{{ form.password2 }} {% if form.password2.errors %}
{{ form.password2.errors }}
{% endif %}

{{ form.branches }} {{ form.branches.help_text }} {% if form.branches.errors %}
{{ form.branches.errors }}
{% endif %}
{{ form.expiry_date }} {% if form.expiry_date.errors %}
{{ form.expiry_date.errors }}
{% endif %}
{{ form.status }} {% if form.status.errors %}
{{ form.status.errors }}
{% endif %}

Bank Account Access

Select which bank accounts this user can use. Leave all unchecked to grant access to all banks.

Select a branch above to see its bank accounts.
{% if banks_by_branch %} {% for group in banks_by_branch %} {# FIX: convert branch.pk to string BEFORE building composite key #} {% with bpk=group.branch.pk|stringformat:"s" %}
{{ group.branch.company_name }} / {{ group.branch.branch_name }}
{% for bank in group.banks %} {# FIX: convert t_id to string FIRST, then concatenate — avoids string+int = '' bug #} {% with btid=bank.t_id|stringformat:"s" %} {% with ck=bpk|add:"__"|add:btid %}
{% endwith %}{% endwith %} {% endfor %}
{% endwith %} {% endfor %}
{% else %}

No bank accounts found.

{% endif %} {% if form.bank_accounts.errors %}
{{ form.bank_accounts.errors }}
{% endif %}
{% if has_sub_tenants %}
Counter / Sub-Tenant Access

Leave unchecked for parent-level access only.

{% if form.sub_tenants.field.queryset.exists %}
{% for checkbox in form.sub_tenants %}
{{ checkbox.tag }}
{% endfor %}
{% else %}

No sub-tenants available.

{% endif %} {% if form.sub_tenants.errors %}
{{ form.sub_tenants.errors }}
{% endif %}
{% endif %}
Cancel
{% endblock %} {% block javascripts %} {% endblock %}