mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-05 06:48:48 +00:00
Merge remote-tracking branch 'inventree/master'
This commit is contained in:
commit
d6ca21273d
@ -82,6 +82,32 @@ function loadStockTable(table, options) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return stock;
|
return stock;
|
||||||
|
} else if (field == 'batch') {
|
||||||
|
var batches = [];
|
||||||
|
|
||||||
|
data.forEach(function(item) {
|
||||||
|
var batch = item.batch;
|
||||||
|
|
||||||
|
if (!batch || batch == '') {
|
||||||
|
batch = '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!batches.includes(batch)) {
|
||||||
|
batches.push(batch);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (batches.length > 1) {
|
||||||
|
return "" + batches.length + " batches";
|
||||||
|
} else if (batches.length == 1) {
|
||||||
|
if (batches[0]) {
|
||||||
|
return batches[0];
|
||||||
|
} else {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
} else if (field == 'location__path') {
|
} else if (field == 'location__path') {
|
||||||
/* Determine how many locations */
|
/* Determine how many locations */
|
||||||
var locations = [];
|
var locations = [];
|
||||||
@ -165,6 +191,11 @@ function loadStockTable(table, options) {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'batch',
|
||||||
|
title: 'Batch',
|
||||||
|
sortable: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'location__path',
|
field: 'location__path',
|
||||||
title: 'Location',
|
title: 'Location',
|
||||||
|
@ -130,6 +130,7 @@
|
|||||||
<td><i>Part can be purchased from external suppliers</i></td>
|
<td><i>Part can be purchased from external suppliers</i></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
|
{% if 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Sellable</b></td>
|
<td><b>Sellable</b></td>
|
||||||
<td>{% include "slide.html" with state=part.salable field='salable' %}</td>
|
<td>{% include "slide.html" with state=part.salable field='salable' %}</td>
|
||||||
@ -139,6 +140,7 @@
|
|||||||
<td><i>Part cannot be sold to customers</i></td>
|
<td><i>Part cannot be sold to customers</i></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user