2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Build order improvements (#6343)

* Auto-fill project code

When creating a new child build order, copy project code from parent build

* Auto-fill project code for sales orders

* Annotate "building" quantity to BuildLine serializer

- So we know how many units are in production

* Display building quantity in build line table

* Update API version info

* Skeleton for BuildLineTable

- No content yet (needs work)

* Refactor part hovercard

* Navigate to part

* Add actions for build line table

* Display more information for "available stock" column

* More updates

* Fix "building" filter

- Rename to "in_production"

* Add filters

* Remove unused imports
This commit is contained in:
Oliver
2024-01-29 10:56:34 +11:00
committed by GitHub
parent 1272b89839
commit f6ba180cc4
14 changed files with 334 additions and 49 deletions

View File

@ -173,6 +173,11 @@ function newBuildOrder(options={}) {
fields.sales_order.value = options.sales_order;
}
// Specify a project code
if (options.project_code) {
fields.project_code.value = options.project_code;
}
if (options.data) {
delete options.data.pk;
}
@ -2553,6 +2558,7 @@ function loadBuildLineTable(table, build_id, options={}) {
sortable: true,
formatter: function(value, row) {
var url = `/part/${row.part_detail.pk}/?display=part-stock`;
// Calculate the "available" quantity
let available = row.available_stock + row.available_substitute_stock;
@ -2603,6 +2609,10 @@ function loadBuildLineTable(table, build_id, options={}) {
icons += makeIconBadge('fa-shopping-cart', `{% trans "On Order" %}: ${formatDecimal(row.on_order)}`);
}
if (row.in_production && row.in_production > 0) {
icons += makeIconBadge('fa-tools icon-blue', `{% trans "In Production" %}: ${formatDecimal(row.in_production)}`);
}
return renderLink(text, url) + icons;
}
},
@ -2695,6 +2705,7 @@ function loadBuildLineTable(table, build_id, options={}) {
part: row.part_detail.pk,
parent: build_id,
quantity: Math.max(row.quantity - row.allocated, 0),
...options,
});
});

View File

@ -2174,7 +2174,8 @@ function loadSalesOrderLineItemTable(table, options={}) {
part: pk,
sales_order: options.order,
quantity: quantity,
success: reloadTable
success: reloadTable,
...options
});
});