From 39dc2b17fd85d66dce2db7c79f2125edce683020 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 13:47:45 +1000 Subject: [PATCH] Fix for RenderStockItem (#10336) (#10337) - Handle case where serial number is empty string (cherry picked from commit f057247fc1aac3edec1b01fc4bf99ae8391b6e88) Co-authored-by: Oliver --- 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);