{% extends "base.html" %} {% block content %}

Asset Allocations

{% if allocations %} {% for a in allocations %} {# IMPORTANT: don't do "or 1" here, qty can be 0 in bad legacy rows and we should show it #} {% set qty = (a.quantity if a.quantity is not none else 1) %} {% endfor %} {% else %} {% endif %}
Asset Employee Allocated On Qty Due Back Returned On Status Actions
{{ a.asset.asset_tag }} - {{ a.asset.name }}
Stock: {{ a.asset.quantity_available if a.asset.quantity_available is not none else '-' }} / {{ a.asset.quantity_total if a.asset.quantity_total is not none else '-' }}
{{ a.employee.employee_code }} - {{ a.employee.full_name }} {{ a.allocated_on.strftime('%d-%m-%Y') if a.allocated_on else '-' }} {% if qty <= 0 %} 0 {% else %} {{ qty }} {% endif %} {% if a.expected_return_date %} {{ a.expected_return_date.strftime('%d-%m-%Y') }} {% else %} - {% endif %} {% if a.actual_return_date %} {{ a.actual_return_date.strftime('%d-%m-%Y') }} {% else %} - {% endif %} {% if a.status == 'allocated' %} Allocated {% elif a.status == 'return_pending' %} Return Pending {% elif a.status == 'returned' %} Returned {% else %} {{ a.status }} {% endif %} {% if a.status == 'allocated' %} {% if qty <= 0 %} Invalid qty {% else %} {% endif %} {% elif a.status == 'return_pending' %} Pending approval {% else %} - {% endif %}
No allocations found.
{# ---------------- Return Modal (lets user pick date + remarks; prevents accidental returns) ---------------- #} {% endblock %}