2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-16 01:36:29 +00:00

Pack quantity improvements (#3661)

* Specify serializer label

* Add units to part grid view

* improve display of stock units in part table

* Add units display to stock on part page

* Display units in supplier part table

* Simplify stock quantity display in stock table
This commit is contained in:
Oliver
2022-09-08 13:44:53 +10:00
committed by GitHub
parent 2242088f90
commit b827f14bf6
7 changed files with 39 additions and 28 deletions

View File

@@ -1757,20 +1757,16 @@ function loadStockTable(table, options) {
var val = '';
var available = Math.max(0, (row.quantity || 0) - (row.allocated || 0));
if (row.serial && row.quantity == 1) {
// If there is a single unit with a serial number, use the serial number
val = '# ' + row.serial;
} else if (row.quantity != available) {
// Some quantity is available, show available *and* quantity
var ava = formatDecimal(available);
var tot = formatDecimal(row.quantity);
val = `${ava} / ${tot}`;
} else {
// Format floating point numbers with this one weird trick
val = formatDecimal(value);
if (row.part_detail) {
val += ` ${row.part_detail.units}`;
}
}
var html = renderLink(val, `/stock/item/${row.pk}/`);