mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 11:05:41 +00:00
Show BomItem reference field in BOM table
This commit is contained in:
@ -136,6 +136,7 @@ class EditBomItemForm(HelperForm):
|
|||||||
'part',
|
'part',
|
||||||
'sub_part',
|
'sub_part',
|
||||||
'quantity',
|
'quantity',
|
||||||
|
'reference',
|
||||||
'overage',
|
'overage',
|
||||||
'note'
|
'note'
|
||||||
]
|
]
|
||||||
|
@ -166,6 +166,7 @@ class BomItemSerializer(InvenTreeModelSerializer):
|
|||||||
'sub_part',
|
'sub_part',
|
||||||
'sub_part_detail',
|
'sub_part_detail',
|
||||||
'quantity',
|
'quantity',
|
||||||
|
'reference',
|
||||||
'price_range',
|
'price_range',
|
||||||
'overage',
|
'overage',
|
||||||
'note',
|
'note',
|
||||||
|
@ -63,33 +63,39 @@ function loadBomTable(table, options) {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Part reference
|
||||||
|
cols.push({
|
||||||
|
field: 'reference',
|
||||||
|
title: 'Reference',
|
||||||
|
searchable: true,
|
||||||
|
sortable: true,
|
||||||
|
});
|
||||||
|
|
||||||
// Part quantity
|
// Part quantity
|
||||||
cols.push(
|
cols.push({
|
||||||
{
|
field: 'quantity',
|
||||||
field: 'quantity',
|
title: 'Quantity',
|
||||||
title: 'Required',
|
searchable: false,
|
||||||
searchable: false,
|
sortable: true,
|
||||||
sortable: true,
|
formatter: function(value, row, index, field) {
|
||||||
formatter: function(value, row, index, field) {
|
var text = value;
|
||||||
var text = value;
|
|
||||||
|
|
||||||
if (row.overage) {
|
if (row.overage) {
|
||||||
text += "<small> (+" + row.overage + ") </small>";
|
text += "<small> (+" + row.overage + ") </small>";
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
footerFormatter: function(data) {
|
footerFormatter: function(data) {
|
||||||
var quantity = 0;
|
var quantity = 0;
|
||||||
|
|
||||||
data.forEach(function(item) {
|
data.forEach(function(item) {
|
||||||
quantity += item.quantity;
|
quantity += item.quantity;
|
||||||
});
|
});
|
||||||
|
|
||||||
return quantity;
|
return quantity;
|
||||||
},
|
},
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
if (!options.editable) {
|
if (!options.editable) {
|
||||||
cols.push(
|
cols.push(
|
||||||
|
Reference in New Issue
Block a user