{% extends "two_column.html" %} {% load i18n %} {% load static %} {% load inventree_extras %} {% load status_codes %} {% block page_title %} {% inventree_title %} | {% trans "Purchase Order" %} {% endblock %} {% block thumbnail %} {% endblock %} {% block page_data %}

{% trans "Purchase Order" %} {{ order.reference }} {% if user.is_staff and roles.purchase_order.change %} {% endif %}

{% purchase_order_status_label order.status large=True %} {% if order.is_overdue %} {% trans "Overdue" %} {% endif %}


{{ order.description }}{% include "clip.html"%}

{% if roles.purchase_order.change %} {% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %} {% elif order.status == PurchaseOrderStatus.PLACED %} {% endif %} {% if order.can_cancel %} {% endif %} {% endif %}
{% endblock %} {% block page_details %}

{% trans "Purchase Order Details" %}

{% if order.supplier_reference %} {% endif %} {% if order.link %} {% endif %} {% if order.issue_date %} {% endif %} {% if order.target_date %} {% endif %} {% if order.status == PurchaseOrderStatus.COMPLETE %} {% endif %} {% if order.responsible %} {% endif %}
{% trans "Order Reference" %} {% settings_value 'PURCHASEORDER_REFERENCE_PREFIX' %}{{ order.reference }}{% include "clip.html"%}
{% trans "Order Status" %} {% purchase_order_status_label order.status %} {% if order.is_overdue %} {% trans "Overdue" %} {% endif %}
{% trans "Supplier" %} {{ order.supplier.name }}{% include "clip.html"%}
{% trans "Supplier Reference" %} {{ order.supplier_reference }}{% include "clip.html"%}
External Link {{ order.link }}{% include "clip.html"%}
{% trans "Created" %} {{ order.creation_date }}{{ order.created_by }}
{% trans "Issued" %} {{ order.issue_date }}
{% trans "Target Date" %} {{ order.target_date }}
{% trans "Received" %} {{ order.complete_date }}{{ order.received_by }}
{% trans "Responsible" %} {{ order.responsible }}
{% endblock %} {% block js_ready %} {{ block.super }} {% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %} $("#place-order").click(function() { launchModalForm("{% url 'po-issue' order.id %}", { reload: true, }); }); {% endif %} $('#print-order-report').click(function() { printPurchaseOrderReports([{{ order.pk }}]); }); $("#edit-order").click(function() { constructForm('{% url "api-po-detail" order.pk %}', { fields: { reference: { prefix: global_settings.PURCHASEORDER_REFERENCE_PREFIX, }, {% if order.lines.count == 0 and order.status == PurchaseOrderStatus.PENDING %} supplier: { }, {% endif %} supplier_reference: {}, description: {}, target_date: { icon: 'fa-calendar-alt', }, link: { icon: 'fa-link', }, responsible: { icon: 'fa-user', }, }, title: '{% trans "Edit Purchase Order" %}', reload: true, }); }); $("#receive-order").click(function() { launchModalForm("{% url 'po-receive' order.id %}", { reload: true, secondary: [ { field: 'location', label: '{% trans "New Location" %}', title: '{% trans "Create new stock location" %}', url: "{% url 'stock-location-create' %}", }, ] }); }); $("#complete-order").click(function() { launchModalForm("{% url 'po-complete' order.id %}", { reload: true, }); }); $("#cancel-order").click(function() { launchModalForm("{% url 'po-cancel' order.id %}", { reload: true, }); }); $("#export-order").click(function() { location.href = "{% url 'po-export' order.id %}"; }); {% endblock %}