mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Adds footer formatter to stock table (#4528)
Closes https://github.com/inventree/InvenTree/issues/4525
This commit is contained in:
parent
be92a4345c
commit
b8b19c60ef
@ -1896,6 +1896,18 @@ function loadStockTable(table, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
},
|
||||||
|
footerFormatter: function(data) {
|
||||||
|
// Display "total" stock quantity of all rendered rows
|
||||||
|
let total = 0;
|
||||||
|
|
||||||
|
data.forEach(function(row) {
|
||||||
|
if (row.quantity != null) {
|
||||||
|
total += row.quantity;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return total;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user