mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Calculate total allocation data per-row
This commit is contained in:
parent
aa491e336d
commit
b192deb465
@ -103,4 +103,15 @@ function fillAllocationTable(table, parent_row, options) {
|
|||||||
],
|
],
|
||||||
url: "/api/build/item?build=" + options.build + "&part=" + parent_row.sub_part,
|
url: "/api/build/item?build=" + options.build + "&part=" + parent_row.sub_part,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
table.on('load-success.bs.table', function(data) {
|
||||||
|
var allocated = 0;
|
||||||
|
|
||||||
|
var allocationData = table.bootstrapTable('getData');
|
||||||
|
|
||||||
|
// Calculate total allocation
|
||||||
|
for (var i = 0; i < allocationData.length; i++) {
|
||||||
|
allocated += allocationData[i].quantity;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user