{{ a.subcategory.name if a.subcategory else '-' }}
{{ a.vendor.name if a.vendor else '-' }}
{{ a.serial_number or '-' }}
{{ (a.status or 'in_stock').replace('_',' ')|title }}
{% set total = (a.quantity_total if a.quantity_total is not none else 1) %}
{% set avail = (a.quantity_available if a.quantity_available is not none else total) %}
{{ total|int }}/{{ avail|int }}
{% set hard_block_status = ['lost', 'damaged', 'retired'] %}
{% set soft_block = a.id in blocked_for_allocation %}
{% if a.status not in hard_block_status and not soft_block %}
{% else %}
{% endif %}