{% extends "page_base.html" %} {% load i18n %} {% load static %} {% load barcode %} {% load inventree_extras %} {% load generic %} {% 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 %} {% admin_url user "order.purchaseorder" order.pk as url %} {% include "admin_button.html" with url=url %} {% if barcodes %}
{% endif %}
{% if roles.purchase_order.change %}
{% if order.can_issue %} {% elif order.status == PurchaseOrderStatus.PLACED %} {% endif %} {% endif %} {% endblock actions %} {% block thumbnail %} {% trans {% endblock thumbnail %} {% block details %} {% include "project_code_data.html" with instance=order %} {% include "barcode_data.html" with instance=order %} {% if order.destination %} {% endif %}
{% trans "Order Reference" %} {{ order.reference }}{% include "clip.html" %}
{% trans "Order Description" %} {{ order.description }}{% include "clip.html" %}
{% trans "Order Status" %} {% display_status_label 'purchase_order' order.status_custom_key order.status %} {% if order.is_overdue %} {% trans "Overdue" %} {% endif %}
{% trans "Destination" %} {{ order.destination.name }}
{% 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.address %} {% 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 supplier 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 %}
{% trans "External Link" %} {% include 'clip_link.html' with link=order.link new_window=True %}
{% 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 "Address" %} {{ order.address.title }}: {{ order.address }}
{% 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 or order.status == PurchaseOrderStatus.ON_HOLD %} $("#place-order").click(function() { issuePurchaseOrder( {{ order.pk }}, { reload: true, } ); }); {% endif %} {% if report_enabled %} $('#print-order-report').click(function() { printReports('purchaseorder', [{{ order.pk }}]); }); {% 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, }); }); $("#complete-order").click(function() { completePurchaseOrder( {{ order.pk }}, { onSuccess: function() { window.location.reload(); } } ); }); {% if order.can_cancel %} $("#cancel-order").click(function() { cancelPurchaseOrder( {{ order.pk }}, { onSuccess: function() { window.location.reload(); } }, ); }); {% endif %} {% if order.can_hold %} $("#hold-order").click(function() { holdOrder( '{% url "api-po-hold" order.pk %}', { onSuccess: function() { window.location.reload(); } } ); }); {% endif %} {% 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" escape %}', `{% clean_barcode order.barcode %}` ); }); {% if roles.purchase_order.change %} $("#barcode-link").click(function() { linkBarcodeDialog( { purchaseorder: {{ order.pk }}, }, { title: '{% trans "Link Barcode to Purchase Order" escape %}', } ); }); $("#barcode-unlink").click(function() { unlinkBarcode({ purchaseorder: {{ order.pk }}, }); }); {% endif %} {% endif %} {% endblock js_ready %}