{% extends "base.html" %} {% from "_macros.html" import wf_badge, approval_panel, attachments_card, vendor_picker with context %} {% block title %}{{ r.number }}{% endblock %} {% block content %} {% set cur = branch.currency %} {% set open = r.state in ('draft', 'sent') %}
{{ t('Requests for Quotation') }}

{{ r.number }} {% if r.state == 'award_pending' %}{{ t('Award waiting approval') }}{% else %}{{ wf_badge(r.state) }}{% endif %} {% if r.sealed %}{{ t('Sealed') if sealed else t('Bids opened') }}{% endif %}

{{ branch.code }} · {{ t('Date') }} {{ r.date }}{% if r.closing_at %} · {{ t('Closes') }} {{ r.closing_at.replace('T', ' ') }}{% if closed %} ({{ t('closed') }}){% endif %}{% endif %} {% if has('projects') and r.project_id %} · {{ r.pj_code }} {{ nm({'name_en': r.pj_en, 'name_ar': r.pj_ar}) }}{% endif %}
{% if r.mr_id %}{{ r.mr_number }}{% endif %} {% if r.pr_id %}{{ r.pr_number }}{% endif %} {% for po in pos %}{{ po.number }}{% endfor %} {% if can_write and r.state == 'draft' %} {{ t('Edit') }}
{% endif %} {% if can_write and sealed and closed and r.state == 'sent' %}
{% endif %} {% if can_write and r.state in ('draft', 'sent', 'award_pending') %}
{% endif %}
{{ t('Closing') }}
{{ r.closing_at.replace('T', ' ') if r.closing_at else '—' }}
{{ t('Quotation validity') }}
{{ (r.validity_days ~ ' ' ~ t('days')) if r.validity_days else '—' }}
{{ t('Payment terms') }}
{{ r.payment_terms or '—' }}
{{ t('Incoterms') }}
{{ r.incoterms or '—' }} {{ r.delivery_place or '' }}
{% if r.opened_at %}
{{ t('Bids opened') }}
{{ r.opened_at[:16].replace('T', ' ') }} · {{ r.opened_name or '' }}
{% endif %}

{{ t('Quotation comparison') }} ({{ cur }}, {{ t('unit prices excl. VAT') }})

{% for v in c.vendors %} {% endfor %} {% for ln in lines %} {% for v in c.vendors %}{% set qt = c.quotes.get((v.id, ln.id)) %} {% endfor %} {% endfor %} {% for v in c.vendors %}{% endfor %} {% for v in c.vendors %} {% endfor %}
{{ t('Item') }}{{ t('Qty') }}{{ nm(v) }}
{{ wf_badge(v.state) }} {% if not sealed and v.lead_days is not none %}
{{ v.lead_days }} {{ t('days lead time') }}{% endif %} {% if not sealed and v.valid_until %}
{{ t('valid until') }} {{ v.valid_until }}{% endif %}
{{ ln.item_code or '' }} {{ ln.description or '' }} {% if ln.specification %}
{{ ln.specification }}{% endif %} {% if ln.manufacturer or ln.part_number %}
{{ ln.manufacturer or '' }} {{ ln.part_number or '' }}{% endif %} {% if ln.required_date %}
{{ t('Required by') }} {{ ln.required_date }}{% endif %} {% if ln.allow_alternative %} {{ t('Alternatives allowed') }}{% endif %}
{{ '%g' % ln.quantity }} {{ ln.uom or '' }} {% if sealed %}{{ t('Sealed') if qt else '—' }} {% elif qt %}{{ qt.price|money(cur) }} {% if qt.offered %}
{{ qt.offered }}{% endif %}{% if qt.is_alternative %}
{{ t('Alternative') }}{% endif %} {% else %}—{% endif %}
{{ t('Total excl. VAT') }}{% if sealed %}{{ t('Sealed') if v.state == 'quoted' else '—' }}{% else %}{{ c.totals[v.id]|money(cur) if c.complete[v.id] else (t('Incomplete') if c.totals[v.id] else '—') }}{% endif %}
{% if can_write and open and not closed %}{{ t('Enter Quote') if v.state == 'invited' else (t('Replace Quote') if sealed else t('Edit Quote')) }}{% endif %} PDF
{% if sealed %}
{{ icon('lock') }} {{ t('Sealed bids') }}
{{ c.vendors|selectattr('state', 'equalto', 'quoted')|list|length }} {{ t('of') }} {{ c.vendors|length }} {{ t('vendors have quoted. Prices can be seen after the closing time, when the bids are opened.') }}
{% else %}
{{ t('Green = lowest price per line. The highlighted column is the lowest complete quotation.') }}
{% endif %}
{{ approval_panel('rfq_award', r.id, url_for('procurement.rfq_action', rfq_id=r.id, action='approve'), url_for('procurement.rfq_action', rfq_id=r.id, action='reject')) }} {% if r.state == 'award_pending' and r.award_reason %}
{{ t('Reason for the choice') }}: {{ r.award_reason }}
{% endif %} {% if can_write and open %}
{% if not sealed and c.vendors|selectattr('state', 'equalto', 'quoted')|list %}

{{ t('Recommend award') }}

{{ t('The award goes through the approval workflow. Once approved, the purchase order is created and confirmed at the quoted prices.') }}


{% if has('inventory') %}

{% endif %}
{% elif sealed %}

{{ t('Recommend award') }}

{{ t('Available after the sealed bids are opened.') }}

{% endif %}
{% if other_vendors and not closed %}

{{ t('Invite more vendors') }}

{{ vendor_picker(other_vendors, []) }}
{% endif %} {% if not r.opened_at %}

{{ t('Extend closing time') }}

{% endif %}
{% endif %} {% if r.notes %}

{{ t('Notes') }}

{{ r.notes }}
{% endif %} {% if r.terms %}

{{ t('Terms & Conditions') }}

{{ r.terms }}
{% endif %} {{ attachments_card('rfq', r.id) }} {% endblock %}