2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-18 00:21:31 +00:00

Fix for RenderStockItem (#10336)

- Handle case where serial number is empty string
This commit is contained in:
Oliver
2025-09-17 13:36:59 +10:00
committed by GitHub
parent a6e555708f
commit f057247fc1

View File

@@ -88,7 +88,14 @@ export function RenderStockItem(
const allocated: number = Math.max(0, instance?.allocated ?? 0); 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}`; quantity_string += `${t`Serial Number`}: ${instance.serial}`;
} else if (allocated > 0) { } else if (allocated > 0) {
const available: number = Math.max(0, instance.quantity - allocated); const available: number = Math.max(0, instance.quantity - allocated);