mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
BOM table: remove quantity footer (#4930)
- Summing quantities of different parts does not make sense - Especially when different parts have units - i.e. "3 m + 22 litres = ??"
This commit is contained in:
parent
99d122baa9
commit
685cc1fd77
@ -786,7 +786,6 @@ function deleteBomItems(items, options={}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function loadBomTable(table, options={}) {
|
|
||||||
/* Load a BOM table with some configurable options.
|
/* Load a BOM table with some configurable options.
|
||||||
*
|
*
|
||||||
* Following options are available:
|
* Following options are available:
|
||||||
@ -797,6 +796,7 @@ function loadBomTable(table, options={}) {
|
|||||||
*
|
*
|
||||||
* BOM data are retrieved from the server via AJAX query
|
* BOM data are retrieved from the server via AJAX query
|
||||||
*/
|
*/
|
||||||
|
function loadBomTable(table, options={}) {
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
part: options.parent_id,
|
part: options.parent_id,
|
||||||
@ -977,32 +977,6 @@ function loadBomTable(table, options={}) {
|
|||||||
|
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
footerFormatter: function(data) {
|
|
||||||
|
|
||||||
// Top-level BOM count
|
|
||||||
var top_total = 0;
|
|
||||||
|
|
||||||
// Total BOM count
|
|
||||||
var all_total = 0;
|
|
||||||
|
|
||||||
data.forEach(function(row) {
|
|
||||||
var q = +row['quantity'] || 0;
|
|
||||||
|
|
||||||
all_total += q;
|
|
||||||
|
|
||||||
if (row.part == options.parent_id) {
|
|
||||||
top_total += q;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var total = `${formatDecimal(top_total)}`;
|
|
||||||
|
|
||||||
if (top_total != all_total) {
|
|
||||||
total += ` / ${formatDecimal(all_total)}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return total;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
cols.push({
|
cols.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user