{% extends "base.html" %} {% from "_macros.html" import approval_panel, wf_badge, vendor_picker with context %} {% block title %}{{ doc.number }}{% endblock %} {% block content %} {% set cur = branch.currency %}
{{ t(info.title) }}

{{ doc.number }} {{ wf_badge(doc.state) }}

{% if kind == 'pr' and related.mr %}{{ related.mr.number }}{% endif %} {% for r in related.get('prs', []) %}{{ r.number }}{% endfor %} {% for r in related.get('pickings', []) %}{{ r.number }}{% endfor %} {% for r in related.get('rfqs', []) %}{{ r.number }}{% endfor %} {% for r in related.get('pos', []) %}{{ r.number }}{% endfor %} {% if can_write %} {% set act = 'procurement.' ~ kind ~ '_action' %} {% if doc.state == 'draft' %} {{ t('Edit') }}
{% elif doc.state == 'submitted' %}
{% elif doc.state in ('rejected', 'cancelled') %}
{% endif %} {% if doc.state in ('draft', 'submitted', 'approved') %}
{% endif %} {% endif %}
{{ t('Branch') }}
{{ branch.code }} — {{ nm(branch) }}
{% if has('projects') and doc.project_id %}
{{ t('Project') }}
{{ doc.pj_code }} — {{ nm({'name_en': doc.pj_en, 'name_ar': doc.pj_ar}) }}
{% endif %}
{{ t('Department') }}
{{ doc.department or '—' }}
{{ t('Requested by') }}
{{ doc.requester or doc.username or '—' }}
{{ t('Date') }}
{{ doc.date }}
{{ t('Required by') }}
{{ doc.required_date or '—' }}
{% if doc.approved_at %}
{{ t('Rejected by') if doc.state == 'rejected' else t('Approved by') }}
{{ doc.approver or '—' }} {{ doc.approved_at[:10] }}
{% endif %} {% if doc.reject_reason %}
{{ t('Rejection reason') }}
{{ doc.reject_reason }}
{% endif %}
{{ t('Purpose') if kind == 'mr' else t('Justification') }}
{{ (doc.purpose if kind == 'mr' else doc.justification) or '—' }}
{% if has('inventory') %}{% endif %} {% if kind == 'pr' %}{% endif %} {% for l in lines %} {% if has('inventory') %}{% endif %} {% if kind == 'pr' %}{% endif %} {% endfor %} {% if kind == 'pr' %}{% endif %}
{{ t('Product') }}{{ t('Description') }}{{ t('Qty') }}{{ t('Available in branch') }}{{ t('Estimated Price') }}{{ t('Estimated Total') }}{{ t('Suggested Vendor') }}
{% if l.product_id %}{{ l.code or '' }} {{ nm(l) }}{% endif %}{{ l.description or '' }} {{ '%g' % l.quantity }} {{ l.uom or '' }}{{ ('%g' % l.available) if l.type == 'stock' else '—' }}{{ l.est_price|money(cur) }}{{ (l.quantity * l.est_price)|round|int|money(cur) }} {{ nm({'name_en': l.vname_en, 'name_ar': l.vname_ar}) if l.vname_en else '' }}
{{ t('Estimated Total') }}{{ est_total|money(cur) }} {{ cur }}
{{ approval_panel(kind, doc.id, url_for('procurement.' ~ kind ~ '_action', doc_id=doc.id, action='approve'), url_for('procurement.' ~ kind ~ '_action', doc_id=doc.id, action='reject')) }} {% if can_write and doc.state == 'approved' %}
{% if kind == 'mr' %} {% if has('inventory') %}

{{ t('Issue from stock') }}

{{ t('Issues the stock items from the warehouse and charges each product’s expense account.') }}

{% endif %}

{{ t('Request quotations') }}

{{ t('Creates a draft RFQ with these lines. Add the specification, vendors and closing time, then send it.') }}

{{ t('Buy directly') }}


{{ t('Purchase requisition') }} ({{ t('optional') }})

{{ t('Only when your policy needs a separate requisition approval before buying.') }}

{% else %}

{{ t('Request quotations') }}

{{ vendor_picker(vendors, []) }}

{{ t('Buy directly') }}


{% if has('inventory') %}
{% endif %}
{% endif %}
{% endif %} {% endblock %}