{% extends "base.html" %} {% from "components/ui.html" import page_header %} {% block content %} {% set breadcrumbs = [ {'text': 'Inventory', 'url': url_for('inventory.list_stock_items')}, {'text': 'Suppliers', 'url': url_for('inventory.list_suppliers')}, {'text': supplier.name} ] %} {{ page_header( icon_class='fas fa-truck', title_text=supplier.name, subtitle_text=supplier.code, breadcrumbs=breadcrumbs, actions_html='Edit' if (current_user.is_admin or has_permission('manage_inventory')) else None ) }}

{{ _('Supplier Details') }}

{{ supplier.code }}

{% if supplier.is_active %} {{ _('Active') }} {% else %} {{ _('Inactive') }} {% endif %}

{% if supplier.description %}

{{ supplier.description }}

{% endif %} {% if supplier.contact_person %}

{{ supplier.contact_person }}

{% endif %} {% if supplier.email %}

{{ supplier.email }}

{% endif %} {% if supplier.phone %}

{{ supplier.phone }}

{% endif %} {% if supplier.address %}

{{ supplier.address }}

{% endif %} {% if supplier.website %}

{{ supplier.website }}

{% endif %} {% if supplier.tax_id %}

{{ supplier.tax_id }}

{% endif %} {% if supplier.payment_terms %}

{{ supplier.payment_terms }}

{% endif %}

{{ supplier.currency_code }}

{% if supplier.notes %}

{{ supplier.notes }}

{% endif %}
{% if supplier_items %}

{{ _('Stock Items from this Supplier') }}

{% for supplier_item in supplier_items %} {% endfor %}
{{ _('Item') }} {{ _('Supplier SKU') }} {{ _('Unit Cost') }} {{ _('MOQ') }} {{ _('Lead Time') }} {{ _('Preferred') }}
{{ supplier_item.stock_item.name }} ({{ supplier_item.stock_item.sku }}) {{ supplier_item.supplier_sku or '—' }} {% if supplier_item.unit_cost %} {{ "%.2f"|format(supplier_item.unit_cost) }} {{ supplier_item.currency_code }} {% else %} — {% endif %} {{ supplier_item.minimum_order_quantity or '—' }} {% if supplier_item.lead_time_days %} {{ supplier_item.lead_time_days }} {{ _('days') }} {% else %} — {% endif %} {% if supplier_item.is_preferred %} {{ _('Preferred') }} {% else %} — {% endif %}
{% else %}

{{ _('No stock items associated with this supplier.') }}

{% endif %}

{{ _('Summary') }}

{{ supplier_items|length }}

{{ supplier_items|selectattr('is_preferred', 'equalto', True)|list|length }}

{% endblock %}