{% extends "build/build_base.html" %} {% load static %} {% load i18n %} {% load inventree_extras %} {% block page_title %} {% inventree_title %} | {% trans "Allocate Parts" %} {% endblock %} {% block menubar %} {% include "build/navbar.html" with tab='allocate' %} {% endblock %} {% block heading %} {% trans "Allocate Stock to Build" %} {% endblock %} {% block details %} {% if build.has_untracked_bom_items %} {% if build.active %}
{% if build.areUntrackedPartsFullyAllocated %}
{% trans "Untracked stock has been fully allocated for this Build Order" %}
{% else %}
{% trans "Untracked stock has not been fully allocated for this Build Order" %}
{% endif %} {% endif %}
{% else %}
{% trans "This Build Order does not have any associated untracked BOM items" %}
{% endif %} {% endblock %} {% block js_ready %} {{ block.super }} var buildInfo = { pk: {{ build.pk }}, quantity: {{ build.quantity }}, completed: {{ build.completed }}, part: {{ build.part.pk }}, }; {% if build.has_untracked_bom_items %} // Load allocation table for un-tracked parts loadBuildOutputAllocationTable(buildInfo, null); {% endif %} function reloadTable() { $('#allocation-table-untracked').bootstrapTable('refresh'); } {% if build.active %} $("#btn-auto-allocate").on('click', function() { launchModalForm( "{% url 'build-auto-allocate' build.id %}", { success: reloadTable, } ); }); $('#btn-unallocate').on('click', function() { launchModalForm( "{% url 'build-unallocate' build.id %}", { success: reloadTable, } ); }); $("#btn-order-parts").click(function() { launchModalForm("/order/purchase-order/order-parts/", { data: { build: {{ build.id }}, }, }); }); {% endif %} {% endblock %}