{% extends "page_base.html" %} {% load i18n %} {% load static %} {% load inventree_extras %} {% load status_codes %} {% block page_title %} {% inventree_title %} | {% trans "Purchase Order" %} {% endblock page_title %} {% block breadcrumbs %} {% endblock breadcrumbs %} {% block heading %} {% trans "Purchase Order" %}: {{ order.reference }} {% endblock heading %} {% block actions %} {% if user.is_staff and roles.purchase_order.change %} {% url 'admin:order_purchaseorder_change' order.pk as url %} {% include "admin_button.html" with url=url %} {% endif %} {% if barcodes %}
{% endif %}
{% if roles.purchase_order.change %}
{% if order.is_pending %} {% elif order.is_open %} {% endif %} {% endif %} {% endblock actions %} {% block thumbnail %} {% endblock thumbnail %} {% block details %} {% include "project_code_data.html" with instance=order %} {% include "barcode_data.html" with instance=order %}
{% trans "Order Reference" %} {{ order.reference }}{% include "clip.html"%}
{% trans "Order Description" %} {{ order.description }}{% include "clip.html" %}
{% trans "Order Status" %} {% purchase_order_status_label order.status %} {% if order.is_overdue %} {% trans "Overdue" %} {% endif %}
{% endblock details %} {% block details_right %} {% 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.contact %} {% endif %} {% if order.responsible %} {% endif %} {% include "currency_data.html" with instance=order %}
{% trans "Supplier" %} {% if order.supplier %} {{ order.supplier.name }}{% include "clip.html"%} {% else %} {% trans "No suppplier information available" %} {% endif %}
{% trans "Supplier Reference" %} {{ order.supplier_reference }}{% include "clip.html"%}
{% trans "Completed Line Items" %} {{ order.completed_line_count }} / {{ order.line_count }} {% if order.is_complete %} {% trans "Complete" %} {% else %} {% trans "Incomplete" %} {% endif %}
External Link {{ order.link }}{% include "clip.html"%}
{% trans "Created" %} {% render_date order.creation_date %}{{ order.created_by }}
{% trans "Issued" %} {% render_date order.issue_date %}
{% trans "Target Date" %} {% render_date order.target_date %} {% if order.is_overdue %}{% endif %}
{% trans "Received" %} {% render_date order.complete_date %}{{ order.received_by }}
{% trans "Contact" %} {{ order.contact.name }}
{% trans "Responsible" %} {{ order.responsible }}
{% trans "Total cost" %} {% with order.total_price as tp %} {% if tp == None %} {% trans "Total cost could not be calculated" %} {% else %} {% render_currency tp currency=order.currency %} {% endif %} {% endwith %}
{% endblock details_right %} {% block js_ready %} {{ block.super }} {% if order.status == PurchaseOrderStatus.PENDING %} $("#place-order").click(function() { issuePurchaseOrder( {{ order.pk }}, { reload: true, } ); }); {% endif %} {% if report_enabled %} $('#print-order-report').click(function() { printReports({ items: [{{ order.pk }}], key: 'order', url: '{% url "api-po-report-list" %}', }); }); {% endif %} {% if roles.purchase_order.change %} $("#edit-order").click(function() { editPurchaseOrder({{ order.pk }}, { {% if order.lines.count > 0 or order.status != PurchaseOrderStatus.PENDING %} hide_supplier: true, {% endif %} reload: true, }); }); $("#receive-order").click(function() { // Auto select items which have not been fully allocated var items = getTableData('#po-line-table'); receivePurchaseOrderItems( {{ order.id }}, items, { success: function() { $("#po-line-table").bootstrapTable('refresh'); } } ); }); $("#complete-order").click(function() { completePurchaseOrder( {{ order.pk }}, { onSuccess: function() { window.location.reload(); } } ); }); $("#cancel-order").click(function() { cancelPurchaseOrder( {{ order.pk }}, { onSuccess: function() { window.location.reload(); } }, ); }); {% endif %} {% if roles.purchase_order.add %} $('#duplicate-order').click(function() { duplicatePurchaseOrder( {{ order.pk }}, ); }); {% endif %} $("#export-order").click(function() { exportOrder('{% url "po-export" order.id %}'); }); {% if barcodes %} $('#show-qr-code').click(function() { showQRDialog( '{% trans "Purchase Order QR Code" %}', '{"purchaseorder": {{ order.pk }}}' ); }); {% if roles.purchase_order.change %} $("#barcode-link").click(function() { linkBarcodeDialog( { purchaseorder: {{ order.pk }}, }, { title: '{% trans "Link Barcode to Purchase Order" %}', } ); }); $("#barcode-unlink").click(function() { unlinkBarcode({ purchaseorder: {{ order.pk }}, }); }); {% endif %} {% endif %} {% endblock js_ready %}