Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2019-06-19 08:12:14 +10:00
commit e5c2ee5587
23 changed files with 192 additions and 166 deletions

View File

@ -1,6 +1,7 @@
<h4>Required Parts</h4>
<hr>
<div id='#build-item-toolbar'>
<div id='build-item-toolbar'>
<div class='btn-group'>
<button class='btn btn-primary' type='button' id='btn-allocate' title='Allocate Stock'>Allocate</button>
<button class='btn btn-primary' type='button' id='btn-order-parts' title='Order Parts'>Order Parts</button>

View File

@ -7,6 +7,8 @@
<h4>Build Details</h4>
<hr>
<table class='table table-striped'>
<tr>
<td>Title</td><td>{{ build.title }}</td>

View File

@ -6,5 +6,3 @@
<a href="{% url 'build-allocate' build.id %}">Parts</a>
</li>
</ul>
<br>

View File

@ -24,6 +24,19 @@ InvenTree | Company - {{ company.name }}
<div class='media-body'>
<h4>{{ company.name }}</h4>
<p>{{ company.description }}</p>
<div class='btn-group'>
{% if company.is_supplier %}
<button type='button' class='btn btn-default btn-glyph' id='company-order' title='Create purchase order'>
<span class='glyphicon glyphicon-shopping-cart'/>
</button>
{% endif %}
<button type='button' class='btn btn-default btn-glyph' id='company-edit' title='Edit company information'>
<span class='glyphicon glyphicon-cog'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='company-delete' title='Delete company'>
<span class='glyphicon glyphicon-trash' style='color: #a11;'/>
</button>
</div>
</div>
</div>
</div>
@ -77,6 +90,22 @@ InvenTree | Company - {{ company.name }}
{% block js_ready %}
$('#company-edit').click(function() {
launchModalForm(
"{% url 'company-edit' company.id %}",
{
reload: true
});
});
$('#company-delete').click(function() {
launchModalForm(
"{% url 'company-delete' company.id %}",
{
redirect: "{% url 'company-index' %}"
});
});
enableDragAndDrop(
"#company-thumb",
"{% url 'company-image' company.id %}",

View File

@ -4,24 +4,7 @@
{% include 'company/tabs.html' with tab='details' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Company Details</h4>
</div>
<div class='col-sm-6'>
<h3>
<div class="dropdown" style="float: right;">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#" id='edit-company' title='Edit company'>Edit</a></li>
<li><a href="#" id='delete-company' title='Delete company'>Delete</a></li>
</ul>
</div>
</h3>
</div>
</div>
<hr>
<table class='table table-striped'>
@ -45,19 +28,5 @@
{% endblock %}
{% block js_ready %}
{{ block.super }}
$('#edit-company').click(function() {
launchModalForm(
"{% url 'company-edit' company.id %}",
{
reload: true
});
});
$('#delete-company').click(function() {
launchModalForm(
"{% url 'company-delete' company.id %}",
{
redirect: "{% url 'company-index' %}"
});
});
{% endblock %}

View File

@ -6,6 +6,8 @@
<h4>Supplier Parts</h4>
<hr>
<div id='button-toolbar'>
<button class="btn btn-success" id='part-create'>New Supplier Part</button>
<div class="dropdown" style="float: right;">
@ -17,8 +19,6 @@
</div>
</div>
<hr>
<table class='table table-striped table-condensed' id='part-table' data-toolbar='#button-toolbar'>
</table>

View File

@ -5,14 +5,15 @@
{% include 'company/tabs.html' with tab='po' %}
<h4>Open Purchase Orders</h4>
<hr>
<div class='container' style='float: right;'>
<div id='button-bar'>
<div class='btn-group'>
<button class='btn btn-primary' type='button' id='po-create' title='Create new purchase order'>New Purchase Order</button>
<button class='btn btn-primary' type='button' id='company-order-2' title='Create new purchase order'>New Purchase Order</button>
</div>
</div>
{% include "order/po_table.html" with orders=company.outstanding_purchase_orders.all %}
{% include "order/po_table.html" with orders=company.outstanding_purchase_orders.all toolbar='#button-bar' %}
{% if company.closed_purchase_orders.count > 0 %}
{% include "order/po_table_collapse.html" with title="Closed Orders" orders=company.closed_purchase_orders.all %}
@ -23,15 +24,27 @@
{% block js_ready %}
{{ block.super }}
$("#po-create").click(function() {
function newOrder() {
launchModalForm("{% url 'purchase-order-create' %}",
{
data: {
supplier: {{ company.id }},
},
follow: true,
});
}
);
$("#company-order").click(function() {
newOrder();
});
$("#company-order-2").click(function() {
newOrder();
});
$("#po-table").bootstrapTable({
search: true,
sortable: true,
});
{% endblock %}

View File

@ -7,6 +7,8 @@
<h4>Supplier Stock</h4>
<hr>
{% include "stock_table.html" %}
{% endblock %}

View File

@ -8,20 +8,15 @@ InvenTree | Supplier List
{% block content %}
<div class='row'>
<div class='col-sm-6'>
<h3>Supplier List</h3>
</div>
<div class='col-sm-6'>
<div class='container' id='active-build-toolbar' style='float: right;'>
<div class='btn-group' style='float: right;'>
<hr>
<div id='button-toolbar'>
<div class='btn-group'>
<button type='button' class="btn btn-success" id='new-company' title='Add new supplier'>New Supplier</button>
</div>
</div>
</div>
</div>
<hr>
<table class='table table-striped' id='company-table' data-toolbar='#button-toolbar'>
</table>

View File

@ -3,7 +3,7 @@
{% block form %}
<h4>
Step 1 of 2 - Select Parts
Step 1 of 2 - Select Part Suppliers
</h4>
{% if parts|length > 0 %}

View File

@ -1,11 +1,14 @@
<table class='table table-striped table-condensed' id='po-table'>
<table class='table table-striped table-condensed' id='po-table' {% if toolbar %}data-toolbar='{{ toolbar }}'{% endif %}>
<thead>
<tr>
<th data-field='company'>Company</th>
<th data-field='reference'>Order Reference</th>
<th data-field='description'>Description</th>
<th data-field='company' data-searchable='true'>Company</th>
<th data-field='reference' data-searchable='true'>Order Reference</th>
<th data-field='description' data-searchable='true'>Description</th>
<th data-field='status'>Status</th>
<th data-field='items'>Items</th>
</tr>
</thead>
<tbody>
{% for order in orders %}
<tr>
<td>{% include "hover_image.html" with image=order.supplier.image hover=True %}<a href="{{ order.supplier.get_absolute_url }}purchase-orders/">{{ order.supplier.name }}</a></td>
@ -15,4 +18,5 @@
<td>{{ order.lines.count }}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -62,6 +62,9 @@ InvenTree | {{ order }}
<hr>
<div id='order-toolbar-buttons' class='btn-group' style='float: right;'>
{% if order.status == OrderStatus.PENDING %}
<button type='button' class='btn btn-default' id='new-po-line'>Add Line Item</button>
{% endif %}
<button type='button' class='btn btn-primary' id='edit-order'>Edit Order</button>
{% if order.status == OrderStatus.PENDING and order.lines.count > 0 %}
<button type='button' class='btn btn-primary' id='place-order'>Place Order</button>
@ -73,10 +76,6 @@ InvenTree | {{ order }}
<h4>Order Items</h4>
{% if order.status == OrderStatus.PENDING %}
<button type='button' class='btn btn-default' id='new-po-line'>Add Line Item</button>
{% endif %}
<table class='table table-striped table-condensed' id='po-lines-table' data-toolbar='#order-toolbar-buttons'>
<thead>
<tr>
@ -122,10 +121,10 @@ InvenTree | {{ order }}
{% if order.status == OrderStatus.PENDING %}
<td>
<div class='btn-group'>
<button class='btn btn-default btn-edit' id='edit-line-item-{{ line.id }} title='Edit line item' onclick='editPurchaseOrderLineItem()'>
<button class='btn btn-default btn-edit' line='{{ line.id }}' id='edit-line-item-{{ line.id }} title='Edit line item' onclick='editPurchaseOrderLineItem()'>
<span url="{% url 'po-line-item-edit' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-small glyphicon-edit'></span>
</button>
<button class='btn btn-default btn-remove' id='remove-line-item-{{ line.id }' title='Remove line item' type='button' onclick='removePurchaseOrderLineItem()'>
<button class='btn btn-default btn-remove' line='{{ line.id }}' id='remove-line-item-{{ line.id }' title='Remove line item' type='button' onclick='removePurchaseOrderLineItem()'>
<span url="{% url 'po-line-item-delete' line.id %}" line='{{ line.id }}' class='glyphicon glyphicon-small glyphicon-remove'></span>
</button>
</div>

View File

@ -8,18 +8,16 @@ InvenTree | Purchase Orders
{% block content %}
<div class='row'>
<div class='col-sm-6'>
<h3>Purchase Orders</h3>
</div>
<div class='col-sm-6'>
<hr>
<div id='table-buttons'>
<div class='btn-group' style='float: right;'>
<button class='btn btn-primary' type='button' id='po-create' title='Create new purchase order'>New Purchase Order</button>
</div>
</div>
</div>
{% include "order/po_table.html" %}
{% include "order/po_table.html" with toolbar='#table-buttons' %}
{% endblock %}
@ -34,4 +32,8 @@ $("#po-create").click(function() {
);
});
$("#po-table").bootstrapTable({
search: true,
});
{% endblock %}

View File

@ -5,25 +5,26 @@
{% include 'part/tabs.html' with tab='attachments' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Part Attachments</h4>
</div>
<div class='col-sm-6'>
<div class="btn-group" style="float: right;">
<button type='button' class='btn btn-success' id='new-attachment'>Add Attachment</button>
</div>
</div>
</div>
<hr>
<table class='table table-striped table-condensed' data-toolbar='#toolbar' id='attachment-table'>
<div id='attachment-buttons'>
<div class="btn-group">
<button type='button' class='btn btn-success' id='new-attachment'>Add Attachment</button>
</div>
</div>
<table class='table table-striped table-condensed' data-toolbar='#attachment-buttons' id='attachment-table'>
<thead>
<tr>
<th>File</th>
<th>Comment</th>
<th data-field='file' data-searchable='true'>File</th>
<th data-field='comment' data-searchable='true'>Comment</th>
<th></th>
</tr>
</thead>
<tbody>
{% for attachment in part.attachments.all %}
<tr>
<td><a href='/media/{{ attachment.attachment }}'>{{ attachment.basename }}</a></td>
@ -36,6 +37,7 @@
</td>
</tr>
{% endfor %}
</tbody>
{% if part.variant_of and part.variant_of.attachments.count > 0 %}
<tr>
<td colspan='3'>
@ -83,4 +85,9 @@
});
});
$("#attachment-table").bootstrapTable({
search: true,
sortable: true,
});
{% endblock %}

