{% extends "two_column.html" %} {% load static %} {% load inventree_extras %} {% load status_codes %} {% load i18n %} {% block page_title %} {% inventree_title %} | {% trans "Stock Item" %} - {{ item }} {% endblock %} {% block sidenav %}
{% endblock %} {% block pre_content %} {% include 'stock/loc_link.html' with location=item.location %} {% endblock %} {% block thumbnail %} {% endblock %} {% block page_data %} {% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} {% if owner_control.value == "True" %} {% authorized_owners item.owner as owners %} {% endif %}

{% trans "Stock Item" %} {% if item.is_expired %} {% trans "Expired" %} {% else %} {% if roles.stock.change %} {% endif %} {% stock_status_label item.status large=True %} {% if roles.stock.change %} {% endif %} {% if item.is_stale %} {% trans "Stale" %} {% endif %} {% endif %}


{% if roles.part.view %} {% endif %} {{ item.part.full_name}} {% if roles.part.view %} {% endif %} {% if item.serialized %} # {{ item.serial }} {% else %} × {% decimal item.quantity %} {% endif %} {% if user.is_staff and roles.stock.change %} {% endif %}

{% if barcodes %}
{% endif %}
{% if owner_control.value == "False" or owner_control.value == "True" and user in owners or user.is_superuser %} {% if roles.stock.change and not item.is_building %}
{% endif %} {% if roles.stock.change and not item.is_building %}
{% endif %} {% endif %}
{% endblock %} {% block below_thumbnail %}
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} {% if owner_control.value == "True" %} {% authorized_owners item.owner as owners %} {% if not user in owners and not user.is_superuser %}
{% trans "You are not in the list of owners of this item. This stock item cannot be edited." %}
{% endif %} {% endif %} {% if item.is_building %}
{% trans "This stock item is in production and cannot be edited." %}
{% trans "Edit the stock item from the build view." %}
{% if item.build %} {{ item.build }} {% endif %}
{% endif %} {% if item.hasRequiredTests and not item.passedAllRequiredTests %}
{% trans "This stock item has not passed all required tests" %}
{% endif %} {% for allocation in item.sales_order_allocations.all %}
{% object_link 'so-detail' allocation.line.order.id allocation.line.order as link %} {% decimal allocation.quantity as qty %} {% blocktrans %}This stock item is allocated to Sales Order {{ link }} (Quantity: {{ qty }}){% endblocktrans %}
{% endfor %} {% for allocation in item.allocations.all %}
{% object_link 'build-detail' allocation.build.id allocation.build %} {% decimal allocation.quantity as qty %} {% blocktrans %}This stock item is allocated to Build {{ link }} (Quantity: {{ qty }}){% endblocktrans %}
{% endfor %} {% if item.serialized %}
{% trans "This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted." %}
{% elif item.child_count > 0 %}
{% trans "This stock item cannot be deleted as it has child items" %}
{% elif item.delete_on_deplete and item.can_delete %}
{% trans "This stock item will be automatically deleted when all stock is depleted." %}
{% endif %}
{% endblock %} {% block page_details %}

{% trans "Stock Item Details" %}

