Display stock item serial number (if it exists)!

This commit is contained in:
Oliver Walters 2019-05-28 18:29:12 +10:00
parent 807798810b
commit e4acca2951

View File

@ -469,7 +469,16 @@ function loadStockTable(table, options) {
title: 'Stock',
sortable: true,
formatter: function(value, row, index, field) {
var text = renderLink(value, row.url);
var val = value;
// If there is a single unit with a serial number, use the serial number
if (row.serial && row.quantity == 1) {
val = '# ' + row.serial;
}
var text = renderLink(val, row.url);
text = text + "<span class='badge'>" + row.status_text + "</span>";
return text;
}