mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add page to show stock which is assigned to a customer
This commit is contained in:
parent
9f599546de
commit
544e217347
29
InvenTree/company/templates/company/assigned_stock.html
Normal file
29
InvenTree/company/templates/company/assigned_stock.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{% extends "company/company_base.html" %}
|
||||||
|
{% load static %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block details %}
|
||||||
|
|
||||||
|
{% include "company/tabs.html" with tab="assigned" %}
|
||||||
|
|
||||||
|
<h4>{% trans "Assigned Stock" %}</h4>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<table class='table table-striped table-condensed' id='stock-table'></table>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block js_ready %}
|
||||||
|
{{ block.super }}
|
||||||
|
|
||||||
|
loadStockTable($("#stock-table"), {
|
||||||
|
params: {
|
||||||
|
test: 7,
|
||||||
|
customer: {{ company.id }},
|
||||||
|
part_detail: true,
|
||||||
|
location_detail: true,
|
||||||
|
},
|
||||||
|
url: "{% url 'api-stock-list' %}",
|
||||||
|
});
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -21,6 +21,13 @@
|
|||||||
<li{% if tab == 'co' %} class='active'{% endif %}>
|
<li{% if tab == 'co' %} class='active'{% endif %}>
|
||||||
<a href="{% url 'company-detail-sales-orders' company.id %}">{% trans "Sales Orders" %} <span class='badge'>{{ company.sales_orders.count }}</span></a>
|
<a href="{% url 'company-detail-sales-orders' company.id %}">{% trans "Sales Orders" %} <span class='badge'>{{ company.sales_orders.count }}</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
<li{% if tab == 'assigned' %} class='active'{% endif %}>
|
||||||
|
<a href="{% url 'company-detail-assigned-stock' company.id %}">{% trans "Assigned Stock" %}
|
||||||
|
<span class='badge'>
|
||||||
|
{{ company.assigned_stock.count }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li{% if tab == 'notes' %} class='active'{% endif %}>
|
<li{% if tab == 'notes' %} class='active'{% endif %}>
|
||||||
<a href="{% url 'company-notes' company.id %}">{% trans "Notes" %}{% if company.notes %} <span class='fas fa-info-circle'></span>{% endif %}</a>
|
<a href="{% url 'company-notes' company.id %}">{% trans "Notes" %}{% if company.notes %} <span class='fas fa-info-circle'></span>{% endif %}</a>
|
||||||
|
@ -13,13 +13,14 @@ company_detail_urls = [
|
|||||||
|
|
||||||
# url(r'orders/?', views.CompanyDetail.as_view(template_name='company/orders.html'), name='company-detail-orders'),
|
# url(r'orders/?', views.CompanyDetail.as_view(template_name='company/orders.html'), name='company-detail-orders'),
|
||||||
|
|
||||||
url(r'parts/', views.CompanyDetail.as_view(template_name='company/detail_part.html'), name='company-detail-parts'),
|
url(r'^parts/', views.CompanyDetail.as_view(template_name='company/detail_part.html'), name='company-detail-parts'),
|
||||||
url(r'stock/?', views.CompanyDetail.as_view(template_name='company/detail_stock.html'), name='company-detail-stock'),
|
url(r'^stock/', views.CompanyDetail.as_view(template_name='company/detail_stock.html'), name='company-detail-stock'),
|
||||||
url(r'purchase-orders/?', views.CompanyDetail.as_view(template_name='company/purchase_orders.html'), name='company-detail-purchase-orders'),
|
url(r'^purchase-orders/', views.CompanyDetail.as_view(template_name='company/purchase_orders.html'), name='company-detail-purchase-orders'),
|
||||||
url(r'sales-orders/?', views.CompanyDetail.as_view(template_name='company/sales_orders.html'), name='company-detail-sales-orders'),
|
url(r'^assigned-stock/', views.CompanyDetail.as_view(template_name='company/assigned_stock.html'), name='company-detail-assigned-stock'),
|
||||||
url(r'notes/?', views.CompanyNotes.as_view(), name='company-notes'),
|
url(r'^sales-orders/', views.CompanyDetail.as_view(template_name='company/sales_orders.html'), name='company-detail-sales-orders'),
|
||||||
|
url(r'^notes/', views.CompanyNotes.as_view(), name='company-notes'),
|
||||||
|
|
||||||
url(r'thumbnail/?', views.CompanyImage.as_view(), name='company-image'),
|
url(r'^thumbnail/', views.CompanyImage.as_view(), name='company-image'),
|
||||||
|
|
||||||
# Any other URL
|
# Any other URL
|
||||||
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detail'),
|
url(r'^.*$', views.CompanyDetail.as_view(), name='company-detail'),
|
||||||
|
@ -351,8 +351,6 @@ function loadStockTable(table, options) {
|
|||||||
loc = "{% trans "Undefined location" %}";
|
loc = "{% trans "Undefined location" %}";
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Location: " + loc);
|
|
||||||
|
|
||||||
if (!locations.includes(loc)) {
|
if (!locations.includes(loc)) {
|
||||||
locations.push(loc);
|
locations.push(loc);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user