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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -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);