mirror of
https://github.com/inventree/InvenTree.git
synced 2025-10-03 15:52:51 +00:00
Tweak build line table (#10397)
- Show allocated quantity even if fully consumed - Handles edge case where fully consumed but more stock allocated
This commit is contained in:
@@ -479,6 +479,7 @@ export default function BuildLineTable({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const allocated = record.allocatedQuantity ?? 0;
|
||||||
let required = Math.max(0, record.quantity - record.consumed);
|
let required = Math.max(0, record.quantity - record.consumed);
|
||||||
|
|
||||||
if (output?.pk) {
|
if (output?.pk) {
|
||||||
@@ -486,7 +487,7 @@ export default function BuildLineTable({
|
|||||||
required = record.bom_item_detail?.quantity;
|
required = record.bom_item_detail?.quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (required <= 0) {
|
if (allocated <= 7 && required <= 0) {
|
||||||
return (
|
return (
|
||||||
<Group gap='xs' wrap='nowrap'>
|
<Group gap='xs' wrap='nowrap'>
|
||||||
<IconCircleCheck size={16} color='green' />
|
<IconCircleCheck size={16} color='green' />
|
||||||
@@ -502,7 +503,7 @@ export default function BuildLineTable({
|
|||||||
return (
|
return (
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
progressLabel={true}
|
progressLabel={true}
|
||||||
value={record.allocatedQuantity}
|
value={allocated}
|
||||||
maximum={required}
|
maximum={required}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user