{% for p in products %}
{% set s = stock_at_outlet.get(p.id, {}) %}
{% if s.get('total_in', 0) > 0 or s.get('confirmed_rcv') %}
{{ p.name }}
{% if s.get('discrepancy') is not none %}
{% if s.get('discrepancy') < 0 %}
β β{{ (s.get('discrepancy')|abs)|int }}
{% elif s.get('discrepancy') > 0 %}
+{{ s.get('discrepancy')|int }}
{% else %}
β
{% endif %}
{% endif %}
{% if s.get('remaining',0) <= 5 or (s.get('total_in',0) > 0 and s.get('remaining',0) / s.get('total_in',1) <= 0.2) %}
π΄ LOW
{% endif %}
{{ s.get('remaining', 0) }}
{{ s.get('sold', 0) }} sold
{% if s.get('confirmed_rcv') is not none %}
Β· Received: {{ s.get('confirmed_rcv')|int }}
{% endif %}
{% if s.get('dispatched', 0) > 0 %}
Β· Dispatched: {{ s.get('dispatched')|int }}
{% endif %}