diff --git a/src/frontend/src/components/render/Stock.tsx b/src/frontend/src/components/render/Stock.tsx index 30aec4db01..5dd2af05b6 100644 --- a/src/frontend/src/components/render/Stock.tsx +++ b/src/frontend/src/components/render/Stock.tsx @@ -57,12 +57,19 @@ export function RenderStockItem( const { instance } = props; let quantity_string = ''; + const allocated: number = Math.max(0, instance?.allocated ?? 0); + if (instance?.serial !== null && instance?.serial !== undefined) { quantity_string += `${t`Serial Number`}: ${instance.serial}`; + } else if (allocated > 0) { + const available: number = Math.max(0, instance.quantity - allocated); + quantity_string = `${t`Available`}: ${available} / ${instance.quantity}`; } else if (instance?.quantity) { quantity_string = `${t`Quantity`}: ${instance.quantity}`; } + console.log('item:', instance); + let batch_string = ''; if (!!instance.batch) { diff --git a/src/frontend/src/tables/build/BuildLineTable.tsx b/src/frontend/src/tables/build/BuildLineTable.tsx index 2bc691c935..c80dbfd73f 100644 --- a/src/frontend/src/tables/build/BuildLineTable.tsx +++ b/src/frontend/src/tables/build/BuildLineTable.tsx @@ -560,7 +560,6 @@ export default function BuildLineTable({ in_production && !consumable && user.hasChangeRole(UserRoles.build) && - record.allocated < record.quantity && record.trackable == hasOutput; // Can de-allocate