{% extends "base.html" %} {% from "_macros.html" import picking_badge, attachments_card, doc_export with context %} {% block title %}{{ p.number }}{% endblock %} {% block content %} {% set cur = branch.currency %} {% set editable = can_write and p.state == 'ready' %}
{{ t(kinds[p.kind]) }}

{{ p.number }} {{ picking_badge(p.state) }}

{% if p.kind != 'adjust' %}{{ doc_export() }}{% endif %} {% if p.kind == 'in' and p.state == 'done' %}{{ t('Print Labels') }}{% endif %} {% if p.order_id %}{{ p.onumber }}{% endif %} {% if p.invoice_id %}{{ p.inumber }}{% endif %} {% if p.move_id %}{{ t('Journal Entry') }}{% endif %}
{{ t('Type') }}
{{ t(types[p.kind]) }}
{% if p.pname_en %}
{{ t('Partner') }}
{{ nm({'name_en': p.pname_en, 'name_ar': p.pname_ar}) }}
{% endif %}
{{ t('Branch') }}
{{ branch.code }} — {{ nm(branch) }}
{{ t('Warehouse') }}
{{ p.wcode }} — {{ nm({'name_en': p.wname_en, 'name_ar': p.wname_ar}) }}
{{ t('Date') }}
{% if editable %}{% else %}{{ p.date }}{% endif %}
{% if p.reason %}
{{ t('Reason') }}
{{ t(reasons.get(p.reason, p.reason)) }}
{% endif %} {% if p.notes %}
{{ t('Notes') }}
{{ p.notes }}
{% endif %}
{% if p.kind in ('adjust', 'pos', 'scrap') %} {% else %}{% endif %} {% if p.state == 'done' %}{% endif %} {% for l in lines %} {% if p.kind in ('adjust', 'pos', 'scrap') %} {% else %} {% endif %} {% if p.state == 'done' %}{% endif %} {% endfor %}
{{ t('Product') }}{{ t('Counted Quantity') if p.kind == 'adjust' else t('Quantity') }}{{ t('Difference') }}{{ t('Planned') }}{{ t('On Hand') }}{{ t('Done') }}{{ t('Value') }} ({{ cur }})
{{ l.code or '' }} {{ nm(l) }} {% if l.tracking == 'lot' and editable and p.kind == 'in' %}
{% elif l.tracking == 'lot' and editable %}
{{ t('Batches are chosen automatically, earliest expiry first.') }}
{% endif %} {% for b in line_lots.get(l.id, []) %}{% endfor %}
{{ '%g' % l.quantity }} {{ l.uom or '' }}{{ '%+g' % l.qty_signed }}{{ '%g' % l.quantity }} {{ l.uom or '' }} {{ '%g' % l.on_hand }} {% if editable %}{% else %}{{ '%g' % (l.qty_signed|abs) }}{% endif %}{{ (l.value_signed|abs)|money(cur) }}
{% if p.kind == 'return_in' and editable %}

{{ t('The goods come back into stock at the cost they left with, and that cost is taken out of cost of goods sold.') }}

{% endif %} {% if p.kind == 'return_out' and editable %}

{{ t('The goods leave stock at average cost; the refund price clears goods received not invoiced and any gap goes to cost of goods sold.') }}

{% endif %} {% if editable %}

{{ t('Lower the done quantity for a partial transfer; the rest stays as a backorder.') }}

{% endif %}
{{ attachments_card('picking', p.id) }} {% endblock %}