From f057247fc1aac3edec1b01fc4bf99ae8391b6e88 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 17 Sep 2025 13:36:59 +1000 Subject: [PATCH] Fix for RenderStockItem (#10336) - Handle case where serial number is empty string --- src/frontend/src/components/render/Stock.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/components/render/Stock.tsx b/src/frontend/src/components/render/Stock.tsx index 3304458e8e..6ee29e6f17 100644 --- a/src/frontend/src/components/render/Stock.tsx +++ b/src/frontend/src/components/render/Stock.tsx @@ -88,7 +88,14 @@ export function RenderStockItem( const allocated: number = Math.max(0, instance?.allocated ?? 0); - if (instance?.serial !== null && instance?.serial !== undefined) { + // Determine if this item is serialized + const serialized: boolean = + instance?.quantity == 1 && + instance?.serial !== null && + instance?.serial !== undefined && + instance?.serial !== ''; + + if (serialized) { quantity_string += `${t`Serial Number`}: ${instance.serial}`; } else if (allocated > 0) { const available: number = Math.max(0, instance.quantity - allocated);