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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user