{% extends "stock/stock_app_base.html" %} {% load static %} {% block content %} {% load qr_code %}

Stock Item Details

{{ item.quantity }} × {{ item.part.name }}

{% if item.belongs_to %} {% elif item.location %} {% endif %} {% if item.serial %} {% else %} {% endif %} {% if item.batch %} {% endif %} {% if item.customer %} {% endif %} {% if item.URL %} {% endif %} {% if item.supplier_part %} {% endif %} {% if item.stocktake_date %} {% else %} {% endif %} {% if item.notes %} {% endif %}
Part {{ item.part.name }}
UUID {{ item.uuid }}
Belongs To {{ item.belongs_to }}
Location {{ item.location.name }}
Serial {{ item.serial }}
Quantity {{ item.quantity }}
Batch {{ item.batch }}
Customer {{ item.customer.name }}
URL {{ item.URL }}
Supplier Part {{ item.supplier_part.SKU }}
Last Updated {{ item.updated }}
Last Stocktake{{ item.stocktake_date }} {{ item.stocktake_user }}No stocktake performed
Status {{ item.get_status_display }}
Notes {{ item.notes }}
{% qr_from_text item.uuid size="s" image_format="png" error_correction="L" %}
{% if item.has_tracking_info %}

Stock Tracking{{ item.tracking_info.all|length }}

{% endif %} {% endblock %} {% block js_ready %} {{ block.super }} $("#stock-edit").click(function () { launchModalForm( "{% url 'stock-item-edit' item.id %}", { reload: true, submit_text: "Save", }); }); {% if item.in_stock %} $("#stock-move").click(function() { launchModalForm( "{% url 'stock-item-move' item.id %}", { reload: true, submit_text: "Move" }); }); function itemAdjust(action) { adjustStock({ query: { pk: {{ item.id }}, }, action: action, success: function() { location.reload(); } }); } $("#stock-stocktake").click(function() { itemAdjust('stocktake'); return false; }); $('#stock-remove').click(function() { itemAdjust('remove'); return false; }); $('#stock-add').click(function() { itemAdjust('add'); return false; }); {% endif %} $("#stock-delete").click(function () { launchDeleteForm( "{% url 'stock-item-delete' item.id %}", { redirect: "{% url 'part-stock' item.part.id %}" }); }); $('#track-table').bootstrapTable({ sortable: true, search: true, method: 'get', queryParams: function(p) { return { item: {{ item.pk }}, } }, columns: [ { field: 'date', title: 'Date', sortable: true, formatter: function(value, row, index, field) { var m = moment(value); if (m.isValid()) { var html = m.format('dddd MMMM Do YYYY') + '
' + m.format('h:mm a'); return html; } return 'N/A'; } }, { field: 'title', title: 'Description', sortable: true, formatter: function(value, row, index, field) { var html = "" + value + ""; if (row.notes) { html += "
" + row.notes + ""; } return html; } }, { field: 'quantity', title: 'Quantity', }, { sortable: true, field: 'user', title: 'User', formatter: function(value, row, index, field) { if (value) { // TODO - Format the user's first and last names return value.username; } else { return "No user information"; } } } ], url: "{% url 'api-stock-track' %}", }) {% endblock %}