mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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;
|
||||
},
|
||||
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…
Reference in New Issue
Block a user