{% if item.serialized %} {% else %} {% endif %} {% if item.customer %} {% endif %} {% if item.belongs_to %} {% elif item.sales_order %} {% else %} {% if item.location %} {% else %} {% endif %} {% endif %} {% if item.uid %} {% endif %} {% if item.batch %} {% endif %} {% if item.packaging %} {% endif %} {% if item.build %} {% endif %} {% if item.purchase_order %} {% endif %} {% if item.purchase_price != None %} {% endif %} {% if item.parent %} {% endif %} {% if item.link %} {% endif %} {% if item.supplier_part.manufacturer_part %} {% if item.supplier_part.manufacturer_part.manufacturer %} {% else %} {% endif %} {% endif %} {% if item.supplier_part %} {% endif %} {% if item.expiry_date %} {% endif %} {% if item.stocktake_date %} {% else %} {% endif %} {% if item.hasRequiredTests %} {% endif %}
{% trans "Base Part" %} {% if roles.part.view %} {% endif %} {{ item.part.full_name }} {% if roles.part.view %} {% endif %}
{% trans "Serial Number" %} {% if previous %} {{ previous.serial }} {% endif %} {{ item.serial }} {% if next %} {{ next.serial }} {% endif %}
{% trans "Quantity" %} {% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}
{% trans "Customer" %} {{ item.customer.name }}
{% trans "Installed In" %} {{ item.belongs_to }}
{% trans "Sales Order" %} {{ item.sales_order.reference }} - {{ item.sales_order.customer.name }}
{% trans "Location" %}{{ item.location.name }}{% trans "No location set" %}
{% trans "Barcode Identifier" %} {{ item.uid }}
{% trans "Batch" %} {{ item.batch }}
{% trans "Packaging" %} {{ item.packaging }}
{% trans "Build" %} {{ item.build }}
{% trans "Purchase Order" %} {{ item.purchase_order }}
{% trans "Purchase Price" %} {{ item.purchase_price }}
{% trans "Parent Item" %} {% trans "Stock Item" %} #{{ item.parent.id }}
{% trans "External Link" %} {{ item.link }}
{% trans "Manufacturer" %}{{ item.supplier_part.manufacturer_part.manufacturer.name }}{% trans "No manufacturer set" %}
{% trans "Manufacturer Part" %} {{ item.supplier_part.manufacturer_part.MPN }}
{% trans "Supplier" %} {{ item.supplier_part.supplier.name }}
{% trans "Supplier Part" %} {{ item.supplier_part.SKU }}
{% trans "Expiry Date" %} {{ item.expiry_date }} {% if item.is_expired %} {% trans "Expired" %} {% elif item.is_stale %} {% trans "Stale" %} {% endif %}
{% trans "Last Updated" %} {{ item.updated }}
{% trans "Last Stocktake" %}{{ item.stocktake_date }} {{ item.stocktake_user }}{% trans "No stocktake performed" %}
{% trans "Status" %} {% stock_status_label item.status %}
{% trans "Tests" %} {{ item.requiredTestStatus.passed }} / {{ item.requiredTestStatus.total }}
{% endblock %} {% block js_ready %} {{ block.super }} enableNavbar({ label: 'item', toggleId: '#item-menu-toggle', }); loadTree("{% url 'api-stock-tree' %}", "#stock-tree", { name: 'stock', } ); initNavTree({ label: 'stock', treeId: '#sidenav-left', toggleId: '#toggle-stock-tree', }); $("#stock-serialize").click(function() { launchModalForm( "{% url 'stock-item-serialize' item.id %}", { reload: true, } ); }); $('#stock-install-in').click(function() { launchModalForm( "{% url 'stock-item-install' item.pk %}", { data: { 'part': {{ item.part.pk }}, 'install_in': true, }, reload: true, } ); }); $('#stock-uninstall').click(function() { launchModalForm( "{% url 'stock-item-uninstall' %}", { data: { 'items[]': [{{ item.pk }}], }, reload: true, } ); }); $("#stock-test-report").click(function() { printTestReports([{{ item.pk }}]); }); $("#print-label").click(function() { printStockItemLabels([{{ item.pk }}]); }); {% if roles.stock.change %} $("#stock-duplicate").click(function() { createNewStockItem({ follow: true, data: { copy: {{ item.id }}, } }); }); $("#stock-edit").click(function () { launchModalForm( "{% url 'stock-item-edit' item.id %}", { reload: true, submit_text: '{% trans "Save" %}', } ); }); $('#stock-edit-status').click(function () { constructForm('{% url "api-stock-detail" item.pk %}', { fields: { status: {}, }, reload: true, title: '{% trans "Edit Stock Status" %}', }); }); {% endif %} $("#show-qr-code").click(function() { launchModalForm("{% url 'stock-item-qr' item.id %}", { no_post: true, }); }); $("#barcode-link").click(function() { linkBarcodeDialog({{ item.id }}); }); $("#barcode-unlink").click(function() { unlinkBarcode({{ item.id }}); }); $("#barcode-scan-into-location").click(function() { scanItemsIntoLocation([{{ item.id }}]); }); function itemAdjust(action) { inventreeGet( '{% url "api-stock-detail" item.pk %}', { part_detail: true, location_detail: true, }, { success: function(item) { adjustStock(action, [item], { success: function() { location.reload(); } }); } } ); } $('#stock-add').click(function() { itemAdjust('add'); }); $("#stock-delete").click(function () { launchModalForm( "{% url 'stock-item-delete' item.id %}", { redirect: "{% url 'part-detail' item.part.id %}" } ); }); {% if item.part.can_convert %} $("#stock-convert").click(function() { launchModalForm("{% url 'stock-item-convert' item.id %}", { reload: true, } ); }); {% endif %} {% if item.in_stock %} $("#stock-assign-to-customer").click(function() { launchModalForm("{% url 'stock-item-assign' item.id %}", { reload: true, } ); }); $("#stock-move").click(function() { itemAdjust("move"); }); $("#stock-count").click(function() { itemAdjust('count'); }); $('#stock-remove').click(function() { itemAdjust('take'); }); {% else %} $("#stock-return-from-customer").click(function() { launchModalForm("{% url 'stock-item-return' item.id %}", { reload: true, } ); }); {% endif %} attachNavCallbacks({ name: 'stockitem', default: 'history' }); {% endblock %}