View File

@ -4,9 +4,12 @@
{% include 'part/tabs.html' with tab='detail' %}
<h4>Part Details</h4>
<hr>
<div class='row'>
<div class='col-sm-6'>
<h4>Part Details</h4>
<table class='table table-striped'>
<tr>
<td><b>Part name</b></td>
@ -75,7 +78,6 @@
</table>
</div>
<div class='col-sm-6'>
<h4>Part Type</h4>
<table class='table table-striped'>
<tr>
<td><b>Virtual</b></td>

View File

@ -5,15 +5,16 @@
{% include 'part/tabs.html' with tab='orders' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Open Part Orders</h4>
</div>
<div class='col-sm-6'>
<h4>Part Orders</h4>
<hr>
<div id='button-bar'>
<div class='btn-group'>
<button class='btn btn-primary' type='button' id='part-order-2' title='Order part'>Order Part</button>
</div>
</div>
{% include "order/po_table.html" with orders=part.open_purchase_orders %}
{% include "order/po_table.html" with orders=part.open_purchase_orders toolbar='#button-bar' %}
{% if part.closed_purchase_orders|length > 0 %}
<h4>Closed Orders</h4>
@ -21,3 +22,21 @@
{% endif %}
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#po-table").bootstrapTable({
search: true,
sortable: true,
});
$("#part-order-2").click(function() {
launchModalForm("/order/purchase-order/order-parts/", {
data: {
part: {{ part.id }},
},
});
});
{% endblock %}

