Improve rendering of purchase order table

This commit is contained in:
Oliver Walters 2019-06-15 15:33:10 +10:00
parent 0fa8e3809e
commit 11d9312c45

View File

@ -74,20 +74,24 @@ InvenTree | {{ order }}
{% endif %}
<table class='table table-striped table-condensed' id='po-lines-table'>
<thead>
<tr>
<th data-field='line'>Line</th>
<th data-field='part'>Part</th>
<th data-field='sku'>Order Code</th>
<th data-field='reference'>Reference</th>
<th data-field='quantity'>Quantity</th>
<th data-sortable='true'>Line</th>
<th data-sortable='true'>Part</th>
<th>Description</th>
<th data-sortable='true'>Order Code</th>
<th data-sortable='true'>Reference</th>
<th data-sortable='true'>Quantity</th>
{% if not order.status == OrderStatus.PENDING %}
<th data-field='received'>Received</th>
<th data-sortable='true'>Received</th>
{% endif %}
<th data-field='notes'>Note</th>
<th>Note</th>
{% if order.status == OrderStatus.PENDING %}
<th data-field='buttons'></th>
<th></th>
{% endif %}
</tr>
</thead>
<tbody>
{% for line in order.lines.all %}
<tr>
<td>
@ -98,9 +102,10 @@ InvenTree | {{ order }}
{% include "hover_image.html" with image=line.part.part.image hover=True %}
<a href="{% url 'part-detail' line.part.part.id %}">{{ line.part.part.full_name }}</a>
</td>
<td>{{ line.part.part.description }}</td>
<td><a href="{% url 'supplier-part-detail' line.part.id %}">{{ line.part.SKU }}</a></td>
{% else %}
<td colspan='2'><strong>Warning: Part has been deleted.</strong></td>
<td colspan='3'><strong>Warning: Part has been deleted.</strong></td>
{% endif %}
<td>{{ line.reference }}</td>
<td>{{ line.quantity }}</td>
@ -124,6 +129,7 @@ InvenTree | {{ order }}
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% if order.notes %}
@ -182,6 +188,8 @@ $('#new-po-line').click(function() {
{% endif %}
$("#po-lines-table").bootstrapTable({
search: true,
sortable: true,
});