View File

@ -2,7 +2,9 @@
{% block pre_form_content %}
Are you sure you want to delete part '{{ part.full_name }}'?
<div class='alert alert-block alert-danger'>
Are you sure you want to delete part '<b>{{ part.full_name }}</b>'?
</div>
{% if part.used_in_count %}
<hr>

View File

@ -4,13 +4,7 @@
{% include 'part/tabs.html' with tab='stock' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Part Stock</h4>
</div>
<div class='col-sm-6'>
</div>
</div>
<hr>
{% if part.is_template %}

View File

@ -4,14 +4,7 @@
{% include 'part/tabs.html' with tab='suppliers' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Part Suppliers</h4>
</div>
<div class='col-sm-6'>
</div>
</div>
<hr>
<div id='button-toolbar'>

View File

@ -49,5 +49,3 @@
<a href="{% url 'part-attachments' part.id %}">Attachments {% if part.attachment_count > 0 %}<span class="badge">{{ part.attachment_count }}</span>{% endif %}</a>
</li>
</ul>
<br>

View File

@ -4,15 +4,7 @@
{% include 'part/tabs.html' with tab='used' %}
<div class='row'>
<div class='col-sm-6'>
<h4>Used to Build</h4>
</div>
<div class='col-sm-6'>
<div class="btn-group" style="float: right;">
</div>
</div>
</div>
<h4>Assemblies</h4>
<hr>

View File

@ -158,6 +158,10 @@
.navigation {
}
.nav-tabs {
margin-bottom: 20px;
}
.breadcrump {
margin-bottom: 5px;
}

View File

@ -9,32 +9,29 @@
<p>
<div class='btn-group'>
{% include "qr_button.html" %}
{% if item.in_stock %}
<button type='button' class='btn btn-default btn-glyph' id='stock-add' title='Add to stock'>
<span class='glyphicon glyphicon-plus-sign' style='color: #1a1;'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-remove' title='Take from stock'>
<span class='glyphicon glyphicon-minus-sign' style='color: #a11;'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-move' title='Transfer stock'>
<span class='glyphicon glyphicon-transfer' style='color: #11a;'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-duplicate' title='Duplicate stock item'>
<span class='glyphicon glyphicon-duplicate'/>
</button>
{% endif %}
<button type='button' class='btn btn-default btn-glyph' id='stock-edit' title='Edit stock item'>
<span class='glyphicon glyphicon-cog'/>
</button>
<button type='button' class='btn btn-default btn-glyph' id='stock-delete' title='Edit stock item'>
<span class='glyphicon glyphicon-trash' style='color: #a11;'/>
</button>
</div>
</p>
</div>
<div class='col-sm-6'>
<h3>
<div style='float: right;'>
<div class="dropdown" style="float: right;">
<button class='btn btn-primary' type='button' id='duplicate-item'>Copy Stock Item</button>
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<span class="caret"></span></button>
<ul class="dropdown-menu">
{% if item.in_stock %}
<li><a href="#" id='stock-edit' title='Edit stock item'>Edit stock item</a></li>
<hr>
<li><a href='#' id='stock-add' title='Add stock'>Add to stock</a></li>
<li><a href='#' id='stock-remove' title='Take stock'>Take from stock</a></li>
<li><a href='#' id='stock-stocktake' title='Count stock'>Stocktake</a></li>
<li><a href="#" id='stock-move' title='Move stock'>Move stock item</a></li>
{% endif %}
<hr>
<li><a href="#" id='stock-delete' title='Delete stock item'>Delete stock item</a></li>
</div>
</div>
</h3>
</div>
</div>
<div class='row'>
<div class='col-sm-6'>
@ -90,6 +87,10 @@
</tr>
{% endif %}
{% if item.supplier_part %}
<tr>
<td>Supplier</td>
<td><a href="{% url 'company-detail' item.supplier_part.supplier.id %}">{{ item.supplier_part.supplier.name }}</a></td>
</tr>
<tr>
<td>Supplier Part</td>
<td><a href="{% url 'supplier-part-detail' item.supplier_part.id %}">{{ item.supplier_part.SKU }}</a></td>
@ -134,7 +135,7 @@
{% block js_ready %}
{{ block.super }}
$("#duplicate-item").click(function() {
$("#stock-duplicate").click(function() {
launchModalForm(
"{% url 'stock-item-create' %}",
{